Skip to content
Georg Muntingh edited this page Aug 17, 2017 · 26 revisions

Geometric Data Structures

\image html data_structure2.gif "Simplified overview of the geometry class hierarchy"

The figure above shows the main geometry classes in GoTools.

All geometric objects are of type GeomObject. This class has a function instanceType, and by calling this function, it is possible to check the concrete type of a given object. A GeomObject is Streamable, which means that they can be written to and read from a stream (typically a file) in a uniform way. See the GoTools g2-file format documentation for more information on this topic. Similarly, they can be created in a uniform way by the Factory, which is useful when you want to generate objects whose exact kind is unknown at compile time.

Parametric Curves

ParamCurve is the base class for all parametric curves in GoTools and defines a common interface. Many operations do not need to distinguish between different types of parametric curves. A parametric curve has (with some exceptions) the following functionality:

  • operations on the curve
    • Go::ParamCurve::clone clone: make a copy of this curve
    • Go::ParamCurve::subCurve subCurve: create a subcurve of this curve
    • Go::ParamCurve::appendCurve appendCurve: append another curve to this curve
    • Go::ParamCurve::split split: split the curve into two curves at a given parameter
  • operations in the parameter interval
    • Go::ParamCurve::startparam startparam: fetch start parameter
    • Go::ParamCurve::endparam endparam: fetch end parameter
    • Go::ParamCurve::setParameterInterval setParameterInterval: linearly reparametrize the parameter interval
    • Go::ParamCurve::reverseParameterDirection reverseParameterDirection: reverse the parameter interval
  • evaluations
    • Go::ParamCurve::point point: evaluate the curve's position (and perhaps a certain number of derivatives) at a given parameter
    • Go::ParamCurve::uniformEvaluator uniformEvaluator: evaluate the curve's position at a regular set of parameter values
  • geometric information retrieval
    • Go::ParamCurve::length length: compute the length of (a segment of) the curve
    • Go::ParamCurve::estimatedCurveLength estimatedCurveLength: estimate the length of (a segment of) the curve
    • Go::ParamCurve::compositeBox compositeBox: compute a composite box (bounding box) enclosing the curve
    • Go::ParamCurve::directionCone directionCone: compute a directional cone containing all tangent directions of this curve
  • closest point computations
    • Go::ParamCurve::closestPointGeneric closestPointGeneric: compute the closest point on (a segment of) this curve to a specified point --- generic implementation
    • Go::ParamCurve::closestPoint closestPoint: compute the closest point on (a segment of) this curve to a specified point --- specific implementation for each parametric curve type
  • checks for degeneracy, symmetry, and type
    • Go::ParamCurve::isLinear isLinear: check if the curve is linear
    • Go::ParamCurve::isInPlane isInPlane: check if the curve is contained in a plane belonging to a given pencil of planes
    • Go::ParamCurve::isAxisRotational isAxisRotational: check if the curve is axis rotational
    • Go::ParamCurve::isDegenerate isDegenerate: check whether the curve degenerates to a single point
    • Go::ParamCurve::isClosed isClosed: check whether the curve is closed

Parametric Surfaces

