Parameter Space Curve

From DocR21

Jump to: navigation, search

A parameter space curve is a two-dimensional curve that lies in the parameter space of a surface. A parameter space curve should not be confused with a three-dimensional curve that is based upon a parameter space curve.

Contents

The Parameter Space of a Surface

Each type of surface in ACIS has a parameter space representation, even analytic surfaces. (Analytic surfaces have a parametric form.) Although each surface exists in a three-dimensional space, sometimes referred to as object space or xyz-space, there is also a two-dimensional representation of each surface in parameter space or uv-space. Given a (x,y,z) point on a surface, it is possible to find a corresponding (u,v) point in parameter space. Alternatively, given a (u,v) point in parameter space, it is possible to find the corresponding (x,y,z) point on the surface. This is sometimes referred to as mapping points between the spaces. The calculation of object space points and derivatives on a surface is often called evaluating a surface. The inverse of this operation, determining a parameter space location given an object space location, is sometimes called an inverse evaluation.

Each type of surface has a specific range of parameters over which the surface is defined. This parameter range defines the minimum and maximum values for the u and v parameters. Some surfaces are periodic in one or both parametric directions. This means that more than one parametric location will map to the same point on the surface. For example, a cylinder is periodic in the v-direction, with a period of . This means that two parametric locations that differ by a multiple of in the v-parameter will map to the same point on the surface. In other words, the (u,v) location (0,0) maps to the same point on the surface as (0,), (0,), and (0,). Periodic surfaces have what is often called a principal parameter range (or principal range for short.) When a point on a periodic surface is mapped into parameter space, there are an infinite number of parametric space points to which it could map. To resolve this ambiguity, when an object space point on a periodic surface is mapped into parameter space, it will always map into the principal parameter range. The length of the principal parameter range in the periodic direction is one period. For a cylinder the principal parameter range in the v-direction is [ − π, π). Thus, the point on the surface of the cylinder that maps to (0,0) will always map to (0,0) never to (0,), (0,), or (0,). It is possible for the parameter range of a surface to be restricted to a smaller range than the default range. This is called "subsetting" a surface. (This increases the efficiency of geometric calculations because they do not need to operate upon large or infinite surfaces.) In the case of a periodic surface, the subsetted range does not need to be within the principal range. For more information about subsetting, refer to Subsetting.

Surface Mapping

A plane is, by default, an infinite surface. Each (x,y,z) point on an infinite plane maps to a unique (u,v) point in parameter space. Similarly, each (u,v) point in parameter space maps to a unique (x,y,z) point in object space. This one-to-one correspondence is guaranteed only for planar surfaces. All other surface types may be periodic or have singularities, which allows multiple (u,v) points in parameter space to map to the same (x,y,z) point in object space. The figure to the right illustrates the mapping between object space and parameter space for a point on a plane.

A Plane in Object Space and Parameter Space

The mapping between object space and parameter space is slightly different for a sphere. A sphere is periodic in the v-parameter direction, and has singularities at the minimum and maximum u-parameter values. The principal range of a sphere is [-\tfrac{\pi}{2}, \tfrac{\pi}{2}] in u and [-\pi\,\!, \pi\,\!) in v. The parametric singularities at the north and south poles of a sphere mean that the u = -\tfrac{\pi}{2} and u = \tfrac{\pi}{2} lines in parameter space map into single points in object space. Although the mappings are different for spheres and planes, the concept remains the same: points in object space can be mapped into parameter space and vice versa.

A Sphere in Object Space and Parameter Space

The principal range of a non-degenerate torus is [-\pi\,\!, \pi\,\!) in u and [-\pi\,\!, \pi\,\!) in v. It is periodic in both the u and v directions, suggesting that any (u,v) location can be mapped into the principal range. Degenerate tori have reduced ranges in the u-direction and have singularities at the minimum and maximum u-parameter values, but they are still periodic in the v-direction.

Note: This is similar to a sphere. In fact, a degenerate torus can be spherical and it would have identical parameterization to a sphere.

