## AnimDoAnimation

(geom_lib/animate.c:504)
Prototype:

      void AnimDoAnimation(AnimationStruct *Anim, IPObjectStruct *PObjs)

Description:
Routine to run a sequence of objects through an animation according to animation attributes of matrices and curves that are attached to them.
Parameters:

Anim: | Animation structure.
--- | ---
PObjs: | Objects to render.

Returned Value:

void.

See Also:
AnimEvalAnimation
Keywords:
animation

## AnimDoSingleStep

(geom_lib/animate.c:607)
Prototype:

      void AnimDoSingleStep(AnimationStruct *Anim, IPObjectStruct *PObjs)

Description:
Routine to exectue a single step the animation, at current time.
Parameters:

Anim: | Animation structure.
--- | ---
PObjs: | Objects to render.

Returned Value:

void.

Keywords:
animation

## AnimEvalAnimation

(geom_lib/animate.c:578)
Prototype:

      void AnimEvalAnimation(RealType t, IPObjectStruct *PObjs)

Description:
Evaluate the animation curves at the given time, setting the proper animation attributes ("_animation_mat" and "_isvisible"), in place.
Parameters:

t: | Time to evaluate the animation at.
--- | ---
PObjs: | To evaluate their animation curves.

Returned Value:

void

See Also:
AnimDoAnimation
Keywords:
animation

## AnimFindAnimationTime

(geom_lib/animate.c:260)
Prototype:

      void AnimFindAnimationTime(AnimationStruct *Anim, IPObjectStruct *PObjs)

Description:
Computes the time span for which the animation executes.
Parameters:

Anim: | Animation structure to update.
--- | ---
PObjs: | Objects to scan for animation attributes.

Returned Value:

void

Keywords:
animation

## AnimGenAnimInfoText

(geom_lib/animate.c:87)
Prototype:

      void AnimGetAnimInfoText(AnimationStruct *Anim)

Description:
Getting input parameters of animation from user using textual user interface.
Parameters:

Anim: | The animation state to update.
--- | ---

Returned Value:

void

Keywords:
animation

## AnimResetAnimStruct

(geom_lib/animate.c:55)
Prototype:

      void AnimResetAnimStruct(AnimationStruct *Anim)

Description:
Resets the slots of an animation structure.
Parameters:

Anim: | The animation state to reset.
--- | ---

Returned Value:

void

Keywords:
animation

## AnimSaveIterationsToFiles

(geom_lib/animate.c:645)
Prototype:

      void AnimSaveIterationsToFiles(AnimationStruct *Anim, IPObjectStruct *PObjs)

Description:
Saves one iteration of the animation sequence as IRIT data (*.dat). The objects that are saved are those that are visibled on the current time frame as set via current animation_mat attribute.
Parameters:

Anim: | Animation structure.
--- | ---
PObjs: | Objects to render.

Returned Value:

void

Keywords:
animation

## BBComputeBboxObject

(geom_lib/bbox.c:45)
Prototype:

      BBBboxStruct *BBComputeBboxObject(IPObjectStruct *PObj)

Description:
Computes a bounding box of a given object of any type.
Parameters:

PObj: | To compute a bounding box for.
--- | ---

Returned Value:

BBBboxStruct *: A pointer to a statically allocated bounding box holding bounding box information on PObj.

Keywords:
bounding box

## BBComputeBboxObjectList

(geom_lib/bbox.c:146)
Prototype:

      BBBboxStruct *BBComputeBboxObjectList(IPObjectStruct *PObj)

Description:
Computes a bounding box of a list of objects of any type.
Parameters:

PObj: | To compute a bounding box for.
--- | ---

Returned Value:

BBBboxStruct *: A pointer to a statically allocated bounding box holding bounding box information on objects PObj.

Keywords:
bounding box

## BBComputeOnePolyBbox

(geom_lib/bbox.c:181)
Prototype:

      BBBboxStruct *BBComputeOnePolyBbox(IPPolygonStruct *PPoly)

Description:
Computes a bounding box of a polygon/polyline/pointlist object.
Parameters:

PPoly: | To compute a bounding box for.
--- | ---

Returned Value:

BBBboxStruct *: A pointer to a statically allocated bounding box holding bounding box information on PPoly.

Keywords:
bounding box

## BBComputeOnePolyListBbox

(geom_lib/bbox.c:213)
Prototype:

      BBBboxStruct *BBComputePolyListBbox(IPPolygonStruct *PPoly)

Description:
Computes a bounding box for a list of polygon/polyline/pointlist objects.
Parameters:

PPoly: | To compute a bounding box for.
--- | ---

Returned Value:

BBBboxStruct *: A pointer to a statically allocated bounding box holding bounding box information on PPoly list.

Keywords:
bounding box

## BBComputePointBbox

(geom_lib/bbox.c:248)
Prototype:

      BBBboxStruct *BBComputePointBbox(RealType *Pt)

Description:
Computes a bounding box of a point object.
Parameters:

Pt: | To compute a bounding box for.
--- | ---

Returned Value:

BBBboxStruct *: A pointer to a statically allocated bounding box holding bounding box information on Pt.

Keywords:
bounding box

## BBMergeBbox

(geom_lib/bbox.c:274)
Prototype:

      BBBboxStruct *BBMergeBbox(BBBboxStruct *Bbox1, BBBboxStruct *Bbox2)

Description:
Merges (union) given two bounding boxes into one. Either Bbox1 or Bbox2 can be pointing to the static area Bbox used herein.
Parameters:

Bbox1: | First bounding box to union up.
--- | ---
Bbox2: | Second bounding box to union up.

Returned Value:

BBBboxStruct *: A unioned bounding box the contains both BBox1 and BBox2.

Keywords:
bounding box

## CG2PointsFromLineLine

(geom_lib/geomat3d.c:896)
Prototype:

      int CG2PointsFromLineLine(PointType Pl1,
                                PointType Vl1,
                                PointType Pl2,
                                PointType Vl2,
                                PointType Pt1,
                                RealType *t1,
                                PointType Pt2,
                                RealType *t2)

Description:
Routine to find the two points Pti on the lines (Pli, Vli) , i = 1, 2 with the minimal Euclidian distance between them. In other words, the distance between Pt1 and Pt2 is defined as distance between the two lines. The two points are calculated using the fact that if V = (Vl1 cross Vl2) then these two points are the intersection point between the following: Point 1 - a plane (defined by V and line1) and the line line2. Point 2 - a plane (defined by V and line2) and the line line1. This function returns TRUE iff the two lines are not parallel!
Parameters:

Pl1, Vl1: | Position and direction defining the first line.
--- | ---
Pl2, Vl2: | Position and direction defining the second line.
Pt1: | Point on Pt1 that is closest to line 2.
t1: | Parameter value of Pt1 as (Pl1 + Vl1 * t1).
Pt2: | Point on Pt2 that is closest to line 1.
t2: | Parameter value of Pt2 as (Pl2 + Vl2 * t2).

Returned Value:

int: TRUE, if successful.

Keywords:
line line distance

## CGBaryCentric3Pts

