Synopsis

PDX_MSGT gdx_DecompCurveToSimpleSegs(long option, MDA_PTR gdx_db_ptr, double degen_tol, double (**seg_pbnds)[2], char **seg_flags, long *nsegs)

Purpose

Determine cusps, piecewise linear and line segments of curve

Description

This routine finds the parameter bounds defining the following types of segments within a curve: 1. segments defined by cusps 2. segments which are piecewise linear 3. straight line segments This allows a curve to be decomposed into simpler segments. This is particularly helpful when approximating or projecting complex curves which have been composited from simpler pieces.

Input

option

Not used.

gdx_db_ptr

Database pointer of the GDX curve.

degen_tol

Arc length tolerance used to flag degenerate curve segments.

Output

seg_pbnds

Parameter bounds defining the segments. Upon error-free return, there will be at least one segment. Memory is allocated in this routine and must be deallocated by the calling routine.

seg_flags

Flags indicating type of segment: = 0 : general segment. = 1 : piecewise linear segment. = 2 : straight line segment. = 3 : degenerate segment.

nsegs

Number of segments (at least 1 upon error-free return).

Tolerances

      MODEL_SPACE_PNT_TOL
      COLLINEAR_TOL
      TANGENT_TOL
      ANGLE_TOL
      .fi

Return

      GDX_NOERR
      Low level error return
      .fi