A Torus in Object Space and Parameter Space

A cone is periodic only in the v-direction, with a period of . In the u-direction the parameter range is infinite if the cone is a cylinder, or it is semi-infinite if the cone is tapered; that is, if an apex exists. (A conical surface represents the portion of the surface on one side of the apex, a single cone.) A conical surface will have a singularity if and only if the apex of the cone is within the parameter range of the surface. The figure to the right depicts a subsetted parameter range for a cone. In this case the parameter range has been subsetted such that consists only of the portion of the surface between the base ellipse and the upper ellipse. (If unsubsetted, the default parameter range in the u-direction would have extended from -infinity to the apex.)

A Cone in Object Space and Parameter Space

A spline may be open, closed, or periodic, in either the u or v directions, and it may have singularities at the minimum and/or maximum values of either u or v. A spline can precisely represent any of the analytic surface types, or a wide range of other surface shapes, but regardless of the shape of the surface in object space, the concept remains the same: points in object space can be mapped into parameter space and vice versa.

A Spline in Object Space and Parameter Space

Parameter Space Curves

In addition to mapping individual points between object space and parameter space, you can also map a curve between object space and parameter space. In the case of a plane: a straight line segment in object space will map into a straight line segment in parameter space, a circle in object space will map into a circle in parameter space, and an arbitrary curve in object space will map into a similar curve in parameter space. The only difference will be a possible scaling. This is quite different with other surface types. For other surface types the shape, length, and form of the curve can be very different in parameter space and object space. For instance, with a sphere and torus a straight line segment in parameter space (at a constant u or v value) will map into a circular arc in object space. In fact, an open straight line segment in parameter space can map into a periodic full circle in object space. For an elliptical cone, a constant u line segment in parameter space will map into a elliptical arc in object space, whereas a constant v line segment in parameter space will map into a straight line segment in object space. The figure below illustrates the mapping between parameter space and object space for a curve on a spline surface. The curve is periodic in both spaces, but its shape and length are somewhat different because of the shape of the surface. A curve that exists in the parameter space of a surface is referred to as a parameter space curve.

A Curve in Object Space and Parameter Space

Representations of Parameter Space Curves in ACIS

The Classes

There are multiple representations for parameter space curves in ACIS and several types of objects are used to represent parameter space curves in ACIS. The two primary classes for representing parameter space curves are the pcurve and PCURVE classes. The implementation of these geometry classes is similar to the intcurve and INTCURVE classes, but there are some differences too. As an example of a similarity that is also a difference, a bs2_curve is used to represent a two-dimensional B-spline curve, much as a bs3_curve is used to represent a three-dimensional B-spline curve.

There are multiple flavors of pcurves, just as there are multiple flavors of intcurves. (A pcurve is based upon a par_cur, similar to the way an intcurve is based upon an int_cur. This allows efficient copying, reduces the size of the ACIS model, and shelters applications from changes to the underlying geometric definitions.) The two primary flavors of pcurves are explicit and implicit. An explicit pcurve contains pointers to a two-dimensional B-spline curve that lives in the parameter space of a surface (a bs2_curve) and a surface. An implicit pcurve contains a pointer to an intcurve, whose definition contains a bs2_curve and a surface. The interface to these two pcurve flavors is the same, so an application developer generally does not need to know which flavor of pcurve exists.

There are also two flavors of PCURVEs: one flavor contains a pcurve (this is referred to as a private definition) and the other flavor refers to a bs2_curve and surface underlying an intcurve (this is referred to as a shared definition.) The PCURVE class is derived from the ENTITY class; therefore, a PCURVE is part of the persistent model and it inherits Model Management capabilities from the ENTITY class. The interface to these two flavors of PCURVEs is slightly different; therefore, an application developer may need to distinguish between them. For additional information on the interface to these flavors, refer to The Interface below.

