compas_tf.geometry
¤
Geometry operations for polylines.
Classes: - PolylineOffset: Offset operations for polylines - PolylineCut: Cutting operations for polylines - BezierCurve: Quadratic Bezier sampling - PolylineLoft: Lofting polylines into meshes
Classes¤
BezierCurve
¤
Bezier curve generation utilities.
Methods:¤
quadratic_points
staticmethod
¤
Generate points along a quadratic Bezier curve (parabola).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p0
|
:class:`compas.geometry.Point`
|
Start point. |
required |
p1
|
:class:`compas.geometry.Point`
|
Control point. |
required |
p2
|
:class:`compas.geometry.Point`
|
End point. |
required |
divisions
|
int
|
Number of points to generate along the curve. |
7
|
Returns:
| Type | Description |
|---|---|
class:`compas.geometry.Polyline`
|
Polyline of points along the Bezier curve. |
PolylineCut
¤
Cutting operations for polylines.
Methods:¤
cut_by_plane
staticmethod
¤
Cut polyline by plane.
By default the side containing the polyline's arc-length midpoint is kept.
Pass flip=False/True to force the legacy fixed-side behavior
(keep side opposite to the plane normal, or aligned with it).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
polyline
|
:class:`compas.geometry.Polyline`
|
Polyline to cut. |
required |
plane
|
:class:`compas.geometry.Plane`
|
Cutting plane. |
required |
flip
|
bool
|
Manual override of which side to keep. |
None
|
Returns:
| Type | Description |
|---|---|
class:`compas.geometry.Polyline`
|
Cut polyline. |
PolylineLoft
¤
Lofting polylines into meshes.
Methods:¤
to_mesh
staticmethod
¤
Loft two polylines into a mesh.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
polyline0
|
:class:`compas.geometry.Polyline`
|
First polyline (bottom). |
required |
polyline1
|
:class:`compas.geometry.Polyline`
|
Second polyline (top). |
required |
cap
|
bool
|
If True, add triangulated caps at top and bottom. |
True
|
close
|
bool
|
If True, close the polylines by connecting last point to first. |
True
|
Returns:
| Type | Description |
|---|---|
class:`compas.datastructures.Mesh`
|
Lofted mesh. |
PolylineOffset
¤
Offset operations for polylines.
Methods:¤
offset_polyline
staticmethod
¤
Offset a polyline by a distance in 3D.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
polyline
|
:class:`compas.geometry.Polyline`
|
Polyline to offset. |
required |
distance
|
float
|
Offset distance. |
required |
baseplane
|
:class:`compas.geometry.Plane`
|
Reference plane for offset direction. Defaults to world XY. |
None
|
Returns:
| Type | Description |
|---|---|
class:`compas.geometry.Polyline`
|
Offset polyline. |