Class NGonPrismCellType
Cell type for a regular polygon with n sides extended in the z-axis to a prism.
The canonical shape (for use with deformations) is the shape for the corresponding NGonCellType, extended to +-0.5 along the z-axis.
Inheritance
NGonPrismCellType
Assembly: Sylves.dll
Syntax
public class NGonPrismCellType : ICellType
Properties
N
Declaration
Property Value
ReflectX
Declaration
public CellRotation ReflectX { get; }
Property Value
ReflectY
Declaration
public CellRotation ReflectY { get; }
Property Value
RotateCCW
Declaration
public CellRotation RotateCCW { get; }
Property Value
RotateCW
Declaration
public CellRotation RotateCW { get; }
Property Value
Methods
CircumcircleDiameterToSideLength(float)
Declaration
public float CircumcircleDiameterToSideLength(float diameter)
Parameters
| Type |
Name |
Description |
| float |
diameter |
|
Returns
CircumcircleToIncircle(float)
Declaration
public float CircumcircleToIncircle(float diameter)
Parameters
| Type |
Name |
Description |
| float |
diameter |
|
Returns
Declaration
public string Format(CellCorner corner)
Parameters
Returns
Declaration
public string Format(CellDir dir)
Parameters
Returns
Declaration
public string Format(CellRotation rotation)
Parameters
Returns
FromMatrix(Matrix4x4)
Declaration
public CellRotation? FromMatrix(Matrix4x4 matrix)
Parameters
Returns
Get(int)
Declaration
public static ICellType Get(int n)
Parameters
| Type |
Name |
Description |
| int |
n |
|
Returns
GetCellCorners()
Gets all the CellCorner used by this cell type.
Declaration
public IEnumerable<CellCorner> GetCellCorners()
Returns
GetCellDirs()
Gets all the CellDir used by this cell type.
Declaration
public IEnumerable<CellDir> GetCellDirs()
Returns
GetCornerPosition(CellCorner)
Returns the position of a given corner in the canonical cell shape.
Note: This method describes the canonical cell shape, but many shapes of cell might reference this cell type.
Declaration
public Vector3 GetCornerPosition(CellCorner corner)
Parameters
Returns
GetIdentity()
Returns the rotation that leaves everything unchanged
Declaration
public CellRotation GetIdentity()
Returns
GetMatrix(CellRotation)
Returns the matrix a given rotation corresponds to.
Note: This method works for the canonical cell shape, but many shapes of cell might reference this cell type.
Declaration
public Matrix4x4 GetMatrix(CellRotation cellRotation)
Parameters
Returns
GetRotations(bool)
Gets all possible rotations of this cell type.
Declaration
public IList<CellRotation> GetRotations(bool includeReflections = false)
Parameters
| Type |
Name |
Description |
| bool |
includeReflections |
|
Returns
IncircleToCircumcircle(float)
Declaration
public float IncircleToCircumcircle(float diameter)
Parameters
| Type |
Name |
Description |
| float |
diameter |
|
Returns
Invert(CellDir)
Returns the dir pointing in the opposite direction, if it exists.
Declaration
public CellDir? Invert(CellDir dir)
Parameters
Returns
Invert(CellRotation)
Gets the inverse rotation.
i.e. GetIdentity() == Multiply(a, Invert(a)) == Multiply(Invert(a), a)
Declaration
public CellRotation Invert(CellRotation a)
Parameters
Returns
Multiply(CellRotation, CellRotation)
Composes two rotations/reflections together, doing b first, then a.
Declaration
public CellRotation Multiply(CellRotation a, CellRotation b)
Parameters
Returns
Rotate(CellCorner, CellRotation)
Declaration
public CellCorner Rotate(CellCorner corner, CellRotation rotation)
Parameters
Returns
Rotate(CellDir, CellRotation)
Rotates a dir by the given rotation.
Declaration
public CellDir Rotate(CellDir dir, CellRotation rotation)
Parameters
Returns
Rotate(CellDir, CellRotation, out CellDir, out Connection)
Declaration
public void Rotate(CellDir dir, CellRotation rotation, out CellDir resultDir, out Connection connection)
Parameters
SideLengthToCircumcircleDiameter(float)
Declaration
public float SideLengthToCircumcircleDiameter(float sideLength)
Parameters
| Type |
Name |
Description |
| float |
sideLength |
|
Returns
TryGetRotation(CellDir, CellDir, Connection, out CellRotation)
Declaration
public bool TryGetRotation(CellDir fromDir, CellDir toDir, Connection connection, out CellRotation rotation)
Parameters
Returns
Implements