Closed runette closed 3 years ago
The triangulation method used in TriangulatedPolygonGenerator does this, sorry. It's because it does not actually triangulate the polygon, it cuts the polygon into a mesh (a rectangle formed from 2 triangles), by incrementally inserting the edges. Sometimes this adds vertices. It's not really the right way to triangulate a polygon - Delaunay triangulation works better, but the library does not have an implementation of that.
TriangulatedPolygonGenerator is just a wrapper around MeshInsertUVPolycurve, which has a function Simplify() which will try to remove these extra vertices. However it doesn't always work.
Thanks
On Sun, 16 Aug 2020, 06:26 Ryan Schmidt, notifications@github.com wrote:
The triangulation method used in TriangulatedPolygonGenerator does this, sorry. It's because it does not actually triangulate the polygon, it cuts the polygon into a mesh (a rectangle formed from 2 triangles), by incrementally inserting the edges. Sometimes this adds vertices. It's not really the right way to triangulate a polygon - Delaunay triangulation works better, but the library does not have an implementation of that.
TriangulatedPolygonGenerator is just a wrapper around MeshInsertUVPolycurve, which has a function Simplify() which will try to remove these extra vertices. However it doesn't always work.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gradientspace/geometry3Sharp/issues/145#issuecomment-674477226, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARC2MZQPL3EH6VPJR2SBA3SA5NWJANCNFSM4O52EGRQ .
Hi
I am using TriangulatedPolygonGenerator to mesh Polygons with holes. It mostly seems to work very well, but sometimes it seems to add a vertex to one of the linear rings of the polygon. I have not been able to work out a pattern to why it is doing this.
Do you have any idea of why this is happening?
This is a problem since what I am actually doing is using this to triangulated a 2.5D Polygon - using OrthogonalPlaneFit3 to find the nearest plane, projecting the vertices onto the plane as a Polygon2D and then creating the triangulation. Unfortunately, I cannot project back to the original points - I have to do a matching between the Polygon2D vertices and the 3D vertices in the triangulation (and there does not seem to be a simple mapping between the vertices in the final mesh and the vertices from the original Polygon2D). At the moment I have to do some fancy footwork around the extra vertex if it there - and it also means that I do not have round trip integrity.