Generated by DocFX

Class NurbsSurface

This class represents a NURBS surface.

Inheritance
System.Object
NurbsSurface
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Syntax
public class NurbsSurface : IGeometry<NurbsSurface>, IEquatable<NurbsSurface>, ITransformable<NurbsSurface>
Examples
Point3 p1 = new Point3(0.0, 0.0, 0.0);
Point3 p2 = new Point3(10.0, 0.0, 0.0);
Point3 p3 = new Point3(10.0, 10.0, 2.0);
Point3 p4 = new Point3(0.0, 10.0, 4.0);

NurbsSurface surface = NurbsSurface.FromCorners(p1, p2, p3, p4);

Properties

| Improve this Doc View Source

ControlPointLocations

A 2D collection of points, V direction increases from left to right, the U direction from bottom to top.

Declaration
public List<List<Point3>> ControlPointLocations { get; }
Property Value
Type Description
System.Collections.Generic.List<System.Collections.Generic.List<Point3>>
| Improve this Doc View Source

ControlPoints

A 2d collection of control points, V direction increases from left to right, the U direction from bottom to top.

Declaration
public List<List<Point4>> ControlPoints { get; }
Property Value
Type Description
System.Collections.Generic.List<System.Collections.Generic.List<Point4>>
| Improve this Doc View Source

DegreeU

The degree in U direction.

