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.gsGeometry — Type
gsGeometryAbstract 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/surfacesTensorBSpline: Tensor product B-spline surfaces and volumesNurbs: Univariate and multivariate NURBS curves/surfacesTensorNurbs: Tensor product NURBS surfaces and volumes
All geometry types support common operations such as evaluation, derivatives, closest point queries, and geometric refinement.
See Also
B-Spline Geometries
Univariate B-Splines
TinyGismo.BSpline — Type
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 basiscoefs: 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)Properties and Queries
These query functions are also available for basis functions. See the Basis Functions section for detailed documentation.
TinyGismo.knots- Get the knot vectorTinyGismo.degree- Get the polynomial degreeTinyGismo.basis- Get the underlying basisboundary- Extract a boundary curve/surface
TinyGismo.basis — Function
basis(spline::BSpline)Get the underlying B-spline basis.
Arguments
spline: The B-spline
Returns
The BSplineBasis used by the spline
Missing docstring for TinyGismo.boundary. Check Documenter's build log for details.
TinyGismo.numCoefs — Function
numCoefs(spline::BSpline)Get the number of control points.
Arguments
spline: The B-spline
Returns
The number of control points
TinyGismo.coefAtCorner — Function
coefAtCorner(geometry::gsGeometry, c::Int)Get the control point at a specific corner.
Arguments
geometry: The geometryc: The corner index
Returns
The control point coordinates at that corner
Refinement
Refinement operations are shared with basis functions. See the Basis Functions - Refinement section for detailed documentation.
insertKnot!- Insert a knot into the geometryuniformRefine!- Uniformly refine the meshuniformCoarsen!- Uniformly coarsen the mesh
Degree Operations
These degree operations are shared with basis functions. See the Basis Functions - Degree and Continuity Operations section for detailed documentation.
degreeElevate!- Elevate the polynomial degreedegreeReduce!- Reduce the polynomial degreedegreeIncrease!- Increase the polynomial degreedegreeDecrease!- Decrease the polynomial degree
Tensor Product B-Splines
TinyGismo.TensorBSpline — Type
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 basiscoefs: Control point coefficients (matrix)kv1,kv2,[kv3]: Knot vectors for each parametric directioncorner: 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)Properties and Queries
These query functions are also available for basis functions. See the Basis Functions section for detailed documentation.
TinyGismo.knots- Get the knot vectorTinyGismo.degree- Get the polynomial degreeTinyGismo.basis- Get the underlying basisTinyGismo.boundary- Extract a boundary curve/surface
Refinement
Refinement operations are shared with basis functions. See the Basis Functions - Refinement section for detailed documentation.
insertKnot!- Insert a knot into the geometryuniformRefine!- Uniformly refine the meshuniformCoarsen!- Uniformly coarsen the mesh
Degree Operations
These degree operations are shared with basis functions. See the Basis Functions - Degree and Continuity Operations section for detailed documentation.
degreeElevate!- Elevate the polynomial degreedegreeReduce!- Reduce the polynomial degreedegreeIncrease!- Increase the polynomial degreedegreeDecrease!- Decrease the polynomial degree
NURBS Geometries
Univariate NURBS
TinyGismo.Nurbs — Type
Nurbs(basis::NurbsBasis, coefs::Union{Vector{Float64}, Matrix{Float64}})Construct a NURBS curve from a NURBS basis and control points.
Arguments
basis: The NURBS basiscoefs: 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)Properties and Queries
These query functions are also available for basis functions. See the Basis Functions section for detailed documentation.
TinyGismo.knots- Get the knot vectorTinyGismo.degree- Get the polynomial degreeTinyGismo.basis- Get the underlying basisTinyGismo.boundary- Extract a boundary curve/surfaceTinyGismo.weights- Get the control point weights
TinyGismo.weight — Function
weight(nurbs::Nurbs, i::Int)Get the weight of a specific control point.
Arguments
nurbs: The NURBS curvei: The control point index (1-indexed)
Returns
The weight value at control point i
Refinement
Refinement operations are shared with basis functions. See the Basis Functions - Refinement section for detailed documentation.
insertKnot!- Insert a knot into the geometryuniformRefine!- Uniformly refine the meshuniformCoarsen!- Uniformly coarsen the mesh
Degree Operations
These degree operations are shared with basis functions. See the Basis Functions - Degree and Continuity Operations section for detailed documentation.
degreeElevate!- Elevate the polynomial degreedegreeReduce!- Reduce the polynomial degreedegreeIncrease!- Increase the polynomial degreedegreeDecrease!- Decrease the polynomial degree
Tensor Product NURBS
TinyGismo.TensorNurbs — Type
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 basiscoefs: 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)Properties and Queries
These query functions are also available for basis functions. See the Basis Functions section for detailed documentation.
TinyGismo.knots- Get the knot vectorTinyGismo.degree- Get the polynomial degreeTinyGismo.basis- Get the underlying basisTinyGismo.boundary- Extract a boundary curve/surfaceTinyGismo.weights- Get the control point weights
Refinement
Refinement operations are shared with basis functions. See the Basis Functions - Refinement section for detailed documentation.
insertKnot!- Insert a knot into the geometryuniformRefine!- Uniformly refine the meshuniformCoarsen!- Uniformly coarsen the mesh
Degree Operations
These degree operations are shared with basis functions. See the Basis Functions - Degree and Continuity Operations section for detailed documentation.
degreeElevate!- Elevate the polynomial degreedegreeReduce!- Reduce the polynomial degreedegreeIncrease!- Increase the polynomial degreedegreeDecrease!- Decrease the polynomial degree
Generic Geometry Operations
These methods work on all geometry types (B-spline and NURBS).
Control Points
TinyGismo.coefsSize — Function
coefsSize(geometry::gsGeometry)Get the size (number of control points).
Arguments
geometry: The geometry
Returns
The number of control points
TinyGismo.coefs — Function
coefs(geometry::gsGeometry)Get the control points (coefficients) of the geometry.
Arguments
geometry: The geometry
Returns
A matrix of control point coordinates
Evaluation
These evaluation methods are shared with basis functions. See the Basis Functions - Evaluation section for detailed documentation.
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 derivativederiv2!- Second derivative (in-place)deriv2- Second derivative
Geometric Queries
TinyGismo.closestPointTo — Function
closestPointTo(geometry::gsGeometry, pt::Vector{Float64}, result::gsVector{Float64})Find the closest point on the geometry to a given point.
Arguments
geometry: The geometrypt: The query pointresult: 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.
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 geometryu: Parametric evaluation pointsout: 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.
TinyGismo.jacobian — Function
jacobian(geometry::gsGeometry, u::Union{Vector{Float64}, Matrix{Float64}})Evaluate the Jacobian matrix of the geometry.
Arguments
geometry: The geometryu: Parametric evaluation points
Returns
The Jacobian matrix
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 geometryu: Parametric evaluation pointsout: 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.
TinyGismo.hessian — Function
hessian(geometry::gsGeometry, u::Union{Vector{Float64}, Matrix{Float64}}, coord::Int)Evaluate the Hessian matrix of a coordinate function.
Arguments
geometry: The geometryu: Parametric evaluation pointscoord: The coordinate component (1-indexed)
Returns
The Hessian matrix
Dimension Queries
TinyGismo.targetDim — Function
targetDim(geometry::gsGeometry)Get the dimension of the ambient space (target dimension).
Arguments
geometry: The geometry
Returns
The target dimension (physical space dimension)
TinyGismo.coefDim — Function
coefDim(geometry::gsGeometry)Get the dimension of the coefficient space.
Arguments
geometry: The geometry
Returns
The coefficient dimension
TinyGismo.geoDim — Function
geoDim(geometry::gsGeometry)Get the geometric dimension (same as target dimension).
Arguments
geometry: The geometry
Returns
The geometric dimension
TinyGismo.parDim — Function
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.)