1

I'm using PyGTS to construct domain specific 3D geometry. It doesn't have binding to triangulation functions of GTS, so I'm using poly2try instead. I triangulate coplanar polygon with 6 vertices, then filter it's edges on number of faces that they belong to, that way I obtain original outline of polygon, but with edges already attached to faces.

Next step is to "extrude" these edges along Z axis. For PyGTS boolean operations to work, all edges needs to be reused and the object must be closed (no edge belonging to just 1 face). So I want to iterate over my outline edges and build up sides of extrusion, reusing original polygon edge, 3 more, and saving one of those for reuse in next iteration. For this to work, those outline edges needs to be sorted so that: e1.v2 = e2.v1 and e2.v2 = e3.v1 and so on.

How do I sort these outline edges? Original sorting is lost when the base polygon is triangulated.

illustration

skrat
  • 5,518
  • 3
  • 32
  • 48

0 Answers0