Go::ParamSurface ParamSurface is the base class for a parametric surface and defines the common interface for all parametric surfaces. A parametric surface has (with some exceptions) the following functionality:

  • operations on the surface
    • Go::ParamSurface::clone clone: make a copy of this surface
    • Go::ParamSurface::subSurfaces subSurfaces: create subsurfaces of this surface
    • Go::ParamSurface::asSplineSurface asSplineSurface: create a spline surface represented by this surface, if any
    • Go::ParamSurface::outerBoundaryLoop outerBoundaryLoop: fetch the anticlockwise, outer boundary loop of the surface
    • Go::ParamSurface::allBoundaryLoops allBoundaryLoops: fetch the anticlockwise outer boundary loop of the surface, together with clockwise loops of any interior boundaries
    • Go::ParamSurface::getBoundaryInfo getBoundaryInfo: compute the boundary curve segment between two points on the boundary, as well as the cross-tangent curve
    • Go::ParamSurface::mirrorSurface mirrorSurface: reflect the surface through a given plane
    • Go::ParamSurface::getInternalPoint getInternalPoint: fetch an (unspecified) internal point in the surface
    • Go::ParamSurface::constParamCurves constParamCurves: fetch the curve(s) obtained by intersecting the surface with one of its isoparametric curves
    • Go::ParamSurface::nextSegmentVal nextSegmentVal: determine the parameter value of the start of the 'next segment' from a parameter value, along a given parameter direction
    • Go::ParamSurface::turnOrientation turnOrientation: flip the direction of the normal of the surface
    • Go::ParamSurface::getCornerPoints getCornerPoints: fetch surface corners, geometric and parametric points
  • operations in the parameter domain
    • Go::ParamSurface::setParameterDomain setParameterDomain: set the parameter domain to a given rectangle
    • Go::ParamSurface::parameterDomain parameterDomain: fetch the parameter domain
    • Go::ParamSurface::containingDomain containingDomain: fetch a rectangular domain that contains the parameter domain
    • Go::ParamSurface::inDomain inDomain: check if a parameter pair lies in the parameter domain
    • Go::ParamSurface::inDomain2 inDomain2: check if a parameter pair lies inside, on the boundary, or outside of the parameter domain
    • Go::ParamSurface::onBoundary onBoundary: check if a parameter pair lies on the boundary of the parameter domain
    • Go::ParamSurface::closestInDomain closestInDomain: fetch the parameter value in the parameter domain closest to a given parameter pair
    • Go::ParamSurface::reverseParameterDirection reverseParameterDirection: reverse one of the parameter directions
    • Go::ParamSurface::swapParameterDirection swapParameterDirection: swap the two parameter directions
  • geometric information retrieval
    • Go::ParamSurface::normalCone normalCone: create a direction cone containing all surface normals
    • Go::ParamSurface::tangentCone tangentCone: create a direction cone containing all surface tangents in a given parameter direction
    • Go::ParamSurface::compositeBox compositeBox: compute a composite box (bounding box) enclosing the surface
    • Go::ParamSurface::area area: compute the total area of this surface
    • Go::ParamSurface::estimateSfSize estimateSfSize: estimate the size of the surface in the two parameter directions
  • evaluations
    • Go::ParamSurface::point point: evaluate the surface's position (and perhaps a certain number of derivatives) at a given parameter pair
    • Go::ParamSurface::normal normal: evaluate the surface normal for a given parameter pair
    • Go::ParamSurface::evalGrid evalGrid: evaluate the surface's position at a grid in the parameter domain
  • closest point computations
    • Go::ParamSurface::closestPoint closestPoint: iteratively find the closest point on the surface to a given point
    • Go::ParamSurface::closestBoundaryPoint closestBoundaryPoint: iteratively find the closest point on the boundary of the surface to a given point
    • Go::ParamSurface::setIterator setIterator: set type of closest point iterator
  • checks for degeneracy, symmetry, and type
    • Go::ParamSurface::isDegenerate isDegenerate: check whether one of the four boundary curves is degenerate (i.e., has zero length)
    • Go::ParamSurface::getDegenerateCorners getDegenerateCorners: find degenerate surface corners by checking for parallel and anti-parallel partial derivatives
    • Go::ParamSurface::isIsoTrimmed isIsoTrimmed: check if the surface is trimmed along constant parameter curves
    • Go::ParamSurface::isSpline isSpline: check if the surface is of type spline
    • Go::ParamSurface::isAxisRotational isAxisRotational: check if the surface is axis rotational
    • Go::ParamSurface::isPlanar isPlanar: check if the surface is planar
    • Go::ParamSurface::isLinear isLinear: check if the surface is linear in one or both directions
    • Go::ParamSurface::ElementOnBoundary ElementOnBoundary: check if a polynomial element (for spline surfaces) intersects the (trimming) boundaries
    • Go::ParamSurface::ElementBoundaryStatus ElementBoundaryStatus : check if a polynomial element (for spline surfaces) intersects the (trimming) boundaries, is inside or outside

B-spline Curves

A B-spline curve is represented by the Go::SplineCurve SplineCurve class.

Mathematically, the curve is defined by the parametrization

$$ {\bf c}(t) = \sum_{i=1}^{n} {\bf p}_{i} B_{i,k,{\bf t}}(t). $$

