# How can I project 3D objects with the Instance on Points node perpendicular to an adjacent line?

The last few week I worked on developing a Geometry Node workflow. This Geometry Node workflow's main goal is to speed up a Digital Twin's modeling process. This product is part of a larger research project. As a student, I am currently working on thesis research about the development of Digital Twins. This study aims to discover new workflows that could significantly improve the level of detail and location recognition inside the current Digital Twin. The findings and new research results will be shared in a publication and presentation. This thesis will be the final project to complete my higher vocational education in Architecture and Construction Engineering.

Objective

I hope to achieve a workflow that makes it possible to project 3D objects on 2D points. The orientation of the 3D object should be perpendicular to the adjacent line. To clarify the use case of this workflow I will further explain the scope of my thesis research. In the Netherlands, it is possible to receive large datasets from urban areas. These datasets contain vector or raster data of the buildings, landscape and infrastructure. Besides the 2D geometry, lots of these datasets also contain valuable metadata. The 2D geometry consists of polylines, lines and points. I am developing a workflow that will convert the 2D points of streetlights into 3D objects.

The prototypes of this workflow contain a line and some random points. The line illustrates the center of the road. The 2D points are the basepoints of the 3D objects. An important precondition is that the lighting from the streetlights cover the road. To meet this objective, I want to integrate mathematical tools in my geometry nodes workflow. Mathematical insights make clear that the shortest distance from a point to a line is always the perpendicular projection. For every random point, I want to retrieve the perpendicular projection between the point and line. In the next step I will align the light bulb form the streetlight to this normal vector.

Issues

During my variant study I discovered the following nodes:

• Align Euler to Vector
• Sample Nearest
• Capture Atrribute These nodes were used to retrieve the perpendicular projection of the points and line. I tried to integrate these nodes with the Instance on Points nodes. Unfortunately, I discovered that every streetlight gets the same rotation. In my current workflow I tried to retrieve the normal vector of the line via an object info node. In the following steps this geometry gets translated to vector data.

Desired solution and workflow

In my desired workflow I want to control the position of every individual streetlight. In the following iteration, I want to align the light bulb of the object perpendicular to a line. Every streetlight has another normal vector because the shortest distances between the line and points vary. My intuition says that the order of the nodes needs to get adjusted. This has already been confirmed when connecting two Align Euler to Vector nodes in a row. The second Align Euler to Vector nodes determines the rotation in the Instance on Points node.

Since I have worked with Revit and Dynamo I am used to integrating a watch node in my scripts. In Dynamo this Watch node reviews the outcomes of a chain of nodes and operations. Is it possible to integrate a similar node inside the Geometry Nodes of Blender?

Examples

My variant study and current findings are displayed below.

GN script with rotate euler node as manually correction button of rotation

GN script with combination of two align euler to vector nodes in a row

Second option; integrating a capture attribute node

Third option; integrating a sample nearest node

Sketch of the desired solution; light bulb of streetlight perpendicular to line of road

I would highly appreciate your input on my thesis research and look forward to hearing from you at your earliest convenience.

Kind regards,

• In your sketch of the desired solution it looke like the street lamps are lying on the floor, is this really what you want to achieve? If not, could you maybe make a manual 3D model of the situation you want to achieve automatically? Also "light bulb of streetlight perpendicular to line of road" - I don't see that. Maybe the 2nd from the bottom, but the others surely not. If you've used a software like Excalidraw to draw vectors and display clearly the right angles, it would be some starting point for discussion. All in all, very lengthy question, and not a lot of meat :P Commented Jul 28, 2023 at 13:26
• @YosriSem In img no. 5&6 why are you using the object a for sampling or capturing? It's the points of the line mesh that you have to calculate the normal of not the streetlight. Commented Jul 28, 2023 at 14:38