NurbsCurve

NurbsCurve

Represents a Non Uniform Rational B-Splines (NURBS) curve.

Constructor

new NurbsCurve(degree, pointCount)

Constructs a new NURBS curve with a specific degree and control point count.
Parameters:
Name Type Description
degree int Degree of curve. Must be equal to or larger than 1 and smaller than or equal to 11.
pointCount int Number of control-points.

Extends

Members

degree :int

Overrides:
Gets the maximum algebraic degree of any span or a good estimate if curve spans are not algebraic.
Type:
  • int

dimension :int

Overrides:
Gets the dimension of the object. The dimension is typically three. For parameter space trimming curves the dimension is two. In rare cases the dimension can be one or greater than three.
Type:
  • int

domain :Interval

Overrides:
Gets or sets the domain of the curve.
Type:
  • Interval

hasBezierSpans :bool

Returns true if the NURBS curve has Bezier spans (all distinct knots have multiplicity = degree)
Type:
  • bool

hasBrepForm :bool

Overrides:
Returns true if the Brep.TryConvertBrep function will be successful for this object
Type:
  • bool

isClosed :bool

Overrides:
Gets a value indicating whether or not this curve is a closed curve.
Type:
  • bool

isDeformable :bool

Overrides:
true if object can be accurately modified with "squishy" transformations like projections, shears, and non-uniform scaling.
Type:
  • bool

isPeriodic :bool

Overrides:
Gets a value indicating whether or not this curve is considered to be Periodic.
Type:
  • bool

isRational :bool

Gets a value indicating whether or not the curve is rational. Rational curves have control-points with custom weights.
Type:
  • bool

isValid :bool

Overrides:
Tests an object to see if it is valid.
Type:
  • bool

objectType :ObjectType

Overrides:
Useful for switch statements that need to differentiate between basic object types like points, curves, surfaces, and so on.
Type:
  • ObjectType

order :int

Gets the order of the curve. Order = Degree + 1.
Type:
  • int

pointAtEnd :Array.<x, y, z>

Overrides:
Evaluates point at the end of the curve.
Type:
  • Array.<x, y, z>

pointAtStart :Array.<x, y, z>

Overrides:
Evaluates point at the start of the curve.
Type:
  • Array.<x, y, z>

spanCount :int

Overrides:
Gets the number of non-empty smooth (c-infinity) spans in the curve.
Type:
  • int

tangentAtEnd :Array.<x, y, z>

Overrides:
Evaluate unit tangent vector at the end of the curve.
Type:
  • Array.<x, y, z>

tangentAtStart :Array.<x, y, z>

Overrides:
Evaluates the unit tangent vector at the start of the curve.
Type:
  • Array.<x, y, z>

userStringCount

Overrides:

Methods

(static) create(periodic, degree, points) → {NurbsCurve}

Constructs a 3D NURBS curve from a list of control points.
Parameters:
Name Type Description
periodic bool If true, create a periodic uniform curve. If false, create a clamped uniform curve.
degree int (>=1) degree=order-1.
points System.Collections.Generic.IEnumerable.<Point3d> control vertex locations.
Returns:
new NURBS curve on success null on error.
Type
NurbsCurve

(static) createFromArc() → {NurbsCurve}

Gets a rational degree 2 NURBS curve representation of the arc. Note that the parameterization of NURBS curve does not match arc's transcendental parameterization.
Returns:
Curve on success, null on failure.
Type
NurbsCurve

(static) createFromCircle() → {NurbsCurve}

Gets a rational degree 2 NURBS curve representation of the circle. Note that the parameterization of NURBS curve does not match circle's transcendental parameterization. Use GetRadianFromNurbFormParameter() and GetParameterFromRadian() to convert between the NURBS curve parameter and the transcendental parameter.
Returns:
Curve on success, null on failure.
Type
NurbsCurve

(static) createFromEllipse() → {NurbsCurve}

Gets a rational degree 2 NURBS curve representation of the ellipse. Note that the parameterization of the NURBS curve does not match with the transcendental parameterization of the ellipsis.
Returns:
A NURBS curve representation of this ellipse or null if no such representation could be made.
Type
NurbsCurve

(static) createFromLine() → {NurbsCurve}

Gets a non-rational, degree 1 NURBS curve representation of the line.
Returns:
Curve on success, null on failure.
Type
NurbsCurve

changeClosedCurveSeam(t) → {bool}

Overrides:
If this curve is closed, then modify it so that the start/end point is at curve parameter t.
Parameters:
Name Type Description
t double Curve parameter of new start/end point. The returned curves domain will start at t.
Returns:
true on success, false on failure.
Type
bool

changeDimension(desiredDimension) → {bool}

Overrides:
Changes the dimension of a curve.
Parameters:
Name Type Description
desiredDimension int The desired dimension.
Returns:
true if the curve's dimension was already desiredDimension or if the curve's dimension was successfully changed to desiredDimension; otherwise false.
Type
bool

curvatureAt(t) → {Array.<x, y, z>}

