Deform Geometry Along a Curve in Blender Geometry Nodes
This guide explains how to deform any mesh along a 3D curve using Blender's Geometry Nodes. You will learn how to map an object's bounding box coordinates to the curve's factor, sample curve attributes such as position and tangent, and accurately transform vertices to follow the curve's flow without relying on the legacy Curve Modifier.
1. Prerequisites and Setup
- Create or select a mesh object you want to deform (ensure it has enough subdivisions along the length axis to bend smoothly).
- Create the target Bezier or NURBS curve.
- Add a Geometry Nodes modifier to the mesh and open the Geometry Node Editor.
2. Map the Mesh Axis to Curve Factor
To align the mesh along the curve, you must normalize the mesh's length axis (commonly the X or Z axis) into a 0-to-1 range:
- Add a Bounding Box node and connect the
Geometryinput to it. - Add a Position node and separate its axes using a Separate XYZ node.
- Separate the
MinandMaxoutputs of the Bounding Box using two Separate XYZ nodes. - Add a Map Range node:
- Connect the selected axis (e.g., X) from the Position node to the Value input.
- Connect the
Minof that axis to From Min. - Connect the
Maxof that axis to From Max. - Set To Min to
0.0and To Max to1.0.
The output of this Map Range represents the curve factor for each vertex.
3. Sample the Target Curve
- Add an Object Info node, select your target curve, and set it to Relative.
- Connect the
Geometryoutput of the Object Info node to a Curve to Mesh or directly into a Sample Curve node (in Blender 3.4+, use the Sample Curve node; in Blender 4.0+, use Sample at Index or Sample Curve in Factor mode). - Connect the output of the Map Range node to the Factor input of the Sample Curve node.
The Sample Curve node now outputs the exact Position,
Tangent, and Normal on the curve corresponding
to each point on your mesh.
4. Calculate Vertex Offsets
To preserve the cross-sectional shape and thickness of your mesh:
- Use the remaining two axes from the mesh's initial Separate XYZ position (e.g., Y and Z if X is your length axis).
- Add an Align Euler to Vector node:
- Set the vector input to the
Tangentfrom the Sample Curve node. - Set the primary axis to match your mesh's deformation axis (e.g., X).
- Set the vector input to the
- Combine the local Y and Z offsets using a Combine
XYZ node (leaving the length axis set to
0). - Add a Vector Rotate node (set to Euler) to rotate the cross-sectional offset by the Euler rotation generated in step 2.
5. Apply the New Positions
- Add a Vector Math (Add) node.
- Connect the
Positionoutput of the Sample Curve node to the first input. - Connect the rotated cross-section offset vector to the second input.
- Add a Set Position node between the original geometry input and the group output.
- Connect the result of the Vector Math (Add) node to the Position input of the Set Position node.
Your mesh will now smoothly bend, twist, and deform along the curve in real time while retaining procedural editability.