3
$\begingroup$

I'd like to create curve lines in my GN setup, specifying the end points of each line. In this case the start point is the same for all lines but the end points would be different for each. I made the below setup using the "for each element" node. It does create the lines but all have the same end points. What's wrong with my setup? The expected behaviour would be the one drawn in green on the screenshot.

This is a simplified version of my setup, the lines I'm trying to create are not the same long and not evenly distributed but have random endpoints fed in.

Screenshot & node setup

$\endgroup$
6
  • $\begingroup$ Could it be that the Element socket of the For Each Element node is returning a single Point, whose Index is always 0 ? Could you try and hard code 0 in the Index socket of the Sample Index node ? $\endgroup$ Commented May 23 at 11:20
  • $\begingroup$ Wow... unplugging the Index socket of the Sample Index node and setting its value to 0 solves the issue indeed! Strange.. I don't understand. $\endgroup$ Commented May 23 at 11:28
  • $\begingroup$ @Booth "Index" tells you what was the index in the original geometry, however the point is separated, so now in this separated geometry you have only one element, which index is therefore first available index: zero. Very similar problem to this: blender.stackexchange.com/q/335674/60486 $\endgroup$ Commented May 23 at 14:42
  • $\begingroup$ imgur.com/a/4Ol9L72 .. ? $\endgroup$ Commented May 25 at 8:28
  • $\begingroup$ @StefLAncien your comment to hardcode 0 in the index socket of the Sample Index node and Markus, your explanation were the answer and solution to my issue. Would you like to offer these in the form of an answer for me to accept? Thank you and sorry for the delay in replying. $\endgroup$ Commented May 26 at 16:55

1 Answer 1

3
$\begingroup$

Just instance the lines on a circle and set their start point to zero:

Nodes

Result

$\endgroup$
3
  • 1
    $\begingroup$ And for this specific case i.imgur.com/96uMQTR.png - I'm aware it won't help OP on his real case while your answer will. $\endgroup$ Commented May 23 at 14:41
  • $\begingroup$ Simpler than mine :) $\endgroup$ Commented May 23 at 15:41
  • $\begingroup$ this is a perfectly fine way to solve the issue, thank you, I've marked it as useful! However, besides solving the issue I also wanted to learn and that's why I asked "what's wrong with my setup"? It turned out that there was only a tiny little thing wrong with it so I'd prefer to accept the clue that let me to make my setup work as the answer, if I can. $\endgroup$ Commented May 26 at 17:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.