Home

skin_spl_sur Class Reference
[surfaces]

Defines a skin surface between a list of curves. More...

#include <skin_spl.hxx>

Inheritance diagram for skin_spl_sur:

Inheritance graph
[legend]
Collaboration diagram for skin_spl_sur:

Collaboration graph
[legend]

List of all members.

Public Member Functions

int accurate_derivs (SPApar_box const &area=*(SPApar_box *) NULL_REF) const
 Calculates the derivatives within the given parameter box.
void add_path_data (int no_curves, curve **curves)
 Adds the path data to the skin_spl_sur object.
void add_ref ()
 Uses count manipulation.
void clear_trans ()
 Clears any references to this object using transformation lists, before incompatible changes.
logical closed_u () const
 Determines if the surface is closed, smoothly or not, in the u-parameter direction.
logical closed_v () const
 Determines if the surface is closed, smoothly or not, in the v-parameter direction.
virtual spl_surdeep_copy (pointer_map *pm=NULL) const
 Creates a copy of an item that does not share any data with the original.
double estimate_min_rad_curv ()
 This function estimates the minimum radius of curvature of the skin surface for a given set of tangent factor values.
void estimate_tanfacs_scale (SPAinterval &tan_range)
 Estimates the scaling factor range.
virtual SPAposition eval_position (SPApar_pos const &parameter) const
 Finds the point on the spline for a given parameter-space point.
double fitol () const
 Returns the fit tolerance for the approximating bs3_surface.
void get_curves (int &no_crv, curve ***curves) const
 Returns the surface curves.
void get_laws (int &no_laws, law **&laws) const
 Returns a list of laws used by the skin_spl_sur.
subtrans_objectget_next () const
 Returns the next object in the list.
virtual curveget_path () const
 Returns the sweep path curve for this spl_sur.
virtual sweep_path_type get_path_type () const
 Returns the sweep path type for this spl_sur.
virtual curveget_profile (double param) const
 Returns the sweep profile curve for this spl_sur.
virtual lawget_rail () const
 Returns the sweep rail law for this spl_sur.
void get_surfaces (int &no_surfaces, surface **&surf_arr) const
 Returns the surfaces.
logical get_tanfacs (double *tangents) const
 Get the tangent factors to determine optimal values for them.
void get_v_knots (double u, int &out_no_knots, double **out_vknots) const
 Returns the v_knot sequence for a given parameter value.
void invalidate_cache ()
 Method to be called by any user who modifies the surface in an external process, to ensure that stale evaluation results are discarded.
logical iterate_perp (SPAposition const &pos, SPAposition &surf, SPAunit_vector &normal, surf_princurv &curv, SPApar_pos const &guess, SPApar_pos &actual, logical pt) const
 Support function for point_perp (and bs3_surface_perp).
subtrans_objectmake_trans (SPAtransf const &trans)
 Transforms the subtrans_object on an external level.
logical mult_ref () const
 Returns TRUE if there is more than one reference - else, it returns FALSE.
logical operator!= (subtype_object const &rhs) const
 TRUE if two subtype objects are not the same.
double param_period_u () const
 Returns the u period of a periodic parametric surface, zero if the surface is not periodic in the u direction.
double param_period_v () const
 Returns the v period of a periodic parametric surface, zero if the surface is not periodic in the v direction.
SPApar_box param_range (SPAbox const &box=*(SPAbox *) NULL_REF) const
 Returns the principal parameter range of a parametric surface in both u and v-parameter directions.
SPAinterval param_range_u (SPAbox const &box=*(SPAbox *) NULL_REF) const
 Returns the principal parameter range of a parametric surface in the u-parameter direction.
SPAinterval param_range_v (SPAbox const &box=*(SPAbox *) NULL_REF) const
 Returns the principal parameter range of a parametric surface in the v-parameter direction.
logical periodic_u () const
 Determines if a parametric surface is periodic in the u direction.