(geom_lib/geomat3d.c:1387)
Prototype:

      RealType *CGBaryCentric3Pts(PointType Pt1,
                                  PointType Pt2,
                                  PointType Pt3,
                                  PointType Pt)

Description:
Computes the Barycentric coordinates of given point Pt with respect to given Triangle Pt1 Pt2 Pt3. All points are assumed to be coplanar.
Parameters:

Pt1, Pt2, Pt3: | Three points forming a triangular in general position.
--- | ---
Pt: | A point for which the barycentric coordinates are to be computed.

Returned Value:

RealType *: A pointers to a static space holding the three Barycentric coefficients, or NULL if point Pt is outside the triangle Pt1 Pt2 Pt3.

Keywords:

## CGConvertPolysToTriangles

(geom_lib/poly_pts.c:43)
Prototype:

      IPObjectStruct *CGConvertPolysToTriangles(IPObjectStruct *PolyObj)

Description:
Creates a new polygonal objects out of given one, that contains only triangles. None convex polygons are split to convex one which, in turn, converted to triangles.
Parameters:

PolyObj: | Polygonal object to split into triangles.
--- | ---

Returned Value:

IPObjectStruct *: A polygonal object containing only triangles representing the same model as PolyObj.

See Also:
ConvexPolyObjectN
Keywords:

## CGDistLineLine

(geom_lib/geomat3d.c:954)
Prototype:

      RealType CGDistLineLine(PointType Pl1,
                              PointType Vl1,
                              PointType Pl2,
                              PointType Vl2)

Description:
Routine to find the distance between two lines (Pli, Vli) , i = 1, 2.
Parameters:

Pl1, Vl1: | Position and direction defining the first line.
--- | ---
Pl2, Vl2: | Position and direction defining the second line.

Returned Value:

RealType: Distance between the two lines.

Keywords:
line line distance

## CGDistPointLine

(geom_lib/geomat3d.c:697)
Prototype:

      RealType CGDistPointLine(PointType Point, PointType Pl, PointType Vl)

Description:
Routine to compute the disstance between a 3d point and a 3d line. The line is prescribed using a point on it (Pl) and vector (Vl).
Parameters:

Point: | To find the distance to on the line.
--- | ---
Pl, Vl: | Position and direction that defines the line.

Returned Value:

RealType: The computed distance.

Keywords:
point line distance

## CGDistPointPlane

(geom_lib/geomat3d.c:732)
Prototype:

      RealType CGDistPointPlane(PointType Point, PlaneType Plane)

Description:
Routine to compute the distance between a Point and a Plane. The Plane is prescribed using its four coefficients : Ax + By + Cz + D = 0 given as four elements vector.
Parameters:

Point: | To find the distance to on the plane.
--- | ---
Plane: | To find the distance to on the point.

Returned Value:

RealType: The computed distance.

Keywords:
point plane distance

## CGDistPointPoint

(geom_lib/geomat3d.c:573)
Prototype:

      RealType CGDistPointPoint(PointType P1, PointType P2)

Description:
Routine to compute the distance between two 3d points.
Parameters:

P1, P2: | Two points to compute the distance between.
--- | ---

Returned Value:

RealType: Computed distance.

Keywords:
point point distance

## CGGenMatrixRotVec

(geom_lib/geomat3d.c:1353)
Prototype:

      void CGGenMatrixRotVec(MatrixType Mat, VectorType Vec, RealType Degrees)

Description:
Generates a transformation matrix that rotates the object around Vec, Angle degrees.
Parameters:

Mat: | To place the computed transformation.
--- | ---
Vec: | Vector to rotate along its axis.
Degrees: | Amount ofrotation, in degrees.

Returned Value:

void

Keywords:
transformations rotation

## CGGenMatrixZ2Dir

(geom_lib/geomat3d.c:1249)
Prototype:

      void CGGenMatrixZ2Dir(MatrixType Mat, VectorType Dir)

Description:
Same as CGGenTransMatrixZ2Dir but with no scaling and/or translation.
Parameters:

Mat: | To place the computed transformation.
--- | ---
Dir: | Direction to take Z axis to.

Returned Value:

void

Keywords:
transformations rotation

## CGGenMatrixZ2Dir2

(geom_lib/geomat3d.c:1329)
Prototype:

      void CGGenMatrixZ2Dir2(MatrixType Mat, VectorType Dir, VectorType Dir2)

Description:
Same as CGGenTransMatrixZ2Dir2 but with no scaling and/or translation.
Parameters:

Mat: | To place the computed transformation.
--- | ---
Dir: | Direction to take Z axis to.
Dir2: | Direction to take X axis to.

Returned Value:

void

Keywords:
transformations rotation

## CGGenTransMatrixZ2Dir

(geom_lib/geomat3d.c:1201)
Prototype:

      void CGGenTransMatrixZ2Dir(MatrixType Mat,
                                 VectorType Trans,
                                 VectorType Dir,
                                 RealType Scale)

Description:
Routine to prepare a transformation martix to do the following (in this order): scale by Scale, rotate such that the Z axis is in direction Dir and then translate by Trans. Algorithm: given the Trans vector, it forms the 4th line of Mat. Dir is used to form the second line (the first 3 lines set the rotation), and finally Scale is used to scale first 3 lines/columns to the needed scale:

                   |  Tx  Ty  Tz  0 |   A transformation which takes the coord
                   |  Bx  By  Bz  0 |  system into T, N & B as required and
    [X  Y  Z  1] * |  Nx  Ny  Nz  0 |  then translate it to C. T, N, B are
                   |  Cx  Cy  Cz  1 |  scaled by Scale.

N is exactly Dir (unit vec) but we got freedom on T & B which must be on a plane perpendicular to N and perpendicular between them but thats all! T is therefore selected using this (heuristic ?) algorithm: Let P be the axis of which the absolute N coefficient is the smallest. Let B be (N cross P) and T be (B cross N).
Parameters:

Mat: | To place the computed transformation.
--- | ---
Trans: | Translation factor.
Dir: | Direction to take Z axis to.
Scale: | Scaling factor.

Returned Value:

void

Keywords:
transformations rotation

## CGGenTransMatrixZ2Dir2

(geom_lib/geomat3d.c:1288)
Prototype:

      void CGGenTransMatrixZ2Dir2(MatrixType Mat,
                                  VectorType Trans,
                                  VectorType Dir,
                                  VectorType Dir2,
                                  RealType Scale)

Description:
Routine to prepare a transformation martix to do the following (in this order): scale by Scale, rotate such that the Z axis is in direction Dir and X axis is direction T and then translate by Trans. Algorithm: given the Trans vector, it forms the 4th line of Mat. Dir is used to form the second line (the first 3 lines set the rotation), and finally Scale is used to scale first 3 lines/columns to the needed scale:

                   |  Tx  Ty  Tz  0 |   A transformation which takes the coord
                   |  Bx  By  Bz  0 |  system into T, N & B as required and
    [X  Y  Z  1] * |  Nx  Ny  Nz  0 |  then translate it to C. T, N, B are
                   |  Cx  Cy  Cz  1 |  scaled by Scale.

