PK_SURF_eval_with_normal   


PK_ERROR_code_t    PK_SURF_eval_with_normal
(
--- received arguments ---
PK_SURF_t          surf,        --- surf
PK_UV_t            uv,          --- surf u and v parameter pair
int                n_u_derivs,  --- number of u derivatives
int                n_v_derivs,  --- number of v derivatives
PK_LOGICAL_t       triangular,  --- triangular derivative array required

--- returned arguments ---
PK_VECTOR_t        p[],     --- point and derivatives
PK_VECTOR_t *const normal   --- surface normal
)


This function evaluates a point, derivatives and normal at a parameter pair
on the given surface.


Specific Errors:
    PK_ERROR_bad_parameter            cannot evaluate out of range
    PK_ERROR_at_singularity           failed to evaluate normal at singularity
    PK_ERROR_too_many_derivatives     too many derivatives requested
    PK_ERROR_num_derivs_not_equal     where triangular format requested
    PK_ERROR_eval_failure             internal evaluator failure


This function provides an extension to the functionality of PK_SURF_eval;
all the documentation for that function also applies here.

The normalised surface normal at uv is also calculated. This normal will be
parallel to the cross product of the the derivative with respect to u and the
derivative with respect to v (unless this cross-product is zero).

A value may be returned for normal even at a singular point of the surface.
Note that a singular point may have an ambiguous parameterisation, and
different uv pairs at the same point may give different normals.