The dimension $dim$ of the curve ${\bf c}$ is equal to that of its control points ${\bf p}_i$. For example, if the dimension of the control points is one, the curve is a function, if the dimension is two, the curve is planar, and if the dimension is three, the curve is spatial. Usually the dimension of the curve will be at most three, but higher dimensions are allowed.

A B-spline curve is a linear combination of a sequence of B-splines $B_{i,k,{\bf t}}$ (called a B-basis) uniquely determined by a knot vector ${\bf t}$ and the order $k$. The order is equal to the polynomial degree plus one. For example, if the order is two, the degree is one and the B-splines and the curve $c$ they generate are (piecewise) linear. If the order is three, the degree is two and the B-splines and the curve are quadratic. Cubic B-splines and curves have order 4 and degree 3, etc.

The parameter range of a B-spline curve ${\bf c}$ is the interval $[t_k, t_{n+1}], $ and so mathematically, the curve is a mapping ${\bf c}: [t_k, t_{n+1}] \to {\bf R}^{dim}$, where $dim$ is the Euclidean space dimension of its control points.

The complete representation of a B-spline curve consists of

  • $dim$: The dimension of the underlying Euclidean space, $1,2,3,\ldots$.
  • $n$: The number of control points (also the number of B-splines)
  • $k$: The order (polynomial degree + 1) of the B-splines.
  • ${\bf t}$: The knot vector of the B-splines. ${\bf t} = (t_1, t_2, \ldots, t_{n+k})$.
  • ${\bf p}$: The control points of the B-spline curve. $p_{d,i}, d=1,\ldots,dim, i=1,\ldots,n.$ E.g. when $dim = 3$, we have ${\bf p} = (x_1,y_1,z_1,x_2,y_2,z_2,\ldots,x_n,y_n,z_n)$.

We note that arrays in $c$ start at index 0 which means, for example, that if the array $t$ holds the knot vector, then $t[0] = t_1,\ldots, t[n+k-1] = t_{n+k}$ and the parameter interval goes from $t[k-1]$ to $t[n]$. Similar considerations apply to the other arrays.

The data in the curve representation must satisfy certain conditions:

  • The knot vector must be non-decreasing: $t_i \le t_{i+1}$. Moreover, the knots $t_i$ and $t_{i+k}$ must be distinct: $t_i < t_{i+k}$.
  • The number of control points should be greater than or equal to the order of the curve: $n \ge k$.

To understand the representation better, we will look at three parts of the representation: the B-splines (the basis functions), the knot vector and the control polygon.

B-spline Basis Functions

The spline space is represented by the class Go::BsplineBasis BsplineBasis. A set of B-spline basis functions is determined by the order $k$ and the knots.

Linear B-splines

For example, to define a single basis function of degree one, we need three knots.

\image html linear_B_spline.gif "A linear B-spline (order 2) defined by three knots" In the figure the three knots are marked as dots.

\image html linear2_B_spline.gif "Linear B-splines with multiple knots at one end" In the figure above the two knots at each end are equal.

By taking a linear combination of the three basis functions shown above, we can generate a linear spline function as shown in the next figure.

\image html linear_B_spline_curve.gif "A linear B-spline curve of dimension 1 (solid) as a linear combination of a sequence of B-splines. Each B-spline (dashed) is scaled by a coefficient."

Quadratic B-splines

A quadratic B-spline basis function is a linear combination of two linear basis functions, in which the coefficients are linear affine in the parameter $t$. In the next figure, we will see a quadratic B-spline defined by four knots. A quadratic B-spline is the sum of two products, the first product between the linear B-spline on the left and a corresponding line from 0 to 1, the second product between the linear B-spline on the right and a corresponding line from 1 to 0.

\image html quadratic_B_spline_curve.gif "A quadratic B-spline (solid) as a weighted (dashed) linear combination of linear B-splines (solid)"

Higher-order B-splines

For higher-order B-splines there is a similar definition. A B-spline of order $k\geq 2$ is a weighted linear combination of two B-splines of order $k-1$. Explicitly, we define B-splines of order $k=1$ as box functions,

$$ B_{i,1}(t) = 1 \quad \text{if} \quad t_i \leq t < t_{i+1} \quad \text{and} \quad 0 \quad \text{otherwise}, $$

