# Tutorial:ACIS Tutorial 5: Basics of ACIS Geometry (Part 2)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

## Parameter-Space Curves (Pcurves)

Main article: Parameter Space Curve

If an EDGE lies on a FACE, ACIS may contain a representation of the CURVE underlying the EDGE in the parameter space of the SURFACE underlying the FACE. The only cases in which ACIS requires a parameter-space representation of the CURVE are:

• if the SURFACE is a SPLINE, or
• if the EDGE is a tolerant EDGE. (For details, see the technical article Tolerant Modeling.)

For all other cases, a parameter-space representation of a CURVE is optional. That is, for all other cases you may construct one for use by your application, but it most likely will not be used by ACIS algorithms.

With the exception of par_int_cur-based curves (and tolerant edges), parameter-space curves are 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.

The non-persistent class representing parameter-space curves is pcurve, with PCURVE the corresponding persistent class.

### pcurve (lower-case class)

A pcurve is somewhat similar to an intcurve, in the sense that a pcurve is really just a wrapper around a par_cur. This makes it much more efficient to copy and manipulate pcurves. The par_cur class is an abstract base class. There are three classes derived from the par_cur class. These are enumerated below.

par_cur class Description
exp_par_cur An explicit parameter-space curve

(defined by a surface and a bs2_curve)

imp_par_cur An implicit parameter-space curve

(defined by one of the surfaces and bs2_curves underlying an intcurve)

law_par_cur A law-based parameter-space curve

(defined by a surface and a 2-dimensional law)

We have already mentioned the bs2_curve class. A bs2_curve is a 2-dimensional B-spline curve. (It is actually a NURBS curve.) A bs2_curve underlying a par_cur is an approximation to the image of a curve projected into the parameter space of a surface. Because the evaluation of par_curs is based upon the evaluation of their underlying bs2_curves, the accuracy of par_cur (and, therefore, pcurve) evaluations depends upon the accuracy to which the bs2_curves are generated. In other words, pcurves are not procedural curves.

This discussion of par_curs and bs2_curves is intended to familiarize you with some of the terminology and concepts used in ACIS. Most likely, you will never create a par_cur or bs2_curve directly. In fact, most applications do not require direct access to either pcurves or PCURVEs. They will be created and maintained for you as a result of your application's use of higher-level functions.

### PCURVE (upper-case class)

PCURVEs are the geometry underlying COEDGEs, but not all COEDGEs possess PCURVEs. A PCURVE is required only if a COEDGE lies on a SPLINE surface or when the COEDGE is tolerant; otherwise, the PCURVE is optional.

Unlike with CURVEs and SURFACEs, there are no classes derived from the PCURVE class. There is only one PCURVE class. However, there are two fundamentally different types of PCURVEs. A PCURVE may have a private definition, meaning it contains a pcurve, or it may use a surface and bs2_curve underlying an intcurve. This flexibility (using the data underlying an intcurve) allows models to be constructed with fewer explicit pcurves.

### Pcurve-related Functions

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

To create or remove PCURVEs:

```void sg_add_pcurve_to_coedge(COEDGE*, ...)
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 from a PCURVE without a private pcurve:

```pcurve PCURVE::equation() const
```

Note: PCURVE::equation() returns a pcurve by value, not by reference.

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&)
```

We should mention that adding the parameter-space boxes of all the PCURVEs on a FACE that lies on a periodic surface or a surface with singularities may not give you the same result as calling sg_get_face_par_box. You must consider periodicity and singularities when computing parameter-space boxes for faces. Each PCURVE is constructed and maintained independently of other PCURVEs on a given face; therefore, PCURVEs on a periodic surface or a surface with singularities may not meet end to end, implying that PCURVEs on such a surface do not necessarily form a closed loop in parameter space.