Curves


Curves
Extrude
To add the Extrude component, go to Abthoclo/Tools/Curves/Mesh Generator/Extrude - Curves

The Extrude modifier will extrude a mesh along the SplineContainer with the parameters provided in the inspector.

Inspector Inspector Extrude Segments Per Curve
The number of segments per curve.

SHAPE
Select SplineContainer Shape
Select a SplineContainer in the scene or project that you want to use as the shape to extrude, default shape is a circle. NOTE: Curves uses the X and Z for the shape, so make sure the shape is flat.

Clear Shape data
Revert back to the default shape by erasing the custom shape data.

Resolution Shape
The resolution of the extruded shape. A higher number means more details.

Cap Start
Indicates if the start of the mesh are filled.

Cap End
Indicates if the end of the mesh are filled.

Can Solidify
Indicates if the mesh has a thickness.

Thickness
Thickness of the extruded mesh. This is a normalized value."

Inverse Mesh
Inverse the mesh incase of flipped normals.

ROTATION
Start Rotation
Initial rotation of the extrude.

Additional Rotation Type
"Apply additional scaling according to total distance of the spline, or by custom distance."

SCALING
Scale Shape
Adjust the scale of the extrude.

Additional Scaling
Apply additional scaling according to total distance of the spline, or by custom distance.

UV
Calculate Uvs
Include UV0 in the generated mesh.

Calculate Lightmap
Include UV1 - Lightmap in the generated mesh.
Update At Runtime
Automatically update the Mesh Generator at runtime.

Rebuild
Force a rebuild of the mesh.


Samples
Curves contains sample scenes for Extrude, they are located at Abthoclo/Curves/Examples/Extrude/

Repeat
To add the Repeat component, go to Abthoclo/Tools/Curves/Mesh Generator/Repeat - Curves

The Repeat modifier will repeat a mesh along the SplineContainer with distorting the mesh reference.

Inspector Inspector Repeat Auto + Default Settings Mesh
Mesh reference. Default mesh is a cube.

Spacing
Spacing
Additional space between each instance.
Spacing Type
Spacing type to calculate the space value. You have the option between a constant or relative type.
Transform Options
Offset
Adjust the offset of the mesh according to the Spline Element.
Orientation
Adjust the orientation of the mesh according to the Spline Element.
Scale Mesh
Adjust the scale of the mesh according to the Spline Element.

Caps
Additional option to include caps at the start and end of the spline(s).

Update At Runtime
Automatically update the Mesh Generator at runtime.

Rebuild
Force a rebuild of the mesh.

Fixed Inspector Repeat - Fixed Count
The number of instances along the SplineContainer.

Align Threshold
Normalized position along the Spline(s) that the instances should be aligned at.

Align Type
Alignment type, according to the Spline element.

Snapping
Presets for the alignment.

Fit Inspector Repeat - Fit Count
The number of instances along the SplineContainer.

Min Range
The minimum section of the Spline(s) to use.

Max Range
The maximum section of the Spline(s) to use.

Cap Inspector Repeat - Cap Enabled
Indicates if the SplineContainer has a cap.

Mesh
Mesh reference for the cap. Default mesh is a cube.

Offset
Adjust the offset of the mesh according to the Spline Element.

Orientation
Adjust the orientation of the mesh according to the Spline Element.

Scale Mesh
Adjust the scale of the mesh according to the Spline Element.

Spacing
Additional space between each instance.

Spacing Type
Spacing type to calculate the space value.


Samples
Curves contains sample scenes for the Repeat, they are located at Abthoclo/Curves/Examples/Repeat/

Custom Modifier
Include your own custom modifiers, simple use the template below to start creating your own awesome modifier. This modifier will then automatically be included in the Curves Component.

using UnityEngine;

using UnityEngine.Splines;
using Abthoclo.Tools.Curves;

// Calling Haptic with a specific lowFrequence, highFrequence and duration.
[System.Serializable]
public class CustomModifier : CurvesModifier
{
	[SerializeField]
    	private CustomData _customData;
	
	public CustomModifier() { }

	// Init
	public CustomModifier(SplineContainer splineContainer)
	{
		_splineContainer = splineContainer;

		_customData = new SplineExtrudeInfo();

		_mesh = new Mesh();
	}
	
	// This contains your own custom implementation of your modifier
	internal override Mesh CalculateMesh(out Matrix4x4 mat)
	{
		if (_mesh == null) _mesh = new Mesh();
		mat = Matrix4x4.identity;

		if (_splineContainer == null) return _mesh;

		// ADD your own mesh modifier code here...

		return _mesh;
	}
	
	// Array should contain all the Serialized Object you want to draw in the inspector
	public override string[] GetRelativePropertyPaths() => new string[] { "_customData" };

	// Name of your modifier
    	public override string ToString() => "Custom Modifier";
}