Multiple disconnected path segments
Name | Return Type | Description |
---|---|---|
count | number Read-only | Gets the number of paths in the PathList |
pointCount | number Read-only | Gets the number of points in all paths in the PathList |
Creates a new empty PathList
Returns: PathList
PathList:New()
Creates a new PathList from a list of Paths
Returns: PathList
Parameters:
Name | Type | Default | Description |
---|---|---|---|
pathList | Path[] | A list of Paths . |
PathList:New(pathList)
Creates a new PathList from a text
Returns: PathList
Parameters:
Name | Type | Default | Description |
---|---|---|---|
text | string | Input text to generate a path. |
PathList.FromText('example')
Draws this PathList using current settings
Returns: nil
myPaths:Draw()
Inserts a path at the end of the PathList
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
path | Path | The path to be inserted. |
myPaths:Insert(myPath)
Inserts a path at the specified index of the PathList
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
path | Path | The path to be inserted | |
index | number | Inserts the new path at this position in the list of paths |
myPaths:Insert(myPath, 3)
Inserts a point at the end of the last path in the PathList
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
transform | Transform | The point to be inserted |
myPaths:InsertPoint(myTransform)
Inserts a point at the specified index of the specified path
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
transform | Transform | The point to be inserted | |
pathIndex | number | Index of the path to add the point to | |
pointIndex | number | Inserts the point at this index in the list of points |
myPaths:InsertPoint(myTransform, 3, 0)
Transforms the whole set of paths
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
transform | Transform | A Transform specifying the translation, rotation and scale to apply |
myPaths:TransformBy(myTransform)
Translates the whole set of paths by a given amount
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
amount | Vector3 | The amount to move the paths by |
myPaths:TranslateBy(Vector3.up:Multiply(4))
Rotates the whole set of paths by a specified amount
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
rotation | Rotation | The amount to rotate the paths by |
myPaths:RotateBy(Rotation.anticlockwise)
Scales the whole set of paths by a specified factor
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
scale | Vector3 | The amount to scale the paths by |
myPaths:ScaleBy(vector3)
Scales the whole set of paths by a specified factor
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
scale | number | The amount to scale the paths by |
myPaths:ScaleBy(float)
Offsets all points on the path so that their common center is at the origin
Returns: nil
myPaths:Center()
Scales the whole PathList to fit inside a cube of given size at the origin
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
size | number | 1 | The size of the cube to fit inside |
myPaths:Normalize(1.5)
Resamples all paths with a specified spacing between points
Returns: nil (The new PathList)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
spacing | number | The distance between each new point |
myPaths:SampleByDistance(0.2)
Resamples each path evenly into a specified number of points
Returns: nil (The new PathList)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
count | number | Number of points in the new path |
myPaths:SampleByCount(4)
For each path in the list subdivide it's path segment into the specified number of parts
Returns: nil (The new PathList)
Parameters:
Name | Type | Default | Description |
---|---|---|---|
parts | number | Number of parts to subdivide each path segment into |
myPaths:SubdivideSegments(4)
Joins all the paths in order connecting each end to the following start
Returns: Path (A single path)
myPaths:Join()
Returns the longest path in the PathList
Returns: Path (The path with the most control points)
path = myPaths:Longest()