pasbi / ommpfritt

semantic, procedural, non-destructive vector modelling
GNU General Public License v3.0
45 stars 7 forks source link

Closed path is not recognized as face #239

Open pasbi opened 2 years ago

pasbi commented 2 years ago

Describe the bug Sometimes faces (closed paths) are not recognized correctly.

To Reproduce Create a path like on this image: Problematic Geometry

Expected behavior The closed area should be recognized as a face and filed with the blue brush. a

Additional context It seems like the problem is caused by the two consecutive 3-joints. If the 3-joint is separated by another 2-joint (or ordinary path point), the face recognition works.

pasbi commented 2 years ago

The problem also occurs/disappears if a point gets only moved:

a b

pasbi commented 2 years ago

It seems like the zero-length tangent is a problem: When the path intersects itself (and the intersection is not a point), there is no guarantee to detect all faces correctly. With tangents, one can make the path intersect itself. Every point has tangents, they might just have zero length, but they still have an orientation. The orientation is, however, not (or barely, if the tangent is very short) visible, but still might make the path overlap itself and hence break the face detection algorithm.