N is exactly Dir (unit vec) and T is exactly Dir2.
Parameters:

Mat: | To place the computed transformation.
--- | ---
Trans: | Translation factor.
Dir: | Direction to take Z axis to.
Dir2: | Direction to take X axis to.
Scale: | Scaling factor.

Returned Value:

void

Keywords:
transformations rotation

## CGPlaneFrom3Points

(geom_lib/geomat3d.c:609)
Prototype:

      int CGPlaneFrom3Points(PlaneType Plane,
                             PointType Pt1,
                             PointType Pt2,
                             PointType Pt3)

Description:
Routine to construct the plane from given 3 points. If two of the points are the same or the three points are colinear it returns FALSE, otherwise (successful), it returns TRUE.
Parameters:

Plane: | To compute.
--- | ---
Pt1, Pt2, Pt3: | Three points to fit a plane through.

Returned Value:

int: TRUE if successful, FALSE otherwise.

Keywords:
plane

## CGPointCoverOfPolyObj

(geom_lib/poly_pts.c:133)
Prototype:

      IPObjectStruct *CGPointCoverOfPolyObj(IPObjectStruct *PolyObj,
                                            int n,
                                            RealType *Dir)

Description:
Computes a uniform distribution of points on a polygonal object.
Parameters:

PolyObj: | Object to compute a uniform point distribution on.
--- | ---
n: | Number of points to distribute (estimate).
Dir: | If given - use it as view dependent uniform distribution. Note that if Dir != NULL less than n points will be generated.

Returned Value:

IPObjectStruct *: A point list object.

Keywords:

## CGPointCoverOfUnitHemiSphere

(geom_lib/sph_pts.c:30)
Prototype:

      IPObjectStruct *CGPointCoverOfUnitHemiSphere(RealType HoneyCombSize)

Description:
Computes a honey comb distribution of points on a sphere. Result is an approximation.
Parameters:

HoneyCombSize: | Size of honey comb.
--- | ---

Returned Value:

IPObjectStruct *: A point list object.

Keywords:

## CGPointFromLinePlane

(geom_lib/geomat3d.c:777)
Prototype:

      int CGPointFromLinePlane(PointType Pl,
                               PointType Vl,
                               PlaneType Plane,
                               PointType InterPoint,
                               RealType *t)

Description:
Routine to find the intersection point of a line and a plane (if any). The Plane is prescribed using four coefficients : Ax + By + Cz + D = 0 given as four elements vector. The line is define via a point on it Pl and a direction vector Vl. Returns TRUE only if such point exists.
Parameters:

Pl, Vl: | Position and direction that defines the line.
--- | ---
Plane: | To find the intersection with the line.
InterPoint: | Where the intersection occured.
t: | Parameter along the line of the intersection location (as Pl + Vl * t).

Returned Value:

int: TRUE, if successful.

Keywords:
line plane intersection

## CGPointFromLinePlane01

(geom_lib/geomat3d.c:831)
Prototype:

      int CGPointFromLinePlane01(PointType Pl,
                                 PointType Vl,
                                 PlaneType Plane,
                                 PointType InterPoint,
                                 RealType *t)

Description:
Routine to find the intersection point of a line and a plane (if any). The Plane is prescribed using four coefficients : Ax + By + Cz + D = 0 given as four elements vector. The line is define via a point on it Pl and a direction vector Vl. Returns TRUE only if such point exists. this routine accepts solutions only for t between zero and one.
Parameters:

Pl, Vl: | Position and direction that defines the line.
--- | ---
Plane: | To find the intersection with the line.
InterPoint: | Where the intersection occured.
t: | Parameter along the line of the intersection location (as Pl + Vl * t).

Returned Value:

int: TRUE, if successful and t between zero and one.

Keywords:
line plane intersection

## CGPointFromPointLine

(geom_lib/geomat3d.c:653)
Prototype:

      void CGPointFromPointLine(PointType Point,
                                PointType Pl,
                                PointType Vl,
                                PointType ClosestPoint)

Description:
Routine to compute the closest point on a given 3d line to a given 3d point. the line is prescribed using a point on it (Pl) and vector (Vl).
Parameters:

Point: | To find the closest to on the line.
--- | ---
Pl, Vl: | Position and direction that defines the line.
ClosestPoint: | Where closest point found on the line is to be saved.

Returned Value:

void

Keywords:
point line distance

## CGPolygonRayInter

(geom_lib/geomat3d.c:1022)
Prototype:

      int CGPolygonRayInter(IPPolygonStruct *Pl, PointType PtRay, int RayAxes)

Description:
Routine that implements "Jordan Theorem": Fire a ray from a given point and find the number of intersections of a ray with the polygon, excluding the given point Pt (start of ray) itself, if on polygon boundary. The ray is fired in +X (Axes == 0) or +Y if (Axes == 1). Only the X/Y coordinates of the polygon are taken into account, i.e. the orthogonal projection of the polygon on an X/Y parallel plane (equal to polygon itself if on X/Y parallel plane...). Note that if the point is on polygon boundary, the ray should not be in its edge direction. Algorithm: 1. 1.1. Set NumOfIntersection = 0; 1.2. Find vertex V not on Ray level and set AlgState to its level (below or above the ray level). If none goto 3; 1.3. Mark VStart = V; 2. Do 2.1. While State(V) == AlgState do 2.1.1. V = V -> Pnext; 2.1.2. If V == VStart goto 3; 2.2. IntersectionMinX = IRIT_INFNTY; 2.3. While State(V) == ON_RAY do 2.3.1. IntersectionMin = MIN(IntersectionMin, V -> Coord[Axes]); 2.3.2. V = V -> Pnext; 2.4. If State(V) != AlgState do 2.4.1. Find the intersection point between polygon edge VLast, V and the Ray and update IntersectionMin if lower than it. 2.4.2. If IntersectionMin is greater than Pt[Axes] increase the NumOfIntersection counter by 1. 2.5. AlgState = State(V); 2.6. goto 2.2. 3. Return NumOfIntersection;
Parameters:

Pl: | To compute "Jordan Theorem" for the given ray. Can be either a polygon or a closed polyline (first and last points of polyline are equal).
--- | ---
PtRay: | Origin of ray.
RayAxes: | Direction of ray. 0 for X, 1 for Y, etc.

Returned Value:

int: Number of intersections of ray with the polygon.

Keywords:
ray polygon intersection Jordan theorem

## CGPolygonRayInter3D

(geom_lib/geomat3d.c:1135)
Prototype:

      int CGPolygonRayInter3D(IPPolygonStruct *Pl, PointType PtRay, int RayAxes)

Description:
Same as CGPolygonRayInter but for arbitrary oriented polygon. The polygon is transformed into the XY plane and then CGPolygonRayInter is invoked on it.
Parameters:

Pl: | To compute "Jordan Theorem" for the given ray.
--- | ---
PtRay: | Origin of ray.
RayAxes: | Direction of ray. 0 for X, 1 for Y, etc.

Returned Value:

int: Number of intersections of ray with the polygon.

Keywords:
ray polygon intersection Jordan theorem

## CleanUpPolygonList

