Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

LINEs to ClosedPolyCurve

$
0
0

Hi,
Is there a way in python to join together a bunch of LINEs that have endpoints touching each other, to form either a ClosedPolyline, or better still a ClosedPolyCurve? (Without having to ‘manually’ iterate through all lines, and search at their endpoints)

Note that this need be done in Batch as having an operator manually select the lines and then have them processed is not an option.

In some cases a LINE will turn out to be an Inner Edge. (LINEs 0 & 9)

eg: 0 through 9 represent individual LINEs
I need to end up with 3 ClosedPolyCurves

 11111111111111111111111111111111111112
 8 9                                  2
 8   9                                2
 8      9                             2
 8         3333333333333333333333333332
 8         4         
 8         4         
 8         4         
 8         4 555555555555555555555555555
 8       0                             6
 8    0                                6
 8 0                                   6
 777777777777777777777777777777777777777

If there is a Rhino command that will at least just join together LINEs that have endpoints touching - then I could create code to “sort out” points with >2 lines emanating from them.

Thanks in advance,
Zoltan
FWIW, I’m totally new to Rhino and have no clue about high-level stuff like Grasshopper.
(But GIS data structur programming I’m “OK” with)

6 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles