sweep_spl_sur
List of: Classes
Subjects: Construction Geometry, SAT Save and Restore, Sweeping
Contents: Kernel

Purpose: Defines the perpendicular sweep of a planar profile curve along a path curve.

Derivation: sweep_spl_sur : spl_sur : subtrans_object : subtype_object : ACIS_OBJECT : -

SAT Identifier: "sweepsur"

Filename: kern/kernel/sg_husk/sweep/swp_spl.hxx

Description: This class defines the perpendicular sweep of a planar profile curve along a path curve. The start of the path is in the plane of the shape curve.


The evaluator for the "sweep" surface type has been redone to remove the restriction on the profile and path curves.


The new equation S(u,v) for the sweep surface is defined below:


S (u,v) = k (u) *M (v)


where



k (u) = w (u) * transpose ( M (start v) )


p (u) = the position of the profile at u


w (u) = p (u) - (the start of the sweep path)



M (v) = the 3 x 3 matrix




with rows { mx (v), my (v), mz (v) }



mx (v) = rail_law (v)


mz (v) = normalized (sweep path tangent at v)


my (v) = mz (v) X mx (v)


M is a frame at v on the sweep path, and k is the vector in the starting frame's coordinate system that points from the start of the sweep path to the profile at u.


When we consider scale, the equation becomes


S (u,v) = k (u) *s (v) * M (v)


where



s (v) = the 3 x 3 matrix




with diagonal equal to { xs (v), ys (v), zs (v) }



and where



"_s" is the scale in the frame's "_" direction


When we consider draft, the equation becomes


S (u,v) = k (u,v) * s (v) * M (v)


where



k (u,v) = p (u,v) - (the start of the sweep path)



and where



p (u,v) is the u position of the profile offset by the draft_law (v)


The profile must be planar if draft is used.

References: KERN curve

BASE SPAinterval, SPAmatrix, SPAposition, SPAunit_vector

LAW law

Data: protected bs3_curve path_bs;

The spline representation of a path curve.


protected bs3_curve profile_bs;

The spline representation of a profile curve.


protected curve *path_curve;

A copy of the path curve.


protected curve *profile_curve;

A copy of the profile curve.


protected SPAinterval draft_domain;

The draft range.


protected law *draft_law;

This is a law that represents the draft angle as a function of the length of the wire, starting at wire length equal to zero for the beginning of the wire.


protected law *rail_law;

This is a law that represents a vector orientation as a function of the length of the wire, starting at wire length equal to zero for the beginning of the wire.


protected law *scale_law;

This is a law that represents xyz scaling as a function of the length of the wire, starting at wire length equal to zero for the beginning of the wire.


protected logical is_path_normal;

The variables to switch on the path type.


protected logical sweep_nor;

A logical variable that is TRUE if the shape is in the plane formed by local_x and local_y; otherwise, it is FALSE.


protected SPAmatrix start_frame;

Start of frame used by the path and rail law. x is the rail, z is the path direction at the start. y = z X x.


protected SPAmatrix start_frame_t;

The transpose of the start_frame.


protected SPAposition path_start;

Start the Frenet Frame, which is defined by the path and the rail curves.


protected SPAunit_vector profile_nor;

The normal vector to the profile.

Constructor: protected: sweep_spl_sur::sweep_spl_sur ();


C++ allocation constructor requests memory for this object but does not populate it.






public: sweep_spl_sur::sweep_spl_sur (


curve const&,
// shape curve


curve const&,
// path curve


law*,
// rail law


law*,
// draft law


law*,
// scale law


SPAinterval const&,
// shape range


SPAinterval const&,
// path range


logical,
// shape perp. to





// path?


bs3_curve help_profile_bs // rail curve



= (bs3_curve) NULL,


bs3_curve help_path_bs
// rail curve



= (bs3_curve) NULL,


SPAunit_vector const&
// unit vector



in_profile_nor
// normal in shape



= * (SPAunit_vector const* ) NULL_REF


);


C++ initialize constructor requests memory for this object and populates it with the data supplied as arguments.


This sweep surface is formed by sweeping the shape along the path curve, with an optional rail curve to specify the twist of the shape curve when it is swept along the path. If the path curve is normal, the path normal must not be NULL. If the path is not planar, a rail curve must be specified.




Destructor: protected: virtual sweep_spl_sur::~sweep_spl_sur ();


C++ destructor, deleting a sweep_spl_sur.