A bs2_curve represents a two-dimensional B-spline curve that lives in the parameter space of a surface. Its implementation is very similar to a bs3_curve, which is a three-dimensional B-spline curve that resides in object space. A bs2_curve is not a class: it is typedef'ed as a pointer to a class. Thus, when a function uses a bs2_curve as an argument or a return type, it is not passing an object by value, it is passing a pointer. For more information on bs2_curves, refer to Spline Interface Objects.

To make a 3D curve based on a parameter space curve, refer to the article HowTo:Make a 3D curve based on a parameter space curve.

Extensions of a parcur intcurve are created by extending the parameter space curve and mapping the extended curve into object space. This may not create a linear extension in object space. For more information on extending curves, refer to Extending Curves.

Background

Given two representations for the same curve lying in a surface (one in parameter space and one in object space), one must be the primary and one must be the secondary. (The secondary representation is based upon and calculated from the primary representation.) In ACIS, the three-dimensional curve is typically the primary representation; therefore, the parameter space curve is usually a secondary representation. More precisely, a parameter space curve is usually a B-spline approximation to the precise parameter space representation of the three-dimensional curve.

The approximate parameter space curve (the bs2_curve) often is used by algorithms to determine the "true" surface parameter values \bold{}(u,v) corresponding to object space points \bold{}(x,y,z) on the curve. It does this by using the parameter value \bold{}(t) on the object space curve to evaluate the bs2_curve giving an approximation to the surface parameter values \bold{}(\hat u,\hat v) for iterative refinement. For this reason, a bs2_curve must always have the same parameter range as its associated curve (or be the subset of that range used by a coedge), and its internal parameterization must be similar (though not necessarily identical) to that of the curve.

A Private Definition: Consider the curve, surface, and parameter space curve in the previous figure A Curve in Object Space and Parameter Space. Given the surface and the curve lying on the surface (to within some positional tolerance), it is possible to calculate an approximation to the parameter space curve by mapping a set of points on the curve (which are also points on the surface) into the parameter space of the surface, and then interpolating these parameter space points with a two-dimensional B-spline curve (a bs2_curve.) The data needed to calculate the bs2_curve are the surface and the curve. The data needed to represent and evaluate the approximation to the parameter space curve are the surface and the bs2_curve. The pcurve class encapsulates this data and provides an interface to it.

A Shared Definition: The figure below depicts two sheet bodies that intersect. When the intersection of the two surfaces is calculated, the intersection curve is returned as a procedural, surface-surface intersection curve. (This is a particular flavor of intcurve.) This curve contains an approximation for the three-dimensional intersection curve (a bs3_curve), the two surfaces being intersected, and an approximation for the curve in the parameter space of each surface (bs2_curves.) Thus, a surface-surface intersection curve contains enough information to represent two pcurves. (A surface-surface intersection curve is not the only flavor of intcurve that contains surface and parameter space curve data. Many flavors do.) To prevent the creation of unnecessary pcurves, ACIS allows a PCURVE to directly reference the surfaces and bs2_curves underlying an intcurve. If the two sheet bodies in the figure below were united, the intersection EDGE would have four COEDGES (one on each FACE meeting at the EDGE.) Each COEDGE would have a PCURVE that would represent the intersection curve in the parameter space of the SURFACE underlying the FACE. The direction of each PCURVE would be the same as the COEDGE. Because the two COEDGES on the same SURFACE are in opposite directions, there is actually a need four different PCURVEs. To achieve this the PCURVE class contains sense information when it uses the data underlying an intcurve: this specifies if the PCURVE is in the same direction or the opposite direction as the parameter space curve in the intcurve. Thus, each of the four parameter space curves can be represented by a PCURVE that references data underlying the intersection curve. There is no need for a pcurve in this case. Of course as was mentioned above, a pcurve also can reference data underlying an intcurve in a manner similar to a PCURVE; therefore, it would be possible to create PCURVEs that are based upon pcurves that reference the intcurve data.

Two Intersecting Sheet Bodies

Implementation Details

