Jump to content

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


AntoineSfx

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

Link to comment
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 ? 

Link to comment
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.

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

  • Like 1
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...