Methods: public: int sweep_spl_sur::accurate_derivs (


SPApar_box const&
// range for derivs



= * (SPApar_box*) NULL_REF


) const;


Calculates the derivatives for the surface.






public: void

sweep_spl_sur::check_for_approx () const;


This function should be used after creating a sweep_spl_sur, to ensure the surface will be valid for downstream operations.






protected: virtual subtrans_object*


sweep_spl_sur::copy () const;


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






protected: void


sweep_spl_sur::curve_add_discontinuities ();


Calculates discontinuity information from the generating curves and adds it to the sweep surface.






protected: virtual void sweep_spl_sur::debug (


char const*, // class-identifying line


logical, // brief output?


FILE* // file name


) const;


Prints out a class-specific identifying line to standard output or to the specified file.






protected: void sweep_spl_sur::debug_data (


char const*, // class-identifying line


logical, // brief output?


FILE* // file name


) 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 use its parent's instead. A string argument provides the introduction to each displayed line after the first, and a logical sets brief output (normally removing detailed subsidiary curve and surface definitions).






public: virtual spl_sur* sweep_spl_sur::deep_copy (


pointer_map* pm // list of items within



= NULL // the entity that are




// already deep copied


) const;


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.






protected: virtual int sweep_spl_sur::evaluate (


SPApar_pos const& uv,
// parameter


SPAposition& xyz,
// point on surface





// at given parameter


SPAvector** derivs,
// array of points





// to vector


int number_of_derivs,
// no. of derivatives





// required


evaluate_surface_quadrant // location to



quadrant
// evaluate


) const;


Calculates derivatives of any order up to the number requested, and stores them in vectors provided by the user. It returns the number of derivatives it was able to calculate. (In most circumstances, this will be the number of derivatives requested.) Lower order derivatives will be evaluated directly and with reasonable accuracy; higher derivatives will be automatically calculated by finite differencing. The accuracy of the higher derivatives decreases with the order of the derivative, while the computing 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 large enough to contain all the derivatives of that order; i.e., 2 for the first derivatives, 3 for the second, etc.






protected: virtual double sweep_spl_sur::eval_cross (


SPApar_pos const&, // parametric position


SPAunit_vector const& // curve direction


) const;


Finds the curvature of a cross-section curve of the surface at the point on the surface with the specified parameter values. The cross-section curve is defined as the intersection of the surface with a plane passing through the point on the surface and normal to the specified direction, which must lie in the surface.






protected: virtual SPAunit_vector


sweep_spl_sur::eval_normal (


SPApar_pos const& // parametric position


) const;


Finds the normal to the surface at the point with the specified parameter values.






protected: virtual void


sweep_spl_sur::eval_prin_curv (


SPApar_pos const&, // parametric position


SPAunit_vector&, // first curvature axis




// direction


double&, // curvature in first




// direction


SPAunit_vector&, // second curvature axis




// direction


double& // curvature in the 2nd




// direction


) const;


Finds the principal axes of curvature of the surface at a point with the specified parameter values and curvatures in those directions.






public: virtual law*


sweep_spl_sur::get_draft () const;


Returns the draft law for the sweep.






public: virtual curve*


sweep_spl_sur::get_path () const;


Returns the sweep path curve.






public: virtual sweep_path_type


sweep_spl_sur::get_path_type () const;


Returns the sweep path type.






public: virtual curve* sweep_spl_sur::get_profile (


double param // parameter location


) const;


Evaluates the curve at the given parameter location.






public: virtual law*


sweep_spl_sur::get_rail () const;


Returns a pointer to the sweep rail law.






public: virtual law*


sweep_spl_sur::get_scale () const;


Returns a pointer to the sweep scale law.






public: logical sweep_spl_sur::helix (


spline const& owner, // starting surface


SPAvector& axis // axis start direction



= * (SPAvector* )NULL_REF,


SPAposition& root // axis start position



= * (SPAposition* )NULL_REF,


double& pitch // thread pitch



= * (double* )NULL_REF,


double& radius // radius of helix



= * (double* )NULL_REF,


logical& right_handed // TRUE is right handed



= * (logical* )NULL_REF


) const;


Sweeps a helical surface.






public: static int sweep_spl_sur::id ();


Returns the ID for the sweep_spl_sur list.






protected: virtual void sweep_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 void sweep_spl_sur::operator*= (


SPAtransf const& // transformation


);


Transforms the sweep by the specified transform.






protected: logical sweep_spl_sur::operator== (


subtype_object const& // sweep_spl_sur


) const;


