fastest 3D software for linux

Linux 3D
interactive ray-tracing

Index

 E3d_SplineGetTransformedBoundingBox
 E3d_SplineFreeCVs
 E3d_SplineGetDrawingArcLengthParameters
 E3d_SplineCVInit
 E3d_SplineCVsNew
 E3d_SplineGetUsAtCVs
 E3d_SplineUpdateSegmentLengths
 E3d_SplineGetXYRange
 E3d_SplineGetYValueFromX
 E3d_SplineGet3DPosition
 E3d_SplinesReadFromCSV


E3d_SplineGetTransformedBoundingBox

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

Syntax
EBool E3d_SplineGetTransformedBoundingBox(E3dSpline* PSpline, const E3dMatrix PMatrix, E3dCoord3* PBBMin, E3dCoord3* PBBMax)

Arguments
E3dSpline* PSpline Pointer to the Spline structure const E3dMatrix PMatrix The Matrix that defines the coordinate system E3dCoord3* PBBMin Returned bounding box point 0 E3dCoord3* PBBMax 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(PSpline, LModel->LocalToWorldMatrix, PBBMin, PBBMax); This will return the "world-aligned" bounding box of the PSpline (assuming that PSpline is a Geometry of LModel).

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

See also
E3d_SplineGetBoundingBox

E3d_SplineFreeCVs

Free Control Vertices of a Spline

Syntax
void E3d_SplineFreeCVs(E3dSpline* PSpline)

Argument
E3dSpline* PSpline Pointer to the Spline structure
Description
This function frees all the CVs of the given Spline.

Return value
None.

See also
E3d_SplineCVsNew

E3d_SplineGetDrawingArcLengthParameters

Get visual arc-length parameters (following "DrawSteps") of Spline

Syntax
E3dCoordinate E3d_SplineGetDrawingArcLengthParameters(const E3dSpline* PSpline, const E3dCoordinate PGapSize, const EBool PInvert, E3dCoordinate* PTable, EIndex* PNumOfGapsP)

Arguments
const E3dSpline* PSpline Pointer to the Spline const EBool PInvert If TRUE, get parameters in reverse order const E3dCoordinate PGapSize Gap size in U space. If < 0, all segments are considered visible E3dCoordinate* PTable Pre-allocated array of at least PSpline->NumOfLinSegments + 1 elements for the result EIndex* PNumOfGapsP Return the number of gaps here (number of segments marked invisible)
Description
Fills in the length-proportional values in PTable, walking through the piece-wise linear approximation of the Spline that is used for rendering.

Return value
The total "drawn length" of the Spline (the sum of the lengths of the linear segments).

See also
E3d_SplineCreateLinearSegments

E3d_SplineCVInit

Set a Spline Control Vertex to a default

Syntax
void E3d_SplineCVInit(E3dSplineCV* PCV, const int PSegmentType)

Arguments
LSplineType Type of the Spline the CVs will be used with LCV Pointer to the Spline CV
Description
Initializes the given Spline CV (control vertex).

Return value
None.

See also
E3d_SplineCVsAllocate

E3d_SplineCVsNew

Allocate array of Spline Control Vertices (CVs)

Syntax
E3dSplineCV* E3d_SplineCVsNew(const int PType, const EIndex PNumOfCVs)

Arguments
const int PType Type of the Spline the CVs will be used with const EIndex PNumOfCVs Number of 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 CVs or NULL in case of an error.

E3d_SplineGetUsAtCVs

Return U values at the CVs of a Spline

Syntax
E3dCoordinate* E3d_SplineGetUsAtCVs(E3dSpline* PSpline)

Arguments
E3dSpline* PSpline Pointer to the Spline
Description
Return normalized arc-length distance values (0 to 1) at the CVs of PSpline.

Return value
=============================================================================== Coordinate* E3d_SplineGetUsAtCVs(E3dSpline* PSpline) / The first and last CVs of B-splines and cardinal splines have no correspoding curve segments, so set U to -1.0 there, to indicate this

E3d_SplineUpdateSegmentLengths

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