Declaration
public int DegreeU { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

DegreeV

The degree in V direction.

Declaration
public int DegreeV { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

KnotsU

The knotVector in U direction.

Declaration
public KnotVector KnotsU { get; }
Property Value
Type Description
KnotVector
| Improve this Doc View Source

KnotsV

The knotVector in V direction.

Declaration
public KnotVector KnotsV { get; }
Property Value
Type Description
KnotVector
| Improve this Doc View Source

Weights

A 2d collection of weight values.

Declaration
public List<List<double>> Weights { get; }
Property Value
Type Description
System.Collections.Generic.List<System.Collections.Generic.List<System.Double>>

Methods

| Improve this Doc View Source

BoundaryEdges()

Extracts the boundary curves of the surface.

Declaration
public NurbsBase[] BoundaryEdges()
Returns
Type Description
NurbsBase[]

The boundary edges.

| Improve this Doc View Source

ClosestParameter(Point3)

Computes the U and V parameters of the surface that is closest to the test point.

Declaration
public (double U, double V) ClosestParameter(Point3 point)
Parameters
Type Name Description
Point3 point

The point to test against.

Returns
Type Description
System.ValueTuple<System.Double, System.Double>

The U and V parameters of the surface that are closest to the test point.

| Improve this Doc View Source

ClosestPoint(Point3)

Computes the point on the surface that is closest to the test point.

Declaration
public Point3 ClosestPoint(Point3 point)
Parameters
Type Name Description
Point3 point

The point to test against.

Returns
Type Description
Point3

The closest point on the surface.

| Improve this Doc View Source

Equals(NurbsSurface)

Compares if two NURBS surfaces are the same.
Two NURBS curves are equal when the have same degrees, same control points order and dimension, and same knots.

Declaration
public bool Equals(NurbsSurface other)
Parameters
Type Name Description
NurbsSurface other

The NURBS surface.

Returns
Type Description
System.Boolean

Return true if the NURBS surface are equal.

| Improve this Doc View Source

EvaluateAt(Double, Double, EvaluateSurfaceDirection)

Evaluate the surface at the given U and V parameters.

Declaration
public Vector3 EvaluateAt(double u, double v, EvaluateSurfaceDirection direction)
Parameters
Type Name Description
System.Double u

U parameter.

System.Double v

V parameter.

EvaluateSurfaceDirection direction

The evaluate direction required as result.

Returns
Type Description
Vector3

The unitized tangent vector in the direction selected.

| Improve this Doc View Source

FromCorners(Point3, Point3, Point3, Point3)

Constructs a NURBS surface from four corners.
If the corners are ordered ccw the normal of the surface will point up otherwise, if corners ordered cw the normal will point down.
The surface is defined of degree 1.

Declaration
public static NurbsSurface FromCorners(Point3 p1, Point3 p2, Point3 p3, Point3 p4)
Parameters
Type Name Description
Point3 p1

The first point.

Point3 p2

The second point.

Point3 p3

The third point.

Point3 p4

The fourth point.

Returns
Type Description
NurbsSurface
| Improve this Doc View Source

FromExtrusion(Vector3, NurbsBase)

Constructs a surface extruding a curve profile long a direction.

Declaration
public static NurbsSurface FromExtrusion(Vector3 direction, NurbsBase profile)
Parameters
Type Name Description
Vector3 direction

The extrusion direction.

NurbsBase profile

The profile curve to extrude.

Returns
Type Description
NurbsSurface

The extruded surface.

| Improve this Doc View Source

FromLoft(IList<NurbsBase>, LoftType)

Constructs a NURBS surface from a set of NURBS curves.

Declaration
public static NurbsSurface FromLoft(IList<NurbsBase> curves, LoftType loftType = LoftType.Normal)
Parameters
Type Name Description
System.Collections.Generic.IList<NurbsBase> curves

Set of a minimum of two curves to create the surface.

LoftType loftType

Enum to choose the type of loft generation.

Returns
Type Description
NurbsSurface

A NURBS surface.

| Improve this Doc View Source

FromPoints(Int32, Int32, List<List<Point3>>, List<List<Double>>)

Constructs a NURBS surface from a 2D grid of points.
The grid of points should be organized as, the V direction from left to right and the U direction increases from bottom to top.

Declaration
public static NurbsSurface FromPoints(int degreeU, int degreeV, List<List<Point3>> points, List<List<double>> weight = null)
Parameters
Type Name Description
System.Int32 degreeU

Degree of surface in U direction.

System.Int32 degreeV

Degree of surface in V direction.

System.Collections.Generic.List<System.Collections.Generic.List<Point3>> points

Points locations.

System.Collections.Generic.List<System.Collections.Generic.List<System.Double>> weight

A 2D collection of weights.

Returns
Type Description
NurbsSurface

A NURBS surface.

| Improve this Doc View Source

FromSweep(NurbsBase, NurbsBase, Nullable<Vector3>, Nullable<Vector3>)

Constructs a sweep surface with one rail curve. Follows the algorithm A10.2 at page 477 of The NURBS Book by Piegl and Tiller.

Declaration
public static NurbsSurface FromSweep(NurbsBase rail, NurbsBase profile, Vector3? startTangent = null, Vector3? endTangent = null)
Parameters
Type Name Description
NurbsBase rail

The rail curve.

NurbsBase profile

The section curve.

System.Nullable<Vector3> startTangent

If not null override start tangent vector.

System.Nullable<Vector3> endTangent

If not null override end tangent vector.

Returns
Type Description
NurbsSurface

The sweep surface.

| Improve this Doc View Source

IsClosed(SurfaceDirection)

Checks if the surface is closed.
A surface is closed if the first points and the lasts in a direction are coincident.

Declaration
public bool IsClosed(SurfaceDirection direction)
Parameters
Type Name Description
SurfaceDirection direction
Returns
Type Description
System.Boolean

True if the curve is closed.

| Improve this Doc View Source

IsoCurve(Double, SurfaceDirection)

Extracts the isoparametric curves (isocurves) at the given parameter and surface direction.

Declaration
public NurbsCurve IsoCurve(double parameter, SurfaceDirection direction)
Parameters
Type Name Description
System.Double parameter

The parameter between 0.0 to 1.0 whether the isocurve will be extracted.

SurfaceDirection direction

The U or V direction whether the isocurve will be extracted.

Returns
Type Description
NurbsCurve

The isocurve extracted.

| Improve this Doc View Source

IsPlanar(Double)

Checks is surface is planar within specified tolerance.

Declaration
public bool IsPlanar(double tolerance = 1E-10)
Parameters
Type Name Description
System.Double tolerance
Returns
Type Description
System.Boolean
| Improve this Doc View Source

PointAt(Double, Double)

Evaluates a point at a given U and V parameters.

Declaration
public Point3 PointAt(double u, double v)
Parameters
Type Name Description
System.Double u

Evaluation U parameter.

System.Double v

Evaluation V parameter.

Returns
Type Description
Point3

A evaluated point.

| Improve this Doc View Source

Reverse(SurfaceDirection)

Reverses the parameterization of a surface in the specified direction. The domain is unaffected.

Declaration
public NurbsSurface Reverse(SurfaceDirection surfaceDirection)
Parameters
Type Name Description
SurfaceDirection surfaceDirection

The U or V direction whether the surface will be reversed.

Returns
Type Description
NurbsSurface

A surface reversed in the specified direction.

| Improve this Doc View Source

Revolved(NurbsBase, Ray, Double)

Creates a surface of revolution through an arbitrary angle, and axis. Corresponds the algorithm A8.1 of The NURBS Book by Piegl and Tiller.

Declaration
public static NurbsSurface Revolved(NurbsBase curveProfile, Ray axis, double rotationAngle)
Parameters
Type Name Description
NurbsBase curveProfile

Profile curve.

Ray axis

Revolution axis.

System.Double rotationAngle

Angle in radiance.

Returns
Type Description
NurbsSurface

The revolution surface.

| Improve this Doc View Source

Ruled(NurbsBase, NurbsBase)

Constructs a ruled surface between two curves. Follows the algorithm at page 337 of The NURBS Book by Piegl and Tiller.

Declaration
public static NurbsSurface Ruled(NurbsBase curveA, NurbsBase curveB)
Parameters
Type Name Description
NurbsBase curveA

The first curve.

NurbsBase curveB

The second curve.

Returns
Type Description
NurbsSurface

A ruled surface.

| Improve this Doc View Source

SplitAt(Double, SplitDirection)

Splits (divides) the surface into two parts at the specified parameter

Declaration
public NurbsSurface[] SplitAt(double parameter, SplitDirection direction)
Parameters
Type Name Description
System.Double parameter

The parameter at which to split the surface, parameter should be between 0 and 1.

SplitDirection direction

Where to split in the U or V direction of the surface.

Returns
Type Description
NurbsSurface[]

If the surface is split vertically (U direction) the left side is returned as the first surface and the right side is returned as the second surface.
If the surface is split horizontally (V direction) the bottom side is returned as the first surface and the top side is returned as the second surface.

| Improve this Doc View Source

ToString()

Implements the override method to string.

Declaration
public override string ToString()
Returns
Type Description
System.String

The representation of a NURBS surface in string.

Overrides
System.Object.ToString()
| Improve this Doc View Source

Transform(TransformMatrix)

Transforms a NURBS surface with the given transformation matrix.

Declaration
public NurbsSurface Transform(TransformMatrix transformation)
Parameters
Type Name Description
TransformMatrix transformation

The transformation matrix.

Returns
Type Description
NurbsSurface

A new NURBS surface transformed.

Implements

IGeometry<T>
System.IEquatable<T>
ITransformable<T>