Geometries

Geometric objects represent spline curves, surfaces, and volumes. All geometry types inherit from gsGeometry and support evaluation, derivatives, and various geometric queries.

Base Types

TinyGismo.gsGeometryType
gsGeometry

Abstract base type for all geometry types in TinyGismo.

Details

gsGeometry is the parent type for all geometric objects, including:

  • BSpline: Univariate and multivariate B-spline curves/surfaces
  • TensorBSpline: Tensor product B-spline surfaces and volumes
  • Nurbs: Univariate and multivariate NURBS curves/surfaces
  • TensorNurbs: Tensor product NURBS surfaces and volumes

All geometry types support common operations such as evaluation, derivatives, closest point queries, and geometric refinement.

See Also

source

B-Spline Geometries

Univariate B-Splines

TinyGismo.BSplineType
BSpline(basis::BSplineBasis, coefs::Union{Vector{Float64}, Matrix{Float64}})

Construct a B-spline curve or surface from a basis and control points.

Arguments

  • basis: The B-spline basis
  • coefs: Control point coefficients (vector for curves, matrix for surfaces)

Returns

A BSpline object

Details

A B-spline is defined by a basis and control points. The basis determines the spline space, and the control points define the actual geometry.

Examples

basis = BSplineBasis(kv)
coefs = [1.0, 2.0, 3.0, 4.0]
spline = BSpline(basis, coefs)
source

Properties and Queries

These query functions are also available for basis functions. See the Basis Functions section for detailed documentation.

TinyGismo.basisFunction
basis(spline::BSpline)

Get the underlying B-spline basis.

Arguments

  • spline: The B-spline

Returns

The BSplineBasis used by the spline

source
Missing docstring.

Missing docstring for TinyGismo.boundary. Check Documenter's build log for details.

TinyGismo.numCoefsFunction
numCoefs(spline::BSpline)

Get the number of control points.

Arguments

  • spline: The B-spline

Returns

The number of control points

source
TinyGismo.coefAtCornerFunction
coefAtCorner(geometry::gsGeometry, c::Int)

Get the control point at a specific corner.

Arguments

  • geometry: The geometry
  • c: The corner index

Returns

The control point coordinates at that corner

source

Refinement

Refinement operations are shared with basis functions. See the Basis Functions - Refinement section for detailed documentation.

Degree Operations

These degree operations are shared with basis functions. See the Basis Functions - Degree and Continuity Operations section for detailed documentation.

Tensor Product B-Splines

TinyGismo.TensorBSplineType
TensorBSpline{1}(basis::TensorBSplineBasis{1}, coefs::Union{Vector{Float64}, Matrix{Float64}})
TensorBSpline{2}(basis::TensorBSplineBasis{2}, coefs::Matrix{Float64})
TensorBSpline{2}(kv1::KnotVector, kv2::KnotVector, coefs::Matrix{Float64})
TensorBSpline{2}(corner::Matrix{Float64}, kv1::KnotVector, kv2::KnotVector)
TensorBSpline{3}(basis::TensorBSplineBasis{3}, coefs::Matrix{Float64})
TensorBSpline{3}(kv1::KnotVector, kv2::KnotVector, kv3::KnotVector, coefs::Matrix{Float64})

Construct a tensor product B-spline surface or volume from a basis and control points.

Arguments

  • basis: The tensor product B-spline basis
  • coefs: Control point coefficients (matrix)
  • kv1, kv2, [kv3]: Knot vectors for each parametric direction
  • corner: Corner points (for constructing bilinear patches)

Returns

A TensorBSpline object (surface or volume)

Details

Tensor product B-splines are formed by taking the tensor product of univariate B-spline bases. They are parameterized by 2 or more parameters and are commonly used for representing surfaces and volumes.

All methods from gsGeometry are available for TensorBSpline objects.

Examples

kv1 = KnotVector([0.0, 0.0, 0.0, 1.0, 1.0, 1.0])
kv2 = KnotVector([0.0, 0.0, 0.0, 1.0, 1.0, 1.0])
coefs = [0.0 1.0 2.0; 0.0 0.0 0.0; 0.0 1.0 2.0; 0.0 0.0 0.0; ...]
basis = TensorBSplineBasis{2}(kv1, kv2)
surface = TensorBSpline{2}(basis, coefs)
source

