5
$\begingroup$

I'm trying to create a geometry nodes structure that creates junctions (multiple at once). I have a mesh of vertices and edges as input. I'm trying to get a junction geometry (which somewhat works), but the issue is orientation of curves on which I want to later generate other geometry like pavement, curb etc. I want to make so that the pavements are generated all in same direction (ideally inwards while offsetting the curve outwards before that by width of pavement). I'm not that familiar with geometry nodes yet.

I have tried to figure it out through visualizing it better but no ideas were sparked (red are endpoints and green are start points of the curve, and black are center points of junction).

enter image description here

If I were able to get the positions of the endpoint and startpoint as vectors, not only the boolean masks from Endpoint Selection node, and then the position of the "center point" of the given junction also as vector, I would be able to calculate selection through sign of angle. But I was unable to get to that point so far. Here is the main part of the node tree:

Any ideas or ways to achieve the same result are welcome.

$\endgroup$

2 Answers 2

5
$\begingroup$

You can solve this task by comparing the direction to the nearest edges of the original mesh with the normals of your curves. If they point in different directions, you can reverse the curves.

The Compare node, which you set to Vector and Dot Product, will help you with this task. If the resulting value is in the minus range, this means that the nearest edge is pointing in the opposite direction.

Something like this:


(Blender 4.1.1+)

$\endgroup$
1
  • 1
    $\begingroup$ Thank you! I would also add for future readers that for version 4.1.0 that I use (and possibly other), you have to set domains for sample nodes to Edge. $\endgroup$
    – Poncaada
    Commented May 2 at 13:48
1
$\begingroup$

Hello Poncaada, another approach is to keep the curves circular, to resort the points then delete the unwanted points:

enter image description here

Keep the curve circular by adding a Delete Geometry plug on the Intersecting Edges of the Mesh Boolean then squeeze it on Z.

enter image description here

Then reorder the point Curve with an Offset Point in Curve capture it then Sort Elements on the new mesh. Be aware that is working only if the first point of each curve is on a point in the middle of “the road”. With a Geometry Proximity on your original geometry you can now delete the unwanted points.

enter image description here

The .blend:

I hope it helps.

$\endgroup$

You must log in to answer this question.

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