Jump to content
AntoineSfx

Add points at given relative length on a curve, then split the curve

Recommended Posts

Hi there

How may I achieve this: let's say I have a  rectangle. I want to add a point at 10% of its length, then another at 20% of its length.

Later I'd like to have some knowledge of whether a segment is between two points that were added to the original geo, for example to make an opening for a door.

I didn't have much luck with carve because the First U parameter is expressed in terms of a u parameter in NURBS, not a distance on the curve; also two consecutive carve SOP are not commutative, carve.thumb.png.786638db33e5fd1410c4ac49c34df588.png

Share this post


Link to post
Share on other sites

Also, from a tool design perspective, how do you think such an operator should work so that it can be applied to its output in a commutative way, and give the same result ?

For example init geo0 = a rectangle

geo1 = gap(geo0, dist0, width0)  [ door 0 ]

geo2 = gap(geo1, dist1, width1)  [ door 1 ]

so that the distances are always expressed relatively to the initial geometry. The idea would be to be able to switch dist0 with dist1 and width0 with width1 and still have the same geo

I understand this information is lost doing that way, so maybe something like just splitting / marking portions of the curve for deletion later ? 

Share this post


Link to post
Share on other sites

As long as your defining your gaps by a distance it wouldnt be a problem to just reapply the same operator (in this case with my solution you would have to create a more solid way to figure out the "val" variable, atm i guess it will be wonky with uneven point distribution).

If you want to use a percent approach, the easiest way is to store the original length of the first primitive and pass it on. 

I would make it so that you pass on two arrays to the operator with position and width for all your doors (so this would be another asset you apply first). And then your doorway asset needs to be able to make several new prims based on the input. 

Anyway, this is by far a final tool, its just a start.

Share this post


Link to post
Share on other sites
8 hours ago, AntoineSfx said:

Also, from a tool design perspective, how do you think such an operator should work so that it can be applied to its output in a commutative way, and give the same result ?

For example init geo0 = a rectangle

geo1 = gap(geo0, dist0, width0)  [ door 0 ]

geo2 = gap(geo1, dist1, width1)  [ door 1 ]

so that the distances are always expressed relatively to the initial geometry. The idea would be to be able to switch dist0 with dist1 and width0 with width1 and still have the same geo

I understand this information is lost doing that way, so maybe something like just splitting / marking portions of the curve for deletion later ? 

it's easy, just reference the original geo.

split_curve1.hipnc

hth.

petz

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

×