0

I'm trying to create a buffer polygon out of a triangulated mesh. I've tried various combinations with geos and gdal polygonization (using the whole polyline as linestring, using sets of line arrays, point sets,...). I'm always getting NULL, or an empty polygon when polygonizing.

As background info: The mesh is produced during CAD data export out of polylines which have width style set or have bulges (closed polylines are treated as polygons, or otherwise exported linestring as-is).

So I come to the conclusion that it's not possible to polygonize a triangle mesh. Is this correct?

Since I can in my usage safely assume that my polyline is a single geometry, and I just want the buffer (outer ring / hull, without holes) of this geometry anyways, how can I algorithmically solve this to create the hull myself?

benjist
  • 2,740
  • 3
  • 31
  • 58
  • Perhaps I'm missing the point, but a triangular mesh is composed by a set of polygones (i.e. the triangles). Are you trying to cluster together triangles with some common properties (e.g. adjacent and coplanar)? – Nic Aug 30 '16 at 09:04
  • Similar. Polylines in CAD can have width or bulges. I use GDAL to approximate these. The result is a set of linestrings that form the mesh. In some cases however the result is a set of meshes which cannot be translated into a polygon. I want to recover these issues by creating a buffer region around any geometry in a set. – benjist Aug 30 '16 at 14:53
  • still not sure I get it so by **polygonize** you mean extract circumference polygon of some triangulated surface? or is it volume? is it just one surface or more? Is it 2D,3D or ND ? Why not create table of edges and remove all edges used more than once then connect the rest? very similar to this: [How to detect and save cyclic connectivity in edge vertices (hole detection)?](https://stackoverflow.com/a/45541861/2521214). Or merge triangles by shared edge constructing the polygon directly without edge list ... – Spektre Apr 03 '18 at 12:28

0 Answers0