Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate math::Triangle on construction #240

Closed
hannobraun opened this issue Feb 23, 2022 · 1 comment · Fixed by #249
Closed

Validate math::Triangle on construction #240

hannobraun opened this issue Feb 23, 2022 · 1 comment · Fixed by #249
Labels
good first issue Good for newcomers topic: core Issues relating to core geometry, operations, algorithms type: development Work to ease development or maintenance, without direct effect on features or bugs

Comments

@hannobraun
Copy link
Owner

hannobraun commented Feb 23, 2022

math::Triangle should be validated on construction. If buggy code constructs an invalid triangle, that should cause an immediate panic, so the bug can be discovered and fixed as easily as possible.

In specific terms, validation includes the following steps:

  • Checking that the three points are distinct.
  • Checking that the three points don't lie on the same line.

See math::Segment for an example of this kind of validation.

Labeling https://github.com/hannobraun/Fornjot/labels/good%20first%20issue, as those are relatively small changes that are very localized.

@hannobraun hannobraun added good first issue Good for newcomers type: development Work to ease development or maintenance, without direct effect on features or bugs topic: core Issues relating to core geometry, operations, algorithms labels Feb 23, 2022
hannobraun added a commit that referenced this issue Feb 23, 2022
This addresses part of #240.

This required a modification to the approximation test suite, which had
some redundant checking code. I will follow this up with a cleanup in
the next commit, to remove the redundancy.
@hannobraun hannobraun changed the title Validate math::Segment and math::Triangle on construction Validate math::Triangle on construction Feb 23, 2022
@hannobraun
Copy link
Owner Author

Segment validation has been addressed as part of #245. I've updated the issue title and description accordingly.

therealprof added a commit to therealprof/Fornjot that referenced this issue Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers topic: core Issues relating to core geometry, operations, algorithms type: development Work to ease development or maintenance, without direct effect on features or bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant