0
$\begingroup$

I instanced a randomized curve line(with profile curve) onto a circle but all resultig meshes are the same. I want them to be different for each triangle tube. "Plane A":

Geometry Nodes used in Plane A

In "Plane B" i first instanced a curve line onto a circle and then added randomized wiggles onto the result. This does make every triangle tube different but now the triangle tubes arent aligned to the circle normals anymore. "Plane B":

Geometry Nodes used in Plane B

How can i align the triangle tubes in Plane B to the normals of the circle like in Plane A?

$\endgroup$
0

1 Answer 1

1
$\begingroup$

Explanation

In your 1st example, you first create a line, (skipping the random part as it's not that important here) then bevel it with a triangle with the sharp tip pointing up towards positive $y$ (a viewer will make it seem it points up, that is, towards positive $z$, but that's because your object is rotated), and then rotate around the vertical ($z$) axis, in order to make this tip ($y$) point in the direction of the "normal" (those are ironic quotes, the normal node returns the Position if there's no normal, and there's no normal if there's no face to read the normal from).

In your 2nd example, you first create a line (same as above), but then you instance and align it. Since it's a line going exactly through the $z$ axis, rotating it around the $z$ axis cannot possible do anything. And so your aligning makes no change other than setting an instance rotation attribute - which is then discarded (applied) upon realizing the instances. So you end up with just the vertical lines (again, they seem horizontal in the viewer because the object is rotated) and no additional information distinguishing a line from any other line.

Y Problem

In order to randomize those curve lines and maintain alignment to "normals" (of the big circle), capture the positions and rotations of instances, and then rotate the curves after beveling them:

And yes, some triangles point inwards, but it's not clear from the question if they shouldn't, as "properly" is an ambiguous term.

https://en.wikipedia.org/wiki/XY_problem

X Problem

Here's a more proper approach: you could do it like previously with Instance on Points and use the sampled Position as pivot point ('Center') instead of offsetting to it, but I just wanted to show a different way to do the same thing. The key difference, however, is to displace in the direction of the normal. If you position the initial curve horizontally and displace before rotation, the displace is always $<0, 0, z>$. The bigger benefit of using a horizontal curve is that if you want a sideways displace away from the normal, you can now use Set Curve Normal node with z-up option to ensure the tops of the bridges always point up.

$\endgroup$
4
  • $\begingroup$ Hey, great solution! I had first tried around with Curve Tilt (and was able to successfully solve the problem), but in the end it seemed too cumbersome and error-prone, so I didn't finish the answer. But the way you solved it here is solid and easier. Great! $\endgroup$
    – quellenform
    Sep 11, 2023 at 23:42
  • $\begingroup$ @quellenform I think what the OP really wants (the X problem) is to spawn triangles, align them, and then randomly offset vertices, though I can see why someone would want to do it this way (more consistency of the beveled curve shape) - in which case the triangles pointing inwards can be detected and flipped… Waiting for the OP. $\endgroup$ Sep 12, 2023 at 7:46
  • $\begingroup$ Hello, thanks for the suggestions. I came up with my own solution which works completely different but gives a quasi identical outcome to Markus von Broady's nodes. Are you interested in seeing my solution? Otherwiese both my own and Markus solution have the problem that some triangles point inwards, as mentioned. The triangles are just placeholders for this simplified example, ultimately they are supposed to be bridges spread scross the inside of a ring shaped spacestation, so they should all point outwards (or inwards) $\endgroup$
    – sinwar
    Sep 12, 2023 at 15:32
  • $\begingroup$ @sinwar see edit. $\endgroup$ Sep 12, 2023 at 17:49

You must log in to answer this question.

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