and then the B-splines of order $k\geq 2$ as

$$ B_{i,k}(t) = {t - t_i \over t_{i+k-1} - t_i} B_{i,k-1}(t) + {t_{i+k} - t \over t_{i+k} - t_{i+1}} B_{i-1,k-1}(t). $$

Basic properties

B-spline basis functions satisfy some important properties for curve and surface design. Each basis function is non-negative and it can be shown that they sum to one,

$$ \sum_{i=1}^{n}B_{i,k,{\bf t}}(t) = 1. $$

These properties combined mean that B-spline curves satisfy the convex hull property: the curve lies in the convex hull of its control points. Furthermore, the support of the B-spline basis function $B_{i,k,{\bf t}}$ is the interval $[t_i,t_{i+k}]$ which means that B-spline curves has local control: moving one control point only alters the curve locally.

With $k$ multiple knots at the ends of the knot vector, B-spline curves also have the endpoint property: the start point of the B-spline curve equals the first control point and the end point equals the last control point, in other words

$$ {\bf c}(t_k) = {\bf p}_1 \qquad \hbox{and} \qquad {\bf c}(t_{n+1}) = {\bf p}_n. $$

The Control Polygon

The control polygon of a B-spline curve is the polygonal arc formed by its control points, ${\bf p}_0, {\bf p}_1, \ldots,{\bf p}_n$. This means that the control polygon, regarded as a parametric curve, is itself a piecewise linear B-spline curve (order two), identical to its own control polygon. If we increase the order, the distance between the control polygon and the curve increases. A higher order B-spline curve tends to smooth the control polygon and at the same time mimic its shape. For example, if the control polygon is convex, so is the B-spline curve.

\image html B_spline_curves.gif "Linear, quadratic, and cubic planar B-spline curves sharing the same control polygon"

Another property of the control polygon is that it will get closer to the curve if it is redefined by inserting knots into the curve and thereby increasing the number of control points. This can be seen in the next figure. In the limit, the refinement of the control polygon converges to its B-spline curve.

\image html cubic_B_spline_curve.gif "The cubic B-spline curve shown above with a redefined knot vector"

The Knot Vector

The knots of a B-spline curve describe the following properties of the curve:

  • The parameterization of the B-spline curve
  • The continuity at the joins between the adjacent polynomial segments of the B-spline curve.

Although the curves in the figure below have the same control polygon, they have different knot vectors and therefore different parametrizations.

\image html two_curves.gif "Two quadratic planar B-spline curves with identical control polygons but different knot vectors"

This example is not meant as an encouragement to use parameterization for modelling, rather to make users aware of the effect of parameterization. Something close to curve length parameterization is in most cases preferable. For interpolation, chord-length parameterization is used in most cases.

The number of equal knots determines the degree of continuity. If $k$ consecutive internal knots are equal, the curve is discontinuous. Similarly if $k-1$ consecutive internal knots are equal, the curve is continuous but not in general differentiable. A continuously differentiable curve with a discontinuity in the second derivative can be modelled using $k-2$ equal knots etc. Normally, B-spline curves in GoTools are expected to be continuous. For many algorithms, curves should be continuously differentiable ($C^1$).

\image html quadratic_B_spline_curve2.gif "A quadratic B-spline curve with two inner knots"

NURBS Curves

A NURBS (Non-Uniform Rational B-Spline) curve is a generalization of a B-spline curve,

$$ {\bf c}(t) = {\sum_{i=1}^{n} w_i {\bf p}_{i} B_{i,k,{\bf t}}(t) \over \sum_{i=1}^{n} w_i B_{i,k,{\bf t}}(t)} . $$

In addition to the data of a B-spline curve, the NURBS curve ${\bf c}$ has a sequence of weights $w_1,\ldots,w_n$. One of the advantages of NURBS curves over B-spline curves is that they can be used to represent conic sections exactly (taking the order $k$ to be three). A disadvantage is that NURBS curves depend nonlinearly on their weights, making some calculations, like the evaluation of derivatives, more complicated and less efficient than with B-spline curves.

The representation of a NURBS curve is the same as for a B-spline curve except that it also includes

  • ${\bf w}$: A sequence of weights ${\bf w} = (w_1, w_2, \ldots, w_n)$.

