Jump to content
Sign in to follow this  
Berj

insert vertex where one curve touches another

Recommended Posts

I have two curves, one branching off of another.  But the child branch doesn't start at a vertex of the parent branch.  The first vertex of the child does lie exactly along an edge of the parent, however. 

I've been wracking my brains trying to figure out how to insert a vertex in the parent branch that exactly coincides with the first vertex of the child branch but so far it eludes me.

In reality my geometry is much more complex than this with multiple child branches coming off of a single parent as well as many generations of branches.  But this is the most reductive case.

Any thoughts?

Berj

 

 

branch.jpg

Share this post


Link to post
Share on other sites
Posted (edited)

Hi,

here are some ideas:

  • create a referene for each prim onto its parent (if not already done)
  • for each prim store all children(ref) into one array (using the reference)
  • map this array to the u position of the parent curve (by using distance functions) [there are probably multiple ways -> but xyzdist() should be fine here]
  • push all u values into one array including the existing points and rebuild the curve (with this array sorted by u)

Here is simple setup including some aspects

prim_insert_vertices.hipnc

Edited by Aizatulin

Share this post


Link to post
Share on other sites

Is the IntersectionStitch SOP what you're after?  A quick test seems to create a vertex at the point where the branch touches the original/parent line.

  • Like 1

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
Sign in to follow this  

×