Duplicating an object number of times based on separate object's points

   1654   8   0
User Avatar
Member
6 posts
Joined: March 2018
Offline
Trying to duplicate a box a number of times equal to curve points along a curve. I've merged the box into the curve object, and have tried using a copy op inside a for loop, with the curve being the geometry to iterate over,and i've tried creating an attribute and iterating over it in a for loop, to get the number of points essentially. The problem i have right now is the for loop seems to not be iterating, or i'm doing something completely wrong. Is there an easier way to do this?
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
copy to points SOP should do exactly what you're after - it will copy a box on each point of the curve
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
6 posts
Joined: March 2018
Offline
Yeah, i dont want to copy to the points, cause i want to basically duplicate it along a straight axis, then use path deform to deform it along a curve. Essentially making a more advanced and smooth version of the ue4 spline mesh component.
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
you're looking for a path deformer
https://www.sidefx.com/forum/topic/53867/ [www.sidefx.com]
http://www.entagma.com/td-fundamentals-parallel-transport/ [www.entagma.com]
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
6 posts
Joined: March 2018
Offline
Yeah, i've got a path deformer that will work fine. But i need to first make the object that i want to deform long enough to cover the whole curve. But i dont want to stretch the object along it, i want to duplicate it. Thats what i'm really asking, how can i figure out how many duplications would i need to cover the whole curve when i do the path deform.I use a resample node to get a length for the points, which is the same length as my object, now i just need to figure out how many points are on the curve, duplicate the box that many times along a straight axis, and them path deform.
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
I don't think I'm following you…
pictures?
example from another app?
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
6 posts
Joined: March 2018
Offline
In attachment 1, basically you can see the whole outcome. It works currently, but i want to make it procedural, where I can get the length of the object that i'm copying, use that value during the resample length, then get the number of points, and copy the object that many times, to be able to cover the whole curve, and then path deform it along the curve. In the second image you can see the attribute im trying to create, but at the end of the foreach loop, the result is always 1, no matter what. In the last attachment, you can see what I'm doing in the attibexpression node, just simply adding one to the self value. So, what am i doing wrong?

Attachments:
Capture.JPG (29.3 KB)
Capture2.JPG (23.5 KB)
Capture3.JPG (23.0 KB)

User Avatar
Member
474 posts
Joined: July 2005
Offline
Hi,

is this coming close to what you want? What I understand is, that you want to maintain the original length of the copied object. So what can be done is, getting the length of the curve (Lc) and of the object (Lo), and if you divide them through each other, you'll get the number of copies r = Lc/Lo, which should be floored nr = floor(r), if it is not exactly an integer, which is usually the case. The divsion of floored value and the exact value gives you the u-parameter on the curve (endpoint) u = floor(r)/r.
You can use any path deformer, where you can set the last u-value, and the curve should have constant speed parameterization from (0,1), which can be done automatically by the resample node.
Edited by Aizatulin - March 14, 2018 16:19:57

Attachments:
PathWrangleRed.hipnc (92.9 KB)

User Avatar
Member
6 posts
Joined: March 2018
Offline
Yeah, this is exactly what i wanted! Thanks Aizatulin! Time to dissect this now!
  • Quick Links