Properties and Queries

These query functions are also available for basis functions. See the Basis Functions section for detailed documentation.

Refinement

Refinement operations are shared with basis functions. See the Basis Functions - Refinement section for detailed documentation.

Degree Operations

These degree operations are shared with basis functions. See the Basis Functions - Degree and Continuity Operations section for detailed documentation.

NURBS Geometries

Univariate NURBS

TinyGismo.NurbsType
Nurbs(basis::NurbsBasis, coefs::Union{Vector{Float64}, Matrix{Float64}})

Construct a NURBS curve from a NURBS basis and control points.

Arguments

  • basis: The NURBS basis
  • coefs: Control point coefficients (vector for curves, matrix for surfaces)

Returns

A Nurbs object

Details

A NURBS (Non-Uniform Rational B-Spline) curve or surface is defined by a NURBS basis (which includes weights) and control points. The rational nature allows exact representation of conic sections and provides local control through weights.

All methods from gsGeometry are available for Nurbs objects.

Examples

kv = KnotVector([0.0, 0.0, 0.0, 1.0, 1.0, 1.0])
weights = [1.0, sqrt(2)/2, 1.0]
basis = NurbsBasis(kv, weights)
coefs = [0.0, 1.0, 1.0, 1.0, 0.0, 1.0]
curve = Nurbs(basis, coefs)
source

Properties and Queries

These query functions are also available for basis functions. See the Basis Functions section for detailed documentation.

TinyGismo.weightFunction
weight(nurbs::Nurbs, i::Int)

Get the weight of a specific control point.

Arguments

  • nurbs: The NURBS curve
  • i: The control point index (1-indexed)

Returns

The weight value at control point i

source

Refinement

Refinement operations are shared with basis functions. See the Basis Functions - Refinement section for detailed documentation.

Degree Operations

These degree operations are shared with basis functions. See the Basis Functions - Degree and Continuity Operations section for detailed documentation.

Tensor Product NURBS

TinyGismo.TensorNurbsType
TensorNurbs{2}(basis::TensorNurbsBasis{2}, coefs::Matrix{Float64})
TensorNurbs{2}(kv1::KnotVector, kv2::KnotVector, coefs::Matrix{Float64})
TensorNurbs{3}(basis::TensorNurbsBasis{3}, coefs::Matrix{Float64})
TensorNurbs{3}(kv1::KnotVector, kv2::KnotVector, kv3::KnotVector, coefs::Matrix{Float64})

Construct a tensor product NURBS surface or volume from a basis and control points.

Arguments

  • basis: The tensor product NURBS basis
  • coefs: Control point coefficients (matrix)
  • kv1, kv2, [kv3]: Knot vectors for each parametric direction

Returns

A TensorNurbs object (surface or volume)

Details

Tensor product NURBS surfaces and volumes are formed by taking the tensor product of univariate NURBS bases. They combine the flexibility of tensor products with the rational properties of NURBS, enabling exact representation of complex shapes including quadric surfaces.

All methods from gsGeometry are available for TensorNurbs objects.

Examples

kv1 = KnotVector([0.0, 0.0, 0.0, 1.0, 1.0, 1.0])
kv2 = KnotVector([0.0, 0.0, 0.0, 1.0, 1.0, 1.0])
weights = [1.0 sqrt(2)/2 1.0; 1.0 sqrt(2)/2 1.0; 1.0 sqrt(2)/2 1.0]
basis = TensorNurbsBasis{2}(kv1, kv2, weights)
coefs = [0.0 1.0 1.0; 0.0 0.0 1.0; ...]
surface = TensorNurbs{2}(basis, coefs)
source

Properties and Queries

These query functions are also available for basis functions. See the Basis Functions section for detailed documentation.

Refinement

Refinement operations are shared with basis functions. See the Basis Functions - Refinement section for detailed documentation.

Degree Operations

