PathList
Summary
Multiple disconnected path segments
Instance Properties
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 |
Class Methods
PathList:New()
Creates a new empty PathList
Returns: PathList
Example
PathList:New(pathList)
Creates a new PathList from a list of Paths
Returns: PathList
Parameters:
Name | Type | Default | Description |
---|---|---|---|
pathList | Path[] | A list of Paths . |
Example
PathList:FromText(text)
Creates a new PathList from a text
Returns: PathList
Parameters:
Name | Type | Default | Description |
---|---|---|---|
text | string | Input text to generate a path. |
Example
Instance Methods
pathList:Draw()
Draws this PathList using current settings
Returns: nil
Example
pathList:Insert(path)
Inserts a path at the end of the PathList
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
path | The path to be inserted. |
Example
pathList:Insert(path, index)
Inserts a path at the specified index of the PathList
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
path | The path to be inserted | ||
index | number | Inserts the new path at this position in the list of paths |
Example
pathList:InsertPoint(transform)
Inserts a point at the end of the last path in the PathList
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
transform | The point to be inserted |
Example
pathList:InsertPoint(transform, pathIndex, pointIndex)
Inserts a point at the specified index of the specified path
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
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 |
Example
pathList:TransformBy(transform)
Transforms the whole set of paths
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
transform | A Transform specifying the translation, rotation and scale to apply |
Example
pathList:TranslateBy(amount)
Translates the whole set of paths by a given amount
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
amount | The amount to move the paths by |
Example
pathList:RotateBy(rotation)
Rotates the whole set of paths by a specified amount
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
rotation | The amount to rotate the paths by |
Example
pathList:ScaleBy(scale)
Scales the whole set of paths by a specified factor
Returns: nil
Parameters:
Name | Type | Default | Description |
---|---|---|---|
scale | The amount to scale the paths by |
Example
pathList:ScaleBy(scale)
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 |
Example
pathList:Center()
Offsets all points on the path so that their common center is at the origin
Returns: nil
Example
pathList:Normalize(size)
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 |
Example
pathList:SampleByDistance(spacing)
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 |
Example
pathList:SampleByCount(count)
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 |
Example
pathList:SubdivideSegments(parts)
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 |
Example
pathList:Join()
Joins all the paths in order connecting each end to the following start
Returns: Path (A single path)
Example
pathList:Longest()
Returns the longest path in the PathList
Returns: Path (The path with the most control points)
Example
Last updated