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

Purpose: Defines a planar surface.

Derivation: plane : surface : ACIS_OBJECT : -

SAT Identifier: "plane"

Filename: kern/kernel/kerngeom/surface/pladef.hxx

Description: A plane class defines a plane with a point and a unit vector normal to the plane. Usually, the point chosen to define the plane is near the center of interest. The normal represents the outside of the surface. This is important when a plane is used to define a FACE of a shell or solid.


Four data members describe the parameterization of the plane. For more information about data members, see "Data."


To find the object-space point corresponding to a given (u, v) pair, first find the cross product of the plane normal with u_deriv, negate it if reverse_v is TRUE, and call it v_deriv. Then the evaluated position is:


pos = root_point + u* u_deriv + v* v_deriv


When the plane is transformed, u_deriv is transformed in the usual way, along with the root point and normal, and reverse_v is inverted if the transform includes a reflection. When the plane is negated, the direction of the normal is reversed, and reverse_v is inverted.


When a plane is constructed, u_deriv is automatically generated to be a fairly arbitrary unit vector perpendicular to the normal, and reverse_v is set FALSE. If the normal is of zero length, or if the plane is constructed using the raw constructor with no normal, u_deriv is set to be a zero vector, and the arbitrary direction is generated whenever a parameter-based function is called. Whenever an application changes the normal directly, it should also ensure that u_deriv is perpendicular to it.


In summary, planes are:


- Not true parametric surfaces.

- Open in u and v.

- Not periodic in either u or v.

- Not singular at any u or v.

References: by KERN PLANE

BASE SPAposition, SPAunit_vector, SPAvector

Data: public logical reverse_v;

By default the v-direction is the cross product of normal with u_dir. If this is TRUE, the v-direction must be negated. This is set to TRUE if the parameterization is left-handed with respect to the surface normal, or FALSE if it is right-handed. A right-handed parameterization is such as make the surface normal the direction of the cross product of the u and v-directions, respectively.


public SPAposition root_point;

A point though which the plane passes.


public SPAunit_vector normal;

The normal to the plane. Conventionally set to a NULL unit vector to indicate that the plane is undefined.


public SPAvector u_deriv;

The direction in the plane of constant v-parameter lines, with a magnitude to convert dimensionless parameter values into distances. This vector gives the direction and scaling of u-parameter lines.

Constructor: public: plane::plane ();


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






public: plane::plane (


plane const& // plane name


);


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






public: plane::plane (


SPAposition const&, // position name


SPAunit_vector const& // unit vector name


);


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




Destructor: public: plane::~plane ();


C++ destructor, deleting a plane.



