Skip to content

BH.oM.Geometry.NurbsSurface

A free-form surface constructed as a UV grid of weighted NURBS ControlPoints. A continuous form is generated by approximating a two-directional network of piece-wise polynomial splines across the U and V directions, creating a smooth surface patch. Supports Inner and Outer Trim Curves which enable greater flexibility in final shape through allowing free-form boundaries to be cut across the underlying UV surface domain. A NurbsSurface is immutable as its defining properties are not mutually perpendicular to facilitate robust conversion between platforms. See also BH.oM.Geometry.NurbsCurve for more info on non-uniform rational basis spline (or B-spline) weightings and other parameters.

Class structure

Implemented interfaces and base types

The NurbsSurface is inheriting from the following base type(s) and implements the following interfaces:

Properties

Defining properties

The following properties are defined on the class

Name Type Description Quantity
ControlPoints ReadOnlyCollection<Point> An ordered list of three-dimensional points defining the overall surface patch geometry. Each row of Points in the UV grid are listed sequentially as a single vector. The control point locations are approximating, as opposed to interpolating, meaning in the general case the resulting surface will not pass through the control point locations themselves. -
Weights ReadOnlyCollection<double> A list of scalar factors, one for each ControlPoint. The weights in effect add an additional degree of freedom, allowing control over the relative influence of each control point on the surface shape. -
UKnots ReadOnlyCollection<double> Defines the spans and transition points of the basis functions in the U domain. See also BH.oM.Geometry.NurbsCurve for more info on Knot Vectors. -
VKnots ReadOnlyCollection<double> Defines the spans and transition points of the basis functions in the V domain. See also BH.oM.Geometry.NurbsCurve for more info on Knot Vectors. -
UDegree int Sets the degree of the polynomial basis functions in the U direction of the surface patch. This ultimately defines the number of local U ControlPoints that influence a given point of the surface. -
VDegree int Sets the degree of the polynomial basis functions in the V direction of the surface patch. This ultimately defines the number of local V ControlPoints that influence a given point of the surface. -
InnerTrims ReadOnlyCollection<SurfaceTrim> Allows definition of a set of free-form shapes to be cut from the underlying Surface. -
OuterTrims ReadOnlyCollection<SurfaceTrim> Allows definition of free-form external perimeter to the NurbsSurface patch. -

Derived properties

The following properties are defined as extension methods in one of the BHoM_Engines

Name Type Description Quantity Engine
Bounds BoundingBox Returns the global world axis oriented BoundingBox for all control points of the NurbsSurface. Note that this is not the minimum eclosing box of the NurbsSurface. - Geometry_Engine
Edges List<ICurve> - - Geometry_Engine
GeometryHash string Returns a signature of the input geometry, useful for diffing.
The hash is computed as a serialised array representing the coordinate of significant points taken on the geometry.
The number of points is reduced to the minimum essential to determine uniquely any geometry.
Additionally, the resulting points are transformed based on the source geometry type, to remove or minimize collisions.
(Any transformation so performed is translational only, in order to support geometrical tolerance, i.e. numerical distance, when comparing GeometryHashes downstream).
- Geometry_Engine
IArea double Calculates the area of the provided geometry. Area [m²] Geometry_Engine
IBounds BoundingBox Returns the global world axis oriented enclosing BoundingBox for all points of the geometry, i.e. the box with the smallest volume within which all the points on the geometry lie. - Geometry_Engine
IExternalEdges List<ICurve> Gets the external edge curves of the ISurface. - Geometry_Engine
IHashArray double[] Returns a signature of the input geometry, useful for distance-based comparisons and diffing.
The hash is computed as an array representing the coordinate of significant points taken on the geometry.
The number of points is reduced to the minimum essential to determine uniquely any geometry.
Additionally, the resulting points are transformed based on the source geometry type, to remove or minimize collisions.
(Any transformation so performed is translational only, in order to support geometrical tolerance, i.e. numerical distance, when comparing GeometryHashes downstream).
- Geometry_Engine
IInternalEdges List<ICurve> - - Geometry_Engine
IIsPlanar bool Checks if the IGeometry is planar, i.e. all of its parts fit in a single plane. - Geometry_Engine
IIsValid bool - - Geometry_Engine
INormals List<Vector> Interface method that returns the list of vectors normal to any IGeometry. - Geometry_Engine
IsClosed bool Checks if the NurbsSurface is closed, i.e. forms a closed loop, in at least one direction, i.e. if one of the edges overlap fully with the edge on the oposite side in the u/v domain. - Geometry_Engine
IsNull bool Checks if a Geometry is null and outputs relevant error message. - Geometry_Engine
IsPeriodic bool - - Geometry_Engine
ISubParts IEnumerable<ISurface> - - Geometry_Engine
ISubParts IEnumerable<IGeometry> - - Geometry_Engine
IsValid bool - - Geometry_Engine
UVCount List<int> - - Geometry_Engine

Code and Schema

C# implementation

C#
public class NurbsSurface : BH.oM.Geometry.ISurface, BH.oM.Geometry.IGeometry, BH.oM.Base.IObject, BH.oM.Base.IImmutable

Assembly: Geometry_oM.dll

The C# class definition is available on github:

All history and changes of the class can be found by inspection the history.

JSON Schema implementation

The object is defined as a JSON schema. You can validate a JSON instance against this schema by reference. To do this, use the schema reference below in a validator like this one.

JSON Schema
{
 "$ref" : "https://raw.githubusercontent.com/BHoM/BHoM_JSONSchema/develop/Geometry_oM/NurbsSurface.json"
}

The JSON Schema is available on github here:

Example JSON instance

Example JSON instance of type NurbsSurface.

Example JSON
{
  "_t": "BH.oM.Geometry.NurbsSurface",
  "ControlPoints": [
    {
      "_t": "BH.oM.Geometry.Point",
      "X": -5.0,
      "Y": -5.0,
      "Z": 0.0
    },
    {
      "_t": "BH.oM.Geometry.Point",
      "X": -5.0,
      "Y": 5.0,
      "Z": 4.0
    },
    {
      "_t": "BH.oM.Geometry.Point",
      "X": 5.0,
      "Y": -5.0,
      "Z": 4.0
    },
    {
      "_t": "BH.oM.Geometry.Point",
      "X": 5.0,
      "Y": 5.0,
      "Z": 0.0
    }
  ],
  "Weights": [
    1.0,
    1.0,
    1.0,
    1.0
  ],
  "UKnots": [
    0.0,
    10.0
  ],
  "VKnots": [
    0.0,
    10.0
  ],
  "UDegree": 1,
  "VDegree": 1,
  "InnerTrims": [],
  "OuterTrims": [],
  "_bhomVersion": "8.2"
}