|
1 | 1 | # Spline Extrude component reference |
2 | 2 |
|
3 | | -Extrude a mesh along a spline to create shapes such as wires, ropes, noodles, and tubes. |
| 3 | +Use the Spline Extrude component to customize the geometry of the mesh you extrude on a spline. |
4 | 4 |
|
5 | | -The Spline Extrude component requires a GameObject to have a Mesh Filter and Mesh Renderer component. When you add a Spline Extrude component to a GameObject, a Mesh Filter and Mesh Renderer component are added to that GameObject. |
| 5 | +**Note:** If you add Spline Extrude to a GameObject that already has a mesh, that mesh is replaced with a new one. |
6 | 6 |
|
7 | | -If you add Spline Extrude to a GameObject that already has a mesh, then Spline Extrude removes that mesh from the GameObject and creates a new mesh for the GameObject to use. |
| 7 | +## Source Spline Container |
| 8 | + |
| 9 | +Select a GameObject that has an attached Spline component you want to extrude a mesh on. |
| 10 | + |
| 11 | +You can use a Spline as a source for the extruded mesh of one or more GameObjects. Edits you make to the source Spline then update those GameObjects. For example, if you want to create a street with a sidewalk, you can create a Spline for the street, and then use the street Spline as a source for a sidewalk GameObject. Any changes you make to the street layout update the sidewalk to match. |
| 12 | + |
| 13 | +## Shape Extrude |
| 14 | + |
| 15 | +| **Property** | | **Description** | |
| 16 | +| --- | --- | --- | |
| 17 | +| **Type** > **Circle**| | Create a shape with a round cross-section. | |
| 18 | +| | **Circle Settings** > **Sides**| Increase to create a smoother surface. The minimum value is `2`. | |
| 19 | +| **Type** > **Square** | | Create a shape with a square cross-section. | |
| 20 | +| **Type** > **Road** | | Create a shape with a flat cross-section and a slight lip. | |
| 21 | +| **Type** > **Spline Profile** | | Use a different spline as a template for the current spline. | |
| 22 | +| | **Spline Profile Settings** > **Template** | Select the spline container you want to use as a template. | |
| 23 | +| | **Spline Profile Settings** > **Spline Index** | If the template container has more than one spline, select the spline you want.| |
| 24 | +| | **Spline Profile Settings** > **Side Count** | Increase to create a smoother surface. The minimum value is `2`. | |
| 25 | +| | **Spline Profile Settings** > **Axis** | Which of the template spline axes to follow when drawing this spline. | |
| 26 | + |
| 27 | + |
| 28 | +## Geometry |
| 29 | + |
| 30 | +| **Property** | **Description** | |
| 31 | +| --- | --- | |
| 32 | +| **Auto Refresh Generation** | Allow the mesh to update at runtime if the spline changes. | |
| 33 | +| **Frequency** | How many times a second to refresh the mesh. | |
| 34 | +| **Radius** | Width of the extrusion, measured from the spline path. | |
| 35 | +| **Segments Per Unit** | Increase the value to create smoother curves. | |
| 36 | +| **Cap Ends** | Fill the ends of an open-ended mesh. | |
| 37 | +| **Flip Normals** | Reveal the inside of the 3D shape. | |
| 38 | + |
| 39 | +## Advanced |
| 40 | + |
| 41 | +| **Property** | **Description** | |
| 42 | +| --- | --- | |
| 43 | +| **Range** | To extrude only some of the spline, define a range. `0` is the first spline point, and `100` is the last one. | |
| 44 | +| **Percentage** | Another way to control the **Range**. | |
| 45 | +| **Update Colliders** | If the spline has a collider, update the collider to match the 3D shape as you change the extrusion properties. | |
8 | 46 |
|
9 | | -Use the Spline Extrude component to customize the geometry of the mesh you extrude on the spline. |
10 | | - |
11 | 47 |
|
12 | | -| **Property** | **Description** | |
13 | | -| :-------------------- | :------------------------ | |
14 | | -| **Spline** | Select a GameObject that has an attached Spline component you want to extrude a mesh on. | |
15 | | -| **Create Mesh Asset** | Create a new mesh asset to attach to this GameObject. </br> This property is visible only if you haven't selected a mesh for the GameObject the Spline Extrude is attached to. | |
16 | | -| **Radius** | Set the radius of the extruded mesh. | |
17 | | -| **Profile Edges** | Set the number of sides that the radius of the mesh has. The minimum value is 3. | |
18 | | -| **Segments Per Unit** | Set how many edge loops make up the length of one unit of the mesh. | |
19 | | -| **Cap Ends** | Enable to fill each end of the mesh. If the spline the mesh is extruded on is closed, then this setting has no effect. | |
20 | | -| **Range** | Select the section of the spline to extrude the mesh on. | |
21 | | -| **Percentage** | Set a percentage of the spline to extrude the mesh on. | |
22 | | -| **Auto-Regen Geometry** | Enable to regenerate the extruded mesh when the target spline is modified at runtime or in the Editor. If you don't want the Spline Extrude component to regenerate the extruded mesh at runtime when the target spline is modified, disable **Auto-Regen Geometry**. | |
23 | | -| **Rebuild Frequency** | Set the maximum number of times per second that mesh regenerates. This property is visible only when you enable the **Auto-Regen Geometry** method.| |
24 | | -| **Update Colliders** | Enable to automatically update any attached collider components when the mesh extrudes. | |
| 48 | +## Mesh Filter and Mesh Renderer components |
| 49 | + |
| 50 | +When you add the Spline Extrude component to a GameObject, the Unity Editor adds two more components that all 3D GameObject need: |
| 51 | + |
| 52 | +* [Mesh Renderer Component](https://docs.unity3d.com/Manual/class-MeshRenderer.html) |
| 53 | +* [Mesh Filter Component](https://docs.unity3d.com/Manual/class-MeshFilter.html) |
25 | 54 |
|
26 | 55 | ## Additional resources |
27 | 56 |
|
28 | | -* [Create a tube-shaped mesh along a spline](extrude-mesh.md) |
| 57 | +* [Create a 3D mesh along a spline](extrude-mesh.md) |
29 | 58 | * [Use components](xref:UsingComponents) |
0 commit comments