NurbsCurve

class compas.geometry.NurbsCurve(*args, **kwargs)[source]

Bases: Curve

A NURBS curve is defined by control points, weights, knots, and a degree.

Parameters

name (str, optional) – The name of the curve.

Attributes
  • points (list[compas.geometry.Point], read-only) – The control points.

  • weights (list[float], read-only) – The weights of the control points.

  • knots (list[float], read-only) – The knots, without multiplicity.

  • knotsequence (list[float], read-only) – The complete knot vector.

  • multiplicity (list[int], read-only) – The multiplicities of the knots.

  • degree (int, read-only) – The degree of the curve.

  • dimension (int, read-only) – The spatial dimension of the curve.

  • domain (tuple[float, float]) – The domain of the parameter space of the curve.

  • order (int, read-only) – The order of the curve (degree + 1).

  • start (compas.geometry.Point, read-only) – The start point of the curve.

  • end (compas.geometry.Point, read-only) – The end point of the curve.

  • is_closed (bool, read-only) – Flag indicating that the curve is closed.

  • is_periodic (bool, read-only) – Flag indicating that the curve is periodic.

  • is_rational (bool, read-only) – Flag indicating that the curve is rational. If the curve is rational, the weights of the control points are rational numbers.

  • bounding_box (compas.geometry.Box, read-only) – The axis aligned bounding box of the curve.

  • length (float) – The length of the curve.

Methods

closest_point

Compute the closest point on the curve to a given point.

copy

Make an independent copy of the current curve.

curvature_at

Compute the curvature at a point on the curve.

divide_by_count

Divide the curve into a specific number of equal length segments.

divide_by_length

Divide the curve into segments of specified length.

fair

frame_at

Compute the local frame at a point on the curve.

from_arc

from_circle

Construct a NURBS curve from a circle.

from_data

Construct a NURBS curve from its data representation.

from_ellipse

Construct a NURBS curve from an ellipse.

from_interpolation

Construct a NURBS curve by interpolating a set of points.

from_line

Construct a NURBS curve from a line.

from_parameters

Construct a NURBS curve from explicit curve parameters.

from_points

Construct a NURBS curve from control points.

from_step

Load a NURBS curve from an STP file.

locus

Compute the locus of all points on the curve.

point_at

Compute a point on the curve.

space

Compute evenly spaced parameters over the curve domain.

tangent_at

Compute the tangent vector at a point on the curve.

to_step

Write the curve geometry to a STP file.

transform

Transform this curve.

transformed

Transform a copy of the curve.

xyz

Compute point locations corresponding to evenly spaced parameters over the curve domain.

Inherited Methods

from_json

Construct an object from serialized data contained in a JSON file.

from_jsonstring

Construct an object from serialized data contained in a JSON string.

to_data

Convert an object to its native data representation.

to_json

Serialize the data representation of an object to a JSON file.

to_jsonstring

Serialize the data representation of an object to a JSON string.

validate_data

Validate the object's data against its data schema.

validate_json

Validate the object's data against its json schema.