(geom_lib/poly_cln.c:28)
Prototype:

      void CleanUpPolygonList(IPPolygonStruct **PPolygons)

Description:
Routine to clean up polygons - delete zero length edges, and polygons with less than 3 vertices.
Parameters:

PPolygons: | List of polygons to clean, in place.
--- | ---

Returned Value:

void

Keywords:
zero length edges cleaning

## CleanUpPolylineList

(geom_lib/poly_cln.c:88)
Prototype:

      void CleanUpPolylineList(IPPolygonStruct **PPolylines)

Description:
Routine to clean up polylines of zero length.
Parameters:

PPolylines: | List of polylines to clean, in place.
--- | ---

Returned Value:

void

Keywords:
zero length polyline cleaning

## Colinear3Vertices

(geom_lib/intrnrml.c:120)
Prototype:

      int Colinear3Vertices(IPVertexStruct *V1,
                            IPVertexStruct *V2,
                            IPVertexStruct *V3)

Description:
Verify the colinearity of the given three vertices.
Parameters:

V1, V2, V3: | ertices to test for colinearity.
--- | ---

Returned Value:

int: TRUE if colinear, FALSE otherwise.

Keywords:
colinearity

## ConvexPolyObject

(geom_lib/convex.c:180)
Prototype:

      void ConvexPolyObject(IPObjectStruct *PObj)

Description:
Routine to test all polygons in a given object for convexity, and split non convex ones, in place. This function will introduce new vertices to the split polygons.
Parameters:

PObj: | To test for convexity of its polygons, and split into convex polygons non convex polygons found, in place. Either a polygonal object or a list of polygonal objects.
--- | ---

Returned Value:

void

See Also:
CGConvertPolysToTriangles ConvexPolyObjectN ConvexPolygon litNonConvexPoly
Keywords:
convexity convex polygon

## ConvexPolyObjectN

(geom_lib/convex.c:149)
Prototype:

      IPObjectStruct *ConvexPolyObjectN(IPObjectStruct *PObj)

Description:
Routine to test all polygons in a given object for convexity, and split non convex ones, non destructively - the original object is not modified. This function will introduce new vertices to the split polygons.
Parameters:

PObj: | To test for convexity of its polygons.
--- | ---

Returned Value:

IPObjectStruct *: A duplocate of PObj, but with convex polygons only.

See Also:
CGConvertPolysToTriangles ConvexPolyObject ConvexPolygon litNonConvexPoly
Keywords:
convexity convex polygon

## ConvexPolygon

(geom_lib/convex.c:258)
Prototype:

      int ConvexPolygon(IPPolygonStruct *Pl)

Description:
Routine to test if the given polygon is convex or not. Algorithm: The polygon is convex iff the normals generated from cross products of two consecutive edges points to the same direction. Note a 5 star polygon satisfies this constraint but it is self intersectingand we assume given polygon is not selft intersecting. The computed direction is alos verified against the polygon's plane normal. The routine returns TRUE iff the polygon is convex. In addition the polygon CONVEX tag (see IPPolygonStruct) is also updated. If the polygon is already marked as convex, nothing is tested!
Parameters:

Pl: | To test its convexity condition.
--- | ---

Returned Value:

int: TRUE if convex, FALSE otherwise.

See Also:
CGConvertPolysToTriangles ConvexPolyObject ConvexPolyObjectN litNonConvexPoly
Keywords:
convexity convex polygon

## DecimateObjSetDcmRatioParam

(geom_lib/decimate.c:151)
Prototype:

      void DecimateObjSetDcmRatioParam(int DcmRatio)

Description:
Function set parameter of the maximal number of the participation of each vertex in the triangulation process.
Parameters:

DcmRatio: | aximal participation number.
--- | ---

Returned Value:

void

See Also:
DecimateObject
Keywords:
polygonal decimation data reduction

## DecimateObjSetDistParam

(geom_lib/decimate.c:108)
Prototype:

      void DecimateObjSetDistParam(RealType Dist)

Description:
Function set parameter of the maximal tolerant distance from the removed vertex to the average plane.
Parameters:

Dist: | hreshold distance value.
--- | ---

Returned Value:

void

See Also:
DecimateObject
Keywords:
polygonal decimation data reduction

## DecimateObjSetMinAspRatioParam

(geom_lib/decimate.c:173)
Prototype:

      void DecimateObjSetMinAspRatioParam(RealType MinAspRatio)

Description:
Function set parameter of the maximal number of the aspect ratio of the loop splitting.
Parameters:

MinAspRatio: | inimal aspect ratio.
--- | ---

Returned Value:

void

See Also:
DecimateObject
Keywords:
polygonal decimation data reduction

## DecimateObjSetPassNumParam

(geom_lib/decimate.c:129)
Prototype:

      void DecimateObjSetPassNumParam(int PassNum)

Description:
Function set parameter of the maximal number of the decimation passages
Parameters:

PassNum: | assages number.
--- | ---

Returned Value:

void

See Also:
DecimateObject
Keywords:
polygonal decimation data reduction

## DecimateObject

(geom_lib/decimate.c:201)
Prototype:

      IPObjectStruct *DecimateObject(IPObjectStruct *IPObj)

Description:
This function implement the decimation of the polygonal mesh by applying Schroeder's decimation scheme. The percentage of the decimation depends on setting of the global variables: NumberOfPassages, VertexDcmRatio and DistToAvrgPln. If Splitting option is set to TRUE, retriangilation of the vertices loop is performed by using recursive splitting algorithm where minimal aspect ratio parametr is equal to AspectRatio. Otherwise, simple sequential triangilation is exploited.
Parameters:

IPObj: | Input polygonal object in IRIT format.
--- | ---

Returned Value:

IPObjectStruct *: The decimated object.

See Also:
DecimateObjSetMinAspRatioParam DecimateObjSetDcmRatioParam DecimateObjSetPassNumParam DecimateObjSetDistParam
Keywords:
Polygonal mech decimation vertices loop splitting

## GMColinear3Pts

(geom_lib/geomat3d.c:124)
Prototype:

      int GMColinear3Pts(PointType Pt1, PointType Pt2, PointType Pt3)

Description:
Verifys the colinearity of three points.
Parameters:

Pt1, Pt2, Pt3: | hree points to verify for colinearity.
--- | ---

Returned Value:

int: TRUE if colinear, FALSE otherwise.

Keywords:
colinearity

## GMGenMatObjectRotVec

(geom_lib/geomat3d.c:282)
Prototype:

      IPObjectStruct *GMGenMatObjectRotVec(VectorType Vec, RealType *Degree)

Description:
Routine to generate rotation object around the vector Vec in Degree degs:
Parameters:

Vec: | Vector to rotate along its axis.
--- | ---
Degree: | Amount of rotation, in degrees.

Returned Value:

IPObjectStruct *: A matrix object.

Keywords:
rotation transformations

## GMGenMatObjectRotVec

(geom_lib/geomat3d.c:259)
Prototype:

      IPObjectStruct *GMGenMatObjectZ2Dir2(VectorType Dir, VectorType Dir2)

Description:
Routine to generate rotation object around the vector Dir in Degree degs:
Parameters:

