7

enter image description hereenter image description hereenter image description hereIs there a way to have the bolts instanced along a curve in geometry nodes with proper spacing between one another on each side of the pipe? I want each segment of pipe to have the same amount of bolts on each side.

3 Answers3

13

The Curve to Points node is really useful for this. If you need even spacing instead of even amounts, change the mode from Count to Length.

enter image description here

This would work on any curve (or multiple curves at once):

enter image description here

The same curves but with mode changed to Length:

enter image description here

Update

What you really need to do to make this work correctly is to create two offset curves based on the original base curve (I'm assuming that your pipe is based on a curve) and then use the Curve to Points node to spread out the instances evenly:

enter image description here

Tobias Einarsson
  • 2,202
  • 14
  • 18
  • Sorry this is not what I need, I want the bolts along the curve to be evenly spaced not the ones on the connecting peice – Mason Heilman Jun 03 '22 at 06:01
  • @MasonHeilman Just saw your edit, doesn't the Curve to Points node with Count set to 11 solve your problem? The curve circle is just a representation of your curve, it could be whatever shape. Otherwise, you need to clarify what you're trying to achieve. – Tobias Einarsson Jun 03 '22 at 06:09
  • I am talking about the bolts along the length of the tube not the flange, they are closer together on the inner bend – Mason Heilman Jun 03 '22 at 06:24
  • @MasonHeilman I've updated my answer with another curve as input. – Tobias Einarsson Jun 03 '22 at 06:45
  • 1
    You can set the Curve-to-Points node to "Length" mode to get even spacing between the points, instead of a fixed count over the whole curve. It will change the total amount based on how long the curve is. This may or may not be what the OP needs, it's hard to tell without more detail. – lukas_t Jun 03 '22 at 07:29
  • The photo you added to your post is showing the same issue. the spacing between the bolts is not the same. Say the curve to the left you updated your post with was to make a full circle. There should not be the same amount of bolts on the inner radius as there are on the outside. – Mason Heilman Jun 03 '22 at 07:35
  • @MasonHeilman Quote from your question: "I want each segment of pipe to have the same amount of bolts on each side." Set the mode to length instead of count if you need even spacing instead of same amount. – Tobias Einarsson Jun 03 '22 at 07:38
  • I added an edit showing the nodes I am using. It is set to length. Are you using two different curves – Mason Heilman Jun 03 '22 at 08:42
  • Yes, there are two curves. – Tobias Einarsson Jun 03 '22 at 08:47
  • @MasonHeilman I updated my answer with a node setup that creates two offset curves (one on each side of the pipe) based on the original one. Hope it helps! – Tobias Einarsson Jun 03 '22 at 10:28
  • 1
    @TobiasEinarsson Thank you for another update, this solves my problem. Sorry for all the confusion – Mason Heilman Jun 03 '22 at 15:40
7

This is a near-repeat of @Tobias Einarrson 's answer since he's edited it (.. the main point being to sample a curve by length). This adds a workflow option, though, so maybe it's worth posting.

Starting after you've made your mesh, somehow, inside or outside a GN tree.

  • You can select edge-loops of the mesh to carry the bolts, weighted 1, and add them to a vertex-group.
  • Feed that group as an input to an 'Add Bolts' GN modifier

In this example, the vertex-group input as 'Linear':

enter image description here

  • First of all, the Normal of the underlying mesh is captured.. (curves can twist undesirably)
  • Then the vertices with enough weight in the group are separated from the mesh. (Edges are preserved)
  • The separated edge-segments are converted to a multi-spline curve.
  • The curve is sampled by length, and the bolts instanced on it.
  • The bolt-instances are rotated to align with the mesh-surface Normal.

enter image description here

When you sample a curve by length in GN, the endpoints are always included, and the rest are 'best fit'. Which, in this case, IMO, is quite helpful.

The method would work just as well for stitches in upholstery or clothing, ornamental beading.. etc.

Robin Betts
  • 76,260
  • 8
  • 77
  • 190
2

you can use this node setup, to achieve the effect:

enter image description here

The resample curve node with "length" gives you even spaces.

result:

enter image description here

by adding scene time, some map range nodes, you can even animate the bolts:

enter image description here

enter image description here

Chris
  • 59,454
  • 6
  • 30
  • 84