logical periodic_v () const
 Determines if a parametric surface is periodic in the v direction.
int ref_count ()
 Returns the use count.
void remove_ref ()
 Removes a reference.
virtual void save () const
 Saves the skin_spl_sur as an approximation if there is a need to approximate.
virtual void save_data () const
 Saves the information for skin_spl_sur to the save file.
void set_next (subtrans_object *obj)
 Sets the next object in the list.
void set_tanfacs (double *tangents, logical remake_approx=TRUE)
 Set the tangent factors and get them for purposes of determining optimal values for them.
logical singular_u (double uparam) const
 Reports whether the surface parameterization is singular at the specified u-parameter value.
logical singular_v (double vparam) const
 Reports whether the surface parameterization is singular at the specified v-parameter value.
 skin_spl_sur (const skin_spl_sur &surf)
 C++ copy constructor requests memory for this object and populates it with the data from the object supplied as an argument.
bs3_surface sur () const
 Returns the bs3_surface approximation.
virtual int type () const
 Returns the type of skin_spl_sur.
virtual char const * type_name () const
 Returns the string of the given spline surface type, which is "skinsur" for a skin_spl_surf.
virtual logical unknown_type () const
 Returns TRUE if this object type is unknown to the system - else, it returns FALSE.

Static Public Member Functions

static int id ()
 Returns the ID for the skin_spl_sur list.
static spl_surmake_skin_spl_sur (logical arc, logical perp, int section, curve **cur, double *arrknot, double *left, double *right, surface **surf, double *fac, law **arrlaw, closed_forms flagu=OPEN, closed_forms flagv=OPEN)
 Constructs a loft surface from the given section curves and the corresponding surfaces on which the sections lie and the optional tangent factors that should be applied to cross-boundary tangents.
static spl_surmake_skin_spl_sur (logical length, int cur, curve **arrcur, double *arrknot, double *left, double *right, SPAvector *dir=(SPAvector *) NULL, closed_forms flagu=OPEN, closed_forms flagv=OPEN)
 Constructs a skin surface from the given section curves and the optional matching tangents.

Protected Member Functions

virtual subtrans_objectcopy () const
 Constructs a duplicate spl_sur in free storage of this object, with a zero use count.
virtual void debug (char const *, logical, FILE *) const
 Writes the subtype_object in readable form for debugging.
virtual void eval (SPApar_pos const &uv, SPAposition &pos, SPAvector *dpos, SPAvector *ddpos) const
 Finds the position and the first and second derivatives of the surface at a specified parameter-space point.
logical operator== (subtype_object const &) const
 Determines if two subtype objects are the same.


Detailed Description

Defines a skin surface between a list of curves.


