Is 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.
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.
This would work on any curve (or multiple curves at once):
The same curves but with mode changed to Length:
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:
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':
- 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.
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.