PathList

Summary

Multiple disconnected path segments

Instance Properties

NameReturn TypeDescription

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:New(pathList)

Creates a new PathList from a list of Paths

Returns: PathList

Parameters:

NameTypeDefaultDescription

pathList

Path[]

A list of Paths .

Example

PathList:New(pathList)

PathList:FromText(text)

Creates a new PathList from a text

Returns: PathList

Parameters:

NameTypeDefaultDescription

text

string

Input text to generate a path.

Example

PathList.FromText('example')

Instance Methods

pathList:Draw()

Draws this PathList using current settings

Returns: nil

Example

myPaths:Draw()

pathList:Insert(path)

Inserts a path at the end of the PathList

Returns: nil

Parameters:

NameTypeDefaultDescription

path

The path to be inserted.

Example

myPaths:Insert(myPath)

pathList:Insert(path, index)

Inserts a path at the specified index of the PathList

Returns: nil

Parameters:

NameTypeDefaultDescription

path

The path to be inserted

index

number

Inserts the new path at this position in the list of paths

Example

myPaths:Insert(myPath, 3)

pathList:InsertPoint(transform)

Inserts a point at the end of the last path in the PathList

Returns: nil

Parameters:

NameTypeDefaultDescription

transform

The point to be inserted

Example

myPaths:InsertPoint(myTransform)

pathList:InsertPoint(transform, pathIndex, pointIndex)

Inserts a point at the specified index of the specified path

Returns: nil

Parameters:

NameTypeDefaultDescription

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

myPaths:InsertPoint(myTransform, 3, 0)

pathList:TransformBy(transform)

Transforms the whole set of paths

Returns: nil

Parameters:

NameTypeDefaultDescription

transform

A Transform specifying the translation, rotation and scale to apply

Example

myPaths:TransformBy(myTransform)

pathList:TranslateBy(amount)

Translates the whole set of paths by a given amount

Returns: nil

Parameters:

NameTypeDefaultDescription

amount

The amount to move the paths by

Example

myPaths:TranslateBy(Vector3.up:Multiply(4))

pathList:RotateBy(rotation)

Rotates the whole set of paths by a specified amount

Returns: nil

Parameters:

NameTypeDefaultDescription

rotation

The amount to rotate the paths by

Example

myPaths:RotateBy(Rotation.anticlockwise)

pathList:ScaleBy(scale)

Scales the whole set of paths by a specified factor

Returns: nil

Parameters:

NameTypeDefaultDescription

scale

The amount to scale the paths by

Example

myPaths:ScaleBy(vector3)

pathList:ScaleBy(scale)

Scales the whole set of paths by a specified factor

Returns: nil

Parameters:

NameTypeDefaultDescription

scale

number

The amount to scale the paths by

Example

myPaths:ScaleBy(float)

pathList:Center()

Offsets all points on the path so that their common center is at the origin

Returns: nil

Example

myPaths:Center()

pathList:Normalize(size)

Scales the whole PathList to fit inside a cube of given size at the origin

Returns: nil

Parameters:

NameTypeDefaultDescription

size

number

1

The size of the cube to fit inside

Example

myPaths:Normalize(1.5)

pathList:SampleByDistance(spacing)

Resamples all paths with a specified spacing between points

Returns: nil (The new PathList)

Parameters:

NameTypeDefaultDescription

spacing

number

The distance between each new point

Example

myPaths:SampleByDistance(0.2)

pathList:SampleByCount(count)

Resamples each path evenly into a specified number of points

Returns: nil (The new PathList)

Parameters:

NameTypeDefaultDescription

count

number

Number of points in the new path

Example

myPaths:SampleByCount(4)

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:

NameTypeDefaultDescription

parts

number

Number of parts to subdivide each path segment into

Example

myPaths:SubdivideSegments(4)

pathList:Join()

Joins all the paths in order connecting each end to the following start

Returns: Path (A single path)

Example

myPaths:Join()

pathList:Longest()

Returns the longest path in the PathList

Returns: Path (The path with the most control points)

Example

path = myPaths:Longest()

Last updated