Class NurbsCurve

Hierarchy (view full)

Constructors

Properties

degree: number

Gets the maximum algebraic degree of any span or a good estimate if curve spans are not algebraic.

dimension: number

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.

domain: number[]

Gets or sets the domain of the curve.

hasBezierSpans: boolean

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

hasBrepForm: boolean

Returns true if the Brep.TryConvertBrep function will be successful for this object

isClosed: boolean

Gets a value indicating whether or not this curve is a closed curve.

isDeformable: boolean

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

isPeriodic: boolean

Gets a value indicating whether or not this curve is considered to be Periodic.

isRational: boolean

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

isValid: boolean

Tests an object to see if it is valid.

isValidWithLog: [boolean, string]

...

objectType: ObjectType

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

order: number

Gets the order of the curve. Order = Degree + 1.

pointAtEnd: number[]

Evaluates point at the end of the curve.

pointAtStart: number[]

Evaluates point at the start of the curve.

spanCount: number

Gets the number of non-empty smooth (c-infinity) spans in the curve.

tangentAtEnd: number[]

Evaluate unit tangent vector at the end of the curve.

tangentAtStart: number[]

Evaluates the unit tangent vector at the start of the curve.

userStringCount: number

Gets the amount of user strings.

Methods

  • Parameters

    • t: number

      Curve parameter of new start/end point. The returned curves domain will start at t.

    Returns boolean

    true on success, false on failure.

    Description

    If this curve is closed, then modify it so that the start/end point is at curve parameter t.

  • Parameters

    • desiredDimension: number

      The desired dimension.

    Returns boolean

    true if the curve's dimension was already desiredDimension or if the curve's dimension was successfully changed to desiredDimension; otherwise false.

    Description

    Changes the dimension of a curve.

  • Returns CurveOrientation

    The orientation of this curve with respect to world XY plane.

    Description

    Determines the orientation (counterclockwise or clockwise) of a closed, planar curve in the world XY plane. Only works with simple (no self intersections) closed, planar curves.

  • Parameters

    • plane: Plane

      The plane in which to solve the orientation.

    Returns CurveOrientation

    The orientation of this curve with respect to world XY plane.

    Description

    Determines the orientation (counterclockwise or clockwise) of a closed, planar curve in a given plane. Only works with simple (no self intersections) closed, planar curves.

  • Parameters

    • spanIndex: number

      The span index, where (0 <= spanIndex <= Points.Count - Order).

    Returns BezierCurve

    Bezier curve if successful, null otherwise.

    Description

    Converts a span of the NURBS curve into a Bezier.

  • Parameters

    • t: number

      Evaluation parameter.

    Returns number[]

    Curvature vector of the curve at the parameter t.

    Description

    Evaluate the curvature vector at a curve parameter.

  • Parameters

    • t: number

      Curve parameter to evaluate.

    • derivativeCount: number

      Number of derivatives to evaluate, must be at least 0.

    Returns number[][]

    An array of vectors that represents all the derivatives starting at zero.

    Description

    Evaluate the derivatives at the specified curve parameter.

  • Parameters

    • t: number

      Curve parameter to evaluate.

    • derivativeCount: number

      Number of derivatives to evaluate, must be at least 0.

    • side: CurveEvaluationSide

      Side of parameter to evaluate. If the parameter is at a kink, it makes a big difference whether the evaluation is from below or above.

    Returns void

    An array of vectors that represents all the derivatives starting at zero.

    Description

    Evaluate the derivatives at the specified curve parameter.

  • Parameters

    • t: number

      Evaluation parameter.

    Returns object

    [boolean, Plane] (boolean) true on success, false on failure. (Plane) The frame is returned here.

    Description

    Returns a 3d frame at a parameter.

  • Parameters

    • accurate: boolean

      If true, a physically accurate bounding box will be computed. If not, a bounding box estimate will be computed. For some geometry types there is no difference between the estimate and the accurate bounding box. Estimated bounding boxes can be computed much (much) faster than accurate (or "tight") bounding boxes. Estimated bounding boxes are always similar to or larger than accurate bounding boxes.

    Returns BoundingBox

    The bounding box of the geometry in world coordinates or BoundingBox.Empty if not bounding box could be found.

    Description

    Bounding box solver. Gets the world axis aligned bounding box for the geometry.

  • Parameters

    • nurbsParameter: number

      NURBS form parameter.

    Returns object

    [boolean, number] (boolean) true on success, false on failure. (number) Curve parameter.

    Description

    Convert a NURBS curve parameter to a curve parameter.

  • Parameters

    • curveParameter: number

      Curve parameter.

    Returns object

    [boolean, number] (boolean) true on success, false on failure. (number) NURBS form parameter.

    Description

    Convert a curve parameter to a NURBS curve parameter.

  • Parameters

    • key: string

      id used to retrieve the string.

    Returns string

    string associated with the key if successful. null if no key was found.

    Description

    Gets user string from this geometry.

  • Returns string[]

    Description

    Gets a copy of all (user key string, user value string) pairs attached to this geometry.

  • Parameters

    • index: number

      Index of Greville (Edit) point.

    Returns number

    Description

    Gets the greville (edit point) parameter that belongs to the control point at the specified index.

  • Parameters

    • index: number

      Index of Greville point.

    Returns number[]

    Description

    Gets the Greville parameter that belongs to the control point at the specified index.

  • Parameters

    • desiredDegree: number

      The desired degree. Degrees should be number between and including 1 and 11.

    Returns boolean

    true on success, false on failure.

    Description

    Increase the degree of this curve.

  • Returns boolean

    true if the curve can be represented by an arc or a circle within tolerance.

    Description

    Test a curve to see if it can be represented by an arc or circle within RhinoMath.ZeroTolerance.

  • Returns boolean

    true if the Curve can be represented by a circle within tolerance.

    Description

    Test a curve to see if it can be represented by a circle within RhinoMath.ZeroTolerance.

  • Returns boolean

    true if the Curve can be represented by an ellipse within tolerance.

    Description

    Test a curve to see if it can be represented by an ellipse within RhinoMath.ZeroTolerance.

  • Returns boolean

    true if the curve is linear.

    Description

    Test a curve to see if it is linear to within RhinoMath.ZeroTolerance units (1e-12).

  • Returns boolean

    true if the curve is planar (flat) to within RhinoMath.ZeroTolerance units (1e-12).

    Description

    Test a curve for planarity.

  • Returns boolean

    true if this curve can be represented as a polyline; otherwise, false.

    Description

    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 boolean

    false if object cannot be converted to a deformable object. true if object was already deformable or was converted into a deformable object.

    Description

    If possible, converts the object into a form that can be accurately modified with "squishy" transformations like projections, shears, an non-uniform scaling.

  • Parameters

    • setEndWeightsToOne: boolean

      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 boolean

    true on success, false on failure.

    Description

    Clamps ends and adds knots so the NURBS curve has Bezier spans (all distinct knots have multiplicity = degree).

  • Parameters

    • t: number

      Evaluation parameter.

    Returns number[]

    Point (location of curve at the parameter t).

    Description

    Evaluates point at a curve parameter.

  • Parameters

    • c: number

      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 boolean

    true if successful.

    Description

    Use a linear fractional transformation to re-parameterize the NURBS curve. This does not change the curve's domain.

  • Returns boolean

    true on success, false on failure.

    Description

    Reverses the direction of the curve.

  • Parameters

    • angleRadians: number

      Angle of rotation in radians.

    • rotationAxis: number[]

      Direction of the axis of rotation.

    • rotationCenter: number[]

      Point on the axis of rotation.

    Returns boolean

    true if geometry successfully rotated.

    Description

    Rotates the object about the specified axis. A positive rotation angle results in a counter-clockwise rotation about the axis (right hand rule).

  • Parameters

    • scaleFactor: number

      The uniform scaling factor.

    Returns boolean

    true if geometry successfully scaled.

    Description

    Scales the object by the specified factor. The scale is centered at the origin.

  • Parameters

    • point: number[]

      New end point of curve.

    Returns boolean

    true on success, false on failure.

    Description

    Forces the curve to end at a specified point. Not all curve types support this operation.

  • Parameters

    • point: number[]

      New start point of curve.

    Returns boolean

    true on success, false on failure.

    Description

    Forces the curve to start at a specified point. Not all curve types support this operation.

  • Parameters

    • key: string

      id used to retrieve this string.

    • value: string

      string associated with key.

    Returns boolean

    true if successful, false if not.

    Description

    Attach a user string (key,value combination) to this geometry.

  • Parameters

    • t: number

      Parameter to split the curve at in the interval returned by Domain().

    Returns Curve[]

    Two curves on success, null on failure.

    Description

    Splits (divides) the curve at the specified parameter. The parameter must be in the interior of the curve's domain.

  • Parameters

    • t: number

      Evaluation parameter.

    Returns number[]

    Unit tangent vector of the curve at the parameter t.

    Description

    Evaluates the unit tangent vector at a curve parameter.

  • Returns string

    Description

    Create a JSON string representation of this object

  • Parameters

    • subdomain: number[]

      The NURBS representation for this portion of the curve is returned.

    Returns NurbsCurve

    NURBS representation of the curve on success, null on failure.

    Description

    Constructs a NURBS curve representation of this curve.

  • Parameters

    • xform: Transform

      Transformation to apply to geometry.

    Returns boolean

    true if geometry successfully transformed.

    Description

    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

    • translationVector: number[]

      A moving vector.

    Returns boolean

    true if geometry successfully translated.

    Description

    Translates the object along the specified vector.

  • Parameters

    • t0: number

      Start of the trimming interval. Portions of the curve before curve(t0) are removed.

    • t1: number

      End of the trimming interval. Portions of the curve after curve(t1) are removed.

    Returns Curve

    Trimmed portion of this curve is successful, null on failure.

    Description

    Removes portions of the curve outside the specified interval.

  • Returns object

    [boolean, Arc] (boolean) true if the curve could be converted into an arc. (Arc) On success, the Arc will be filled in.

    Description

    Try to convert this curve into an Arc using RhinoMath.ZeroTolerance.

  • Returns object

    [boolean, Circle] (boolean) true if the curve could be converted into a Circle. (Circle) On success, the Circle will be filled in.

    Description

    Try to convert this curve into a circle using RhinoMath.ZeroTolerance.

  • Returns object

    [boolean, Polyline] (boolean) true if this curve can be represented as a polyline; otherwise, false. (Polyline) If true is returned, then the polyline form is returned here.

    Description

    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.

  • Parameters

    • periodic: boolean

      If true, create a periodic uniform curve. If false, create a clamped uniform curve.

    • degree: number

      (>=1) degree=order-1.

    • points: Point3dList | number[][]

      control vertex locations as an array of points or a Point3dList.

    Returns NurbsCurve

    new NURBS curve on success null on error.

    Description

    Constructs a 3D NURBS curve from a list of control points.

  • Parameters

    • points: Point3dList | number[][]

      Control points as an array of arrays containing three numbers or a Point3dList.

    • degree: number

      Degree of curve. The number of control points must be at least degree+1.

    Returns Curve

    Description

    Constructs a curve from a set of control-point locations.

  • Parameters

    Returns NurbsCurve

    Curve on success, null on failure.

    Description

    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.

  • Parameters

    Returns NurbsCurve

    Curve on success, null on failure.

    Description

    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.

  • Parameters

    Returns NurbsCurve

    A NURBS curve representation of this ellipse or null if no such representation could be made.

    Description

    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.

  • Parameters

    Returns NurbsCurve

    Curve on success, null on failure.

    Description

    Gets a non-rational, degree 1 NURBS curve representation of the line.

  • Parameters

    • json: object

      A json formatted object in the following format (values are orientative):

      {
      version: 10000,
      archive3dm: 60,
      opennurbs: -1877964208,
      data: 'encoded 3dm object data'
      }

    Returns CommonObject

    Description

    Decodes a Rhino Object

Generated using TypeDoc