Synopsis

PDX_MSGT gdx_CurveBasedSurfToAnalytic(long option, int model, MDA_PTR gdx_surf_ptr, double circle_tol, double angle_tol, MDA_PTR *gdx_analytic_ptr, PDX_BOOL *trimmed, double u_trim[2], double v_trim[2], PDX_BOOL *in_normal)

Purpose

Determine if a curve-based surface is analytic

Description

This routine determines if a GDX curve-based surface (EXT_SURF, RULED_SURF or REV_SURF) is one of the analytic surface types (PLANE, CYLINDER, CONE, SPHERE or TORUS), in that order of preference. If it is, then a surface of that type is created. If the surface is a partial analytic (trimmed), the trimming bounds are returned. For the CYLINDER, CONE, SPHERE and TORUS, a flag is returned indicating discrepancy in the surface normals (inward pointing normal on the curve-based surface).

Input

option

Not used.

model

The GDX model for entity creation.

gdx_surf_ptr

Database pointer of the curve-based surface.

circle_tol

A model space tolerance used to determine if a curve is circular. A number of candidate radii are computed and compared. If the deviation of the smallest radius from the largest radius is less than or equal to circle_tol, then the curve is considered circular. MODEL_SPACE_PNT_TOL (or smaller) should be used for zero tolerance.

angle_tol

An angle tolerance (radians). Should be 0.00001 (or smaller) for zero tolerance; 0.001 (or larger) if approximate analytics are to be detected.

Output

gdx_analytic_ptr

Database pointer of the created analytic surface if the surface is one of those types, otherwise, MDA_NULL_PTR.

trimmed

Flag, indicating if the analytic surface must be trimmed, i.e. in order to obtain the correct surface, u_trim and v_trim must be used to form a GDX_RECT_TRIM_SURF: PDX_TRUE : must be trimmed PDX_FALSE : no trimming, surface is full analytic

u_trim

u trim bounds. Returned only if trimmed = PDX_TRUE.

v_trim

v trim bounds. Returned only if trimmed = PDX_TRUE.

in_normal

Flag, used only if surface is a CYLINDER, CONE, SPHERE or TORUS: PDX_TRUE : original surface has inward pointing normal PDX_FALSE : original surface does not have inward pointing normal

Tolerances

      MODEL_SPACE_PNT_TOL
      ANGLE_TOL
      .fi

Return

      GDX_NOERR
      GDX_BADDATA
      Low level error return
      .fi