3
$\begingroup$

I am trying to align instances of an object normal to faces using geometry nodes. The one in the circle is the only one correctly aligned. I have tried all the solutions I have found on youtube or here, but this is the closest I have been to what I am looking for. Objects align with random rotations and I am not even able to add more instances next to the good one, I have tried distribute points to faces but it results in random distribution and misalignment.

First I thought it could be easier aligning them to an hexagon of edges converted to a curve, but that identifies the normal as the normal of the hexagon, not individual edges. So objects never align well, towards the centre of the hexagon. Maybe exploring this path deeper could be the solution.

Any help or guidance with this would be much welcomed.

Thank you

INSTANCES MISALIGNED

$\endgroup$
1
  • $\begingroup$ If your question has been solved, please be so kind and mark the answer that contributed to the solution as "Accepted answer" so that this question will not continue to be displayed as unsolved. Thank you! Here you can find more information: What should I do if someone answers my question?. If you still haven't gotten a solution to your question, please be kind enough to address it. $\endgroup$
    – quellenform
    Oct 29, 2022 at 18:33

1 Answer 1

4
$\begingroup$

Your objects align correctly – you tell them to align to normals and they do. Now, obviously what you actually mean to do is to not only align the biggest face of an instance to be perpendicular (to face) the normal of the instancer, but you also want one of the smaller sides of the cuboid to face up, so you need to align again and this time limit the rotation axis:

Here I intentionally rotated the instancer to show how this arbitrary angle is not necessarily what you want, you may want to rotate up, based on the direction of the face:

I'm cheating a little bit and removing longer edges because I know the "horizontal" edges are longer. Otherwise you could take the difference between verts of an edge, take an attribute stat of the normalized Z component and compare with that instead (you probably would need a bigger εpsilon for that if edges don't all point in the same direction). Or you could use topology, if there's some logic like e.g. the top verts having lower indices than bottom verts… Or maybe you could use "shortest path" node…

$\endgroup$
3
  • $\begingroup$ Thank you for the detailed answer and solution. I discovered my hexagon mesh is bad one, so I used your attached file and tried working on it. I was able to create an array and place it in every face but now the "cuboid" as you call it is pointing outwards, instead of inwards, and several other problems arise and I don't have the skills nor the knowledge to deal with them. I will do simple arrays and hope I will learn more in the future. Thank you for your patience. $\endgroup$
    – Indigo
    Oct 27, 2022 at 18:00
  • $\begingroup$ @Indigo I spawn the cuboids on the centers of faces, and since the hexagon doesn't have thickness, the cuboids are visible on both sides. The cuboids could be translated so their origin is outside, then they would spawn on one side of the wall. $\endgroup$ Oct 27, 2022 at 20:52
  • 1
    $\begingroup$ It has to be said... Bandstands/Carousels built on a tilt are quite rare... I suppose the case has to be covered .... : ) $\endgroup$
    – Robin Betts
    Oct 28, 2022 at 8:04

You must log in to answer this question.

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