NurbsCurve

class compas_occ.geometry.NurbsCurve(name=None)[source]

Bases: compas_occ.geometry.curves._curve.Curve

Class representing a NURBS curve based on the BSplineCurve of the OCC geometry kernel.

Attributes
  • points (List[Point]) – The control points of the curve.

  • weights (List[float]) – The weights of the control points.

  • knots (List[float]) – The knot vector, without duplicates.

  • multiplicities (List[int]) – The multiplicities of the knots in the knot vector.

  • knotsequence (List[float]) – The knot vector, with repeating values according to the multiplicities.

  • degree (int) – The degree of the polynomials.

  • order (int) – The order of the curve.

  • domain (Tuple[float, float]) – The parameter domain.

  • start (Point) – The point corresponding to the start of the parameter domain.

  • end (Point) – The point corresponding to the end of the parameter domain.

  • is_closed (bool) – True if the curve is closed.

  • is_periodic (bool) – True if the curve is periodic.

  • is_rational (bool) – True is the curve is rational.

References

1

https://dev.opencascade.org/doc/occt-7.4.0/refman/html/class_geom___b_spline_curve.html

2

https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_Geometry_NurbsCurve.htm

3

https://en.wikipedia.org/wiki/Non-uniform_rational_B-spline

4

https://developer.rhino3d.com/guides/opennurbs/nurbs-geometry-overview/

Methods

aabb([precision])

Compute the axis aligned bounding box of the curve.

closest_point(point[, distance])

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

copy()

Make an independent copy of the current curve.

curvature_at(t)

Compute the curvature at a point on the curve.

divide_by_count(count)

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

divide_by_length(length)

Divide the curve into segments of specified length.

fair()

frame_at(t)

Compute the local frame at a point on the curve.

from_arc(arc, degree[, pointcount])

from_circle(circle)

Construct a NURBS curve from a circle.

from_data(data)

Construct a NURBS curve from its data representation.

from_edge(edge)

Construct a NURBS curve from an existing OCC TopoDS_Edge.

from_ellipse(ellipse)

Construct a NURBS curve from an ellipse.

from_interpolation(points[, precision])

Construct a NURBS curve by interpolating a set of points.

from_json(filepath)

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

from_jsonstring(string)

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

from_line(line)

Construct a NURBS curve from a line.

from_occ(occ_curve)

Construct a NURBS curve from an existing OCC BSplineCurve.

from_parameters(points, weights, knots, …)

Construct a NURBS curve from explicit curve parameters.

from_points(points[, degree])

Construct a NURBS curve from control points.

from_step(filepath)

Load a NURBS curve from an STP file.

length([precision])

Compute the length of the curve.

locus([resolution])

Compute the locus of the curve.

obb([precision])

Compute the oriented bounding box of the curve.

point_at(u)

Compute a point on the curve.

reverse()

Reverse the parametrisation of the curve.

space([n])

Compute evenly spaced parameters over the curve domain.

tangent_at(t)

Compute the tangent vector at a point on the curve.

to_data()

Convert an object to its native data representation.

to_json(filepath[, pretty])

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

to_jsonstring([pretty])

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

to_line()

to_polyline()

to_step(filepath[, schema])

Write the curve geometry to a STP file.

transform(T)

Transform this curve.

transformed(T)

Transform a copy of the curve.

validate_data()

Validate the object’s data against its data schema (self.DATASCHEMA).

validate_json()

Validate the object’s data against its json schema (self.JSONSCHEMA).

xyz([n])

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