PCURVEs are the geometry of a COEDGE; however, the only cases in which ACIS requires a PCURVE on a COEDGE are when:

  • The SURFACE underlying the FACE of the COEDGE is a SPLINE, or
  • The COEDGE is a tolerant COEDGE. (For details, refer to Tolerant Modeling.)

For all other cases, a PCURVE is optional. As an application developer, you may construct one for your application, but it most likely will not be used by ACIS algorithms.

Parameter space curves are usually considered to be a secondary representation, generated from the curve and the surface. That is, the parameter space curves can be deleted and reconstructed using the curve and surface information. There are two cases in which the parameter space curve is considered to be the primary representation (not an approximation) and cannot be deleted and reconstructed. These are when:

  • The curve is an intcurve that is based upon the parameter space curve, or
  • The COEDGE associated with the PCURVE is tolerant.

Although object space points map into the principal range of a periodic surface, parameter space curves may extend outside the principal range. For instance, a helical curve on a periodic surface with no seam (for example, a cylindrical surface) could span many periods. That is, its range in the periodic direction could be much longer than the principal range of the surface.

Parameter space curves generally are aligned head-to-tail, forming a closed loop in parameter space, but not always. As shown in figure Pcurves on a Face with a Singularity, it is possible for the loop of parameter space curves to be open if there is a singularity on the surface. In this case the FACE is bounded by three EDGEs, each with a COEDGE and a PCURVE. There is no EDGE, COEDGE, or PCURVE bounding the FACE along the maximum v-parameter line. It is also possible that a parameter space curve could be offset by a period on a periodic face, as shown in figure Potential Pcurves on a Periodic Face. This figure depicts the PCURVE denoted by P3 as being offset from the other three PCURVEs. It is also possible that one loop of parameter space curves to be offset relative to another loop of parameter space curves on a periodic face, as shown in figure Potential Pcurves on a Periodic Face with a Hole. This figure depicts the PCURVE denoted by P4 as being offset from the other four PCURVEs.

Pcurves on a Face with a Singularity
Potential Pcurves on a Periodic Face
Potential Pcurves on a Periodic Face with a Hole

The Interface

Some of the most commonly used functions to construct, destruct, and query PCURVEs are enumerated below.

To create or remove PCURVEs:

void sg_add_pcurve_to_coedge(COEDGE*, ...)
void sg_add_pcurves_to_entity(ENTITY*, ...)
void sg_rm_pcurves_from_entity(ENTITY*, ...)

Important: Removing necessary PCURVEs with sg_rm_pcurves_from_entity can corrupt your model. Use this function with extreme caution.


To obtain the PCURVE pointer from a COEDGE:

PCURVE* COEDGE::geometry() const

To obtain a copy of a private pcurve from a PCURVE, or to construct a pcurve for a PCURVE without a private pcurve:

pcurve PCURVE::equation() const

Note:

  • PCURVE::equation() returns a pcurve that has the same direction as the PCURVE, even if the PCURVE is negated with respect to its underlying definition.
  • PCURVE::equation() returns a pcurve by value, not by reference.


To obtain the bs2_curve from a pcurve:

bs2_curve pcurve::cur() const

To obtain parameter space bounding boxes for a pcurve or FACE:

SPApar_box pcurve::bound() const
void sg_get_face_par_box(FACE*, SPApar_box&)

Combining the parameter space bounding boxes of all the PCURVEs on a FACE that lies on a periodic surface or a surface with singularities may not give the same result as calling sg_get_face_par_box. This function considers periodicity and singularities when computing parameter-space boxes for faces. In other words, it takes into account the issues mentioned in Implementation Details.

To generate a new parameter space B-spline approximation (a bs2_curve) for a COEDGE, to a specific tolerance:

outcome api_approx(COEDGE const *, bs2_curve&, ...)

For more information on the use of api_approx, refer to Approximations. For more information on the procedural interface to bs2_curves, refer to bs2_curve-related Functions.