We make the assumption that the weights are strictly positive: $w_i &gt; 0$.

Under this condition, a NURBS curve, like its B-spline cousin, enjoys the convex hull property. With $k$-fold knots at the ends of the knot vector, also NURBS curves have the endpoint interpolation property.

A NURBS curve is in GoTools stored using the same entities as non-rational spline curves. Note that the constructors of these entities assume that the NURBS coefficients are given in the format: $w_i p_{i,1}, \ldots w_i p_{i,dim},w_i$, for $i=1, \ldots n$, i.e., the coefficients are multiplied with the weigths.

Spline Curve Functionality

In GoTools, Go::SplineCurve SplineCurve inherites Go::ParamCurve ParamCurve and has thereby the functionality specified for ParamCurve objects. Functionality specific for a B-spline curve can be found in the doxygen information. This functionality includes:

  • Compute the derivative curve corresponding to a given curve
  • Fetch information related to the spline space
  • Fetch the control polygon of a spline curve
  • Insert new knots into the knot vector of the curve and update the curve accordingly
  • Increase the polynomial degree of the curve
  • Make sure that the curve has got an open knot vector, i.e., knot multiplicity equal to the order in the ends of the curve

B-spline Surfaces

A tensor product B-spline surface is represented by the class Go::SplineSurface SplineSurface.

Mathematically, the B-spline surface is defined by the parametrization

$$ {\bf s}(u,v) = \sum_{i=1}^{n_1}\sum_{j=1}^{n_2}{\bf p}_{i,j} B_{i,k_1,{\bf u}}(u) B_{j,k_2,{\bf v}}(v) $$

with control points ${\bf p}_{i,j}$ and two variables (or parameters) $u$ and $v$. The formula shows that a basis function of a B-spline surface is a product of two basis functions of B-spline curves (B-splines). This is why a B-spline surface is called a tensor-product surface. The following is a list of the components of the representation:

  • $dim$: The dimension of the underlying Euclidean space.
  • $n_1$: The number of control points with respect to the first parameter.
  • $n_2$: The number of control points with respect to the second parameter.
  • $k_1$: The order (polynomial degree + 1) of the B-splines in the first parameter.
  • $k_2$: The order of the B-splines in the second parameter.
  • ${\bf u}$: The knot vector of the B-splines with respect to the first parameter, ${\bf u} = (u_1,u_2,\ldots,u_{n_1+k_1})$.
  • ${\bf v}$: The knot vector of the B-splines with respect to the second parameter, ${\bf v} = (v_1,v_2,\ldots,v_{n_2+k_2})$.
  • ${\bf p}$: The control points of the B-spline surface, $c_{d,i,j}$, $d=1,\ldots,dim$, $i=1,\ldots,n_1$, $j=1,\ldots,n_2$. When $dim = 3$, we have ${\bf p} = (x_{1,1},y_{1,1},z_{1,1},x_{2,1},y_{2,1},z_{2,1},\ldots$, $x_{n_1,1},y_{n_1,1},z_{n_1,1},\ldots$, $x_{n_1,n_2},y_{n_1,n_2},z_{n_1,n_2})$.

The data of the B-spline surface must fulfill the following requirements:

  • Both knot vectors must be non-decreasing.
  • The number of control points must be greater than or equal to the order with respect to both parameters: $n_1 \ge k_1$ and $n_2 \ge k_2$.

The properties of the representation of a B-spline surface are similar to the properties of the representation of a B-spline curve. The control points ${\bf p}_{i,j}$ form a control net as shown in the figure below. The control net has similar properties to the control polygon of a B-spline curve, described above.

\image html surf1.gif "A B-spline surface and its control net" width=10cm

The Basis Functions

A basis function of a B-spline surface is the product of two basis functions corresponding to B-spline curves,

$ B_{i,k_1,{\bf u}}(u) B_{j,k_2,{\bf v}}(v). $

Its support is the rectangle $[u_i,u_{i+k_1}] \times [v_j,v_{j+k_2}]$. If the basis functions in both directions are of degree one and all knots have multiplicity one, then the surface basis functions are pyramid-shaped. For higher degrees, the surface basis functions are bell shaped.