Dir: | Vector to rotate Z axis to it.
--- | ---
Dir2: | Vector to rotate X axis to it.

Returned Value:

IPObjectStruct *: A matrix object.

Keywords:
rotation transformations

## GMGenMatObjectRotX

(geom_lib/geomat3d.c:170)
Prototype:

      IPObjectStruct *GMGenMatObjectRotX(RealType *Degree)

Description:
Routine to generate rotation object around the X axis in Degree degrees:
Parameters:

Degree: | Amount of rotation, in degrees.
--- | ---

Returned Value:

IPObjectStruct *: A matrix object.

Keywords:
rotation transformations

## GMGenMatObjectRotY

(geom_lib/geomat3d.c:192)
Prototype:

      IPObjectStruct *GMGenMatObjectRotY(RealType *Degree)

Description:
Routine to generate rotation object around the Y axis in Degree degrees:
Parameters:

Degree: | Amount of rotation, in degrees.
--- | ---

Returned Value:

IPObjectStruct *: A matrix object.

Keywords:
rotation transformations

## GMGenMatObjectRotZ

(geom_lib/geomat3d.c:214)
Prototype:

      IPObjectStruct *GMGenMatObjectRotZ(RealType *Degree)

Description:
Routine to generate rotation object around the Z axis in Degree degrees:
Parameters:

Degree: | Amount of rotation, in degrees.
--- | ---

Returned Value:

IPObjectStruct *: A matrix object.

Keywords:
rotation transformations

## GMGenMatObjectScale

(geom_lib/geomat3d.c:327)
Prototype:

      IPObjectStruct *GMGenMatObjectScale(VectorType Vec)

Description:
Routine to generate a scaling object.
Parameters:

Vec: | Amount of scaling, in X, Y, and Z.
--- | ---

Returned Value:

IPObjectStruct *: A matrix object.

Keywords:
scaling transformations

## GMGenMatObjectScale

(geom_lib/geomat3d.c:353)
Prototype:

      IPObjectStruct *GMGetMatTransPortion(IPObjectStruct *MatObj, int *TransPortion)

Description:
Routine to extract the translational part of a matrix or dump it.
Parameters:

MatObj: | To operate on.
--- | ---
TransPortion: | TRUE to extract translational portion out of Mat, FALSE to dump the translational portion from Mat.

Returned Value:

IPObjectStruct *: A matrix object hold either the translational portion of Mat or anything but the translational part.

Keywords:
translation transformations

## GMGenMatObjectTrans

(geom_lib/geomat3d.c:304)
Prototype:

      IPObjectStruct *GMGenMatObjectTrans(VectorType Vec)

Description:
Routine to generate a translation object.
Parameters:

Vec: | Amount of translation, in X, Y, and Z.
--- | ---

Returned Value:

IPObjectStruct *: A matrix object.

Keywords:
translation transformations

## GMGenMatObjectZ2Dir

(geom_lib/geomat3d.c:236)
Prototype:

      IPObjectStruct *GMGenMatObjectZ2Dir(VectorType Dir)

Description:
Routine to generate rotation object to rotate Z to Dir:
Parameters:

Dir: | Vector to rotate Z axis to it.
--- | ---

Returned Value:

IPObjectStruct *: A matrix object.

Keywords:
rotation transformations

## GMPolyOffset

(geom_lib/polyofst.c:83)
Prototype:

      IPPolygonStruct *GMPolyOffset(IPPolygonStruct *Poly,
                                    int IsPolygon,
                                    RealType Ofst,
                                    GMPolyOffsetAmountFuncType AmountFunc)

Description:
Computes the offset of a given polygon/line in the XY plane by Ofst.
Parameters:

Poly: | To compute its offset in the XY plane.
--- | ---
IsPolygon: | TRUE for a polygon, FALSE for a polyline.
Ofst: | Amount of offset.
AmountFunc: | Scale the offset amount according to this function. A NULL here will use a constant scaling factor of one.

Returned Value:

IPPolygonStruct *: Offset of Poly by Ofst amount.

See Also:
GMPolyOffsetAmountDepth
Keywords:

## GMPolyOffsetAmountDepth

(geom_lib/polyofst.c:54)
Prototype:

      RealType GMPolyOffsetAmountDepth(RealType *Coord)

Description:
Sets the offset amount to be a function of the depth Z value by scaling with 1/Z.
Parameters:

Coord: | Of point as XYZ values.
--- | ---

Returned Value:

RealType: scaling factor of offset amount.

See Also:
GMPolyOffset
Keywords:

## GMTransformObject

(geom_lib/geomat3d.c:387)
Prototype:

      IPObjectStruct *GMTransformObject(IPObjectStruct *PObj, MatrixType Mat)

Description:
Routine to transform an object according to the transformation matrix.
Parameters:

PObj: | Object to be transformed.
--- | ---
Mat: | Transformation matrix.

Returned Value:

IPObjectStruct *: Transformed object.

Keywords:
transformations

## GMTransformObjectList

(geom_lib/geomat3d.c:542)
Prototype:

      IPObjectStruct *GMTransformObjectList(IPObjectStruct *PObj, MatrixType Mat)

Description:
Routine to transform an list of objects according to a transformation matrix.
Parameters:

PObj: | Object list to transform.
--- | ---
Mat: | Transformation matrix.

Returned Value:

IPObjectStruct *: Transformed object list.

Keywords:
transformations

## GMVecCopy

(geom_lib/geomat3d.c:35)
Prototype:

      void GMVecCopy(VectorType Vdst, VectorType Vsrc)

Description:
Routine to copy one vector to another:
Parameters:

Vdst: | Destination vector.
--- | ---
Vsrc: | Source vector.

Returned Value:

void

Keywords:
copy

## GMVecCrossProd

(geom_lib/geomat3d.c:100)
Prototype:

      void GMVecCrossProd(VectorType Vres, VectorType V1, VectorType V2)

Description:
Routine to compute the cross product of two vectors. Note Vres may be the same as V1 or V2.
Parameters:

Vres: | Result of cross product
--- | ---
V1, V2: | Two vectors of the cross product.

Returned Value:

void

Keywords:
cross prod

## GMVecDotProd

(geom_lib/geomat3d.c:152)
Prototype:

      RealType GMVecDotProd(VectorType V1, VectorType V2)

Description:
Routine to compute the dot product of two vectors.
Parameters:

V1, V2: | Two vector to compute dot product of.
--- | ---

Returned Value:

RealType: Resulting dot product.

Keywords:
dot product

## GMVecLength

(geom_lib/geomat3d.c:80)
Prototype:

      RealType GMVecLength(VectorType V)

Description:
Routine to compute the magnitude (length) of a given 3D vector:
Parameters:

V: | To compute its magnitude.
--- | ---

Returned Value:

RealType: Magnitude of V.

Keywords:
magnitude

## GMVecNormalize

(geom_lib/geomat3d.c:53)
Prototype:

      void GMVecNormalize(VectorType V)

Description:
Routine to normalize the vector length to a unit size.
Parameters:

V: | To normalize.
--- | ---

