OCCCurve

class compas_occ.geometry.OCCCurve(*args, **kwargs)[source]

Bases: compas.geometry.curves.curve.Curve

Class representing a general curve object.

Parameters

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

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

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

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

  • end (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.

Other Attributes

occ_curve (Geom_Curve) – The underlying OCC curve.

Methods

aabb

Compute the axis aligned bounding box of the curve.

closest_parameters_curve

Computes the curve parameters where the curve is the closest to another given curve.

closest_point

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

closest_points_curve

Computes the points on curves where the curve is the closest to another given curve.

copy

Make an independent copy of the current curve.

curvature_at

Compute the curvature vector at a curve parameter.

divide

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

divide_by_count

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

divide_by_length

embedded

Return a copy of the curve embedded in the parameter space of the surface.

frame_at

Compute the local frame at a curve parameter.

from_occ

Construct a NURBS curve from an existing OCC BSplineCurve.

length

Compute the length of the curve.

offset

Offset the curve over the specified distance in the given direction.

point_at

Compute the point at a curve parameter.

projected

Return a copy of the curve projected onto a surface.

reverse

Reverse the parametrisation of the curve.

tangent_at

Compute the tangent vector at a curve parameter.

to_polyline

Convert the curve to a polyline.

to_step

Write the curve geometry to a STP file.

transform

Transform this curve.

Inherited Methods

ToString

Converts the instance to a string.

fair

from_data

Construct a curve from its data representation.

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.

from_obj

Load a curve from an OBJ file.

from_step

Load a curve from a STP file.

locus

Compute the locus of points on the curve.

reversed

Reverse a copy of the curve.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

smooth

space

Compute evenly spaced parameters over the curve domain.

split

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.

to_obj

Write the curve geometry to an OBJ file.

torsion_at

Compute the torsion of the curve at a parameter.

transformed

Returns a transformed copy of this geometry.

trim

validate_data

Validate the object's data against its data schema.

validate_json

Validate the object's data against its json schema.