Spline Rail deforms polygon objects using up to four splines that define the target shape.
Before Spline Rail deformation
After Spline Rail deformation
Suppose that you want to squeeze a cube through a funnel that is represented by two splines. To do this, proceed as follows:
Choose Objects > Primitive > Cube to create a cube.
In the Attribute manager, change segments X, Y and Z to 10. Changing the segments will enable us to create a smoother deformation.
In the viewport, change to the XY view (by default, select View > View 4). This gives us an orthographic view of the XY plane.
Choose Objects > Create Spline > Freehand to create a freehand spline.
Hold down the Ctrl key and click to create the first point in the viewport. Ctrl-click and make a second point to create a diagonal line as shown in the picture above.
In the Attribute manager, disable Close Spline on the Object page. This is very important.
Double click on the spline’s name in the Object manager and name it Left.
Select the Left spline in the Object manager and duplicate it by pressing Ctrl-C (Windows) or Command-C (Mac OS), then Ctrl-V (Windows) or Command-V (Mac OS). This will create a new spline named Left.1.
Select the Model tool and in the Coordinates manager change H to 180. Your splines should now look like those in the picture below.
In the Object manager, double click the Left.1 spline’s name and name it Right.
Choose Objects > Null Object to create a null object.
In the Coordinates manager, change P to 90. This rotates the Null object so that its Z-axis now points in the same direction as the Y-axis of the cube. We will use this null’s coordinates as the reference for our Spline Rail deformer in a moment.
Select the cube and move it along its Y-axis until the top of the cube is level with the top of the funnel, as in the picture below.
Choose Objects > Deformation >Spline Rail to create a Spline Rail object.
In the Object manager, drag and drop the name Spline Rail onto the name Cube to make the Spline Rail a child of the cube.
Click the name Spline Rail to select the deformer; this displays its settings in the Attribute manager.
Drag and drop the name of the Left spline and the name of the Right spline from the Object manager into the Z Spline Left and Z Spline Right boxes (in the Attribute manager) respectively.
Drag and drop the Null Object’s name from the Object manager into the Reference box.
With the Spline Rail still selected, in the Attribute manager, change Mode to Limited. The Attribute manager should now look like this:
Select the Spline Rail and move it along its Y-axis. The cube will be deformed by the two splines as you move the deformer. Switch to the 3D view if you wish to see the effect in 3D. As with all deformers, the Spline Rail can be animated using CINEMA 4D’s animation tools.
You can also use the Spline Rail object to make surfaces follow splines.