\image html surface_basis_function.gif "A basis function of degree one in both variables"

NURBS Surfaces

A NURBS (Non-Uniform Rational B-Spline) surface is a generalization of a B-spline surface,

$$ {\bf s}(u,v) = {\sum_{i=1}^{n_1}\sum_{j=1}^{n_2} w_{i,j} {\bf p}_{i,j} B_{i,k_1,{\bf u}}(u) B_{j,k_2,{\bf v}}(v) \over \sum_{i=1}^{n_1}\sum_{j=1}^{n_2} w_{i,j} B_{i,k_1,{\bf u}}(u) B_{j,k_2,{\bf v}}(v)}. $$

In addition to the data of a B-spline surface, the NURBS surface has a weights $w_{i,j}$. NURBS surfaces can be used to exactly represent several common rational surfaces such as spheres, cylinders, tori, and cones. A disadvantage is that NURBS surfaces depend nonlinearly on their weights, making some calculations less efficient.

The representation of a NURBS surface is the same as for a B-spline surface except that it also includes

  • ${\bf w}$: The weights of the NURBS surface, $w_{i,j}$, $i=1,\ldots,n_1$, $j=1,\ldots,n_2$, so ${\bf w} = (w_{1,1},w_{2,1},\ldots,w_{n_1,1},\ldots$, $w_{1,2},\ldots,w_{n_1,n_2})$.

The weights are required to be strictly positive: $w_{i,j} &gt; 0$.

The NURBS surface is represented by SISLSurf and SplineSurface in SISL and GoTools, respectively. As for the curve case, the constructors of SISLSurf and SplineSurface expect the coefficients to be multiplied with the weights.

Spline Surface Functionality

Go::SplineSurface SplineSurface inherites Go::ParamSurface ParamSurface in the GoTools data structure and implements the functionality described for ParamSurface. Important additional functionality is listed below:

  • Compute the derivative surface and normal surface corresponding to a given surface
  • Fetch information related to the spline spaces
  • Fetch the control polygon of a spline surface
  • Fetch all weights of a NURBS surface
  • Grid evaluation of the basis functions related to a surface
  • Grid evaluation of the surface
  • Insert new knots into the knot vectors of the surface and adapt the surface description accordingly
  • Increase the polynomial degrees of the surface
  • Fetch information related to the boundary curves of a surface

Other Curve Types

As shown in the class hierarchy, a spline curve is not the only parametric curve in GoTools although it is the most important one. There are also other curves that share parts of the public interface:

  • Go::BoundedCurve BoundedCurve A bounded curve is a restriction of a parametric curve to a given interval. The interval can be specified either in parameter space, in geometry space or both. In the last case, it must be specified whether the parameter space bound or the geometry space bound is the master.
  • Go::ElementaryCurve ElementaryCurve An elementary curve is a container for a conic section or a line. This entity will be described in some detail later.
  • Go::CurveOnSurface CurveOnSurface This class represents a curve lying on a surface.

Curve On Surface

The Go::CurveOnSurface CurveOnSurface entity is often related to a bounded, or trimmed, surface. A bounded surface is limited by a curve loop where each curve in the loop most often is represented by a CurveOnSurface. However, a CurveOnSurface is an entity in its own right. It simply represents a curve lying on a surface. It can for instance originate from intersecting the surface with a plane.

A CurveOnSurface consists of a parametric surface and two corresponding curves, one curve in the parameter domain of the surface and one spatial curve. The master representation is specified. Some operations may required the existence of one particular of these curves, in particular the parameter curve is requested. It exists functions that compute the missing curve from the existing one.

Elementary Curve

