Curve

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

Bases: Geometry

Class representing a general curve object.

Parameters

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

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

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

  • 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) – True if the curve is closed.

  • is_periodic (bool, read-only) – True if the curve is periodic.

Methods

aabb

Compute the axis aligned bounding box of the curve.

closest_point

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

curvature_at

Compute the curvature of the curve at a parameter.

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 of the curve at a parameter.

from_data

Construct a curve from its data representation.

from_obj

Load a curve from an OBJ file.

from_step

Load a curve from a STP file.

length

Compute the length of the curve.

locus

Compute the locus of points on the curve.

offset

point_at

Compute a point of the curve at a parameter.

reverse

Reverse the parametrisation of the curve.

reversed

Reverse a copy of the curve.

smooth

space

Compute evenly spaced parameters over the curve domain.

split

tangent_at

Compute the tangent vector of the curve at a parameter.

to_obj

Write the curve geometry to an OBJ file.

to_step

Write the curve geometry to a STP file.

torsion_at

Compute the torsion of the curve at a parameter.

trim

Inherited Methods

copy

Make an independent copy of the data object.

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.

transform

Transform the geometry.

transformed

Returns a transformed copy of this geometry.

validate_data

Validate the object's data against its data schema.

validate_json

Validate the object's data against its json schema.