Duplicating an object number of times based on separate object's points
1610 8 0- ridley075
- 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?
- goldfarb
- Staff
- 3455 posts
- Joined: July 2005
- Offline
- ridley075
- Member
- 6 posts
- Joined: March 2018
- Offline
- goldfarb
- 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]
https://www.sidefx.com/forum/topic/53867/ [www.sidefx.com]
http://www.entagma.com/td-fundamentals-parallel-transport/ [www.entagma.com]
- ridley075
- 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.
- goldfarb
- Staff
- 3455 posts
- Joined: July 2005
- Offline
- ridley075
- 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?
- Aizatulin
- Member
- 470 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.
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
- ridley075
- Member
- 6 posts
- Joined: March 2018
- Offline
-
- Quick Links