0
$\begingroup$

The past months I received valuable feedback, coaching and knowhow on my first Geometry Nodes question on this forum (How to align object on normal vector between vertex and line)

The past weeks I have been editing one of the shared files. In this shared file, the GN tree places almost every instance with desired rotation. Unfortunately some instances are placed on points that intersect with the road. In my usecase the instances are streetlights that need to be directed to the road. The points are simple 2D geometry which are being used as reference in the Input Socket Points of the Instance on Points node. The road is delivered as a collection node and contains meshes. My questions are as following:

  • Is it possible to rotate instances that intersect with the reference object (polygons of the road)? In this case, I would like to rotate the instances with 180 degrees.
  • How can this transformation be applied to only the instances that are placed on the road? It is important that the correct placed instances stay in the same place.

enter image description here

After some research I discovered the Mesh Boolean node.I thought I could use this node to retrieve the intersection between the extrude mesh in the z-axis and the instances. From there on I would like to collect the objects that intersect and give them a rotation of 180 degrees. enter image description here

In particular, I want to thank @quellenform for the in depth answers and the shared file. The file can be downloaded by the following link; https://we.tl/t-lo3Pvuy8PO

$\endgroup$
3
  • $\begingroup$ If I were you, I would not use a Mesh Boolean in your case. Firstly, you wouldn't be able to do much with the information you get with it, and it's slow. It's best to use Raycast and add a little to the starting point on the Z-axis so that the starting points raycast onto the mesh from above. $\endgroup$
    – quellenform
    Commented Dec 1, 2023 at 22:16
  • 1
    $\begingroup$ @quellenform Thanks for the feedback! With this advice it was a matter of logical thinking and adding two nodes to the GN tree. I solved the question by using the Geometry of the road as a Target Geometry Input Socket. The Is Hit Output Socket from the Raycast node is being used by the Rotate Instances node. For reference see the following link; imgur.com/a/JSyh914 $\endgroup$
    – Yosri Sem
    Commented Dec 2, 2023 at 15:12
  • $\begingroup$ Very nice! You could write that as an answer and accept it. ...and the other/linked question can also be marked as solved? (just to keep this Q&A platform tidy) $\endgroup$
    – quellenform
    Commented Dec 2, 2023 at 15:41

0

You must log in to answer this question.

Browse other questions tagged .