realuptime / PolyDetector

Detect all closed polygons given a set of line segments
MIT License
5 stars 2 forks source link

Polygon corner ordering #2

Open peter-greaves opened 3 years ago

peter-greaves commented 3 years ago

Hi,

I intend to use your project as part of a mesh generator for a finite element models of wind turbine blades. It looks perfect for my use case and runs really quickly! Eventually I plan to integrate it into a mex file to allow it to be called from MATLAB which may take some time, but for now I'm getting the data from the examples into MATLAB just by running the app and copy pasting the results. One thing I noticed is that the polygons don't seem to be ordered in a clockwise or anti clockwise sense, so I get something like this:

image

when I would expect something like this:

image

Am I doing something wrong here, or do the nodes just not come out in an ordered manner? I'm thinking it wouldn't be too hard to get round this but if there's a quick fix it would be great if you could let me know.