Jump to content
papsphilip

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×