Table of Contents

Class CGVolume

Volume Data (Path + Vertex, VertexNormal, Cross)

[CGDataInfo(0.08, 0.4, 0.75, 1)]
public class CGVolume : CGPath
Inheritance
CGVolume
Inherited Members

Constructors

CGVolume(CGPath, CGShape)

Initializes a new instance of CGVolume from the given path and cross shape

public CGVolume(CGPath path, CGShape crossShape)

Parameters

path CGPath

The path used in the creation of the volume

crossShape CGShape

The shape used as the cross section of the volume

CGVolume(CGVolume)

Initializes a new instance of CGVolume as a copy of the given volume

public CGVolume(CGVolume source)

Parameters

source CGVolume

The volume to copy from

CGVolume(int, CGShape)

Initializes a new instance of CGVolume with the specified number of sample points and cross shape

public CGVolume(int samplePoints, CGShape crossShape)

Parameters

samplePoints int

The number of sample points along the path

crossShape CGShape

The shape used as the cross section of the volume

Fields

CrossClosed

Whether the Cross base spline is closed or not

public bool CrossClosed

Field Value

bool

CrossFShift

A shift of the CrossRelativeDistances value that is applied when using the interpolation methods on the volume, like InterpolateVolume(float, float, out Vector3, out Vector3, out Vector3)

public float CrossFShift

Field Value

float

CrossMaterialGroups

Material groups for the cross shape

public SamplePointsMaterialGroupCollection CrossMaterialGroups

Field Value

SamplePointsMaterialGroupCollection

CrossSeamless

Whether the Cross shape covers the whole length of the base spline

public bool CrossSeamless

Field Value

bool

Properties

CrossCustomValues

The CustomValues of the CGShape used in the extrusion of this volume

public SubArray<float> CrossCustomValues { get; set; }

Property Value

SubArray<float>

Remarks

Setting a new SubArray<T> will Free(SubArray<T>) the current SubArray<T> instance

CrossRelativeDistances

The RelativeDistances of the CGShape used in the extrusion of this volume

public SubArray<float> CrossRelativeDistances { get; set; }

Property Value

SubArray<float>

Remarks

Setting a new SubArray<T> will Free(SubArray<T>) the current SubArray<T> instance

CrossSize

Gets the number of cross shape's sample points

public int CrossSize { get; }

Property Value

int

Scales

The 2D scale of the mesh at each sample point of the volume's path

public SubArray<Vector2> Scales { get; set; }

Property Value

SubArray<Vector2>

VertexCount

Gets the total number of vertices in the volume

public int VertexCount { get; }

Property Value

int

VertexNormals

Normals of the points, in the local space

public SubArray<Vector3> VertexNormals { get; set; }

Property Value

SubArray<Vector3>

Remarks

Setting a new SubArray<T> will Free(SubArray<T>) the current SubArray<T> instance

Vertices

Positions of the points, in the local space

public SubArray<Vector3> Vertices { get; set; }

Property Value

SubArray<Vector3>

Remarks

Setting a new SubArray<T> will Free(SubArray<T>) the current SubArray<T> instance

Methods

Clone<T>()

Creates a copy of this data instance

public override T Clone<T>() where T : CGData

Returns

T

Type Parameters

T

CrossDistanceToF(float, float, CurvyClamping)

Converts an absolute distance along the cross shape to a relative cross position

public float CrossDistanceToF(float pathF, float distance, CurvyClamping crossClamping = CurvyClamping.Clamp)

Parameters

pathF float
distance float
crossClamping CurvyClamping

Returns

float

CrossFToDistance(float, float, CurvyClamping)

Converts a cross position to an absolute distance along the cross shape

public float CrossFToDistance(float pathF, float crossF, CurvyClamping crossClamping = CurvyClamping.Clamp)

Parameters

pathF float
crossF float
crossClamping CurvyClamping

Returns

float

Dispose(bool)

protected override bool Dispose(bool disposing)

Parameters

disposing bool

Returns

bool

Get(CGVolume, CGPath, CGShape)

Returns a CGVolume made from the given CGPath and CGShape

[NotNull]
public static CGVolume Get(CGVolume data, CGPath path, CGShape crossShape)

Parameters

data CGVolume

If not null, the returned instance will be the one but with its fields updated. If null, a new instance will be created

path CGPath

The path used in the creation of the volume

crossShape CGShape

The shape used in the creation of the volume

Returns

CGVolume

GetCrossFIndex(float, out float)

Gets the index within the cross shape for a given relative cross position

public int GetCrossFIndex(float crossF, out float frag)

Parameters

crossF float

Position along the cross shape (0..1)

frag float

The interpolation value between the returned index and the next index, defining the exact position of the input point between those two points

Returns

int

GetCrossLength(float)

Gets the length of the cross shape at the given path position

public float GetCrossLength(float pathF)

Parameters

pathF float

Position along the path (0..1)

Returns

float

The length of the cross shape at the specified path position

GetSegmentIndex(int)

Gets the vertex index of the first vertex of a given segment

public int GetSegmentIndex(int segment)

Parameters

segment int

Returns

int

GetSegmentVertices(params int[])

Gets all vertices belonging to one or more extruded shape segments

public Vector3[] GetSegmentVertices(params int[] segmentIndices)

Parameters

segmentIndices int[]

Indices of segments in question

Returns

Vector3[]

An array of vertices for the specified segments

GetVertexIndex(float, float, out float, out float)

Get the index of the first vertex of the edge a certain F and CrossF is part of

public int GetVertexIndex(float pathF, float crossF, out float pathFrag, out float crossFrag)

Parameters

pathF float

position on the path (0..1)

crossF float

position on the cross (0..1)

pathFrag float

remainder between the segment and the next segment

crossFrag float

remainder between the returned vertex and the next vertex

Returns

int

a vertex index

GetVertexIndex(float, out float)

Get the index of the first vertex belonging to the segment a certain F is part of

public int GetVertexIndex(float pathF, out float pathFrag)

Parameters

pathF float

position on the path (0..1)

pathFrag float

remainder between the returned segment and the next segment

Returns

int

a vertex index

InterpolateVolume(float, float, out Vector3, out Vector3, out Vector3)

Interpolates the volume's position, direction, and up vector at the given path and cross positions

public void InterpolateVolume(float pathF, float crossF, out Vector3 pos, out Vector3 dir, out Vector3 up)

Parameters

pathF float

Position along the path (0..1)

crossF float

Position along the cross shape (0..1)

pos Vector3

The interpolated positione

dir Vector3

The interpolated direction (tangent)

up Vector3

The interpolated up vector (normal)

InterpolateVolumeDirection(float, float)

Interpolates the volume's direction (tangent) at the given path and cross positions

public Vector3 InterpolateVolumeDirection(float pathF, float crossF)

Parameters

pathF float

Position along the path (0..1)

crossF float

Position along the cross shape (0..1)

Returns

Vector3

The interpolated direction

InterpolateVolumePosition(float, float)

Interpolates the volume's position at the given path and cross positions

public Vector3 InterpolateVolumePosition(float pathF, float crossF)

Parameters

pathF float

Position along the path (0..1)

crossF float

Position along the cross shape (0..1)

Returns

Vector3

The interpolated position

InterpolateVolumeUp(float, float)

Interpolates the volume's up vector (normal) at the given path and cross positions

public Vector3 InterpolateVolumeUp(float pathF, float crossF)

Parameters

pathF float

Position along the path (0..1)

crossF float

Position along the cross shape (0..1)

Returns

Vector3

The interpolated up vector