0
$\begingroup$

I have some edges, I want to have a number of duplicates of these edges so that they are offset in space but keep their direction. Should be simple? But I'm scratching my head over it for too long now. The elements are created with the Duplicate node, they aren't instances so I can't use Translate Instance node. And Set Position offsets all points in space.

enter image description here

enter image description here

the scene: https://www.dropbox.com/s/x0ki8cbhpq48kqn/geo_random_duplicates.blend?dl=1

$\endgroup$

2 Answers 2

2
$\begingroup$

Basically, Jiří Honzák has already addressed the underlying problem here, but unfortunately not the solution.

To solve this task correctly, you would simply have to feed the node Random Value with a constant value per edge.

To do this, first capture the index of the edges in the attribute domain Edge, and use this index for the input ID of the node Random Value.

This will generate a unique value per edge, which you can use directly as Offset.

enter image description here

$\endgroup$
2
  • $\begingroup$ Thank you! I have a question: why plugging the Duplicate Index socket into ID doesn't produce the same result: the edges aren't split? Because those are only new indices of the duplicates, not all the indices? imgur.com/a/ljHbbXP $\endgroup$ Apr 16, 2023 at 10:00
  • 1
    $\begingroup$ @SergeyKritskiy You don't get the same result because the Duplicate Index starts counting at $0$ for each curve, which gives you groups per duplicate, not the points of an edge as a group. $\endgroup$
    – quellenform
    Apr 16, 2023 at 10:24
0
$\begingroup$

Set position node changes position for each vertice you have within the object. Right now you are creating random numbers for each vertice within the object (which is 3 for the original + 4*3 for the duplicates) and assigning new position for each of them, that's why it is a mess. For simple translation you can use transform node, but that would change the position of the whole object (the duplicate lines would stay on top of each other) What you need to do is to create instances that you can then move separately. If you need the output to be one object again, you can add realize instance at the end of your script.

enter image description here

$\endgroup$
3
  • $\begingroup$ As for the split edge. I don't know how would you be able to divide those into separate instances. 'Separate geometry' node might allow you to do this in this particular case but in different ones it won't (when there are more than 3 edges). You would have to copy separate geometry node multiple times (so it would not be automated) It would be nice to have something like 'disconnected to instances' but we do not yet $\endgroup$ Apr 14, 2023 at 16:44
  • $\begingroup$ Thank you for the reply! As I understand transforming to instance didn't work because when you've instanced 2 separated edges they've became a whole, not a separate instance for each geometry object $\endgroup$ Apr 16, 2023 at 10:03
  • $\begingroup$ Yes exactly. As I wrote before, you could separate them (easy when there are just two of them) but when you have more of them you'd have to repeat the separation over and over. Quellenform's solution for this particular problem is much more elegant. $\endgroup$ Apr 16, 2023 at 10:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .