Class CurveSegment
The base class for CurveSegments. A CurveSgment does not know its own start point. For the first CurveSegment in a sequence the start point is saved in the CurvePart belonging to the segment. The start point for the CurveSegment with index i is the last vertex in the CurveSegent[i-1]'s list of vertices.
Inherited Members
Namespace: Fusee.Math.Core
Assembly: Fusee.Math.Core.dll
Syntax
public abstract class CurveSegment
Fields
Vertices
The vertices of a CurveSegment represented by float3s.
Declaration
public IList<float3> Vertices
Field Value
Type | Description |
---|---|
System.Collections.Generic.IList<float3> |
Methods
CalcAdaptivePolylineWAngle(float3, Int32, Int32)
Returns a polygonal chain, representing the curve segment. Intermediate points are calculated adaptively.
Declaration
public IEnumerable<float3> CalcAdaptivePolylineWAngle(float3 startPoint, int angle, int degree)
Parameters
Type | Name | Description |
---|---|---|
float3 | startPoint | The segment's starting point |
System.Int32 | angle | Determines how far the angle between the two vectors(start point, random point and end point) may vary from 180° |
System.Int32 | degree | The degree of the curve: 1 for linear, 2 for conic, 3 for cubic |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<float3> |
CalcAdaptivePolylineWArcreage(float3, Single, Int32)
Returns a polygonal chain, representing the curve segment. Intermediate points are calculated adaptively.
Declaration
public IEnumerable<float3> CalcAdaptivePolylineWArcreage(float3 startPoint, float acreage, int degree)
Parameters
Type | Name | Description |
---|---|---|
float3 | startPoint | The segment's starting point |
System.Single | acreage | Determines a maximal acreage for the triangle created from start point random point and end point. |
System.Int32 | degree | The degree of the curve: 1 for linear, 2 for conic, 3 for cubic |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<float3> |
CalcPoint(Single, float3[])
Calculates a point on a bézier curve using De Casteljau's algorithm.
Declaration
public float3 CalcPoint(float t, float3[] vertices)
Parameters
Type | Name | Description |
---|---|---|
System.Single | t | Bézier curves are polynominals of t. t is element of [0, 1] |
float3[] | vertices | All control points that represent the curve, incl. start and end point |
Returns
Type | Description |
---|---|
float3 |
CalcUniformPolyline(float3, Int32, Int32)
Returns a polygonal chain, representing the curve segment. Intermediate points are calculated with uniform values of t.
Declaration
public virtual IEnumerable<float3> CalcUniformPolyline(float3 startPoint, int segmentsPerCurve, int degree)
Parameters
Type | Name | Description |
---|---|---|
float3 | startPoint | The segment's starting point. |
System.Int32 | segmentsPerCurve | The number of segments per curve. |
System.Int32 | degree | The degree of the curve: 1 for linear, 2 for conic, 3 for cubic. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<float3> |
SplitCurve(Single, float3[], ref List<float3>, ref List<float3>)
Splits a curve using De Casteljau's algorithm.
Declaration
public void SplitCurve(float t, float3[] vertices, ref List<float3> leftCurve, ref List<float3> rightCurve)
Parameters
Type | Name | Description |
---|---|---|
System.Single | t | Bézier curves are polynominals of t. t is element of [0, 1]. |
float3[] | vertices | All control points that represent the curve, incl. start and end point. |
System.Collections.Generic.List<float3> | leftCurve | The left new curve. |
System.Collections.Generic.List<float3> | rightCurve | The right new curve. |