An Go::ElementaryCurve elementary curve is a fairly new concept in GoTools, and until now such curves have been entered as entities in an IGES or STEP file. The elementary curves may also be represented as spline curves although non-bounded curves must be given a finite extension. The elementary curves is of the types:

  • Go::Circle Circle The circle is defined by its center and radius and the plane in which it lies if the dimension of the geometry space is larger than 2. A circle is parameterized in terms of the angle. This is a bounded parameterization.
  • Go::Ellipse Ellipse An ellips is represented by a centre, the direction of one semi-axis and the length of the two semi-axis. The plane in which the ellipse lies is required if the dimension of the geometry space is larger than 2. An ellipse is parameterized in terms of the angle which gives a bounded parameterization.
  • Go::Line Line A line is given by a point and a direction. It has an unbounded parameterization, $t \in [- \infty , \infty ]$.
  • Go::Parabola Parabola A parabola is given by a position, $C$, a focal distance, $F$, and a coordinate system, $({\bf x}, {\bf y}, {\bf z})$. It is described as $f(t) = C + F(t^2 {\bf x} + 2t{\bf y})$ and has an unbounded parameterization, $t \in [- \infty , \infty ]$.
  • Go::Hyperbola Hyperbola A hyperbola is given by a position, a coordinate system and two distances. The parameterization is unbounded.

Other Surface Types

Similar to the curve case, GoTools supports also other types of parametric surfaces than spline surfaces. The additional surface types are bounded surface, elementary surface and composite surface. The elementary surfaces are conic surfaces, plane and torus. A composite surface consists of a number of spline surfaces where the associated parameter domains are mapped into one composite domain. The class is not complete in the sense that it does not support all functions specified in the interface for a parametric surface.

Bounded Surface

Go::BoundedSurface A bounded surface is a trimmed surface defined by an underlying surface and a trimming loop. The underlying surface is a parametric surface and the loop consists of a closed sequence of ordered parametric curves, often of type CurveOnSurface. The trimming loop must lie on the surface and be continuous with respect to a given tolerance.

Elementary Surface

Also Go::ElementarySurface elementary surfaces are quite new in GoTools, and have been entered as entities from IGES or STEP. The elementary surfaces may also be represented as spline surfaces although non-bounded surfaces must be given a finite extension. Operations involving this curve may, however, be made more efficiently by the knowledge of the surface type. The elementary surfaces is of the types:

  • Go::Cone Cone A cone is described by a location, the cone axis, the radius of the cross section corresponding to the location and the cone angle. The parameterization is given by the angle and the distance along the axis, thus it is unbounded in one parameter direction.
  • Go::Cylinder Cylinder A cylinder is given by its centre and radius and the cylinder axis. It is parameterized by the angle around the circle and the distance in the axis direction.
  • Go::Plane Plane A plane is given by a point and a normal. It has an unbounded parameterization in both parameter directions.
  • Go::Sphere Sphere A sphere is given by its centre and radius. It has an angular parameterization in both parameter directions and thereby bounded.
  • \begnlink Go::Torus Torus A torus is given by the minor and major radius, a location and an axis. The parameterization is angular in both parameter directions.
  • Go::Disc Disc A disc is a part of a plane limited by a circle and given by its centre, radius, plane normal and an additional vector to generate a coordinate system.

The elementary surfaces described above is placed in a coordinate system to facilitate the parameterization. In addition to the geometric information given for each entity, remaining coordinate system information must be specified.

Geometry Construction

The combination of SISL and GoTools provide a lot of methods for geometry construction. They partly overlap. The GoTools functionality is outlined here. More details can be found in the appropriate classes and namespaces. The SISL geometry construction methods are described in the SISL manual.

The classes for parametric curves, surfaces and volumes in GoTools do not contain construction facilites. They are solely for operating on these entites. The construction is performed in separate classes.

Curve Construction

