Synopsis

PDX_MSGT gdx_ProjectPointSurfaceGrid(long option, int model, MDA_PTR db_ptr_srf, T_GDX_RECT_MESH **gdx_surf_grid, MTH_3DPNT point, double u0, double v0, int max_iters, MTH_3DPNT proj_point, double *u1, double *v1)

Purpose

Project a point to a GDX surface using a surface grid

Description

Projects a model space point to a GDX surface using a surface grid to find a good start point. If the option is set to GDX_GLOBAL than a global search is made of the grid to try to find an initial starting parameter values, otherwise the u0 and v0 values are assumed to be initial starting parameter values to use for projection. If the gdx_surf_grid structure pointer is NULL, then a grid entity is computed, used and returned. The max_iters value is the maximium iterations made if the projection does not converge to PNT_PROJ_TOL. The surface must be a valid GDX surface definition. Note: The GDX_NOCONVERGE error is returned, but not set on the error stack.

Input

option

GDX_GLOBAL

Perform a global search for the starting parameter value, otherwise use u0 and v0

GDX_UNNORM

Unnormalize the parameter values and return the parameter values normalized

GDX_OPENCLOSED

Treat the surface as open in U and V even though the surface may be closed.

GDX_INCREASE_SEG_PTS

Increase number of number of grid points generated for point projection

model

The GDX model for entity creation.

db_ptr_srf

The database pointer for the GDX surface

gdx_surf_grid

The pointer to the GDX surface grid entity structure pointer or NULL

point

The model space point to project

u0

The initial surface U parameter value

v0

The initial surface V parameter value

max_iters

The maximium iterations for convergence

Output

gdx_surf_grid

The pointer to the GDX surface grid entity structure pointer if the input was NULL.

proj_point

The model space point on the surface

u1

The U parameter value of the point on the surface

v1

The V parameter value of the point on the surface

Tolerances

      PNT_PROJ_TOL
      MODEL_SPACE_PNT_TOL
      ANGLE_TOL
      ZERO_TOL
      .fi

Return

      GDX_NOERR
      GDX_NOMEMORY
      GDX_NOCONVERGE
      Low level error return
      .fi