Curve
- class compas.geometry.Curve[source]
Bases:
Geometry
Class representing a general parametric curve.
- Parameters:
- frame
compas.geometry.Frame
, optional The local coordinate system of the curve. Default is the world coordinate system.
- namestr, optional
The name of the curve.
- frame
See also
Notes
The curve is a “pluggable”. This means that it does not provide an actual implementation of a parametric curve, but rather serves as an interface for different backends. If a backend is available, it will be used to construct the curve and provide its functionality. This backend is referred to as the “plugin” implementation of the curve.
To activate the plugin mechanism, the backend should provide an implementation of the
new_curve()
function, and of any other function that can be implemented through the functionality available in the backend.- Attributes:
- frame
compas.geometry.Frame
The frame of the curve.
- transformation
compas.geometry.Transformation
, read-only The transformation from the local coordinate system of the curve (
frame
) to the world coordinate system.- plane
compas.geometry.Plane
, read-only The plane of the curve.
- dimensionint, read-only
The spatial dimension of the curve. In most cases this will be 3. For curves embedded on a surface, this is 2.
- domaintuple[float, float], read-only
The domain of the parameter space of the curve is the interval
[0.0, 1.0]
.- is_closedbool, read-only
True if the curve is closed.
- is_periodicbool, read-only
True if the curve is periodic.
- frame
Methods
Compute the axis-aligned bounding box of the curve.
Compute the closest point on the curve to a given point.
Compute the curvature vector of the curve at a parameter.
Compute the curve parameters that divide the curve into a specific number of equal length segments.
Compute the curve parameters that divide the curve into segments of specified length.
Compute the local frame of the curve at a parameter.
Load a curve from an OBJ file.
Load a curve from a STP file.
Compute the length of the curve.
Compute the normal of the curve at a parameter.
Compute a point of the curve at a parameter.
Reverse the parametrisation of the curve.
Reverse a copy of the curve.
Compute the tangent vector of the curve at a parameter.
Write the curve geometry to an OBJ file.
Convert the curve to a list of points.
Convert the curve to a polygon.
Convert the curve to a polyline.
Write the curve geometry to a STP file.
Transform the local coordinate system of the curve.
Inherited Methods
Converts the instance to a string.
Compute the axis-aligned bounding box of the geometry.
Compute the oriented bounding box of the geometry.
Make an independent copy of the data object.
Construct an object of this type from a JSON file.
Construct an object of this type from a JSON string.
Rotate the geometry.
Returns a rotated copy of this geometry.
Scale the geometry.
Returns a scaled copy of this geometry.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation and save it to a JSON file.
Convert an object to its native data representation and save it to a JSON string.
Returns a transformed copy of this geometry.
Translate the geometry.
Returns a translated copy of this geometry.
Validate the data against the object's data schema.