Syntax
E3dCoordinate E3d_SplineUpdateSegmentLengths(E3dSpline* PSpline, EIndex PLinSteps)

Argument
E3dSpline* PSpline Pointer to the Spline structure EIndex PLinSteps 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 explicit integration. The PLinSteps 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.

E3d_SplineGetXYRange

Calculate signed 2D BBox of a Spline

Syntax
int E3d_SplineGetXYRange(const E3dSpline* PSpline, E3dCoord2* PXY0, E3dCoord2* PXY1)

Arguments
const E3dSpline* PSpline Pointer to the Spline E3dCoord2* PXY0 Pointer to the first XY position E3dCoord2* PXY1 Pointer to the last XY position
Description
Return the XY position of the first and last points on PSpline. Beware that this is not quite the same as a bounding box. PXY0.X may be > PXY1.X and / or PXY0.Y may be > PXY1.Y. PXY0.X > PXY1.X indicates that the Spline needs to be inverted if it is to be used for E3d_SplineGetYValueFromX.

Return value
E_SUCCESS if all went well and the X and Y coordinates of the first and last positions on the Spline in PXY0 and PXY1. If the values could not the determined, E_NO_DATA is returned.

See also
E3d_SplineGetYValueFromX

E3d_SplineGetYValueFromX

Compute 3D position along a Spline

Syntax
int E3d_SplineGetYValueFromX(E3dSpline* PSpline, const E3dCoordinate PX, E3dCoordinate* PY)

Arguments
E3dSpline* PSpline Pointer to the Spline structure const E3dCoordinate PX Parameter (0.0...1.0) E3dCoordinate* PY Pointer to the return value
Description
Computes the Y value on a given Spline, at a given X value. The postion returned is in the Spline's local coordinate system. It is used for key-frame animation, guided extrude etc. Note that for performance reasons, this function doesn't do all possible validity tests for PSpline, so: - The Spline must represent a 1D function (no loops etc.). - X coordinates must increase from the first CV toward the last (use E3d_SplineGetXYRange() to determine this and invert the Spline if necessary, via E3d_SplineInvert()).

Return value
E_SUCCESS if all went well and the Y value in *PY.

See also
E3d_SplineUpdateSegmentLengths, E3d_SplineGetXYRange, E3d_SplineInvert

E3d_SplineGet3DPosition

Compute 3D position along a Spline

Syntax
int E3d_SplineGet3DPosition(E3dSpline* PSpline, E3dCoordinate PTime, E3dCoord3* PPositionP, E3dCoord3* PTangentP, E3dCoord3* PNormalP)

Arguments
E3dSpline* PSpline Pointer to the Spline structure E3dCoordinate PTime Parameter (0.0...1.0) E3dCoord3* PPositionP Pointer to structure for the return value
Description
This function computes the 3D position along the given Spline, defined by the "Time" parameter. The parameter value 0.0 represents the starting point and 1.0 represents the end point of the Spline, while values in-between refer to a point along the Spline. The segment lengths and the total length of the Spline must be up-to-date when calling this function. The postion returned is in the Spline's local coordinate system.

Return value
E_SUCCESS if all went well.

See also
E3d_SplineUpdateSegmentLengths

E3d_SplinesReadFromCSV

Read CSV data (comma separated values) with X,Y, values, into Splines

Syntax
int E3d_SplinesReadFromCSV(const char* PBuffer, const EIndex PBufferSize, E3dSpline*** PSplinesP, EIndex* PSplines_CountP)

Arguments
const char* PBuffer Pointer to the string (e.g. from an ASCII file) const EIndex PBufferSize The lenght of the string E3dSpline*** PSplinesP Pointer for returning the Splines EIndex* PSplines_CountP Pointer for returning the number of Splines read
Description
Reads CSV data (comma separated values) with X,Y, values, into Splines. It checks each line for 1, 2 or 3 values and uses those as the X,Y and Z coordinates of each CV of a Spline. The first line is the names of the coordinate axes.

Return value
None.
© 1992-2017 By Gabor Nagy