Returned Value:

void

Keywords:
normalize

## GenRotateMatrix

(geom_lib/convex.c:102)
Prototype:

      void GenRotateMatrix(MatrixType Mat, VectorType Dir)

Description:
Routine to prepare a transformation martix to rotate such that Dir is parallel to the Z axes. Used by the convex decomposition to rotate the polygons to be XY plane parallel. Algorithm: form a 4 by 4 matrix from Dir as follows:

                   |  Tx  Ty  Tz  0 |   A transformation which takes the coord
                   |  Bx  By  Bz  0 |  system into T, N & B as required.
    [X  Y  Z  1] * |  Nx  Ny  Nz  0 |
                   |  0   0   0   1 |

N is exactly Dir, but we got freedom on T & B which must be on a plane perpendicular to N and perpendicular between them but thats all! T is therefore selected using this (heuristic ?) algorithm: Let P be the axis of which the absolute N coefficient is the smallest. Let B be (N cross P) and T be (B cross N).
Parameters:

Mat: | To place the constructed homogeneous transformation.
--- | ---
Dir: | To derive a transformation such that Dir goes to Z axis.

Returned Value:

void

Keywords:
transformations

## InterpNrmlBetweenTwo

(geom_lib/intrnrml.c:162)
Prototype:

      void InterpNrmlBetweenTwo(IPVertexStruct *V,
                                IPVertexStruct *V1,
                                IPVertexStruct *V2)

Description:
Update Normal of the middle vertex V, assumed to be between V1 and V2.
Parameters:

V: | Vertex that its normal is to be updated.
--- | ---
V1, V2: | Edge V is assumed to be on so that the two normals of V1 and V2 can be blended to form the normal of V.

Returned Value:

void

Keywords:
normals

## InterpNrmlBetweenTwo2

(geom_lib/intrnrml.c:200)
Prototype:

      void InterpNrmlBetweenTwo2(PointType Pt,
                                 VectorType Normal,
                                 IPVertexStruct *V1,
                                 IPVertexStruct *V2)

Description:
Update normal of the middle vertex V, assumed to be between V1 and V2.
Parameters:

Pt: | Middle position at which a normal is to be ucomputed.
--- | ---
Normal: | Where resulting vector is to be placed.
V1, V2: | Edge V is assumed to be on so that the two normals of V1 and V2 can be blended to form the normal of V.

Returned Value:

void

Keywords:
normals

## LineSweep

(geom_lib/ln_sweep.c:45)
Prototype:

      void LineSweep(LsLineSegStruct **Lines)

Description:
Computes all intersections between all given lines, in the plane. The Lines segments are updated so the Inters slot holds the list of intersections with the other segments, NULL if none. Returned is a list with possibly a different order than that is given.
Parameters:

Lines: | To compute all intersections against each other, in the plane.
--- | ---

Returned Value:

void

Keywords:
line sweep line line intersections

## PolyCountPolys

(geom_lib/geomvals.c:326)
Prototype:

      double PolyCountPolys(IPObjectStruct *PObj)

Description:
Routine to count the number of polygons in the given geometric object.
Parameters:

PObj: | To count number of polygons in.
--- | ---

Returned Value:

double: Number of polygons, an integer value returned as double.

Keywords:

## PolyObjectArea

(geom_lib/geomvals.c:51)
Prototype:

      double PolyObjectArea(IPObjectStruct *PObj)

Description:
Routine to evaluate the Area of the given geom. object, in object unit.

    Algorithm (for each polygon):                                 V3
    1. Set Polygon Area to be zero.                              /\
       Make a copy of the original polygon                     /    \
       and transform it to a XY parallel plane.              /        \V2
       Find the minimum Y value of the polygon           V4/           |
       in the XY plane.                                    \           |
    2. Let V(0) be the first vertex, V(n) the last one.      \         |
       For i goes from 0 to n-1 add to Area the area           \_______|
       below edge V(i), V(i+1):                                V0      V1
       PolygonArea += (V(i+1)x - V(i)x) * (V(i+1)y' - V(i)y') / 2
       where V(i)y' is V(i)y - MinY, where MinY is polygon minimum Y value.
    3. The result of step 2 is the area of the polygon itself.
       However, it might be negative, so take the absolute result of step 2
       and add it to the global ObjectArea.

Note step 2 is performed by another auxiliary routine: PolygonXYArea.
Parameters:

PObj: | A polyhedra object to compute its surface area.
--- | ---

Returned Value:

double: The area of object PObj.

Keywords:
area

## PolyObjectVolume

(geom_lib/geomvals.c:194)
Prototype:

      double PolyObjectVolume(IPObjectStruct *PObj)

Description:
Routine to evaluate the Volume of the given geom object, in object unit. This routine has a side effect that all non-convex polygons will be splitted to convex ones. Algorithm (for each polygon, and let ObjMinY be the minimum OBJECT Y):

##

                                                                  V3
    1. Set Polygon Area to be zero.                              /\
       Let V(0) be the first vertex, V(n) the last.            /    \
       For i goes from 1 to n-1 form triangles               /        \V2
                      by V(0), V(i), V(i+1).             V4/           |
       For each such triangle di:                          \           |
       1.1. Find the vertex (out of V(0), V(i), V(i+1))      \         |
            with the minimum Z - TriMinY.                      \_______|
       1.2. The volume below V(0), V(i), V(i+1) triangle,      V0      V1
            relative to ObjMinZ level, is the sum of:
            1.2.1. volume of V'(0), V'(i), V'(i+1) - the
                   area of projection of V(0), V(i), V(i+1) on XY parallel
                   plane, times (TriMinZ - ObjMinZ).
            1.2.2. Assume V(0) is the one with the PolyMinZ. Let V"(i) and
                   V"(i+1) be the projections of V(i) and V(i+1) on the plane
                   Z = PolyZMin. The volume above 1.2.1. and below the polygon
                   (triangle!) will be: the area of quadraliteral V(i), V(i+1),
                   V"(i+1), V"(i), times distance of V(0) for quadraliteral
                   plane divided by 3.
       1.3. If Z component of polygon normal is negative add 1.2. result to
            ObjectVolume, else subtract it.

    Parameters:

     PObj:      To compute volume for.

    Returned Value:

      double:    Computed volume.

    Keywords:

      volume

     PolyOnePolyArea   (geom_lib/geomvals.c:86)

    Prototype:

      double PolyOnePolyArea(IPPolygonStruct *Pl)

    Description:

Computes the area of a single polygon.
Parameters:

Pl: | To compute its area.
--- | ---

Returned Value:

double: area of polygon Pl

See Also:
PolyObjectArea
Keywords:

## PrimGenBOXObject

(geom_lib/primitiv.c:148)
Prototype:

      IPObjectStruct *PrimGenBOXObject(VectorType Pt,
                                       RealType WidthX,
                                       RealType WidthY,
                                       RealType WidthZ)

Description:

      Routine to create a BOX geometric object defined by Pt - the minimum
    3d point, and Width - Dx Dy & Dz vector.              4
      Order of vertices is as                         5       7
    follows in the picture:                           |   6   |
                                                      |   |   |
    (Note vertex 0 is hidden behind edge 2-6)         |   |   |
                                                      1   |   3
                                                          2

