3
$\begingroup$

I have a geometry nodes setup which I thought does a proper job with spawning(and aligning) objects on mesh edges. But it appeared that sometimes it works ok, but sometimes it doesn't. For example, it totally nails spawning on cube edges:

111

But it fails with spher-ish low-poly objects, e.g:

  1. With one-subdivision Icosphere:

222

  1. With a Dodecahedron:

333

In case of the IcoSphere and Dodecahedron approximately a half of instances have a right alignment, while other half are rotated to some weird direction.

Now my node setup looks this way: 444

How to fix wrongly aligned instances?

$\endgroup$

1 Answer 1

5
$\begingroup$

Instead of Raycast I would advise to use Capture Attribute enter image description here

There are 2 issues with our original solution. The way ow you use Hit Position gives correct answer only on this specific situation when all edged are “symmetrically” around the center. If this was the desired result, you could use just the Instance Position instead of Raycast result.

The other issue is that you are Ray Casting from a point that sit on the Raycast Target Surface. Because of the (floating point) inaccuracies, the ray will sometimes start inside the surface. You could move points a tiny bit above the surface, but for that you would need Normal information, which also can be used to create the rotation, so Ray casting is a bit redundant step.

$\endgroup$
0

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.