PK_ERROR_code_t PK_SURF_make_bsurf
(
--- received arguments ---
PK_SURF_t surf, --- surface
PK_UVBOX_t uvbox, --- parameter bounds: required part of surf
PK_LOGICAL_t cubic, --- force cubic BCURVE
PK_LOGICAL_t non_rational, --- force non_rational BCURVE
double tolerance, --- for approximate result
--- returned arguments ---
PK_BSURF_t *const b_surf, --- created BSURF
PK_LOGICAL_t *const exact --- whether b_surf is exact
)
This function creates a bsurf which is coincident with the given parametric
uvbox of the given surf.
Specific Errors:
PK_ERROR_cant_make_bspline failed to create equivalent geometry
(SERIOUS)
PK_ERROR_bad_uvbox uvbox does not define valid extent
of surf
PK_ERROR_tolerances_too_tight tolerance is too tight
The created BSURF will be exactly coincident with the given surf if
possible. Where this is not possible, the maximum distance between surf and
result will be limited by tolerance. The function will usually achieve
this condition but this is not guaranteed.
When the surf is being approximated, and excessive subdivision of the
surf has failed to achieve the requested tolerance, then the function will
fail with the error PK_ERROR_tolerances_too_tight. A looser tolerance may
allow the function to succeed.
Representations of planes and the rational forms of cylinders, cones, spheres
and tori are exact.
When the representation of a bsurf is changed it will, in general,
only be exact when the order is not decreased. The returned argument exact
is set to PK_LOGICAL_true if the result is exact, otherwise to
PK_LOGICAL_false.
If cubic is set to PK_LOGICAL_true, then the resulting bsurf is forced to
be cubic. If `non-rational' is set to PK_LOGICAL_true, then the resulting
bsurf is forced to be non-rational.
The form of the created surf depends upon the given values of cubic and
`non-rational' as follows:
| false true true false | cubic
curve | false false true true | non_rational
--------|---------|---------|---------|---------|
plane | 1 1 3 | 3 3 3 | 3 3 3 | 1 1 3 |
| | | | |
cyl | 3 1 4 | 3 3 4 | 3 3 3 | 3 1 3 |
cone | 3 1 4 | 3 3 4 | 3 3 3 | 3 1 3 |
| | | | |
sphere | 3 3 4 | 3 3 4 | 3 3 3 | 3 3 3 |
torus | 3 3 4 | 3 3 4 | 3 3 3 | 3 3 3 |
| | | | |
bsurf | * * * | 3 3 ! | 3 3 3 | ! ! 3 |
| | | | |
swept | * 1 * | 3 3 ! | 3 3 3 | * 1 3 |
| | | | |
spun | * 3 3 | 3 3 3 | 3 3 3 | * 1 3 |
| | | | |
offset | * * * | 3 3 * | 3 3 3 | * * 3 |
| | | | |
others | 3 3 3 | 3 3 3 | 3 3 3 | 3 3 3 |
--------|---------|---------|---------|---------|
where each table entry contains thre items: U V D where:
U - degree of surface in U direction
V - degree of surface in V direction
D - dimensionality of control points: 3 - non-rational
4 - rational
* - inherited from given surf
! - inherited from given surf if representation is exact, otherwise 3