All dimensions can be negative, denoting the reversed direction.
Parameters:

Pt: | Low end corner of BOX.
--- | ---
WidthX: | Width of BOX (X axis).
WidthY: | Depth of BOX( Y axis).
WidthZ: | Height of BOX( Z axis).

Returned Value:

IPObjectStruct *: A BOX primitive

See Also:
PrimSetPolygonalPrimitives PrimGenGBOXObject PrimGenCONEObject PrimGenCONE2Object PrimGenCYLINObject PrimGenSPHEREObject PrimGenTORUSObject
Keywords:
box primitives

## PrimGenCONE2Object

(geom_lib/primitiv.c:394)
Prototype:

      IPObjectStruct *PrimGenCONE2Object(VectorType Pt,
                                         VectorType Dir,
                                         RealType R1,
                                         RealType R2)

Description:
Routine to create a truncated CONE, CON2, geometric object defined by Pt - the base 3d center point, Dir - the cone direction and height, and two base radii R1 and R2. See also PrimSetResolution on fineness control of approximation of the primitive using flat faces.
Parameters:

Pt: | Center location of Base of CON2.
--- | ---
Dir: | Direction and distance from Pt to center of other base of CON2.
R1, R2: | Two base radii of the truncated CON2

Returned Value:

IPObjectStruct *: A CON2 Primitive.

See Also:
PrimSetPolygonalPrimitives PrimGenBOXObject PrimGenGBOXObject PrimGenCONEObject PrimGenCYLINObject PrimGenSPHEREObject PrimGenTORUSObject
Keywords:
cone primitives

## PrimGenCONEObject

(geom_lib/primitiv.c:271)
Prototype:

      IPObjectStruct *PrimGenCONEObject(VectorType Pt, VectorType Dir, RealType R)

Description:
Routine to create a CONE geometric object defined by Pt - the base 3d center point, Dir - the cone direction and height, and base radius R. See also PrimSetResolution on fineness control of approximation of the primitive using flat faces.
Parameters:

Pt: | Center location of Base of CONE.
--- | ---
Dir: | Direction and distance from Pt to apex of CONE.
R: | Radius of Base of the cone.

Returned Value:

IPObjectStruct *: A CONE Primitive.

See Also:
PrimSetPolygonalPrimitives PrimGenBOXObject PrimGenGBOXObject PrimGenCONE2Object PrimGenCYLINObject PrimGenSPHEREObject PrimGenTORUSObject
Keywords:
cone primitives

## PrimGenCYLINObject

(geom_lib/primitiv.c:536)
Prototype:

      IPObjectStruct *PrimGenCYLINObject(VectorType Pt, VectorType Dir, RealType R)

Description:
Routine to create a CYLINder geometric object defined by Pt - the base 3d center point, Dir - the cylinder direction and height, and radius R. See also PrimSetResolution on fineness control of approximation of the primitive using flat faces.
Parameters:

Pt: | Center location of Base of CYLINder.
--- | ---
Dir: | Direction and distance from Pt to other base of cylinder.
R: | Radius of Base of the cylinder.

Returned Value:

IPObjectStruct *: A CYLINDER Primitive.

See Also:
PrimSetPolygonalPrimitives PrimGenBOXObject PrimGenGBOXObject PrimGenCONEObject PrimGenCONE2Object PrimGenSPHEREObject PrimGenTORUSObject
Keywords:
cylinder primitives

## PrimGenEXTRUDEObject

(geom_lib/primitiv.c:1383)
Prototype:

      IPObjectStruct *PrimGenEXTRUDEObject(IPObjectStruct *Cross, VectorType Dir)

Description:
Routine to a create an extrusion surface out of the given cross section and the given direction. Input can either be a polygon/line or a freefrom curve object. If input is a polyline/gon, it must never be coplanar with Dir. See also PrimSetResolution on fineness control of approximation of the primitive using flat faces.
Parameters:

Cross: | To extrude in direction Dir.
--- | ---
Dir: | Direction and magnitude of extrusion.

Returned Value:

IPObjectStruct *: An extrusion surface.

Keywords:
extrusion surface primitives

## PrimGenGBOXObject

(geom_lib/primitiv.c:191)
Prototype:

      IPObjectStruct *PrimGenGBOXObject(VectorType Pt,
                                        VectorType Dir1,
                                        VectorType Dir2,
                                        VectorType Dir3)

Description:
Routine to create a GBOX geometric object defined by Pt - the minimum 3d point, and 3 direction Vectors Dir1, Dir2, Dir3. If two of the direction vectors are parallel the GBOX degenerates to a zero volume object. A NULL pointer is returned in that case.

##

                                                          4
    Order of vertices is as                           5       7
    follows in the picture:                           |   6   |
                                                      |   |   |
    (Note vertex 0 is hidden behind edge 2-6)         |   |   |
                                                      1   |   3
                                                          2

    Parameters:

     Pt:                Low end corner of GBOX.
     Dir1, Dir2, Dir3:  Three independent directional vectors to define GBOX.

    Returned Value:

      IPObjectStruct *:  A GBOX primitive.

    See Also:

      PrimSetPolygonalPrimitives
      PrimGenBOXObject
      PrimGenCONEObject

      PrimGenCONE2Object
      PrimGenCYLINObject
      PrimGenSPHEREObject

      PrimGenTORUSObject

    Keywords:

      general box
      box
      primitives

     PrimGenObjectFromPolyList   (geom_lib/primitiv.c:1164)

    Prototype:

      IPObjectStruct *PrimGenObjectFromPolyList(IPObjectStruct *PObjList)

    Description:

Routine to create an OBJECT directly from set of specified polygons. No test is made for the validity of the model in any sense.
Parameters:

PObjList: | List of polygonal objects.
--- | ---

Returned Value:

IPObjectStruct *: A single object containing all polygons in all provided objects, by a simple union.

Keywords:
primitives

## PrimGenPOLYDISKObject

(geom_lib/primitiv.c:961)
Prototype:

      IPObjectStruct *PrimGenPOLYDISKObject(VectorType N, VectorType T, RealType R)

Description:
Routine to create a POLYDISK geometric object defined by the normal N and the translation vector T. The object is a planar disk (a circle of GlblResolution points in it...) and its radius is equal to R. The normal direction is assumed to point to the inside of the object. See also PrimSetResolution on fineness control of approximation of the primitive using flat faces.
Parameters:

N: | Normal to the plane this disk included in.
--- | ---
T: | A translation factor of the center of the disk.
R: | Radius of the disk.

Returned Value:

IPObjectStruct *: A single polygon object - a disk.

Keywords:
disk primitives

## PrimGenPOLYGONObject

(geom_lib/primitiv.c:1034)
Prototype:

      IPObjectStruct *PrimGenPOLYGONObject(IPObjectStruct *PObjList, int IsPolyline)

Description:
Routine to create a POLYGON/LINE directly from its specified vertices. The validity of the elements in the provided list is tested to make sure they are vectors or points. No test is made to make sure all vertices are on one plane, and that no two vertices are similar.
Parameters:

