Index

 E3d_SplineGetTransformedBoundingBox
 E3d_EdgesAllocate
 E3d_PolyLinesAllocate
 E3d_SplineAllocate
 E3d_SplineFreeCVs
 E3d_SplineClone
 E3d_SplineCVDefault
 E3d_SplineCVsAllocate
 E3d_SplineUpdateSegmentLengths


E3d_SplineGetTransformedBoundingBox

Get the bounding box of a Spline aligned to an arbitrary coordinate system

Syntax
 EBool E3d_SplineGetTransformedBoundingBox(E3dSpline* LSpline,
                               E3dMatrix LMatrix,
                               E3d3DPosition* LBBMin, E3d3DPosition* LBBMax)
Arguments
 E3dSpline*     LSpline      Pointer to the Spline structure
 E3dMatrix      LMatrix      The Matrix that defines the coordinate system
 E3d3DPosition* LBBMin       Returned bounding box point 0
 E3d3DPosition* LBBMax       Returned bounding box point 1
Description
This function transforms each CV of the given Spline with the given Matrix and returns the minimum and maximum XYZ values of the resulting bounding box.

Example
E3d_SplineGetTransformedBoundingBox(LSpline, LModel->LocalToWorldMatrix, LBBMin, LBBMax); This will return the "world-aligned" bounding box of the LSpline (assuming that LSpline is a Geometry of LModel).

Return value
TRUE if successful, FALSE in case of an error.

See also
E3d_SplineGetBoundingBox

E3d_EdgesAllocate

Allocate array of independent Edges (line segments)

Syntax
 E3dEdge* E3d_EdgesAllocate(unsigned int LEdgeNum)
Argument
 unsigned int LEdgeNum       Number of Edges to allocate
Description
This function allocates memory for an array of edges and initializes all the Edges.

Return value
Pointer to the array of Edges or NULL in case of an error.

E3d_PolyLinesAllocate

Allocate array of PolyLines (connected lines)

Syntax
 E3dPolyLine* E3d_PolyLinesAllocate(unsigned int LPolyLineNum)
Argument
 unsigned int LPolyLineNum   Number of PolyLines to allocate
Description
This function allocates memory for an array of points for PolyLines and initializes all the elements of the array.

Return value
Pointer to the array or NULL in case of an error.

E3d_SplineAllocate

Allocate a Spline of the given type

Syntax
 E3dSpline* E3d_SplineAllocate(int LType)
Argument
 int LType        Type of Spline to allocate
Description
This function allocates and initializes an E3dSpline structure and sets the type to LType. The currently supported types are: - E3dSPL_LINEAR "a.k.a. PolyLine"; all segments are linear - E3dSPL_BEZIER segment and key types can vary (you can mix linear and curved segments) - E3dSPL_BSPLINE - E3dSPL_CARDINAL Note that the Spline type can be changed later, but the old spline keys have to be removed and reallocated as they might be incompatible with the new Spline type (e.g. Bezier Spline keys have a different format than B-Spline keys).

Return value
Pointer to the allocated E3dSpline structure or NULL in case of an error.

See also
E3d_SplineFree

E3d_SplineFreeCVs

Free Control Vertices of a Spline

Syntax
 void E3d_SplineFreeCVs(E3dSpline* LSpline)
Argument
 E3dSpline* LSpline        Pointer to the Spline structure
Description
This function frees all the CVs of the given Spline.

Return value
None.

See also
E3d_SplineAllocate

E3d_SplineClone

Duplicate a Spline

Syntax
 E3dSpline* E3d_SplineClone(E3dSpline* LSpline)
Argument
 E3dSpline* LSpline        Pointer to the Spline structure to be cloned
Description
This function creates and exact copy of the given Spline.

Return value
Pointer to the new Spline structure, or NULL in case of an error

See also
E3d_SplineAllocate, E3d_SplineFree

E3d_SplineCVDefault

Set a Spline Control Vertex to a default

Syntax
 void E3d_SplineCVDefault(int LSplineType, void* LCV)
Arguments
 int   LSplineType    Type of the Spline the CVs will be used with
 void* LCV            Pointer to the Spline CV
Description
Initializes the given Spline CV (control vertex), depending on the type of the Spline to which it is assigned. Bezier Spline CVs are treated differently from other types as they have more information.

Return value
None.

See also
E3d_SplineCVsAllocate

E3d_SplineCVsAllocate

Allocate array of Spline Control Vertices (CVs)

Syntax
 void* E3d_SplineCVsAllocate(int LSplineType, unsigned int LNumOfCVs)
Arguments
 int          LSplineType    Type of the spline the keys will be used with
 unsigned int LNumOfCVs      Number of Spline CVs to allocate
Description
Allocates a number of Spline CVs (control vertex) in an array and initializes them. The type of the structures allocated depends on LSplineType.

Return value
Pointer to the array of allocated spline key or NULL in case of an error.

See also
E3d_SplineAllocate

E3d_SplineUpdateSegmentLengths

(Re)compute segment lengths and the total length of a Spline

Syntax
 E3dCoordinate E3d_SplineUpdateSegmentLengths(E3dSpline* LSpline, unsigned int LLinSteps)
Argument
 E3dSpline*   LSpline        Pointer to the Spline structure
 unsigned int LLinSteps      Number of steps for curved segments
Description
This function recomputes the length of all the segments in the given Spline and stores the length value on each Spline CV (CV). As any other segment-related information, the segment length is stored on the segment's starting key. Lengths of curved segments are computed with implicit integration. The LLinSteps argument determines the number of steps (samples) within each curved segment. The higher this number, the higher the precision of the computation will be.

Return value
The total length of the Spline.