Symmetry

Summary

Functions for controlling the mirror symmetry mode

Class Properties

NameReturn TypeDescription

current

SymmetrySettings Read/Write

The current symmetry settings

brushOffset

Vector3 Read-only

Gets the offset between the current brush position and the symmetry widget

wandOffset

Vector3 Read-only

Gets the offset between the current wand position and the symmetry widget

Class Methods

Symmetry:SummonWidget()

Moves the Symmetry Widget close to user

Returns: nil

Example

Symmetry:SummonWidget()

Symmetry:Ellipse(angle, minorRadius)

Returns the radius of an ellipse at a given angle

Returns: number

Parameters:

NameTypeDefaultDescription

angle

number

The angle in degrees to sample the radius at

minorRadius

number

The minor radius of the ellipse (The major radius is always 1)

Example

for i = 0, 90 do
  radius = Symmetry:Ellipse(i * 4, 0.5)
  pointer = Transform:New(Symmetry.brushOffset:ScaleBy(radius, 1, radius))
  pointers:Insert(pointer)
end

Symmetry:Square(angle)

Returns the radius of an square at a given angle

Returns: number

Parameters:

NameTypeDefaultDescription

angle

number

The angle in degrees to sample the radius at

Example

for i = 0, 90 do
  radius = Symmetry:Square(i * 4)
  pointer = Transform:New(Symmetry.brushOffset:ScaleBy(radius, 1, radius))
  pointers:Insert(pointer)
end

Symmetry:Superellipse(angle, n, a, b)

Returns the radius of a superellipse at a given angle

Returns: number

Parameters:

NameTypeDefaultDescription

angle

number

The angle in degrees to sample the radius at

n

number

The exponent of the superellipse. This determines the roundness vs sharpness of the corners of the superellipse. For n = 2, you get an ellipse. As n increases, the shape becomes more rectangular with sharper corners. As n approaches infinity, the superellipse becomes a rectangle. If n is less than 1, the shape becomes a star with pointed tips.

a

number

1

The horizontal radius of the superellipse

b

number

1

The vertical radius of the superellipse

Example

for i = 0, 90 do
  radius = Symmetry:Superellipse(i * 4, 2, 0.5, 0.5)
  pointer = Transform:New(Symmetry.brushOffset:ScaleBy(radius, 1, radius))
  pointers:Insert(pointer)
end

Symmetry:Rsquare(angle, size, cornerRadius)

Returns the radius of a rounded square at a given angle

Returns: number

Parameters:

NameTypeDefaultDescription

angle

number

The angle in degrees to sample the radius at

size

number

Half the length of a side or the distance from the center to any edge midpoint

cornerRadius

number

The radius of the rounded corners

Example

for i = 0, 90 do
  radius = Symmetry:Rsquare(i * 4, 0.5, 0.1)
  pointer = Transform:New(Symmetry.brushOffset:ScaleBy(radius, 1, radius))
  pointers:Insert(pointer)
end

Symmetry:Polygon(angle, numSides, radius)

Returns the radius of a polygon at a given angle

Returns: number

Parameters:

NameTypeDefaultDescription

angle

number

The angle in degrees to sample the radius at

numSides

number

The number of sides of the polygon

radius

number

1

The distance from the center to any vertex

Example

for i = 0, 90 do
  radius = Symmetry:Polygon(i * 4, 5, 0.5)
  pointer = Transform:New(Symmetry.brushOffset:ScaleBy(radius, 1, radius))
  pointers:Insert(pointer)
end

Symmetry:ClearColors()

Clears the list of symmetry pointer colors

Returns: nil

Example

Symmetry:ClearColors()

Symmetry:AddColor(color)

Adds a color to the list of symmetry pointer colors

Returns: nil

Parameters:

NameTypeDefaultDescription

color

The color to add

Example

Symmetry:AddColor(Color.red)

Symmetry:SetColors(colors)

Sets the list of symmetry pointer colors

Returns: nil

Parameters:

NameTypeDefaultDescription

colors

Color[]

The list of colors to set

Example

Symmetry:SetColors({Color.red, Color.green, Color.blue})

Symmetry:GetColors()

Gets the list of symmetry pointer colors

Returns: Color[]

Example

myColors = Symmetry:GetColors()

Symmetry:AddBrush(brush)

Adds a brush to the list of symmetry pointer brushes

Returns: nil

Parameters:

NameTypeDefaultDescription

brush

string

The brush to add. Either the name or the GUID of the brush

Example

Symmetry:AddBrush("Ink")

Symmetry:ClearBrushes()

Clears the list of symmetry pointer brushes

Returns: nil

Example

Symmetry:ClearBrushes()

Symmetry:SetBrushes(brushes)

Sets the list of symmetry pointer brushes

Returns: nil

Parameters:

NameTypeDefaultDescription

brushes

string[]

The list of brushes to set. Either the names or the GUIDs of the brushes

Example

Symmetry:SetBrushes({"Ink", "Marker"})

Symmetry:GetBrushNames()

Gets the list of symmetry pointer brushes as brush names

Returns: string[]

Example

brushNames = Symmetry:GetBrushNames()

Symmetry:GetBrushGuids()

Gets the list of symmetry pointer brushes as brush GUIDs

Returns: string[]

Example

brushGuids = Symmetry:GetBrushGuids()

Symmetry:PathToPolar(path)

Converts a path to a format suitable for using as a symmetry path

Returns: Path

Parameters:

NameTypeDefaultDescription

path

The path to convert

Example

pointers = Symmetry:PathToPolar(myPath):OnY()

Last updated