These degree operations are shared with basis functions. See the Basis Functions - Degree and Continuity Operations section for detailed documentation.

Generic Geometry Operations

These methods work on all geometry types (B-spline and NURBS).

Control Points

TinyGismo.coefsSizeFunction
coefsSize(geometry::gsGeometry)

Get the size (number of control points).

Arguments

  • geometry: The geometry

Returns

The number of control points

source
TinyGismo.coefsFunction
coefs(geometry::gsGeometry)

Get the control points (coefficients) of the geometry.

Arguments

  • geometry: The geometry

Returns

A matrix of control point coordinates

source

Evaluation

These evaluation methods are shared with basis functions. See the Basis Functions - Evaluation section for detailed documentation.

  • eval! - Evaluate at parametric points (in-place)
  • _eval - Evaluate at parametric points

Derivatives

These derivative methods are shared with basis functions. See the Basis Functions - Derivatives section for detailed documentation.

  • deriv! - First derivative (in-place)
  • deriv - First derivative
  • deriv2! - Second derivative (in-place)
  • deriv2 - Second derivative

Geometric Queries

TinyGismo.closestPointToFunction
closestPointTo(geometry::gsGeometry, pt::Vector{Float64}, result::gsVector{Float64})

Find the closest point on the geometry to a given point.

Arguments

  • geometry: The geometry
  • pt: The query point
  • result: Output gsVector{Float64} to store the closest parametric point (modified in-place)

Details

Computes the closest point on the geometry to the given point and returns its parametric coordinates in result.

source
TinyGismo.jacobian!Function
jacobian!(geometry::gsGeometry, u::Union{Vector{Float64}, Matrix{Float64}}, out::gsMatrix{Float64})

Evaluate the Jacobian matrix of the geometry (in-place).

Arguments

  • geometry: The geometry
  • u: Parametric evaluation points
  • out: Output gsMatrix{Float64} to store Jacobian (modified in-place)

Details

The Jacobian is the matrix of all first-order partial derivatives of the geometry mapping.

source
TinyGismo.jacobianFunction
jacobian(geometry::gsGeometry, u::Union{Vector{Float64}, Matrix{Float64}})

Evaluate the Jacobian matrix of the geometry.

Arguments

  • geometry: The geometry
  • u: Parametric evaluation points

Returns

The Jacobian matrix

source
TinyGismo.hessian!Function
hessian!(geometry::gsGeometry, u::Union{Vector{Float64}, Matrix{Float64}}, out::gsMatrix{Float64}, coord::Int)

Evaluate the Hessian matrix of a coordinate function (in-place).

Arguments

  • geometry: The geometry
  • u: Parametric evaluation points
  • out: Output gsMatrix{Float64} to store Hessian (modified in-place)
  • coord: The coordinate component (1-indexed)

Details

The Hessian is the matrix of second-order partial derivatives for the specified coordinate.

source
TinyGismo.hessianFunction
hessian(geometry::gsGeometry, u::Union{Vector{Float64}, Matrix{Float64}}, coord::Int)

Evaluate the Hessian matrix of a coordinate function.

Arguments

  • geometry: The geometry
  • u: Parametric evaluation points
  • coord: The coordinate component (1-indexed)

Returns

The Hessian matrix

source

Dimension Queries

TinyGismo.targetDimFunction
targetDim(geometry::gsGeometry)

Get the dimension of the ambient space (target dimension).

Arguments

  • geometry: The geometry

Returns

The target dimension (physical space dimension)

source
TinyGismo.coefDimFunction
coefDim(geometry::gsGeometry)

Get the dimension of the coefficient space.

Arguments

  • geometry: The geometry

Returns

The coefficient dimension

source
TinyGismo.geoDimFunction
geoDim(geometry::gsGeometry)

Get the geometric dimension (same as target dimension).

Arguments

  • geometry: The geometry

Returns

The geometric dimension

source
TinyGismo.parDimFunction
parDim(geometry::gsGeometry)

Get the parametric dimension (number of parameters).

Arguments

  • geometry: The geometry

Returns

The parametric dimension (1 for curves, 2 for surfaces, etc.)

source