fornjot icon indicating copy to clipboard operation
fornjot copied to clipboard

Validate that coincident vertices within `Sketch` are identical

Open hannobraun opened this issue 2 years ago • 3 comments

Shapes in the Fornjot kernel are made up of objects (faces, edges, vertices, ...). Those objects are managed in a centralized data store, and their location in that store gives them a unique identity. This means that two objects that have been created at different types are never identical, even if they are equal (i.e. contain the same data).

If two vertices within a Sketch or Solid are equal (or really close together) but not identical, this is a bug. If two vertices are meant to be equal, but aren't identical, then they can end up with slightly different positions, depending on various factors, which would result in an error down the line (either a approximation failure, or an invalid triangle mesh being generated). It would be best to have validation checks to protect against this.

This would involve two different but similar validation checks: One for Sketch, one for Solid. Those checks should use the validation configuration to determine which vertices should be identical.

hannobraun avatar Mar 16 '23 09:03 hannobraun

Part of this issue (validation within Solid) has been addressed in #1695. As @A-Walrus alludes to in the commit listed above, it's probably best to hold off on the Sketch-related part of this issue until #1691 has been addressed.

hannobraun avatar Mar 21 '23 10:03 hannobraun

I think this issue is suited for anyone looking to start contributing to Fornjot. There is an existing validation of that kind for Solid (which was part of the original issue description), so basically all that has to be done is to add a validation test for Sketch here, using the existing one as a template.

Also adding a unit test for the new validation check would be great, but is not required. If you're feeling ambitious, Shell validation has quite a few unit tests, which show how that kind of thing could be tested.

hannobraun avatar Oct 30 '23 19:10 hannobraun