Module LRSplines3D - SINTEF-Geometry/GoTools GitHub Wiki

This module contains classes and tools for working with LR spline volumes.

The module lrsplines3D represents LR-spline volumes. This module depends on:

  • GoTools Core library
  • GoTools trivariate
  • GoTools LRSplines2D
  • SISL library

Example programs corresponding to this module are listed in LRsplines3D examples

LR spline volumes

In lrsplines2D it is described how the tensor-product structure that are the simplest way of generating a spline surface can lead to an explosion in data size for surface with much local detail. This is even more so for volumes.

LRSplineVolume inherits ParamVolume and is a spline volume with the property of local refinement. The lrsplines3D module in GoTools provides functionalities for working with LR (Locally Refined) spline volumes. These volumes are a powerful tool for representing complex 3D geometries with local refinement capabilities, offering flexibility in controlling the level of detail.

An LR spline volume is a piecewise polynomial or piecewise rational polynomial volume defined on an LR-mesh, Mesh3D. An LR-mesh is a locally refined mesh made by applying a sequence of refinements starting from a tensor-product mesh. LR spline volume are algorithmically defined throughout the refinement process of the mesh. An LR spline volume is defined as

$$ F(u,v,w) = \sum_{i=1}^L P_i s_i R_{i, p_1, p_2, p_3} (u,v,w) $$

where $P_i, i=1, ... ,L$ are the surface coefficients, and $s_i$ are scaling factors introduced to ensure partition of unity of the resulting collection of tensor product B-splines. The tensor product B-splines $R_{i,p_1,p_2,p_3}$ are of bi-degree $(p_1,p_2,p_3)$ defined on knot vectors of lengths $p_1 + 2$, $p_2 + 2$ and $p_3 + 2$ on the parametric domain in the $u$, $v$ and $w$ directions respectively.

-LR-mesh corresponding to volume. The mesh is shown before and after insertion of one mesh rectangle in the second parameter direction. The mesh is visualized by the mid point and corner curves of the elements-

A trivariate mesh corresponding to an LR volume of degree two is shown in the figure above. The first picture shows the mesh of a tensor-product volume. In the second picture the volume is refined by inserting one mesh rectangle. The example program refine_lrvol.C illustrates the refinement procedure.

As for LR spline surfaces it is required that a new mesh rectangle splits the support of at least one B-spline. The refinement procedure is similar to the surface case.

Classes involved in representing an LR spline volume

The core of lrsplines3D revolves around the LRSplineVolume class, which combines an underlying Mesh3D with a set of LRBSpline3D basis functions.

LRVolApprox implements an adaptive and iterative algorithm for approximating a trivariate point cloud with format (x,y,z,f(x,y,z)) by local refinenement and approximation (LRSpline3DMBA).

The key components and their relationships within the lrsplines3D module are as follows:

This class is the central component for defining, manipulating, and evaluating 3D LR spline volumes. An LRSplineVolume is essentially a sum of LRBSpline3D basis functions, each weighted by a control point, and defined over an adaptive Mesh3D.

Mesh3D

The LR-mesh is represented in Mesh3D. It contains information about knot values in the three parameter directions and mesh rectangles for each knot value. A mesh rectangle is described by the indices of knots corresponding to the lower left and upper right corner of the rectangle as well as multiplicity.

Mesh2D provides functionality to enquire properties of the mesh such as: number of knots excluding multiplicity (numDistinctKnots), value of a given knot (kval), iterators to knots (knotsBegin, knotsEnd), access to knots (getKnots) and parameter domain (minParam, maxParam).

LRBSpline3D

An LRBSpline3D entity is constructed as a tensor product between three univariate B-splines BSplineUniLR entities, but contains in addition the corresponding coefficient, the scaling factor and a possible rational weight. The class contains information of the element in the support of the B-spline.

The class provides functionality to enquire the coefficient, scaling factor and rational weight as well as geometry space dimension, associated knot vector and degree. The elements in the support are avaiable and the support limits can be requested. Functionality to evaluate position and derivatives in a given parameter tripple is also available as well as the associated mesh.

Element3D

An element represents the domain of one polynomial patch in the LR spline volume. It is limited by active mesh rectangles in the three parameter direction. Element3D contains information about the limits of this domain, the B-splines overlapping it and, in approximation context, data points associated to this domain. Element3D provides access to information about the domain properties, the associated B-eplines and neighbouring elements. The example program investigate_Element3D shows how to obtain information related to the elements.

LRSplineVolume

LRSplineVolume is a three-variate entity on which either a function (1D) or a 3D volume is represented.

The LRSplineVolume manages the geometric and topological information of the spline volume. It holds references to the underlying Mesh3D structure, which defines the knot intervals and element connectivity. It also maintains a collection of LRBSpline3D basis functions, which are the fundamental building blocks of the spline volume. The class provides methods for evaluating the volume at specific parameter points, evaluating on a grid, and performing refinement operations. The exmple program evaluateLRVolume.C demonstrates the various evaluation possibilities.

LRSplineVolume is the owner of all information required to represent the volume.

Key Data Members:

: fragment Go::Mesh3D& mesh_: The underlying 3D mesh that defines the parametric domain and local refinement structure. BSplineMap bsplines_: An internal map of individual B-spline basis functions. ElementMap emap_: A map holding information about the individual mesh elements and their associated basis functions.

Univariate B-splines in the three parameter directions are contained
in LRSplineVolume to be referenced by LRBSpline3D.

Evaluation is performed through the functions point and elementGridEvaluate. The first is implemented in several varieties: With and without computing derivatives and with and without getting the relevant element as input. The latter evaluates a grid of points in a specified element.

Other classes, definitions and namespaces

  • LRVolApprox Approximates a 4-dimensional point cloud by an LR spline function (1D volume). The three first point coordinates are seen as the parameter tripple corresponding to the points. The last coordinate is approximated. Refinement is performed according to the distance between the point cloud and the volume and guided by a given tolerance.
  • LRBSpline3DUtils Provides utility functions for refinement related to LRBSpline3D objects.
  • Direction3D Specifies the parameter direction of a volume.
  • LRSpline3DUtils Provides utility functions for spline volumes, mostly related to refinement, but contains also functionality for evaluation of all B-splines in a specified parameter tripple.
  • LRFeature3DUtils Given a current LR spline volume with an associated point cloud, compute feature output in a grid. Called from LRVolApprox to visualize certain aspects of the approximation.
  • LRSpline3DMBA Called from LRVolApprox. The name space provides functionality to update an LR spline volume using an adaptation to the local approximation method multi resolution B-spline approximation.
  • LRSpline3DBezierCoefs Bezier extraction. Coefficients of Bezier volumes are computed by interpolation of a set of sample points depending on the degrees of the LR B-spline volume. Only the quadratic and cubic cases are supported, information of use can be found in the example program Bezier_extraction.C.
  • LRSpline3DEvalGrid Grid evaluation of the elements of an LR spline volume.
  • LRVolStitch Modifies a collection of trivariate LR spline functions organized in a regular pattern to obtain $C^0$ or $C^1$ continuity between adjacent functions. The process involves an increase in data size of the functions.