Synopsis
PDX_MSGT gcr_RevSurf2(long option, MDA_PTR orig_db_ptr, MTH_3DPNT center, MTH_3DVEC axis_vec, MTH_3DVEC ref_vec, double maj_radius, double min_radius, int keep_flg, int gdx_model, MDA_PTR *gdx_rs_ptr)
Purpose
Create a GDX Revolve Surface from a torus definition.
Description
Given a point on the torus axis, a torus axis vector, the maj_radius of the torus, the min_radius of the torus, create a GDX Revolve Surface. The torus may be degenerate (maj_radius less than min_radius). If it is, the keep_flg should be used to indicate which portion of the torus the revolved surface will represent.
The maj_radius must be > the current GDX ZERO_TOL
The min_radius must be > the current GDX ZERO_TOL.
If ref_vec is not NULL, the corresponding magnitude of the given vector must be > the current GDX NORMAL_MAG_TOL. If the given vector is not perpendicular to the torus axis vector within the current GDX ANGLE_TOL, the closest perpendicular vector is used.
If the ref_vec is NULL, an arbitrary ref_vec (perpendicular to the given axis_vec) will be determined and stored in the entity.
If the magnitude of the axis_vec torus axis vector is less than the current GDX NORMAL_MAG_TOL, the Z torus axis vector is assumed. if the torus definition is not degenerate, then the keep_flg will be ignored The GCR_REVERSE_NORMAL option will make the resulting surface point toward the interior of the surface.
\fBRules\fR .IP • 3 maj_radius must be > 0.0 .IP • 3 min_radius must be > 0.0 .IP • 3 ref_vec magnitude > 0.0 (if ref_vec not NULL) .LP
Input
option
GCR_NOVALIDATE
No validation will occur on the input data.
GCR_REVERSE_NORMAL
Normal of resulting GDX_REV_SURF will point inward
orig_db_ptr
The original entities orig_db_ptr as obtained from the mda_GetOrigDbptr function call, or MDA_NULL_PTR
center
The torus point
axis_vec
The center axis of the torus
ref_vec
The U parametric axis reference vector (Must be > 0.0), or NULL to create an unparametrized Torus.
maj_radius
The maj_radius of the torus at the torus point (Must be > 0.0)
min_radius
The min_radius of the torus at the torus point (Must be > 0.0)
keep_flg
GCR_TORUS_ALL
Keep the whole torus, should not be used on degenerative torus entites
GCR_TORUS_INTERIOR
The interior of degenerate torus, tear drop.
GCR_TORUS_EXTERIOR
The exterior of degenerate torus, apple shape.
gdx_model
The GDX model for entity creation
Output
gdx_rs_ptr
Entity database pointer of the GDX Torus
Tolerances
NORMAL_MAG_TOL
ANGLE_TOL
ZERO_TOL
.fi
Return
GCR_NOERR
GCR_INVALID_MODEL
GCR_TORUS_MIN_RADIUS
GCR_TORUS_MAJ_RADIUS
GCR_TORUS_U_REF_VECTOR
Low level error return
.fi