Synopsis

PDX_MSGT gdx_EvalNurbSurfNormal(long option, T_GDX_NURB_SURF *sur, double u, double v, MTH_3DPNT pt, double normal[], double more_normals[], int *case_flag)

Purpose

Compute point and unit length normal on GDX NURB Surface.

Description

Evaluates point and normalized (unit length) normal vector on a surface, given the u and v parameter values. Creases, the intersection of a u-crease with a v-crease, and poles are all handled properly. At a u- or v-crease, two normals are returned. At the intersection of two such creases, four normals are returned. At a pole, the appropriate limit normal (as the pole is approached) is returned.

Input

option

GDX_UNNORM

The evaluation option. If set, unnormalize the parameter values.

sur

Pointer to the surface to be evaluated.

u

u surface parameter value.

v

v surface parameter value.

Output

pt

Point on the surface at (u,v).

normal

The unit length normal vector at (u,v).

more_normals

Used only in the special cases resulting in additional normals (creases). See case_flag.

case_flag

An output flag: = 1 : Unique normal returned in normal[]. = 2 : u-crease. Normal from the left in normal[0], normal from the right in more_normals[0]. = 3 : v-crease. Normal from below in normal[0], normal from above in more_normals[0]. = 4 : u-crease/v-crease intersection. Normal from left/below in normal[0]; normals from right/below, left/above and right/above in more_normals[0], more_normals[3] and more_normals[6] respectively. = 5 : Pole. Limit normal vector returned in normal[0].

Return

      GDX_NOERR
      GDX_PARMOUTOFRANGE
      Low level error return
      .fi