0
$\begingroup$

What I want to do is the following: I want some way to easily make objects that look like a system of tubes or pipes. I start with an easily-editable mesh that is basically extruded points (edit mode of a cube, select all vertices, merge at center, extrude extrude extrude and then you end up with a segmented line like in the picture below, the black lines underneath the cylinders). I tried with the solidify modifier and some other ways but they all don't give me the corners I'm looking for, so now I'm trying to implement the following strategy.

My current approach is: if I make a geometry node that will position a cylinder at each vertex of my mesh except the last one, then orient that cylinder so that it points toward the next vertex in the mesh, and then scale it to the length of the edge, I'll have the connecting pipes part done (I'll then add spheres on each vertex to fix up the corners). I tried several different approaches in geometry nodes. The most promising is also the most straightforward: for each edge, I take the location of the start- and end point; subtract them from each other; then rotate the cylinder around the Z axis by the angle of the result of that subtraction (I'm only doing this in 2D, so we can assume the Z position of all vertices is the same). This should be possible with some simple trig. And indeed it works for the first and last vertex, but not the ones in between. Note in the screenshot below that the first and last cylinders are aligned with the edges connected to them, the others are sort of in the middle between the two edges connected to them (but not exactly). When I move the edges around, the rotation of the cylinders on those two points tends to flip around quite a bit, while those at the ends stay correct. So this doesn't seem like it's an issue with flipping signs because the result of the subtraction is in another quadrant.

enter image description here

This is my node setup:

enter image description here

Any ideas on what I could be looking at? Or even just tricks on debugging geometry nodes? I've found the 'spreadsheet' view but I'm having a really hard time finding out what values are being passed around, and the concept of the 'fields' in- and outputs is making things quite a bit worse. Yes I've watched several Youtube videos (and the manual) on what they are and how they work, but I can't seem to get them to work with the 'instance on points' and related nodes.

$\endgroup$
4
  • $\begingroup$ Meta: I tried to edit the question to attach the blend file but it looks like that's not possible? What's the easiest way to add a blend file? $\endgroup$
    – Roel
    Commented Jan 17 at 13:46
  • 1
    $\begingroup$ you can use blend-exchange.com and paste the link you obtain here. $\endgroup$
    – lemon
    Commented Jan 17 at 13:47
  • $\begingroup$ Ah I see, great thanks. $\endgroup$
    – Roel
    Commented Jan 17 at 13:56
  • $\begingroup$ to ensure a regular thickness, small angles will be hard to handle. How do you expect it to be, for small angles? $\endgroup$
    – lemon
    Commented Jan 18 at 6:53

1 Answer 1

0
$\begingroup$
  1. You are mis-using (or not using 😄) the spline geometry node. that node just seperates geometry depending on a selection [and with no selection it does nothing ], so your 'Instance on Points' is still using the points.

    What you want is the 'Mesh to Points' node set to Edge.

  2. You are calculating the rotation wrong. Use the 'Align Euler to Vector' node. Use the direction (the output of your vector math subtract) as the Vector (not rotation) input of the 'Align Euler to Vector' node.

  3. Once you use the 'Mesh to Points' node, it won't have edges vertices etc., so you have to capture the rotation (or at least the direction) before you use the 'Mesh to Points' node. Afterwards use the captured rotation as the Instance on Points''s rotation.

$\endgroup$

You must log in to answer this question.

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