Overrides:
Evaluate the curvature vector at a curve parameter.
Parameters:
Name Type Description
t double Evaluation parameter.
Returns:
Curvature vector of the curve at the parameter t.
Type
Array.<x, y, z>

duplicate() → {GeometryBase}

Overrides:
Constructs a deep (full) copy of this object.
Returns:
An object of the same type as this, with the same properties and behavior.
Type
GeometryBase

encode()

Overrides:
...

frameAt(t) → {Array}

Overrides:
Returns a 3d frame at a parameter.
Parameters:
Name Type Description
t double Evaluation parameter.
Returns:
[bool, Plane]
  • (bool) true on success, false on failure.
  • (Plane) The frame is returned here.
Type
Array

getBoundingBox(plane) → {Array}

Overrides:
Aligned Bounding box solver. Gets the plane aligned bounding box.
Parameters:
Name Type Description
plane Plane Orientation plane for BoundingBox.
Returns:
[BoundingBox, Box]
  • (BoundingBox) A BoundingBox in plane coordinates.
  • (Box) Aligned box in World coordinates.
Type
Array

getCurveParameterFromNurbsFormParameter(nurbsParameter) → {Array}

Overrides:
Convert a NURBS curve parameter to a curve parameter.
Parameters:
Name Type Description
nurbsParameter double NURBS form parameter.
Returns:
[bool, double]
  • (bool) true on success, false on failure.
  • (double) Curve parameter.
Type
Array

getNurbsFormParameterFromCurveParameter(curveParameter) → {Array}

Overrides:
Convert a curve parameter to a NURBS curve parameter.
Parameters:
Name Type Description
curveParameter double Curve parameter.
Returns:
[bool, double]
  • (bool) true on success, false on failure.
  • (double) NURBS form parameter.
Type
Array

getUserString()

Overrides:
...

getUserStrings()

Overrides:
...

grevilleParameter(index)

Gets the greville (edit point) parameter that belongs to the control point at the specified index.
Parameters:
Name Type Description
index int Index of Greville (Edit) point.

grevillePoint(index)

Gets the Greville parameter that belongs to the control point at the specified index.
Parameters:
Name Type Description
index int Index of Greville point.

increaseDegree(desiredDegree) → {bool}

Increase the degree of this curve.
Parameters:
Name Type Description
desiredDegree int The desired degree. Degrees should be number between and including 1 and 11.
Returns:
true on success, false on failure.
Type
bool

isArc(tolerance) → {bool}

Overrides:
Test a curve to see if it can be represented by an arc or circle within the given tolerance.
Parameters:
Name Type Description
tolerance double Tolerance to use when checking.
Returns:
true if the curve can be represented by an arc or a circle within tolerance.
Type
bool

isCircle(tolerance) → {bool}

Overrides:
Test a curve to see if it can be represented by a circle within the given tolerance.
Parameters:
Name Type Description
tolerance double Tolerance to use when checking.
Returns:
true if the curve can be represented by a circle to within tolerance.
Type
bool

isEllipse(tolerance) → {bool}

Overrides:
Test a curve to see if it can be represented by an ellipse within a given tolerance.
Parameters:
Name Type Description
tolerance double Tolerance to use for checking.
Returns:
true if the Curve can be represented by an ellipse within tolerance.
Type
bool

isLinear(tolerance) → {bool}

Overrides:
Test a curve to see if it is linear to within the custom tolerance.
Parameters:
Name Type Description
tolerance double Tolerance to use when checking linearity.
Returns:
true if the ends of the curve are farther than tolerance apart and the maximum distance from any point on the curve to the line segment connecting the curve ends is <= tolerance.
Type
bool

isPlanar(tolerance) → {bool}

Overrides:
Test a curve for planarity.
Parameters:
Name Type Description
tolerance double Tolerance to use when checking.
Returns:
true if there is a plane such that the maximum distance from the curve to the plane is <= tolerance.
Type
bool

isPolyline() → {bool}

Overrides:
Several types of Curve can have the form of a polyline including a degree 1 NurbsCurve, a PolylineCurve, and a PolyCurve all of whose segments are some form of polyline. IsPolyline tests a curve to see if it can be represented as a polyline.
Returns:
true if this curve can be represented as a polyline; otherwise, false.
Type
bool

knots()

...

makeDeformable() → {bool}

Overrides:
If possible, converts the object into a form that can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling.
Returns:
false if object cannot be converted to a deformable object. true if object was already deformable or was converted into a deformable object.
Type
bool

makePiecewiseBezier(setEndWeightsToOne) → {bool}

Clamps ends and adds knots so the NURBS curve has Bezier spans (all distinct knots have multiplicity = degree).
Parameters:
Name Type Description
setEndWeightsToOne bool If true and the first or last weight is not one, then the first and last spans are re-parameterized so that the end weights are one.
Returns:
true on success, false on failure.
Type
bool

pointAt(t) → {Array.<x, y, z>}

Overrides:
Evaluates point at a curve parameter.
Parameters:
Name Type Description
t double Evaluation parameter.
Returns:
Point (location of curve at the parameter t).
Type
Array.<x, y, z>