Role: Surface Parameterization
The surface parameterization is the u-direction corresponds to the parameterization of the curves to be skinned and the v-direction corresponds to the cubic Bezier between the skin-curves.
The input to this surface class are the curves to be skinned (all the curves are reparameterized to lie in [0.0 - 1.0] range), optional tangents (the magnitude of the curves' tangents have to match on the ends) in u-direction, and the optional surfaces on which the curves lie. If surfaces containing the curves are provided, these determine the tangent directions in v.
Evaluation Process
The evaluation process is a three-step process, as described below.
Step 1
If any matching tangent magnitudes are given, the section curves (curves to be skinned) are reparameterized as follows: parameter t is the parameter on the original curve. Parameter u on the skin surface is determined such that the u-partial at each end of the skin surface is equal to the matching tangent magnitude.
t = f(u) = ts*H0(u) + m0*H1(u) + m1*H2(u) + te*H3(u)
In the above expression, Hn are the cubic Hermite polynomials and ts and te are the start and end parameter values of the original curves to be skinned, which here are 0 and 1, respectively.
So, ds/du on the ends are:
dc/du = dc/dt * dt/du
where the dt/du values on the ends are m0 and m1. So by choosing the values m0 and m1 such that the dc/du on the left surface is equal to dc/du on the right surface (provided that the curves are G1), a C1 continuous surface is achieved even when skinning G1 continuous curves.
Step 2
The tangent directions for the v are determined by fitting a circle through the points corresponding to the same u-value on the adjacent section curves to the left and right. The scheme followed is similar to the way Bessel tangents are computed. If there are only two section curves, the circle radius is chosen to be infinity. If the surfaces are given for any section, the tangent direction in v when on that curve is obtained by the cross product of surface normal and the section curve tangent at that point. The direction also has an optional scalar value that can be applied. The surface is called a loft surface when such a surface is provided. Step 3
Now the skin/loft surface is defined using cubic Hermite interpolants between sections that join each other C1 continuously. To evaluate the surface s(u,v) at a particular v-parameter, the first step is to find the segment to which this parameter corresponds. Then a local parameter vi is computed, which ranges from 0 to 1. The section curves ci and ci+1, and the v-tangents ti and ti+1 are also obtained. The surface is defined as:
s(u,v) = ci(u)*H0(vi) + ti*H1(vi) + ti+1*H2(vi) + ci+1*H3(vi) The parametric derivatives of this surface are obtained by differentiating the above equation algebraically.


Constructor & Destructor Documentation

skin_spl_sur::skin_spl_sur ( const skin_spl_sur surf  ) 

C++ copy constructor requests memory for this object and populates it with the data from the object supplied as an argument.

Parameters:
surf surface to copy


Member Function Documentation

int skin_spl_sur::accurate_derivs ( SPApar_box const &  area = *(SPApar_box *) NULL_REF  )  const [virtual]

Calculates the derivatives within the given parameter box.

Parameters:
area area for deriv

Reimplemented from spl_sur.

void skin_spl_sur::add_path_data ( int  no_curves,
curve **  curves 
)

Adds the path data to the skin_spl_sur object.

Parameters:
no_curves number of curves in path
curves curve paths to add

void subtype_object::add_ref (  )  [inherited]

Uses count manipulation.

void subtrans_object::clear_trans (  )  [inherited]

Clears any references to this object using transformation lists, before incompatible changes.

logical spl_sur::closed_u (  )  const [inline, inherited]

Determines if the surface is closed, smoothly or not, in the u-parameter direction.

logical spl_sur::closed_v (  )  const [inline, inherited]

Determines if the surface is closed, smoothly or not, in the v-parameter direction.

virtual subtrans_object* skin_spl_sur::copy (  )  const [protected, virtual]

Constructs a duplicate spl_sur in free storage of this object, with a zero use count.

Implements spl_sur.

virtual void skin_spl_sur::debug ( char const *  leader,
logical  output,
FILE *  fp 
) const [protected, virtual]

Writes the subtype_object in readable form for debugging.



Role: If logical is TRUE, brief output is produced; if logical is FALSE, long output is produced.

Parameters:
leader leader for second and subsequent lines of output.
output TRUE for brief output, FALSE for full output.
fp file name.

Implements spl_sur.

virtual spl_sur* skin_spl_sur::deep_copy ( pointer_map pm = NULL  )  const [virtual]

Creates a copy of an item that does not share any data with the original.


Role: Allocates new storage for all member data and any pointers. Returns a pointer to the copied item.
In a deep copy, all the information about the copied item is self-contained in a new memory block. By comparison, a shallow copy stores only the first instance of the item in memory, and increments the reference count for each copy.
The pointer_map keeps a list of all pointers in the original object that have already been deep copied. For example, a deep_copy of a complex model results in self contained data, but identical sub-parts within the model are allowed to share a single set of data.

Parameters:
mp list of items within the entity that are already deep copied

Implements spl_sur.

double skin_spl_sur::estimate_min_rad_curv (  ) 

This function estimates the minimum radius of curvature of the skin surface for a given set of tangent factor values.

void skin_spl_sur::estimate_tanfacs_scale ( SPAinterval tan_range  ) 

Estimates the scaling factor range.


Role: Estimates the scaling factor range, by which the tangent factors controlling the skin surface should be scaled so as to get the surface with as large a radius of curvature as possible.

Parameters:
tan_range range to use

virtual void skin_spl_sur::eval ( SPApar_pos const &  uv,
SPAposition pos,
SPAvector dpos,
SPAvector ddpos 
) const [protected, virtual]

Finds the position and the first and second derivatives of the surface at a specified parameter-space point.



Parameters:
uv given parameter-space point.
pos returned point.
dpos first derivative.
ddpos second derivative.

Reimplemented from spl_sur.

virtual SPAposition spl_sur::eval_position ( SPApar_pos const &  parameter  )  const [virtual, inherited]

Finds the point on the spline for a given parameter-space point.



Parameters:
parameter given parameter-space point.

double spl_sur::fitol (  )  const [inline, inherited]

Returns the fit tolerance for the approximating bs3_surface.

void skin_spl_sur::get_curves ( int &  no_crv,
curve ***  curves 
) const

Returns the surface curves.

Parameters:
no_crv number of curves
curves output array pointer

void skin_spl_sur::get_laws ( int &  no_laws,
law **&  laws 
) const

Returns a list of laws used by the skin_spl_sur.


Role: The use count of the laws is incremented by one.

Parameters:
no_laws number of laws
laws list of laws pointer

subtrans_object* subtrans_object::get_next (  )  const [inline, inherited]

Returns the next object in the list.

virtual curve* spl_sur::get_path (  )  const [inline, virtual, inherited]

Returns the sweep path curve for this spl_sur.

Reimplemented in off_spl_sur, rot_spl_sur, sum_spl_sur, and sweep_spl_sur.

virtual sweep_path_type spl_sur::get_path_type (  )  const [inline, virtual, inherited]

Returns the sweep path type for this spl_sur.

Reimplemented in off_spl_sur, rot_spl_sur, sum_spl_sur, and sweep_spl_sur.

virtual curve* spl_sur::get_profile ( double  param  )  const [inline, virtual, inherited]

Returns the sweep profile curve for this spl_sur.

Parameters:
param parameter

Reimplemented in rot_spl_sur, sum_spl_sur, and sweep_spl_sur.

virtual law* spl_sur::get_rail (  )  const [inline, virtual, inherited]

Returns the sweep rail law for this spl_sur.

Reimplemented in off_spl_sur, rot_spl_sur, sum_spl_sur, and sweep_spl_sur.

void skin_spl_sur::get_surfaces ( int &  no_surfaces,
surface **&  surf_arr 
) const

Returns the surfaces.


Role: The array of surfaces need to be deleted by the calling routine.

Parameters:
no_surfaces number of surfaces
surf_arr surface array pointer

logical skin_spl_sur::get_tanfacs ( double *  tangents  )  const

Get the tangent factors to determine optimal values for them.

Parameters:
tangents tangent factors, returns FALSE if there are none

void skin_spl_sur::get_v_knots ( double  u,
int &  out_no_knots,
double **  out_vknots 
) const

Returns the v_knot sequence for a given parameter value.

Parameters:
u u parameter
out_no_knots number of knots
out_vknots output array pointer

static int skin_spl_sur::id (  )  [static]

Returns the ID for the skin_spl_sur list.

void spl_sur::invalidate_cache (  )  [inherited]

Method to be called by any user who modifies the surface in an external process, to ensure that stale evaluation results are discarded.

logical spl_sur::iterate_perp ( SPAposition const &  pos,
SPAposition surf,
SPAunit_vector normal,
surf_princurv curv,
SPApar_pos const &  guess,
SPApar_pos actual,
logical  pt 
) const [inherited]

Support function for point_perp (and bs3_surface_perp).



Role: This method finds a true perpendicular given an initial parameter guess, and avoiding oscillations. It may be set to iterate to the nearest perpendicular of any sort (minimum or maximum distance, or inflexion), or to find only minima (which is sometimes more reliable when there are inflexions), and it returns a success or failure indication.

Parameters:
pos given position.
surf position on surface.
normal normal to surface.
curv principal curvature.
guess guess parameter.
actual actual parameter.
pt TRUE to iterate to a (local) near-point rather than any perpendicular..

static spl_sur* skin_spl_sur::make_skin_spl_sur ( logical  arc,
logical  perp,
int  section,
curve **  cur,
double *  arrknot,
double *  left,
double *  right,
surface **  surf,
double *  fac,
law **  arrlaw,
closed_forms  flagu = OPEN,
closed_forms  flagv = OPEN 
) [static]

Constructs a loft surface from the given section curves and the corresponding surfaces on which the sections lie and the optional tangent factors that should be applied to cross-boundary tangents.


Role: The surfaces are passed in are owned by the skin_surface, so the user should pass in a copy. All arrays are the size of int, the number of sections.

Parameters:
arc arc-length flag
perp perpendicular flag
section number of section curves
cur array of curves
arrknot array of knot values
left array of left tangents
right array of right tangents
surf array of surfaces
fac crossboundary tangents array
arrlaw array of laws
flagu flag for periodicity of surface in u
flagv flag for periodicity of surface in v

static spl_sur* skin_spl_sur::make_skin_spl_sur ( logical  length,
int  cur,
curve **  arrcur,
double *  arrknot,
double *  left,
double *  right,
SPAvector dir = (SPAvector *) NULL,
closed_forms  flagu = OPEN,
closed_forms  flagv = OPEN 
) [static]

Constructs a skin surface from the given section curves and the optional matching tangents.

Parameters:
length arc length option
cur number of curves
arrcur array of curves
arrknot aray of knot values
left array of left tangents
right array of right tangents
dir array of tangent dirs
flagu flag for periodicity of surface in u
flagv flag for periodicity of surface in v

subtrans_object* subtrans_object::make_trans ( SPAtransf const &  trans  )  [inherited]

Transforms the subtrans_object on an external level.



Role: This method searches the transform list to find a match. It returns the corresponding transformed object if it is found; otherwise, it constructs a new transformed object, enters it into the transformation list for future reference, and returns the new object. If this object is only singly-referenced and has no transformed counterpart, then it transforms directly without copying, and "this" returns.

Parameters:
trans transformation.

logical subtype_object::mult_ref (  )  const [inline, inherited]

Returns TRUE if there is more than one reference - else, it returns FALSE.

logical subtype_object::operator!= ( subtype_object const &  rhs  )  const [inline, inherited]

TRUE if two subtype objects are not the same.



Role: Use this method for sharing on restoration of old save files.

Parameters:
rhs subtype-object.

logical skin_spl_sur::operator== ( subtype_object const &  obj  )  const [protected, virtual]

Determines if two subtype objects are the same.



Role: Use this method for sharing on restoration of old save files.

Parameters:
obj subtype-object.

Reimplemented from spl_sur.

double spl_sur::param_period_u (  )  const [inline, inherited]

Returns the u period of a periodic parametric surface, zero if the surface is not periodic in the u direction.

double spl_sur::param_period_v (  )  const [inline, inherited]

Returns the v period of a periodic parametric surface, zero if the surface is not periodic in the v direction.

SPApar_box spl_sur::param_range ( SPAbox const &  box = *(SPAbox *)NULL_REF  )  const [inline, inherited]

Returns the principal parameter range of a parametric surface in both u and v-parameter directions.



Role: A periodic surface is defined for all parameter values in the periodic direction, by reducing the given parameter modulo the period into this principal range. For a surface open or nonperiodic in the chosen direction the surface evaluation functions are defined only for parameter values in the returned range.

If a box is specified, the parameter range returned may be restricted to a portion of the surface which is guaranteed to contain all portions of the surface that lie within the region of interest. If none is specified and the parameter range in some direction is unbounded, then an interval unbounded in that direction is returned.

Parameters:
box object space box.

SPAinterval spl_sur::param_range_u ( SPAbox const &  box = *(SPAbox *)NULL_REF  )  const [inline, inherited]

Returns the principal parameter range of a parametric surface in the u-parameter direction.



Role: A periodic surface is defined for all parameter values in the periodic direction, by reducing the given parameter modulo the period into this principal range. For a surface open or nonperiodic in the chosen direction the surface evaluation functions are defined only for parameter values in the returned range.

Parameters:
box object space box.

SPAinterval spl_sur::param_range_v ( SPAbox const &  box = *(SPAbox *)NULL_REF  )  const [inline, inherited]

Returns the principal parameter range of a parametric surface in the v-parameter direction.



Role: A periodic surface is defined for all parameter values in the periodic direction, by reducing the given parameter modulo the period into this principal range. For a surface open or nonperiodic in the chosen direction the surface evaluation functions are defined only for parameter values in the returned range.

Parameters:
box object space box.

logical spl_sur::periodic_u (  )  const [inline, inherited]

Determines if a parametric surface is periodic in the u direction.



Role: Determines if a parametric surface is periodic in the u direction. (i.e. it is smoothly closed, so faces can run over the seam).

logical spl_sur::periodic_v (  )  const [inline, inherited]

Determines if a parametric surface is periodic in the v direction.



Role: Determines if a parametric surface is periodic in the v direction. (i.e. it is smoothly closed, so faces can run over the seam).

int subtype_object::ref_count (  )  [inline, inherited]

Returns the use count.

void subtype_object::remove_ref (  )  [inherited]

Removes a reference.

virtual void skin_spl_sur::save (  )  const [virtual]

Saves the skin_spl_sur as an approximation if there is a need to approximate.

Reimplemented from subtype_object.

virtual void skin_spl_sur::save_data (  )  const [virtual]

Saves the information for skin_spl_sur to the save file.

Reimplemented from spl_sur.

void subtrans_object::set_next ( subtrans_object obj  )  [inherited]

Sets the next object in the list.



Parameters:
obj object.

void skin_spl_sur::set_tanfacs ( double *  tangents,
logical  remake_approx = TRUE 
)

Set the tangent factors and get them for purposes of determining optimal values for them.

Parameters:
tangents tangent factors
remake_approx remake enabled or not

logical spl_sur::singular_u ( double  uparam  )  const [inherited]

Reports whether the surface parameterization is singular at the specified u-parameter value.



Role: The only singularity recognized is where every value of the v parameter generates the same object-space point, and these can only occur at the ends of the parameter range as returned by param_range_u.

Parameters:
uparam specified u parameter value.

logical spl_sur::singular_v ( double  vparam  )  const [inherited]

Reports whether the surface parameterization is singular at the specified v-parameter value.



Role: The only singularity recognized is where every value of the u parameter generates the same object-space point, and these can only occur at the ends of the parameter range as returned by param_range_v.

Parameters:
vparam specified v parameter value.

bs3_surface spl_sur::sur (  )  const [inline, inherited]

Returns the bs3_surface approximation.

virtual int skin_spl_sur::type (  )  const [virtual]

Returns the type of skin_spl_sur.

Implements subtype_object.

virtual char const* skin_spl_sur::type_name (  )  const [virtual]

Returns the string of the given spline surface type, which is "skinsur" for a skin_spl_surf.

Implements spl_sur.

virtual logical subtype_object::unknown_type (  )  const [virtual, inherited]

Returns TRUE if this object type is unknown to the system - else, it returns FALSE.



Role: This method returns FALSE as the default, so except for the system unknown subtype, the method should be omitted from derived class definitions.