Jump to content

Curve network - group branches


Recommended Posts

Is there an easy way to identify the dead-end branches of a curve network? so far i have a point wrangle that removes points if their neighbors are less than 2, but that is heavily depended on the iterations and it takes a lot of iterations to clean up a network from branches and keep only the closed loops.

Any ideas?

 

Capture.JPG

Link to comment
Share on other sites

ok i found a solution in case anyone is interested.

instead of checking each point i look at the primitives.

in a primitive wrangle i look if any of the end points have less than two neighbors. i put that in a for loop with some iterations in case there are branches on branches. like ten iterations. before i had to go up to 100 and more to get rid of all the points,

 

int pts[] = primpoints(0,@primnum);

int f = pts[0];
int l = pts[-1];

int fn = neighbourcount(0,f);
int ln = neighbourcount(0,l);

if(fn<2 || ln<2) removeprim(0,@primnum,1);

 

Capture.JPG

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...