points()

...

rdkXml()

Overrides:
...

reparameterize(c) → {bool}

Use a linear fractional transformation to re-parameterize the NURBS curve. This does not change the curve's domain.
Parameters:
Name Type Description
c double re-parameterization constant (generally speaking, c should be > 0). The control points and knots are adjusted so that output_nurbs(t) = input_nurbs(lambda(t)), where lambda(t) = c*t/( (c-1)*t + 1 ). Note that lambda(0) = 0, lambda(1) = 1, lambda'(t) > 0, lambda'(0) = c and lambda'(1) = 1/c.
Returns:
true if successful.
Type
bool

reverse() → {bool}

Overrides:
Reverses the direction of the curve.
Returns:
true on success, false on failure.
Type
bool

rotate(angleRadians, rotationAxis, rotationCenter) → {bool}

Overrides:
Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).
Parameters:
Name Type Description
angleRadians double Angle of rotation in radians.
rotationAxis Array.<x, y, z> Direction of the axis of rotation.
rotationCenter Array.<x, y, z> Point on the axis of rotation.
Returns:
true if geometry successfully rotated.
Type
bool

scale(scaleFactor) → {bool}

Overrides:
Scales the object by the specified factor. The scale is centered at the origin.
Parameters:
Name Type Description
scaleFactor double The uniform scaling factor.
Returns:
true if geometry successfully scaled.
Type
bool

setEndPoint(point) → {bool}

Overrides:
Forces the curve to end at a specified point. Not all curve types support this operation.
Parameters:
Name Type Description
point Array.<x, y, z> New end point of curve.
Returns:
true on success, false on failure.
Type
bool

setStartPoint(point) → {bool}

Overrides:
Forces the curve to start at a specified point. Not all curve types support this operation.
Parameters:
Name Type Description
point Array.<x, y, z> New start point of curve.
Returns:
true on success, false on failure.
Type
bool

setUserString()

Overrides:
...

split(t) → {Array.<Curve>}

Overrides:
Splits (divides) the curve at the specified parameter. The parameter must be in the interior of the curve's domain.
Parameters:
Name Type Description
t double Parameter to split the curve at in the interval returned by Domain().
Returns:
Two curves on success, null on failure.
Type
Array.<Curve>

tangentAt(t) → {Array.<x, y, z>}

Overrides:
Evaluates the unit tangent vector at a curve parameter.
Parameters:
Name Type Description
t double Evaluation parameter.
Returns:
Unit tangent vector of the curve at the parameter t.
Type
Array.<x, y, z>

toJSON()

Overrides:
Create a JSON string representation of this object

toNurbsCurve() → {NurbsCurve}

Overrides:
Constructs a NURBS curve representation of this curve.
Returns:
NURBS representation of the curve on success, null on failure.
Type
NurbsCurve

transform(xform) → {bool}

Overrides:
Transforms the geometry. If the input Transform has a SimilarityType of OrientationReversing, you may want to consider flipping the transformed geometry after calling this function when it makes sense. For example, you may want to call Flip() on a Brep after transforming it.
Parameters:
Name Type Description
xform Transform Transformation to apply to geometry.
Returns:
true if geometry successfully transformed.
Type
bool

translate(translationVector) → {bool}

Overrides:
Translates the object along the specified vector.
Parameters:
Name Type Description
translationVector Array.<x, y, z> A moving vector.
Returns:
true if geometry successfully translated.
Type
bool

trim(t0, t1) → {Curve}

Overrides:
Removes portions of the curve outside the specified interval.
Parameters:
Name Type Description
t0 double Start of the trimming interval. Portions of the curve before curve(t0) are removed.
t1 double End of the trimming interval. Portions of the curve after curve(t1) are removed.
Returns:
Trimmed portion of this curve is successful, null on failure.
Type
Curve

tryGetArc(tolerance) → {Array}

Overrides:
Try to convert this curve into an Arc using a custom tolerance.
Parameters:
Name Type Description
tolerance double Tolerance to use when checking.
Returns:
[bool, Arc]
  • (bool) true if the curve could be converted into an arc.
  • (Arc) On success, the Arc will be filled in.
Type
Array

tryGetCircle(tolerance) → {Array}

Overrides:
Try to convert this curve into a Circle using a custom tolerance.
Parameters:
Name Type Description
tolerance double Tolerance to use when checking.
Returns:
[bool, Circle]
  • (bool) true if the curve could be converted into a Circle within tolerance.
  • (Circle) On success, the Circle will be filled in.
Type
Array

tryGetPolyline() → {Array}

Overrides:
Several types of Curve can have the form of a polyline including a degree 1 NurbsCurve, a PolylineCurve, and a PolyCurve all of whose segments are some form of polyline. IsPolyline tests a curve to see if it can be represented as a polyline.
Returns:
[bool, Polyline]
  • (bool) true if this curve can be represented as a polyline; otherwise, false.
  • (Polyline) If true is returned, then the polyline form is returned here.
Type
Array