Tests 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 sweep_spl_sur::param (


SPAposition const&,
// given point


SPApar_pos const&
// parameter guess



= * (SPApar_pos* ) NULL_REF


) const;


Finds the parameter values of a point on the surface.






protected: virtual SPApar_vec


sweep_spl_sur::param_unitvec (


SPAunit_vector const&, // direction


SPApar_pos const& // parametric position


) const;


Finds the change in the surface parameter corresponding to a unit offset in a given direction at a given uv, the direction lying in the surface.






public: virtual logical


sweep_spl_sur::planar_profile () const;


Checks whether the sweep profile is planar.






public: virtual logical


sweep_spl_sur::planar_profile (



SPAunit_vector& norm // normal to profile



) const;


Checks whether the sweep profile is planar and returns a vector normal to the profile.






protected: virtual SPAunit_vector


sweep_spl_sur::point_normal (


SPAposition const&,
// point


SPApar_pos const&
// parameter guess



= * (SPApar_pos* ) NULL_REF


) const;


Finds the normal to the surface at a point on the surface nearest to the specified point.






protected: virtual void


sweep_spl_sur::point_prin_curv (


SPAposition const&,
// given point


SPAunit_vector&,
// 1st axis direction


double&,
// curvature in first





// direction


SPAunit_vector&,
// 2nd axis direction


double&,
// curvature in 2nd





// direction


SPApar_pos const&
// parametric guess



= * (SPApar_pos* ) NULL_REF// supplied


) const;


Finds the principle axes of curvature of the surface at a specified point and the curvatures in those directions.






public: curve const& sweep_spl_sur::profile () const;


Returns the sweep profile curve.






protected: void sweep_spl_sur::restore_data ();


Restore the data for a sweep_spl_sur from a save file.


read_logical // path normal, "angled" or "normal"

restore_curve // profile curve

restore_curve // path curve

read_logical // sweep normal, "angled" or "normal"

read_vector // profile normal

read_position // path start position

read_vector // x-vector

read_vector // y-vector

read_vector // z-vector

if ( restore_version_number < APPROX_SUMMARY_VERSION )

read_real // low point of u interval

read_real // high point of u interval

read_real // low point of v interval

read_real // high point of v interval

else // else

read_real // low point

read_real // high point

read_real // start draft distance

read_real // end draft distance

if(restore_version_number >= LAW_VERSION)

restore_law // rail law

restore_law // draft law

restore_law // scale law

restore_common_data // common surface data






public: virtual void sweep_spl_sur::save () const;


Saves an approximation of the surface, or calls the subtype object's save method.






public: virtual void


sweep_spl_sur::save_data () const;


Save the information for the sweep_spl_sur to a save file.






protected: virtual void sweep_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, so shift_v is never used.






protected: virtual void sweep_spl_sur::shift_v (


double // shift value


);


This method is never used because shift_u and shift_v are designed to move portions of a periodic surface by integral multiples of the period. Refer to shift_u for more information.






protected: virtual void sweep_spl_sur::split_u (


double, // u-parameter value


spl_sur* [ 2 ] // returned split




// surfaces


);


Divides a surface into two pieces at the specified parameter value. It the split occurs at the end of the parameter range, the spl_sur returns as the appropriate half (in increasing parameter order), and the other is NULL; otherwise a new spl_sur is used for one part, and the old one is modified for the other part.






protected: virtual void sweep_spl_sur::split_v (


double, // v-parameter value


spl_sur* [ 2 ] // returned split




// surfaces


);


Divides a surface into two pieces at the specified parameter value. It the split occurs at the end of the parameter range, the spl_sur returns as the appropriate half (in increasing parameter order), and the other is NULL; otherwise a new spl_sur is used for one part, and the old one is modified for the other part.






protected: virtual logical


sweep_spl_sur::test_point_tol (


SPAposition const&,

// given point


double,

// tolerance


SPApar_pos const&

// param guess



= * (SPApar_pos* ) NULL_REF,


SPApar_pos&

// actual param



= * (SPApar_pos* ) NULL_REF


) const;


Tests whether a point lies on the surface.






public: virtual int sweep_spl_sur::type () const;


Returns the type of sweep_spl_sur.






public: virtual char const*


sweep_spl_sur::type_name () const;


Returns a string "sweepsur".

Internal Use: full_size




Related Fncs: is_path_planar, restore_sweep_spl_sur
PDF/KERN/37CLSR.PDF
HTM/DATA/KERN/KERN/37CLSR/0016.HTM