Methods: public: virtual int plane::accurate_derivs (


SPApar_box const&
// parameter



= * (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 surface. For a plane, all surface derivatives can be obtained accurately.






public: virtual SPAbox plane::bound (


SPAbox const&,
// box name


SPAtransf const&
// transformation



= * (SPAtransf* ) NULL_REF


) const;


Returns a box around the surface.






public: virtual SPAbox plane::bound (


SPApar_box const&

// parameter






// space box



= * (SPApar_box* ) NULL_REF,


SPAtransf const&

// transformation



= * (SPAtransf* ) NULL_REF


) const;


Returns a box around the surface.






public: virtual logical plane::closed_u () const;


Reports if the surface is closed, smoothly or not, in the u-parameter direction. A plane is open in both directions.






public: virtual logical plane::closed_v () const;


Reports if the surface is closed, smoothly or not, in the v-parameter direction. A plane is open in both directions.






public: virtual void plane::debug (


char const*, // debug leader string


FILE* // file pointer



= debug_file_ptr


) const;


Prints out details of plane.






public: virtual surface* plane::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.






public: virtual void plane::eval (


SPApar_pos const&, // parameter position


SPAposition&, // position


SPAvector* // first derivatives -



= NULL, // array of length 2,




// in order xu, xv


SPAvector* // second derivatives -



= NULL // array of length 3,




// in order xuu, xuv, xvv


) const;


Finds the point on the plane corresponding to the given parameter values. It may also return the first and second derivatives at this point.






public: virtual int plane::evaluate (


SPApar_pos const&,

// param position


SPAposition&,

// position


SPAvector**

// array of ptrs



= NULL,


int


// number of



= 0,

// derivatives






// required (nd)


evaluate_surface_quadrant
// the evaluation



= evaluate_surface_unknown // location,






// which






// is not used


) const;


Finds the principal axes of curvature of the surface at a point with given parameter values. The function also determines curvatures in those directions. 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.






public: virtual double plane::eval_cross (


SPApar_pos const&, // parameter position


SPAunit_vector const& // direction


) const;


Finds the curvature of a cross-section curve of the plane at the point with given parameter values. The cross-section curve is given by the intersection of the surface with a plane passing through the point and with given normal direction.






public: virtual SPAunit_vector plane::eval_normal (


SPApar_pos const& // parameter position


) const;


Returns the surface normal at a given point on the surface.






public: surf_princurv plane::eval_prin_curv (


SPApar_pos const& param // parameter position


) const;


Finds the principal axes of curvature of the surface at a point with given parameter values. The function also determines curvatures in those directions.






public: virtual void plane::eval_prin_curv (


SPApar_pos const&, // parameter position


SPAunit_vector&, // first axis direction


double&, // curvature in first




// direction


SPAunit_vector&, // second axis direction


double& // curvature in second




// direction


) const;


Finds the principal axes of curvature of the surface at a point with given parameter values. The function also determines curvatures in those directions.






public: virtual curve* plane::get_path () const;


Gets the curve used as a sweeping path. This is NULL for a plane, but the method is included for compatibility with other geometry classes.






public: virtual sweep_path_type


plane::get_path_type () const;


Gets the type of sweeping path used for sweeping a plane.






public: virtual law* plane::get_rail () const;


Returns the sweeping rail for the plane. This is normal to the plane.






public: virtual logical


plane::left_handed_uv () const;


Indicates whether the parameter coordinate system of the surface is right 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.






public: virtual surface* plane::make_copy () const;


Returns a copy of the plane.






public: virtual surface& plane::negate ();


Negates this plane; i.e. reverses the surface normal.






public: virtual surf_normcone plane::normal_cone (


SPApar_box const&,
// parameter bounds


logical
// approximate



= FALSE,
// results OK?


SPAtransf const&
// plane transform



= * (SPAtransf* ) NULL_REF


) const;


Returns a cone bounding the normal direction of the surface. The cone is deemed to have its apex at the origin, and has a given axis direction and (positive) half-angle. If the logical argument is TRUE, then a quick approximation may be found. The approximate result may lie completely inside or outside the guaranteed bound (obtained with a FALSE argument), but may not cross from inside to outside. Flags in the returned object indicate whether the cone is in fact the best available, and if not whether this result is inside or outside the best cone.






public: virtual surface& plane::operator*= (


SPAtransf const& // transformation


);


Transforms this plane by the given transform.






public: plane plane::operator- () const;


Returns a plane being (a copy of) this plane negated; i.e., with opposite normal.






public: virtual logical plane::operator== (


surface const& // surface


) const;


Tests two surfaces for equality. This is not guaranteed to state equal for effectively equal surfaces, but is guaranteed to state not equal if the surfaces are not equal. The result can be used for optimization.






public: virtual SPApar_pos plane::param (


SPAposition const&,
// position


SPApar_pos const&
// parameter position



= * (SPApar_pos* ) NULL_REF


) const;


Finds the parameter values corresponding to a point on a surface.






public: virtual logical plane::parametric () const;


Determines if a plane is parametric. A plane is not a parametric surface, as surface characteristics are easy to calculate without and independent of parameter values.






public: virtual double


plane::param_period_u () const;


Returns the period of a periodic parametric surface, or 0 if the surface is not periodic in the u-parameter or not parametric. A plane is not periodic in both directions.






public: virtual double


plane::param_period_v () const;


Returns the period of a periodic parametric surface, or 0 if the surface is not periodic in the v-parameter or not parametric. A plane is not periodic in both directions.






public: virtual SPApar_box plane::param_range (


SPAbox const& // box name



= * (SPAbox* ) NULL_REF


) const;


Returns the parameter range of a portion of the surface in the bounding box. If a box is provided, the parameter range returned is restricted to a portion of the surface that 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: virtual SPAinterval plane::param_range_u (


SPAbox const& // box name



= * (SPAbox* ) NULL_REF


) const;


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


If a box is provided, the parameter range returned may be restricted to a portion of the surface that 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: virtual SPAinterval plane::param_range_v (


SPAbox const& // box name



= * (SPAbox* ) NULL_REF


) const;


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


If a box is provided, the parameter range returned may be restricted to a portion of the surface that 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: virtual SPApar_vec plane::param_unitvec (


SPAunit_vector const&, // direction


SPApar_pos const& // parameter position


) const;


Finds the rate of change in surface parameter corresponding to a unit velocity in a given object-space direction at a given position in parameter space.






public: virtual logical plane::periodic_u () const;


Reports whether the surface is periodic in the u-parameter direction; i.e., it is smoothly closed, so faces can run over the seam. A plane is not periodic in the u-direction.






public: virtual logical plane::periodic_v () const;


Reports whether the surface is periodic in the v-parameter direction; i.e., it is smoothly closed, so faces can run over the seam. A plane is not periodic in the v-direction.






public: virtual logical plane::planar (


SPAposition&, // Point through which




// the plane passes


SPAunit_vector& // axis direction


) const;


Reports on whether the plane is planar.






public: virtual double plane::point_cross (


SPAposition const&,
// position name


SPAunit_vector const&,
// direction


SPApar_pos const&
// parameter



= * (SPApar_pos* ) NULL_REF


) const;


Returns the curvature of a curve in the surface through a given point normal to a given direction in the surface. The curvature of any curve on a plane is always zero.






public: virtual SPAunit_vector plane::point_normal (


SPAposition const&,
// position


SPApar_pos const&
// parameter position



= * (SPApar_pos* ) NULL_REF


) const;


Returns the surface normal at a given point on the surface.






public: virtual void plane::point_perp (


SPAposition const&,
// given position


SPAposition&,
// position on





// plane


SPAunit_vector&,
// normal





// direction at





// point on plane


surf_princurv&,
// surface principle





// curve


SPApar_pos const&
// param position



= * (SPApar_pos* ) NULL_REF,


SPApar_pos&
// actual position



= * (SPApar_pos* ) NULL_REF,


logical f_weak
// weak flag



= FALSE


) const;


Finds the point on the surface nearest to the given point. It may optionally return the normal to and principal curvatures of the surface at that point. Also returns the parameter values at the found point, if desired.






public: void plane::point_perp (


SPAposition const& pos,
// given position


SPAposition& foot,
// position on plane


SPApar_pos const& param_guess // param position



= * (SPApar_pos* ) NULL_REF,


SPApar_pos& param_actual
// actual position



= * (SPApar_pos* ) NULL_REF,


logical f_weak
// weak flag



= FALSE


) const;


Finds the point on the surface nearest to the given point. It may optionally return the parameter value at that point.






public: void plane::point_perp (


SPAposition const& pos, // given position


SPAposition& foot, // position on plane


SPAunit_vector& norm, // normal direction at




// point on plane


SPApar_pos const& // param position



param_guess // possible position



= * (SPApar_pos* ) NULL_REF,


SPApar_pos& param_actual // actual position



= * (SPApar_pos* ) NULL_REF,


logical f_weak // weak flag



= FALSE


) const;


Finds the point on the surface nearest to the given point. It may optionally return the parameter value at that point.






public: surf_princurv plane::point_prin_curv (


SPAposition const& pos,
// position


SPApar_pos const&
// parameter position



param_guess
//possible parameter



= * (SPApar_pos* ) NULL_REF


) const;


Returns the principal directions and magnitudes of curvature at a given point on the surface. The curvature is zero everywhere on a plane, so the principal directions are rather arbitrary in this case.






public: virtual void plane::point_prin_curv (


SPAposition const&,
// position


SPAunit_vector&,
// direction


double&,
// parameter


SPAunit_vector&,
// direction


double&,
// parameter


SPApar_pos const&
// parameter position



= * (SPApar_pos* ) NULL_REF


) const;


Returns the principal directions and magnitudes of curvature at a given point on the surface. The curvature is zero everywhere on a plane, so the principal directions are rather arbitrary in this case.






public: void plane::restore_data ();


Restore the data for a plane from a save file. The restore_data function for each class is called in circumstances when the type of surface is known and there is one available to be filled in.


read_position Root point

read_unit_vector Normal vector to plane

if (restore_version_number < SURFACE_VERSION)

// Old style

else

read_vector u derivative vector

read_logical reverse v measured with respect to right hand rule: either "forward_v" or "reversed_v"

surface::restore_data
Generic surface data






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


Saves the id then calls save_data.






public: void plane::save_data () const;


Saves the information for a plane to the save file.






public: virtual logical plane::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 non-constant 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 non-singular in both directions.






public: virtual logical plane::singular_v (


double // constant v 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 non-constant 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 non-singular in both directions.






public: virtual logical plane::test_point_tol (


SPAposition const&,

// position


double

// tolerance



= 0,

// value


SPApar_pos const&

// param position



= * (SPApar_pos* ) NULL_REF,


SPApar_pos&

// param position



= * (SPApar_pos* ) NULL_REF


) const;


Tests whether a point lies on the surface, to user-supplied precision. The function may optionally return the parametric position of the nearest point.






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


Returns the type of plane.






public: virtual char const*


plane::type_name () const;


Returns string "plane".






public: virtual logical plane::undef () const;


Classification of a plane.






public: SPAvector plane::u_axis () const;


Gets the u-parameter direction.






public: virtual curve* plane::u_param_line (


double // parameter value


) const;


Constructs a parameter line on the surface.


A u-parameter line runs in the direction of increasing u-parameter, at constant v. The parameterization in the non-constant direction matches that of the surface, and has the range obtained by use of param_range_u or param_range_v appropriately. If the supplied constant parameter value is outside the valid range for the surface, or singularity, a NULL is returned.


Because the new curve is constructed in free store, it is the responsibility of the caller to ensure that it is correctly deleted.






public: virtual curve* plane::v_param_line (


double // parameter value


) const;


Constructs a parameter line on the surface.


A v-parameter line runs in the direction of increasing v, at constant u. The parameterization in the non-constant direction matches that of the surface, and has the range obtained by use of param_range_u or param_range_v appropriately. If the supplied constant parameter value is outside the valid range for the surface, or singularity, a NULL is returned.


Because the new curve is constructed in free store, it is the responsibility of the caller to ensure that it is correctly deleted.

Internal Use: full_size




Related Fncs: restore_cone






friend: plane operator* (


plane const&, // given plane


SPAtransf const& // transform


);


Returns a plane that is (a copy of) the given plane transformed by the given transform.
PDF/KERN/34CLP.PDF
HTM/DATA/KERN/KERN/34CLP/0010.HTM