OCCCurve
¤
Class representing a general curve object.
Parameters:
-
native_curve(GeomCurve) –An existing OCC curve handle wrapper.
-
name(str, default:None) –The name of the curve.
Attributes:
-
dimension(int) –The dimension of the curve.
-
domain(tuple[float, float]) –The domain of the parameter space of the curve.
-
end(Point) –The end point of the curve.
-
is_closed(bool) –Flag indicating that the curve is closed.
-
is_periodic(bool) –Flag indicating that the curve is periodic.
-
start(Point) –The start point of the curve.
- API Geometry
Methods:¤
closest_parameters_curve
¤
closest_parameters_curve(curve: OCCCurve, return_distance: bool = False) -> tuple[float, float] | tuple[tuple[float, float], float]
Compute the curve parameters where this curve is closest to another curve.
closest_point
¤
Compute the closest point on the curve to a given point.
If an orthogonal projection is not possible, the start or end point is returned, whichever is closer.
closest_points_curve
¤
closest_points_curve(curve: OCCCurve, return_distance: bool = False) -> tuple[Point, Point] | tuple[tuple[Point, Point], float]
Compute the points where this curve is closest to another curve.
curvature_at
¤
Compute the curvature vector at a curve parameter.
Raises:
-
ValueError–If the parameter is not in the curve domain.
divide_by_count
¤
divide_by_count(count: int, return_points: bool = False, precision: float = 1e-06) -> list[float] | tuple[list[float], list[Point]]
Divide the curve into a specific number of equal length segments.
divide_by_length
¤
divide_by_length(length: float, return_points: bool = False, precision: float = 1e-06) -> list[float] | tuple[list[float], list[Point]]
Divide the curve into segments of a given length.
Note that the end point of the last segment might not coincide with the end point of the curve.
embedded
¤
embedded(surface) -> OCCCurve2d
Return a new curve embedded in the parameter space of the surface.
frame_at
¤
Compute the local frame at a curve parameter.
Raises:
-
ValueError–If the parameter is not in the curve domain.
from_occ
classmethod
¤
from_occ(native_curve) -> OCCCurve
Construct a curve from an existing OCC curve handle.
.. deprecated:: 1.3
Use from_native instead.
offset
¤
Return a new curve offset over a distance in the plane defined by the given normal direction.
parameter_at_distance
¤
Compute the parameter at a given distance along the curve from a starting parameter.
point_at
¤
Compute the point at a curve parameter.
Raises:
-
ValueError–If the parameter is not in the curve domain.
tangent_at
¤
Compute the tangent vector at a curve parameter.
Raises:
-
ValueError–If the parameter is not in the curve domain.
to_points
¤
Convert the curve to a list of n points (single bulk evaluation).
to_step
¤
Write the curve geometry to a STP file.