Construction of elementary curves are being done by their definition or they are read from an IGES file. The curve construction methods in GoTools are concerned with spline curves. The methods are split between two sub modules in gotools-core, namely geometry and creators. The relevant classes are

  • Go::HermiteInterpolator HermiteInterpolator The class is placed in geometry. Interpolates a set of points where each point is associated a tangent vector. The points must be parameterized. This is a local curve construction method.
  • Go::SplineInterpolator SplineInterpolator A set of methods to interpolate a set of points. Some methods accept tangent vectors associated to some points. The points must be parameterized. The class gives the possibility to set particular conditions in the endpoints of the curve. This is a global method for curve construction.
  • Go::SplineApproximator SplineApproximator Approximation in the least squares sense. Parameterized points and a spline space must be given. This class and the two proceeding ones inherite the same class, Go::Interpolator Interpolator, and share parts of the interface.
  • Go::ApproxCurve ApproxCurve Make a curve approximating a set of points with a given accuracy. The points must be parameterized and it is possible to give an initial spline space. The method iteratively applies the method in the class SmoothCurve. This class and the following ones lie in the sub module creators.
  • Go::SmoothCurve SmoothCurve Approximate a set of parameterized data points with a spline curve using a least squares approximation with a smoothing term. The spline space must be given. The method can also be used to perform smoothing on a given curve.
  • Go::AdaptCurve AdaptCurve Approximates an evaluator based curve with a given accuracy. The method is based on least squares approxation with a smoothing term and spline space refinement.
  • Go::ApproxCrvToSeqs ApproxCrvToSeqs Approximate a set of curve sequences by a set of B-spline curves within a given accuracy. The curves are represented in the same spline space.
  • Go::HermiteAppC HermiteAppC Approximate an evaluator based curve represented by a sub class of the class Go::EvalCurve EvalCurve, by a spline curve. An hermite method is used, thus a $C^1$ continuous curve will be generated. The existing evaluator based curves are
    1. Go::ProjectCurve A curve in the parameter domain of a surface is represented as the projection of a 3D curve into the parameter domain of a given surface. The output curve lies in the parameter domain of the surface.
    2. Given data describing a Go::ProjectIntersectionCurve surface-surface intersection curve, the curve lying given offset distances from the two surface involved in the intersection and parameterized similar to the intersection curve is represented. This construction can be used to create a rolling ball blend.
    3. Given two approximations of the same intersection curves, reapproximate the Go::SpaceIntCrv intersection curve.
    4. Given a Go::LiftCurve curve in the parameter domain of a surface, the geometry space curve is evaluated.
    5. Represent Go::CrossTangentOffset an offset curve from a given space curve. The direction of the offset is given as an expression of corresponding curves.
    6. An Go::CrossTanOffDist offset curve to a given curve in the direction of a cross tangent curve constructed as a blend between tangent curves.
    7. A Go::EvalParamCurve parameter curve of any type that is to be approximated by a spline curve.
  • Go::HermiteAppS HermiteAppS Approximate an evaluator based curve set represented by a sub class of the class Go::EvalCurveSet EvalCurveSet. A number of curves defined in the same spline space are generated. One concreate evaluator based curve set exists currently:
    1. Given a surface, a curve in geometry space and a corresponding cross tangent curve, Go::ProjectCurveAndCrossTan the parameter curve representing the projection of the geometry curve into the surface and the corresponding projection of the cross tangent in the parameter domain is represented.
    2. Given an Go::IntCrvEvaluator intersection curve represented as two CurveOnSurface instances, reapproximate this intersection curve along with the two parameter domain curves representing this curve.
    3. Improve the accuracy of an existing Go::TrimCurve trimming curve.
    4. Given an intersection curve between two surfaces, offset these surfaces given distances and create the Go::SmoothTransition intersections curve between the offset surfaces and corresponding cross tangent curves that will give a smooth transition between the offset surfaces.

Surface Construction

Similar to the curve construction methods, these methods are placed in the sub modules geometry and creators.

  • Go::SweepSurfaceCreator SweepSurfaceCreator The class lies in geometry. The class contains two methods; sweep a curve along another curve to create a surface and rotational sweep.
  • Go::ApproxSurf ApproxSurf This class and the following lie in creators. A set of parameterized scattered data are approximated by a spline surface. The boundary curves to the surface can be defined a priori. The spline space must be given. The method iteratively applies the method in SmoothSurface and performs parameter iteration. It may also refine the spline space.
  • Go::SmoothSurf SmoothSurf Approximate a set of parameterized scattered data points using a least squares approach with a smoothing term. The spline space must be given. The method can also be used to smooth a given surface.
  • Go::LoftSurfaceCreator LoftSurfaceCreator constructs a surface by interpolating a number of non-rational spline curves.
  • Go::CoonsPatchGen CoonsPatchGen Construct a surface interpolating 4 boundary curves. The curves may be attached cross tangent curves. To achieve interpolation, the boundary conditions must be consistent.
  • Go::HahnsSurfaceGen HahnsSurfaceGen Fill an $n$-sided hole with $n$ surfaces. $n=3$, $5$ or $6$.

Clone this wiki locally