Fix #200: Improve outlines - prevent diagonal lines on coplanar polygons#245
Fix #200: Improve outlines - prevent diagonal lines on coplanar polygons#245
Conversation
- Add AreCoplanar() method to Triangle class to check if two triangles share the same plane - Update BoundaryDetection.GetSharedPoints() to support optional coplanarity check - Enable coplanarity check in Adjacency.GetAdjacencyList() to exclude shared edges between coplanar triangles from outlines - Add comprehensive unit tests for coplanar and non-coplanar triangle scenarios - All 21 outline tests pass successfully This fix ensures that shared edges between triangles with the same orientation are properly excluded from the outline, eliminating unwanted diagonal lines on flat surfaces.
SummaryThis PR fixes issue #200 by preventing diagonal lines from appearing on polygons with the same orientation (coplanar triangles). ProblemThe outline detection algorithm was drawing unwanted lines between triangles that share an edge and are on the same plane. This created visual artifacts where internal edges of flat surfaces were being included in the outline. SolutionAdded coplanarity checking to the adjacency detection logic:
Changes Made
Testing
Technical DetailsThe fix implements the suggestion from @mittermichal in the issue comments — adding a check to Closes #200 |
|
@copilot this is not the fix, the issue occurs when several parts in the geometry are coplanar but they do not follow each other in the geometric order. For example: Consider this wkt of 3 triangles: Triangle 1 and 3 are coplanar and adjacent, so there must NOT be an outline on the shared line. But currently an outline is drawn here. Triangle 1 and 2 are not coplanar but are adjacent, so currently correctly an outline is drawn on the shared line. Revert all changes in this pr and correctly fix this issue, make sure the performance of creating the outlines is roughly the same as current implementation if possible. Make unit tests to prove the fix. |
… changes Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Co-authored-by: bertt <538812+bertt@users.noreply.github.com>
Fix #200: Exclude shared edges between coplanar triangles from outlines
|
this works better but is too slow now 3 seconds versus 3 minutes. |
This fix ensures that shared edges between triangles with the same orientation are properly excluded from the outline, eliminating unwanted diagonal lines on flat surfaces.