Purpose:
|
Defines an abstract base class from which spline surface definitions are derived.
|
|
Derivation:
|
spl_sur : subtrans_object : subtype_object : ACIS_OBJECT : -
|
|
SAT Identifier:
|
spl_sur
|
|
Filename:
|
kern/kernel/kerngeom/surface/spldef.hxx
|
|
Description:
|
In
ACIS a sculptured surface is represented by the class spline, which contains a pointer to an internal description called
spl_sur. The
spl_sur further contains a
bs3_surface that is a pointer to a rational or nonrational, nonuniform B-spline surface in the underlying surface package.
|
|
|
To support various types of surface construction,
ACIS uses classes derived from the internal representation
spl_sur. Also, surface classes can be derived from the derived class to construct more complicated surfaces. This section covers the base class
spl_sur along with the methods used to create derived classes, rewritten per their specifications. The section also presents the classes derived from
spl_sur and the construction method for them.
|
|
|
This class contains the mathematical definition for a spline surface. It uses use counts to limit copying, and it allows derivation to construct surfaces that are only approximated by the
bs3_surface. The base class
spl_sur contains the following information for defining the surface:
|
|
|
-
|
A use count indicating the number of times this
spl_sur is used.
|
|
-
|
A pointer to a
bs3_surface, that represents the spline surface.
|
|
-
|
A fitting tolerance representing the precision of the spline approximation to the true surface.
|
|
|
Classes derived from
spl_sur can contain additional information, and can record the creation method of the true spline surface.
|
|
|
All functions defined for the spline class are supported by virtual functions that depend on the true definition of the surface. The functionality is made virtual to allow the derived surfaces to implement the functionality on their own. For surfaces that have an exact
bs3_surface, there is no need to implement the functionality because the methods written for the base class are sufficient.
|
|
References:
|
KERN
|
discontinuity_info, summary_bs3_surface
|
|
by KERN
|
spline, summary_bs3_surface
|
|
BASE
|
SPAinterval
|
|
Data:
|
protected bs3_surface sur_data;
|
|
Object-space approximation to true surface.
|
|
|
protected closed_forms closed_in_u;
|
|
Takes the values
OPEN,
CLOSED or
PERIODIC (or unset if the
spl_sur is undefined). If an approximating surface is present (in
sur_data), the closure of the approximating surface will be consistent.
|
|
|
protected closed_forms closed_in_v;
|
|
Takes the values
OPEN,
CLOSED or
PERIODIC (or unset if the
spl_sur is undefined). If an approximating surface is present (in
sur_data), the closure of the approximating surface will be consistent.
|
|
|
protected discontinuity_info u_disc_info;
|
|
Storage for the discontinuities, if there are any.
|
|
|
protected discontinuity_info v_disc_info;
|
|
Storage for the discontinuities, if there are any.
|
|
|
protected double fitol_data;
|
|
The precision that the spline approximates the true surface.
|
|
|
protected SPAinterval u_range;
|
|
The full range of the
spl_sur, as returned by
param_range_u. If an approximating surface is present (in
sur_data), this range should be identical to that of the approximating surface.
|
|
|
protected SPAinterval v_range;
|
|
The full range of the
spl_sur, as returned by
param_range_u. If an approximating surface is present (in
sur_data), this range should be identical to that of the approximating surface.
|
|
|
protected logical calling_make_approx;
|
|
Prevents recursive calls to the method
make_approx.
|
|
|
protected singularity_type u_singularity;
|
|
Records whether the surface is singular in
v. If an approximating surface is present (in
sur_data), the singularities of the approximating surface will be consistent.
|
|
|
protected singularity_type v_singularity;
|
|
Records whether the surface is singular in
u. If an approximating surface is present (in
sur_data), the singularities of the approximating surface will be consistent.
|
|
|
protected summary_bs3_surface* summary_data;
|
|
bs3_surface data in summary form. This field may be set on restore, if the full surface is not available. It may be used to make the actual
bs3_surface.
|
|
Constructor:
|
protected: spl_sur::spl_sur
();
|
|
|
C++ allocation constructor requests memory for this object but does not populate it.
|
|
|
|
|
|
|
public: spl_sur::spl_sur
(
|
|
|
bs3_surface,
|
// approximation surface
|
|
|
double
|
// fit tolerance
|
|
|
|
= 0
|
|
|
);
|
|
|
C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.
|
|
|
|
|
|
|
public: spl_sur::spl_sur
(
|
|
|
const spl_sur&
|
// spline surface
|
|
|
);
|
|
|
C++ copy constructor requests memory for this object and populates it with the data from the object supplied as an argument.
|
|
|
|
|
|
|
public: spl_sur::spl_sur
(
|
|
|
SPAinterval,
|
// u range
|
|
|
SPAinterval,
|
// v range
|
|
|
closed_forms,
|
// type of closure in u
|
|
|
closed_forms,
|
// type of closure in v
|
|
|
singularity_type,
|
// singularity type for u
|
|
|
singularity_type
|
// singularity type for v
|
|
|
);
|
|
|
C++ copy constructor requests memory for this object and populates it with the data from the object supplied as arguments.
|
|
|
|
|
Destructor:
|
protected: virtual spl_sur::~spl_sur
();
|
|
|
C++ destructor, deleting a
spl_sur.
|
|
|
|
Methods:
|
protected: virtual int spl_sur::accurate_derivs
(
|
|
|
SPApar_box const&
|
// parameter box
|
|
|
|
= * (SPApar_box* ) NULL_REF
|
|
|
) const;
|
|
|
Returns the number of derivatives that
evaluate can find accurately and directly, rather than by finite differencing, over the given portion of the curve. If there is no limit to the number of accurate derivatives, this method returns the value,
ALL_SURFACE_DERIVATIVES.
|
|
|
|
|
|
|
protected: virtual void spl_sur::append_u
(
|
|
|
spl_sur&
|
// given surface
|
|
|
);
|
|
|
Concatenates the contents of two surfaces into one. the given surface appends to the existing one along
u. The surfaces are guaranteed to be the same base or derived type and to have contiguous parameter ranges ("this" is the beginning part of the combined surface; i.e., lower parameter values, the argument gives the end part).
|
|
|
|
|
|
|
protected: virtual void spl_sur::append_v
(
|
|
|
spl_sur&
|
// given surface
|
|
|
);
|
|
|
Concatenates the contents of two surfaces into one. the given surface appends to the existing one along
v. The surfaces are guaranteed to be the same base or derived type and to have contiguous parameter ranges ("this" is the beginning part of the combined surface; i.e., lower parameter values, the argument gives the end part).
|
|
|
|
|
|
|
protected: virtual SPAbox spl_sur::bound
(
|
|
|
SPApar_box const&
|
// parameter box
|
|
|
|
= * (SPApar_box* ) NULL_REF
|
|
|
);
|
|
|
Returns a box around the surface. This need not be the smallest box which contains the specified portion of the surface, but needs to balance the tightness of the bound against the cost of evaluation.
|
|
|
|
|
|
|
protected: virtual void
|
|
|
spl_sur::calculate_disc_info ();
|
|
|
Calculates the discontinuity information for the surface.
|
|
|
|
|
|
|
protected: virtual check_status_list*
|
|
|
spl_sur::check (
|
|
|
const check_fix& input
|
|
|
// flags for
|
|
|
|
= * (const check_fix*)
|
|
// allowed
|
|
|
|
NULL_REF,
|
|
|
// fixes
|
|
|
check_fix& result
|
|
|
// fixes
|
|
|
|
= * (check_fix*) NULL_REF,
|
// applied
|
|
|
const check_status_list*
|
|
|
// checks to
|
|
|
|
= (const check_status_list*)
|
// be made
|
|
|
|
NULL_REF
|
|
|
// default none
|
|
|
);
|
|
|
Check for any data errors in the curve, and correct the errors if possible. The various arguments provide control over which checks are made, which fixes can be applied and which fixes were actually applied. The function returns a list of errors that remain in the curve on exit.
|
|
|
The default for the set of flags which say which fixes are allowable is none (nothing is fixed). If the list of checks to be made is null, then every possible check will be made. Otherwise, the function will only check for things in the list. The return value for the function will then be a subset of this list.
|
|
|
|
|
|
|
public: logical
|
|
|
spl_sur::closed_u () const;
|
|
|
Determines if the surface is closed, smoothly or not, in the
u-parameter direction.
|
|
|
|
|
|
|
public: logical
|
|
|
spl_sur::closed_v () const;
|
|
|
Determines if the surface is closed, smoothly or not, in the
v-parameter direction.
|
|
|
|
|
|
|
protected: virtual logical
|
|
|
spl_sur::contains_pipe () const;
|
|
|
Returns
TRUE if this
spl_sur depends on a pipe surface.
|
|
|
|
|
|
|
public: virtual subtrans_object*
|
|
|
spl_sur::copy () const = 0;
|
|
|
Constructs a duplicate
spl_sur in free storage of this object, with a zero use count.
|
|
|
|
|
|
|
protected: virtual void spl_sur::debug
(
|
|
|
char const*,
|
// leader
|
|
|
logical,
|
// brief
|
|
|
FILE*
|
// output file
|
|
|
) const = 0;
|
|
|
Prints the definition of a spline surface to standard output or to the specified file. As for save and restore the operation is split into two parts: the virtual function
debug prints a class-specific identifying line, then calls the ordinary function
debug_data to put out the details.
|
|
|
|
|
|
|
protected: void spl_sur::debug_data
(
|
|
|
char const*,
|
// leader
|
|
|
logical,
|
// brief
|
|
|
FILE*
|
// output file
|
|
|
) const;
|
|
|
Prints out the details. The
debug_data derived class can call its parent's version first, to put out the common data. If the derived class has no additional data it need not define its own version of
debug_data and may use its parent's instead. A string argument provides the introduction to each displayed line and a logical sets brief output (normally removing detailed subsidiary curve and surface definitions).
|
|
|
|
|
|
|
public: virtual spl_sur* spl_sur::deep_copy
(
|
|
|
pointer_map* pm
|
// list of items within
|
|
|
|
= NULL
|
// the entity that are
|
|
|
|
|
// already deep copied
|
|
|
) const = 0;
|
|
|
Creates a copy of an item that does not share any data with the original. 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.
|
|
|
|
|
|
|
protected: void spl_sur::delete_summary_data
();
|
|
|
Allows derived classes to delete
summary_data when it goes out of date.
|
|
|
|
|
|
|
protected: save_approx_level
|
|
|
spl_sur::enquire_save_approx_level () const;
|
|
|
Returns the default level at which the approximating surface should be stored.
|
|
|
|
|
|
|
public: virtual void spl_sur::eval
(
|
|
|
SPApar_pos const& uv,
|
// given parameter
|
|
|
SPAposition& pos,
|
// returned point
|
|
|
SPAvector* dpos,
|
// first derivative
|
|
|
SPAvector* ddpos
|
// second derivative
|
|
|
) const;
|
|
|
Finds the position and the first and second derivatives of the surface at a specified point.
|
|
|
|
|
|
|
protected: virtual int spl_sur::evaluate
(
|
|
|
SPApar_pos const&,
|
|
|
// parameter
|
|
|
SPAposition&,
|
|
|
// pt on surface
|
|
|
|
|
|
|
// at a given
|
|
|
|
|
|
|
// parameter
|
|
|
SPAvector**
|
|
|
// Array of ptrs
|
|
|
|
= NULL,
|
|
|
// to arrays of
|
|
|
|
|
|
|
// vectors size
|
|
|
|
|
|
|
// nd
|
|
|
int
|
|
|
|
// number of
|
|
|
|
= 0,
|
|
|
// derivatives
|
|
|
|
|
|
|
// required (nd)
|
|
|
evaluate_surface_quadrant
|
|
// eval. location
|
|
|
|
= evaluate_surface_unknown
|
|
|
) const;
|
|
|
Calculates position and derivatives. Once calculated the derivatives are stored in vectors provided by the user. This method returns the number it was able to calculate; this equals the number requested in all but the most exceptional circumstances. A certain number are evaluated directly and accurately; higher derivatives are automatically calculated by finite differencing; the accuracy of these decreases with the order of the derivative, as the cost increases. Any of the pointers may be
NULL, in which case the corresponding derivatives will not be returned. Otherwise they must point to arrays long enough for all the derivatives of that order; i.e., 2 for the first derivatives, 3 for the second, etc.
|
|
|
|
|
|
|
protected: virtual int spl_sur::evaluate_iter
(
|
|
|
SPApar_pos const&,
|
|
// parameter position
|
|
|
surface_evaldata*,
|
|
// data supplying
|
|
|
|
|
|
// initial values,
|
|
|
|
|
|
// and set to reflect
|
|
|
|
|
|
// the results of
|
|
|
|
|
|
// this evaluation
|
|
|
SPAposition&,
|
|
// point on surface
|
|
|
|
|
|
// at given parameter
|
|
|
SPAvector**
|
|
// array of pointers
|
|
|
|
= NULL,
|
|
// to vectors, of
|
|
|
|
|
|
// size nd. Any of
|
|
|
|
|
|
// the pointers may
|
|
|
|
|
|
// be null, in which
|
|
|
|
|
|
// case the
|
|
|
|
|
|
// corresponding
|
|
|
|
|
|
// derivative will
|
|
|
|
|
|
// not be returned
|
|
|
int
|
|
|
// number of
|
|
|
|
= 0,
|
|
// derivatives
|
|
|
|
|
|
// required (nd)
|
|
|
evaluate_surface_quadrant
|
// evaluation
|
|
|
|
|
|
// location - above,
|
|
|
|
|
|
// below, don't care
|
|
|
|
= evaluate_surface_unknown
|
|
|
) const;
|
|
|
The
evaluate_iter function is just like
evaluate, but is supplied with a data object which contains results from a previous close evaluation for use as initial values for any iteration involved.
|
|
|
|
|
|
|
protected: int spl_sur::evaluate_iter_with_cache
(
|
|
|
SPApar_pos const&,
|
// parameter
|
|
|
surface_evaldata*,
|
// data supplying initial
|
|
|
|
|
// values, and set to
|
|
|
|
|
// reflect results
|
|
|
SPAposition&,
|
// point on curve at
|
|
|
|
|
// parameter
|
|
|
SPAvector**
|
// size nd array of
|
|
|
|
|
// pointers to arrays of
|
|
|
|
|
// vectors.
|
|
|
|
= NULL,
|
|
|
int
|
|
// Number of deriv's req.
|
|
|
|
= 0,
|
|
|
evaluate_surface_quadrant
|
// evaluation
|
|
|
|
|
|
// location - above,
|
|
|
|
|
|
// below, don't care
|
|
|
|
= evaluate_surface_unknown
|
|
|
) const;
|
|
|
This non-virtual function looks in the cache for position and nd derivatives at the given parameter value. If found it returns them. Otherwise it computes them, puts them in the cache, and returns them. The
evaluate_iter_with_cache method, rather than
evaluate_iter, should be called by classes derived from
spl_sur, so as to get the benefit of caching.
|
|
|
|
|
|
|
protected: int spl_sur::evaluate_with_cache
(
|
|
|
SPApar_pos const&,
|
// parameter
|
|
|
SPAposition&,
|
// position at parameter
|
|
|
SPAvector**
|
// derivates at position
|
|
|
|
= NULL,
|
|
|
int
|
|
// nd number of deriv's
|
|
|
|
= 0,
|
|
|
evaluate_surface_quadrant
|
// evaluation
|
|
|
|
|
// location above, below
|
|
|
|
|
// for each parameter
|
|
|
|
|
// direction
|
|
|
|
= evaluate_surface_unknown
|
|
|
) const;
|
|
|
This non-virtual function looks in the cache for position and nd derivatives at the given parameter value. If found it returns them. Otherwise it computes them, puts them in the cache, and returns them. The
evaluate_with_cache method, rather than
evaluate, should be called by classes derived from
spl_sur, so as to get the benefit of caching.
|
|
|
|
|
|
|
protected: virtual double spl_sur::eval_cross
(
|
|
|
SPApar_pos const&,
|
// given parameter
|
|
|
SPAunit_vector const&
|
// given plane normal
|
|
|
) const;
|
|
|
Finds the curvature of a cross-section curve of the surface at the point on the surface with the given parameter values. The cross-section is defined as the intersection of the surface with a plane passing through the point on the surface and normal to the given direction, which must lie in the surface.
|
|
|
|
|
|
|
protected: virtual SPAunit_vector spl_sur::eval_normal
(
|
|
|
SPApar_pos const&
|
// given parameter
|
|
|
) const;
|
|
|
Finds the normal to the surface at a given parameter.
|
|
|
|
|
|
|
protected: virtual SPAunit_vector spl_sur::eval_outdir
(
|
|
|
SPApar_pos const&
|
// given parameter
|
|
|
) const;
|
|
|
Return a direction which points outward from the surface. This should be the outward normal if the point is not singular, otherwise a fairly arbitrary outward direction.
|
|
|
|
|
|
|
public: virtual SPAposition spl_sur::eval_position
(
|
|
|
SPApar_pos const&
|
// given parameter
|
|
|
) const;
|
|
|
Finds the point on the spline with the given parameter value.
|
|
|
|
|
|
|
protected: virtual void spl_sur::eval_prin_curv
(
|
|
|
SPApar_pos const&,
|
// given parameter
|
|
|
SPAunit_vector&,
|
// first axis direction
|
|
|
double&,
|
// 1st direction
|
|
|
|
|
// curvature
|
|
|
SPAunit_vector&,
|
// second axis direction
|
|
|
double&
|
// 2nd direction
|
|
|
|
|
// curvature
|
|
|
) const;
|
|
|
Finds the principle axes of curvature of the surface at a point with given parameter values and the curvatures in those directions.
|
|
|
|
|
|
|
protected: void spl_sur::eval_with_cache
(
|
|
|
SPApar_pos const&,
|
// parameter
|
|
|
SPAposition&,
|
// position at parameter
|
|
|
SPAvector*,
|
// 1st deriv
|
|
|
SPAvector*
|
// 2nd deriv
|
|
|
) const;
|
|
|
This non-virtual function looks in the cache for point perpendicular at the given parameter value. If found it returns them. Otherwise it computes them, puts them in the cache, and returns them. The
eval_with_cache method, rather than
eval, should be called by classes derived from
spl_sur, so as to get the benefit of caching.
|
|
|
|
|
|
|
public: double spl_sur::fitol
() const;
|
|
|
Returns the fit tolerance for the approximating
bs3_surface.
|
|
|
|
|
|
|
public: virtual curve* spl_sur::get_path
() const;
|
|
|
Returns the sweep path curve for this
spl_sur.
|
|
|
|
|
|
|
public: virtual sweep_path_type
|
|
|
spl_sur::get_path_type () const;
|
|
|
Returns the sweep path type for this
spl_sur.
|
|
|
|
|
|
|
public: virtual curve* spl_sur::get_profile
(
|
|
|
double
|
// parameter
|
|
|
) const;
|
|
|
Returns the sweep profile curve for this
spl_sur.
|
|
|
|
|
|
|
public: virtual law* spl_sur::get_rail
() const;
|
|
|
Returns the sweep rail law for this
spl_sur.
|
|
|
|
|
|
|
protected: virtual void
|
|
spl_sur::incremental_make_approx (
|
|
|
double fit
|
// tolerance value for
|
|
|
|
|
// approx. surface
|
|
|
|
|
// to be made
|
|
|
);
|
|
|
Makes an approximating surface for an extended
spl_sur incrementally given an approximating surface for the original
spl_sur. The extension is done first for the u/v direction, which is a smaller percentage of the original range.
|
|
|
|
|
|
|
public: void spl_sur::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.
|
|
|
|
|
|
|
protected: logical spl_sur::iterate_perp
(
|
|
|
SPAposition const&,
|
// given position
|
|
|
surface_evaldata*,
|
// surface
|
|
|
SPAposition&,
|
// position on surface
|
|
|
SPAunit_vector&,
|
// normal to surface
|
|
|
surf_princurv&,
|
// principle curvature
|
|
|
SPApar_pos const&,
|
// guess parameter
|
|
|
SPApar_pos&,
|
// actual parameter
|
|
|
logical
|
// TRUE to iterate to a
|
|
|
|
|
// (local) near-point
|
|
|
|
|
// rather than any
|
|
|
|
|
// perpendicular.
|
|
|
) const;
|
|
|
Support function for
point_perp (and
bs3_surface_perp). 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.
|
|
|
|
|
|
|
public: logical spl_sur::iterate_perp
(
|
|
|
SPAposition const&,
|
// given position
|
|
|
SPAposition&,
|
// position on surface
|
|
|
SPAunit_vector&,
|
// normal to surface
|
|
|
surf_princurv&,
|
// principle curvature
|
|
|
SPApar_pos const&,
|
// guess parameter
|
|
|
SPApar_pos&,
|
// actual parameter
|
|
|
logical
|
// TRUE to iterate to a
|
|
|
|
|
// (local) near-point
|
|
|
|
|
// rather than any
|
|
|
|
|
// perpendicular.
|
|
|
) const;
|
|
|
Support function for
point_perp (and
bs3_surface_perp). 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.
|
|
|
|
|
|
|
protected: virtual logical
|
|
|
spl_sur::left_handed_uv () const;
|
|
|
Indicates whether the parameter coordinate system of the surface is right-handed or left-handed. With a right-handed system, at any point the outward normal is given by the cross product of the increasing
u direction with the increasing
v direction, in that order. With a left-handed system the outward normal is in the opposite direction from this cross product
|
|
|
|
|
|
|
protected: virtual void spl_sur::make_approx
(
|
|
|
double fit,
|
// fit tolerance
|
|
|
const spline& spl
|
// pointer to output
|
|
|
|
= * (spline*) NULL_REF,// spline approx.
|
|
|
logical force
|
// flag for forcing
|
|
|
|
= FALSE
|
|
|
) const;
|
|
|
Makes or remakes an approximation of the surface, within the given tolerance.
|
|
|
|
|
|
|
protected: virtual surface_evaldata*
|
|
|
spl_sur::make_evaldata () const;
|
|
|
Construct a data object to retain evaluation information across calls to evaluate_iter. This is to allow subsidiary calls within an iterative evaluator to start iteration much closer to the required result than is possible just using the curve information itself.
|
|
|
|
|
|
|
protected: virtual surf_normcone
|
|
|
spl_sur::normal_cone (
|
|
|
SPApar_box const&
|
// parameter box
|
|
|
|
= * (SPApar_box* ) NULL_REF,
|
|
|
logical
|
// approx. results OK
|
|
|
|
= FALSE
|
|
|
);
|
|
|
Returns a cone bounding the normal direction of the surface. The cone has its apex at the origin, and it has a specified axis direction and (positive)half-angle. If
logical is
TRUE, then an approximation is found. The approximate result may lie wholly within or wholly outside the guaranteed bound (obtained with
FALSE), but it may not cross from the inside to the outside. Flags in the returned object indicate whether the cone is in face the best available, and if the result is inside or outside the best cone.
|
|
|
|
|
|
|
protected: virtual void spl_sur::operator*=
(
|
|
|
SPAtransf const&
|
// transform
|
|
|
);
|
|
|
Transforms this spline by the specified transform.
|
|
|
|
|
|
|
protected: virtual logical spl_sur::operator==
(
|
|
|
subtype_object const&
|
// object sub-type
|
|
|
) const;
|
|
|
Tests two surfaces for equality. This does not guarantee to find all effectively equal surfaces, but it does guarantee that different surfaces are correctly identified as different.
|
|
|
|
|
|
|
protected: virtual SPApar_pos spl_sur::param
(
|
|
|
SPAposition const&,
|
// given point
|
|
|
SPApar_pos const&
|
// guess parameter
|
|
|
|
= * (SPApar_pos* ) NULL_REF
|
|
|
) const = 0;
|
|
|
Finds the parameter values of a point on a 3D B-spline surface, iterating from the given parameter values, if supplied.
|
|
|
|
|
|
|
public: double
|
|
|
spl_sur::param_period_u () const;
|
|
|
Returns the
u period of a periodic parametric surface, zero if the surface is not periodic in the
u direction.
|
|
|
|
|
|
|
public: double
|
|
|
spl_sur::param_period_v () const;
|
|
|
Returns the
v period of a periodic parametric surface, zero if the surface is not periodic in the
v direction.
|
|
|
|
|
|
|
public: SPApar_box spl_sur::param_range
(
|
|
|
SPAbox const&
|
// object space box
|
|
|
|
= * (SPAbox* ) NULL_REF
|
|
|
) const;
|
|
|
Return the principal parameter range of a parametric surface in both u and
v-parameter directions. For a nonparametric surface, the range is returned as the empty interval or box.
|
|
|
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 provided, 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 provided, and the parameter range in some direction is unbounded, then conventionally an empty interval is returned.
|
|
|
|
|
|
|
public: SPAinterval spl_sur::param_range_u
(
|
|
|
SPAbox const&
|
// object space box
|
|
|
|
= * (SPAbox* ) NULL_REF
|
|
|
) const;
|
|
|
Return the principal parameter range of a parametric surface in the
u-parameter direction. For a nonparametric surface, the range is returned as the empty interval or box. 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.
|
|
|
|
|
|
|
public: SPAinterval spl_sur::param_range_v
(
|
|
|
SPAbox const&
|
// object space box
|
|
|
|
= * (SPAbox* ) NULL_REF
|
|
|
) const;
|
|
|
Return the principal parameter range of a parametric surface in the
v-parameter direction. For a nonparametric surface, the range is returned as the empty interval or box. 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.
|
|
|
|
|
|
|
protected: virtual SPApar_vec spl_sur::param_unitvec
(
|
|
|
SPAunit_vector const&,
|
// given unit offset
|
|
|
SPApar_pos const&
|
// given parameter
|
|
|
) const;
|
|
|
Finds the change in the surface parameter corresponding to a unit offset in a given direction at a given position. The position and direction must both lie in the surface.
|
|
|
|
|
|
|
protected: SPApar_pos spl_sur::param_with_cache
(
|
|
|
SPAposition const&,
|
// given position
|
|
|
SPApar_pos const&
|
// return parameter
|
|
|
|
= * (SPApar_pos* )NULL_REF
|
|
|
);
|
|
|
This non-virtual function looks in the cache for a given position. If found it returns the parameter, otherwise it finds the parameter using
param, places it in the cache, and returns it. The
param_with_cache method, rather than
param, should be called by classes derived from
int_cur, so as to get the benefit of caching.
|
|
|
|
|
|
|
public: logical spl_sur::periodic_u
() const;
|
|
|
Determines if a parametric surface is periodic in the
u direction. (i.e. it is smoothly closed, so faces can run over the seam).
|
|
|
|
|
|
|
public: logical spl_sur::periodic_v
() const;
|
|
|
Determines if a parametric surface is periodic in the
v direction. (i.e. it is smoothly closed, so faces can run over the seam).
|
|
|
|
|
|
|
protected: virtual logical spl_sur::planar
(
|
|
|
SPAposition&,
|
// point on surface
|
|
|
SPAunit_vector&
|
// axis direction
|
|
|
) const;
|
|
|
Reports whether a surface is planar.
|
|
|
|
|
|
|
protected: virtual double spl_sur::point_cross
(
|
|
|
SPAposition const&,
|
// given point
|
|
|
SPAunit_vector const&,
|
// normal to plane
|
|
|
SPApar_pos const&
|
// guess parameter
|
|
|
|
= * (SPApar_pos* ) NULL_REF
|
|
|
) const;
|
|
|
Finds the curvature of a cross-section curve of the surface at the point on the surface closest to the given point, iterating from the given parameter values, if supplied. The cross-section is determined by the intersection of the surface with a plane passing through the point on the surface and with the given normal.
|
|
|
|
|
|
|
protected: virtual SPAunit_vector
|
|
|
spl_sur::point_normal (
|
|
|
SPAposition const&,
|
// given point
|
|
|
SPApar_pos const&
|
// guess parameter
|
|
|
|
= * (SPApar_pos* ) NULL_REF
|
|
|
) const;
|
|
|
Finds the normal to the surface at the given point. This method returns exactly 0 if the point is a singularity of the surface where there is no well-defined normal.
|
|
|
|
|
|
|
protected: virtual SPAunit_vector
|
|
|
spl_sur::point_outdir (
|
|
|
SPAposition const&,
|
// given point
|
|
|
SPApar_pos const&
|
// guess parameter
|
|
|
|
= * (SPApar_pos* ) NULL_REF
|
|
|
) const;
|
|
|
Returns a direction that points outward from the surface. This should be the outward normal if the point is not singular, otherwise a fairly arbitrary outward direction.
|
|
|
|
|
|
|
protected: virtual void spl_sur::point_perp
(
|
|
|
SPAposition const&,
|
// given point
|
|
|
SPAposition&,
|
// point returned
|
|
|
SPAunit_vector&,
|
// normal returned
|
|
|
surf_princurv&,
|
// principal curvature
|
|
|
SPApar_pos const&
|
// guess parameter
|
|
|
|
= * (SPApar_pos* ) NULL_REF,
|
|
|
SPApar_pos&
|
// parameter returned
|
|
|
|
= * (SPApar_pos* ) NULL_REF,
|
|
|
logical f_weak
|
// weak flag
|
|
|
|
= FALSE
|
|
|
) const;
|
|
|
Finds the point on the surface nearest to the specified point, and optionally, to the normal and the principal curvatures of the surface at that point. If the surface is parametric, this method also returns the parameter values at the found point.
|
|
|
|
|
|
|
protected: void spl_sur::point_perp_with_cache
(
|
|
|
SPAposition const&,
|
// given point
|
|
|
SPAposition&,
|
// point returned
|
|
|
SPAunit_vector&,
|
// normal returned
|
|
|
surf_princurv&,
|
// principle curvature
|
|
|
SPApar_pos const&
|
// guess parameter
|
|
|
|
= * (SPApar_pos* )NULL_REF,
|
|
|
SPApar_pos&
|
// parameter returned
|
|
|
|
= * (SPApar_pos* )NULL_REF,
|
|
|
logical f_weak
|
// weak flag
|
|
|
|
= FALSE
|
|
|
) const;
|
|
|
This non-virtual function looks in the cache for point perpendicular at the given parameter value. If found it returns them. Otherwise it computes them, puts them in the cache, and returns them. The
point_perp_with_cache method, rather than
point_perp, should be called by classes derived from
spl_sur, so as to get the benefit of caching.
|
|
|
|
|
|
|
protected: virtual void spl_sur::point_prin_curv
(
|
|
|
SPAposition const&,
|
// given point
|
|
|
SPAunit_vector&,
|
// first axis direction
|
|
|
double&,
|
// 1st curvature
|
|
|
|
|
// direction
|
|
|
SPAunit_vector&,
|
// second axis direction
|
|
|
double&,
|
// 2nd curvature
|
|
|
|
|
// direction
|
|
|
SPApar_pos const&
|
// surface
|
|
|
|
= * (SPApar_pos* ) NULL_REF
|
|
|
) const;
|
|
|
Finds the principle axes of curvature of the surface at a specified point, and the curvatures in those directions.
|
|
|
|
|
|
|
protected: virtual void spl_sur::reparam
(
|
|
|
double,
|
// new start u parameter
|
|
|
double,
|
// new end u parameter
|
|
|
double,
|
// new start v parameter
|
|
|
double
|
// new end v parameter
|
|
|
);
|
|
|
Reparameterizes the curve.
|
|
|
|
|
|
|
protected: virtual void spl_sur::reparam_u
(
|
|
|
double,
|
// new start u parameter
|
|
|
double
|
// new end u parameter
|
|
|
);
|
|
|
Reparameterizes the curve in u.
|
|
|
|
|
|
|
protected: virtual void spl_sur::reparam_v
(
|
|
|
double,
|
// new start v parameter
|
|
|
double
|
// new end v parameter
|
|
|
);
|
|
|
Reparameterizes the curve in v.
|
|
|
|
|
|
|
protected: void spl_sur::restore_common_data
();
|
|
|
Restore the data for a
spl_sur from a save file.
|
|
|
if ( restore_version_number >= APPROX_SUMMARY_VERSION )
|
|
read_enum
|
Restore enumeration for save_approx_level.
|
|
if ( level == save_approx_full )
|
|
bs3_surface_restore
|
Restore the surface data
|
|
if (restore_version_number < SPLINE_VERSION)
|
|
|
// No fit tolerance to read
|
|
else
|
|
|
read_real
|
Fit tolerance data
|
|
else if ( level == save_approx_summary )
|
|
summary_bs3_surface::restore
|
Restore the surface data
|
|
read_real
|
Fit tolerance data
|
|
read_enum
|
Restore enumeration for closed_forms for u.
|
|
read_enum
|
Restore enumeration for closed_forms for v.
|
|
read_enum
|
Restore enumeration for singularity_type for u.
|
|
read_enum
|
Restore enumeration for singularity_type for v.
|
|
else
|
|
read_interval
|
Restore u range
|
|
read_interval
|
Restore v range
|
|
read_enum
|
Restore enumeration for closed_forms for u.
|
|
read_enum
|
Restore enumeration for closed_forms for v.
|
|
read_enum
|
Restore enumeration for singularity_type for u.
|
|
read_enum
|
Restore enumeration for singularity_type for v.
|
|
if ( restore_version_number >= DISCONTINUITY_VERSION )
|
|
// Restore the discontinuity information
|
|
discontinuity_info::restore
|
u discontinuities
|
|
|
discontinuity_info::restore
|
v discontinuities
|
|
|
|
|
|
|
protected: void spl_sur::save_as_approx
() const;
|
|
|
Saves an approximation of the
spl_sur.
|
|
|
|
|
|
|
protected: void spl_sur::save_common_data
(
|
|
|
save_approx_level
|
// level that spl_sur
|
|
|
|
|
// is to be stored
|
|
|
) const;
|
|
|
Saves data common to all
spl_surs.
|
|
|
|
|
|
|
protected: virtual void spl_sur::save_data
() const;
|
|
|
Save the information for the
spl_sur to a save file.
|
|
|
|
|
|
|
protected: const eval_sscache_entry*
|
|
|
spl_sur::search_eval_cache (
|
|
|
const SPAposition&
|
// position to evaluate
|
|
|
) const;
|
|
|
Searches the underlying cache for an entry at the given position. Returns the matching eval entry if this is found, or
NULL otherwise.
|
|
|
|
|
|
|
protected: void spl_sur::set_sur
(
|
|
|
bs3_surface,
|
// spline surface
|
|
|
double tol
|
// fit tolerance
|
|
|
|
= -1.0
|
|
|
);
|
|
|
Sets the particular spline surface.
|
|
|
|
|
|
|
protected: virtual void spl_sur::shift_u
(
|
|
|
double
|
// shift value
|
|
|
);
|
|
|
Adjusts the spline surface to have a parameter range increased by the shift value, which may be negative. This method is only used to move portions of a periodic surface by integral multiples of the period.
|
|
|
|
|
|
|
protected: virtual void spl_sur::shift_v
(
|
|
|
double
|
// shift value
|
|
|
);
|
|
|
Adjusts the spline surface to have a parameter range increased by the shift value, which may be negative. This method is only used to move portions of a periodic surface by integral multiples of the period.
|
|
|
|
|
|
|
public: logical spl_sur::singular_u
(
|
|
|
double
|
// constant u-parameter
|
|
|
) const;
|
|
|
Reports whether the surface parameterization is singular at the specified
u parameter value. The only singularity recognized is where every value of the nonconstant parameter generates the same object-space point, and these can only occur at the ends of the parameter range as returned by the functions above. A plane is nonsingular in both directions.
|
|
|
|
|
|
|
public: logical spl_sur::singular_v
(
|
|
|
double
|
// constant u-parameter
|
|
|
) const;
|
|
|
Reports whether the surface parameterization is singular at the specified
v parameter value. The only singularity recognized is where every value of the nonconstant parameter generates the same object-space point, and these can only occur at the ends of the parameter range as returned by the functions above. A plane is nonsingular in both directions
|
|
|
|
|
|
|
protected: virtual int spl_sur::split_at_kinks
(
|
|
|
spl_sur**& pieces,
|
// pieces
|
|
|
logical udir,
|
// u direction or not
|
|
|
double curvature = 0.0
|
// curvature
|
|
|
) const;
|
|
|
Divide a surface into separate pieces which are smooth (and therefore suitable for offsetting or blending). The surface is split at its non-G1 discontinuities, and if it is closed after this, it is then split into two. The split pieces are stored in the pieces argument. The function returns the count of split pieces.
|
|
|
|
|
|
|
protected: logical spl_sur::split_spl_sur_u
(
|
|
|
double approx_par,
|
// approx. param. value
|
|
|
double real_par,
|
// real param. value
|
|
|
spl_sur*,
|
// spare spl_sur
|
|
|
spl_sur* [ 2 ]
|
// resulting pieces
|
|
|
);
|
|
|
Divides a surface into two pieces at the specified parameter value, except that it provides an empty
spl_sur in case it is needed. This method returns
TRUE if the
spl_sur is used; otherwise, it returns
FALSE. This method is not externally called, but it is available for use by the derived class implementation of
split_u.
|
|
|
Typically, the derived class implementations of
split_u/v call these functions with a slightly different parameter to the one that they were originally called with (the new parameter is obtained by relaxing from the split point to the approximating surface, and so can be regarded as the parameter on the approximating surface). This method takes both versions of the parameter.
|
|
|
|
|
|
|
protected: logical spl_sur::split_spl_sur_v
(
|
|
|
double approx_par,
|
// approx. param. value
|
|
|
double real_par,
|
// real param. value
|
|
|
spl_sur*,
|
// spare spl_sur
|
|
|
spl_sur* [ 2 ]
|
// resulting pieces
|
|
|
);
|
|
|
Divides a surface into two pieces at the specified parameter value, except that it provides an empty
spl_sur in case it is needed. This method returns
TRUE if the
spl_sur is used; otherwise, it returns
FALSE. This method is not externally called, but it is available for use by the derived class implementation of
split_v.
|
|
|
Typically, the derived class implementations of
split_u/v call these functions with a slightly different parameter to the one that they were originally called with (the new parameter is obtained by relaxing from the split point to the approximating surface, and so can be regarded as the parameter on the approximating surface). This method takes both versions of the parameter.
|
|
|
|
|
|
|
protected: virtual void spl_sur::split_u
(
|
|
|
double,
|
// parameter value
|
|
|
spl_sur* [ 2 ]
|
// resulting pieces
|
|
|
) = 0;
|
|
|
Divides a surface into two pieces at the specified parameter value. This method returns a new surface for the low-parameter side, and changes the old one to represent the high-parameter side.
|
|
|
|
|
|
|
protected: virtual void spl_sur::split_v
(
|
|
|
double,
|
// parameter value
|
|
|
spl_sur* [ 2 ]
|
// resulting pieces
|
|
|
) = 0;
|
|
|
Divides a surface into two pieces at the specified parameter value. This method returns a new surface for the low-parameter side, and changes the old one to represent the high-parameter side.
|
|
|
|
|
|
|
protected: virtual spl_sur* spl_sur::subset
(
|
|
|
SPApar_box const&
|
// parameter box
|
|
|
);
|
|
|
Constructs a new spline that is a copy of the part of the original within the given parameter bounds, unless this is not a proper subset, when returning the
this pointer, or there is no overlap of the ranges, when returning
NULL. The ranges should not overlap at a single point in either parameter direction--if they do, the whole parameter range in that direction is assumed. This cannot be
const because it sometimes returns
this as a non-const pointer.
|
|
|
|
|
|
|
protected: int spl_sur::summary_nuknots
() const;
|
|
|
Provides read-only access to the
nuknotssummary_data for derived classes.
|
|
|
|
|
|
|
protected: int spl_sur::summary_nvknots
() const;
|
|
|
Provides read-only access to the
nvknotssummary_data for derived classes.
|
|
|
|
|
|
|
protected: const double*
|
|
|
spl_sur::summary_uknots () const;
|
|
|
Provides read-only access to the
uknotssummary_data for derived classes.
|
|
|
|
|
|
|
protected: const double*
|
|
|
spl_sur::summary_vknots () const;
|
|
|
Provides read-only access to the
vknotssummary_data for derived classes.
|
|
|
|
|
|
|
public: bs3_surface spl_sur::sur
() const;
|
|
|
Returns the
bs3_surface approximation.
|
|
|
|
|
|
|
protected: virtual logical spl_sur::test_point_tol
(
|
|
|
SPAposition const&,
|
// given point
|
|
|
double,
|
// test tolerance
|
|
|
SPApar_pos const&
|
// guess parameter
|
|
|
|
= * (SPApar_pos* ) NULL_REF,
|
|
|
SPApar_pos&
|
// actual parameter
|
|
|
|
= * (SPApar_pos* ) NULL_REF
|
|
|
) const;
|
|
|
Tests whether a point lies on the surface, within a user-defined tolerance.
|
|
|
|
|
|
|
protected: virtual char const*
|
|
|
spl_sur::type_name () const = 0;
|
|
|
Returns the string "spl_sur".
|
|
|
|
|
|
|
protected: void spl_sur::update_data
(
|
|
|
bs3_surface
|
// surface for update
|
|
|
);
|
|
|
Updates the range, closure and singularity information from a
bs3_surface.
|
|
|
|
|
|
|
protected: virtual curve* spl_sur::u_param_line
(
|
|
|
double,
|
// constant v-parameter
|
|
|
spline const&
|
// owning surface
|
|
|
) const;
|
|
|
Constructs an iso-parameter line on the surface. A
u-parameter line runs in the direction of increasing
u-parameter, at constant
v. The parameterization in the nonconstant direction matches that of the surface, and it has the range obtained by the use of
param_range_u.
|
|
|
|
|
|
|
protected: virtual curve* spl_sur::v_param_line
(
|
|
|
double,
|
// constant v-parameter
|
|
|
spline const&
|
// owning surface
|
|
|
) const;
|
|
|
Constructs an isoparameter line on the surface. A
v-parameter line runs in the direction of increasing
v-parameter, at constant
u. The parameterization in the nonconstant direction matches that of the surface, and it has the range obtained by the use of
param_range_v.
|
|
Internal Use:
|
deep_copy_elements, full_size
|