PObjList: | List of vertices/points to construct as a polygon/line.
--- | ---
IsPolyline: | If TRUE, make a polyline, otherwise a polygon.

Returned Value:

IPObjectStruct *: A polygon/line constructed from PObjList.

Keywords:
polygon polyline primitives

## PrimGenRULEDObject

(geom_lib/primitiv.c:1522)
Prototype:

      IPObjectStruct *PrimGenRULEDObject(IPObjectStruct *Cross1,
                                         IPObjectStruct *Cross2)

Description:
Routine to a create a ruled surface out of the given two cross sections.
Parameters:

Cross1, Cross2: | Polylines to rule a surface between. If both cross sections are in the XY plane, a single planar polygon is constructed. Otherwise, the number of vertices in Cross1 and Cross2 must be equal and a rectangular polygon is constructed for each edge.
--- | ---

Returned Value:

IPObjectStruct *: A single polygon representing the ruled surface.

Keywords:
ruled surface primitives

## PrimGenSPHEREObject

(geom_lib/primitiv.c:678)
Prototype:

      IPObjectStruct *PrimGenSPHEREObject(VectorType Center, RealType R)

Description:
Routine to create a SPHERE geometric object defined by Center, the center of the sphere and R, its radius. See also PrimSetResolution on fineness control of approximation of the primitive using flat faces.
Parameters:

Center: | Center location of SPHERE. R Radius of sphere.
--- | ---

Returned Value:

IPObjectStruct *: A SPHERE Primitive.

See Also:
PrimSetPolygonalPrimitives PrimGenBOXObject PrimGenGBOXObject PrimGenCONEObject PrimGenCONE2Object PrimGenCYLINObject PrimGenTORUSObject
Keywords:
sphere primitives

## PrimGenSURFREVObject

(geom_lib/primitiv.c:1251)
Prototype:

      IPObjectStruct *PrimGenSURFREVObject(IPObjectStruct *Cross)

Description:
Routine to a create surface of revolution by rotating the given cross section along the Z axis. Input can either be a polygon/line or a freefrom curve object. If input is a polyline/gon, it must never be coplanar with the Z axis. See also PrimSetResolution on fineness control of approximation of the primitive using flat faces.
Parameters:

Cross: | To rotate around the Z axis forming a surface of revolution.
--- | ---

Returned Value:

IPObjectStruct *: A surface of revolution.

Keywords:
surface of revolution primitives

## PrimGenTORUSObject

(geom_lib/primitiv.c:842)
Prototype:

      IPObjectStruct *PrimGenTORUSObject(VectorType Center,
                                         VectorType Normal,
                                         RealType Rmajor,
                                         RealType Rminor)

Description:
Routine to create a TORUS geometric object defined by Center - torus 3d center point, the main torus plane normal Normal, major radius Rmajor and minor radius Rminor (Tube radius). Teta runs on the major circle, Fee on the minor one. Then

    X = (Rmajor + Rminor * cos(Fee)) * cos(Teta)
    Y = (Rmajor + Rminor * cos(Fee)) * sin(Teta)
    Z = Rminor * sin(Fee)

See also PrimSetResolution on fineness control of approximation of the primitive using flat faces.
Parameters:

Center: | Center location of the TORUS primitive.
--- | ---
Normal: | Normal to the major plane of the torus.
Rmajor: | Major radius of torus.
Rminor: | Minor radius of torus.

Returned Value:

IPObjectStruct *: A TOURS Primitive.

See Also:
PrimSetPolygonalPrimitives PrimGenBOXObject PrimGenGBOXObject PrimGenCONEObject PrimGenCONE2Object PrimGenCYLINObject PrimGenSPHEREObject
Keywords:
torus primitives

## PrimSetResolution

(geom_lib/primitiv.c:1836)
Prototype:

      void PrimSetResolution(int Resolution)

Description:
Routine to set the polygonal resolution (fineness). Resolution sroutghly the number of edges a circular primitive will have along the entire circle.
Parameters:

Resolution: | To set as new resolution for all primitve constructors.
--- | ---

Returned Value:

void

Keywords:
primitives resolution

## SetPolygonalPrimitives

(geom_lib/primitiv.c:79)
Prototype:

      int PrimSetPolygonalPrimitives(int PolygonalPrimitive)

Description:
Sets the way primitives are constructed - as polygons or as a freeform surface.
Parameters:

PolygonalPrimitive: | TRUE for polygons, FALSE for freeform surfaces.
--- | ---

Returned Value:

int: Old value of PolygonalPrimitive flag.

See Also:
PrimSetSurfacePrimitiveRational PrimGenBOXObject PrimGenGBOXObject PrimGenCONEObject PrimGenCONE2Object PrimGenCYLINObject PrimGenSPHEREObject PrimGenTORUSObject
Keywords:

## SetSurfacePrimitiveRational

(geom_lib/primitiv.c:107)
Prototype:

      int PrimSetSurfacePrimitiveRational(int SurfaceRational)

Description:
Sets the way surface primitives are constructed - as exact rational form or approximated polynomial (integral) form.
Parameters:

SurfaceRational: | TRUE for rational, FALSE for integral form.
--- | ---

Returned Value:

int: Old value of PolygonalPrimitive flag.

See Also:
PrimSetPolygonalPrimitives PrimGenBOXObject PrimGenGBOXObject PrimGenCONEObject PrimGenCONE2Object PrimGenCYLINObject PrimGenSPHEREObject PrimGenTORUSObject
Keywords:

## SplitNonConvexPoly

(geom_lib/convex.c:340)
Prototype:

      IPPolygonStruct *SplitNonConvexPoly(IPPolygonStruct *Pl)

Description:
Routine to split non convex polygon into a list of convex ones. 1. Remove a polygon from GlblList. If non exists stop. 2. Search for non convex corner. If not found stop - polygon is convex. Otherwise let the non convex polygon found be V(i). 3. Fire a ray from V(i) in the opposite direction to V(i-1). Find the closest intersection of the ray with polygon boundary P. 4. Split the polygon into two at V(i)-P edge and push the two new polygons on the GlblList. 5. Goto 1.
Parameters:

Pl: | Non convex polygon to split into convex ones.
--- | ---

Returned Value:

IPPolygonStruct *: A list of convex polygons resulting from splitting up Pl.

See Also:
CGConvertPolysToTriangles ConvexPolyObject ConvexPolyObjectN nvexPolygon
Keywords:
convexity convex polygon

## UpdateVerticesNormals

(geom_lib/intrnrml.c:48)
Prototype:

      void UpdateVerticesNormals(IPPolygonStruct *PlList,
                                 IPPolygonStruct *OriginalPl)

Description:
For each polygon in PlList update any vertex normal which is zero to an interpolated value using the Original polygon vertex list OriginalPl. All the new vertices are enclosed within the original polygon which must be convex as well.
Parameters:

PlList: | List of polygons to update normal for.
--- | ---
OriginalPl: | Original polygons PlList was derived from, probably using Boolean operations.

Returned Value:

void

Keywords:
normals