To determine if a PCURVE has a private or shared definition, you must examine its definition type. The definition type indicates whether the PCURVE contains a pcurve or uses the first or second parameter space curve in an intcurve. The definition type is an integer with valid values {-2, -1, 0, 1, 2}. If the value of the definition type is 0, the PCURVE contains a private pcurve. Non-zero values indicate the PCURVE uses the first or second parameter space curve in an intcurve. A value of 1 or 2 indicates the PCURVE uses the first or second parameter space curve in an intcurve in the forward direction. A value of -1 or -2 indicates the PCURVE uses the first or second parameter space curve in an intcurve in the reversed direction. The value of the definition type is returned by the index member function.

int PCURVE::index() const 

There are multiple member functions to evaluate a pcurve. These include the four listed below:


void pcurve::eval(double param, 
                  SPApar_pos &par_pos, 
                  SPApar_vec &first_deriv = *(SPApar_vec*) NULL_REF, 
                  SPApar_vec &second_deriv = *(SPApar_vec*) NULL_REF) const 
SPApar_vec pcurve::eval_deriv(double param) const 
SPApar_pos pcurve::eval_position(double param) const 

SPApar_pos pcurve::eval_position(SPAposition const &pos, 
                                 double param, 
                                 logical use_point_perp = FALSE) const 

The first three functions listed above evaluate the geometric definition underlying the pcurve, which is typically an approximation to "true" parameter space representation of the EDGE's curve projected into the parameter space of the surface. The evaluation of the approximate parameter space curve is sufficient for most applications. Moreover, in the case of tolerant edges, the pcurve is considered to be precise, so these three functions provide precise evaluations for parameter space curves on tolerant edges.

The fourth member function calculates the "true" parametric location corresponding to the object space location and parameter value. This function is used only when an application must calculate the precise projection of the EDGE's curve onto a surface. This function should be used to evaluate the pcurves on non-tolerant edges only. The code snippet below demonstrates the use of this function.

COEDGE *my_coedge;
double t;  // The parameter
EDGE *edge = my_coedge->edge();
PCURVE *PC = my_coedge->geometry();
const curve &cur = edge->geometry()->equation();
pcurve pc = PC->equation();
SPAposition cur_pos = cur.eval_position( t );
SPApar_pos pcur_pos = pc.eval_position( cur_pos, t, FALSE );

3D Curves Based Upon Parameter Space Curves

In the previous sections it was said that a parameter space curve is usually a secondary representation. In some cases a parameter space curve can be the primary representation for a curve. In such a case, the parameter space curve is considered to be "precise." In other words, the two-dimensional B-spline curve lying in the parameter space of a surface is not an approximation: it is part of the primary definition of a curve. The three-dimensional curve has a procedural definition based upon the two-dimensional B-spline curve and its associated surface. Each point on the curve is defined by mapping a point on the two-dimensional B-spline curve onto its surface. There is a particular flavor of intcurve that is based upon this functionality, a parcur, which is supported by the par_int_cur class. (A parcur should not be confused with a par_cur, which is a class used in the definition of a pcurve.)

A parcur intcurve is commonly used to represent a boundary of a parametric surface. For instance, if a model contained an untrimmed spline surface (without singularities), there would be four pcurves in the model corresponding to the four boundaries of the surface. Each of these pcurves would be an isoparameter line in parameter space. The curves corresponding to each of these pcurves could be represented by a parcur. If you wanted an array of object space curves corresponding to isoparameter lines on a given surface, parcurs provide a means to easily represent them. (An isoparameter curve for a surface can be constructed with surface::u_param_line or surface::v_param_line. Edges representing isoparameter curves can be constructed with api_face_u_iso, api_face_v_iso, or api_face_nu_nv_isolines.)

Extensions of a parcur intcurve are created by extending the parameter space curve and mapping the extended curve into object space. This may not create a linear extension in object space. For more information on extending curves, refer to Extending Curves.

For a discussion of how to construct a parcur intcurve, refer to HowTo:Make a 3D curve based on a parameter space curve.

See Also

Personal tools
Live