0
$\begingroup$

Somebody, help me please. I want to bend the curve at any point. So I separate it into two parts and than I try to rotate one around the point of separation. But I cannot get the correct coordinates of the point - I get origin. So, how can I get global coordinates of any point on the line?

Also, perhaps there is a way to bend the line without splitting it? (but the question above is still relevant) enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ just a hint: providing a blend file would attract way more people... $\endgroup$
    – Chris
    Commented Apr 25, 2023 at 11:05

1 Answer 1

1
$\begingroup$

This is all wrong.

Your vector rotate 'center' is still set to [0,0,0] despite the whole instance thing that you're doing.

Explanation

The reason why this is not working is because any data that isn't connected to the same geometry line is automatically set to 0 since it doesn't exist. even though you are capturing the instance position, the geometry isn't connected (to the set position, so it doesn't exist. You would have to sample the data with one of GN sample nodes (like sample index).

Solution

In truth there is a much simpler way of doing this. and the only operation node (the green nodes) will be a set position.

  • use the field at index node to get the center position to rotate around. (set to vector, and the position as the value)
  • use a compare node (set to Integer) with the index as A and the Integer value you used for the field at index as B. - this will be the selection of your set position.
  • rotate the position around the vector you got from the field at index node, and set the position to that (with a set position node).

This only works for a single curve, but you can make some changes to make it work for multiple.
Here are the nodes: enter image description here

This is an example of it working multiple curves: image being uploaded soon

Alternative Solution

you can use a sample curve node (set to factor or length, it will just change the effect a bit), a spline parameter node, a compare node,(an index node, an interpolate domain node,) and a set position node.

sample curve node:

  • the curves input of the sample curve node should be your curve.
  • the index should be the index on the spline domain (so index -> interpolate domain set to spline).
  • the factor/ length input should be a value we'll call F.

compare node:

  • set to float
  • input A should be the spline parameter factor of length depending on what you set the sample curve to.
  • input B should be the value *F we specified earlier.

set position node:

  • geometry input should be your curve.
  • selection should be the output of the selection node.
  • the position input should be the position rotated around the position output of the sample curve node.

image coming soon or enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you so much, it is very helpful. Sorry for the long delay in responding. $\endgroup$
    – Inversus
    Commented May 6, 2023 at 7:27

You must log in to answer this question.

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