Jump to content

Translate object based on point position / get object's width


Recommended Posts

Hello everyone. I have two issues that I need help with.

  • I have a curve (that I am using as a base for a hanging bridge) that I want to bend. The problem is that with the bend SOP the curve bends from the middle thus offsetting the edges. I want to lock the edge points to position and offset the middle. I think that translating the curve on the Y axis by -TY of one of the edge points after the bend occurs would work, but cannot figure out how to achieve it.
  • I want to resample the curve in order to copy geometry (planks) onto each point. To automate the procedure I would have to divide the length of the curve by the width of the plank but again I cannot figure out how to get the plank object's width to use in an expression on the curve

I hope that was clear enough. Any help would be appreciated.

(please excuse my English)

Link to comment
Share on other sites

Couldn't you just not touch the end points at all? Group the middle points together and bend that group. To only group the middle points, use a Group SOP -> Group by Range, and then Start: 1 (the second point, could use ($N-$N)+1 to be sure) and End: $N-1 . Also remember to set the Entity to "Points", and the Select _ of _ to 1 (in both fields).

As for the Resample, you can just specify the width of your plank right there. So in the Length parameter, ch("../box1/sizex"). You can then add +0.05 or something at the end of that expression if you want gaps between the planks.

I made a small .hip for you, might make it easier to understand what I mean. Although, I don't quite understand how the Twist SOP bends things, I didn't use it since it works really wierd. Take a look at qLib (https://github.com/qLab/qLib), they have a Bend SOP that works a lot neater.

groupMidpoints.hipnc

Link to comment
Share on other sites

Hi there,

Do you mean something like this?

1. The number of points is sampling based off of the bounding box of the planks (using the 'bbox()' expression)

2. the bend of the curve is being controlled by a ramp parameter in a vopsop, and then moving the points using a point sop and looking up the ramp with a 'chramp()' expression.

Hope that helps,

~Ilan

planks.hipnc

Edited by wick3dParticle
Link to comment
Share on other sites

Thank you very much guys. @Skybar Yeah. Had to mess around randomly with the settings of the bend SOP until I got the result I wanted. The thing about the plank is that it is not a box but a sculpted mesh so I couldn't reference the size parameter. wick3dParticle solved it with the bbox expression (which I didn't know). Thanks again :)

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...