pyrobopath.toolpath.toolpath_core.Toolpath#
- class pyrobopath.toolpath.toolpath_core.Toolpath(contours: List[Contour] | None = None)[source]#
Bases:
objectA container for a list of Contour objects, representing a complete toolpath.
- Parameters:
contours (list of Contour, optional) – A list of Contour instances. Defaults to an empty list.
Methods
Combine multiple Toolpath objects into a single toolpath.
Construct a Toolpath from a sequence of G-code lines.
Uniformly scale all waypoints in each contour by a scalar value.
Return a unique list of tools in the toolpath
- classmethod combine(toolpaths: List[Toolpath]) Toolpath[source]#
Combine multiple Toolpath objects into a single toolpath.
- classmethod from_gcode(gcode: List[GcodeLine]) Toolpath[source]#
Construct a Toolpath from a sequence of G-code lines.
Parses linear motion (G1) and tool change (T) commands to generate a set of extruding paths grouped as contours.
- Parameters:
gcode (list of GcodeLine) – A list of parsed G-code lines from which to generate the toolpath.
- Returns:
A new Toolpath object constructed from the G-code input.
- Return type:
Notes
Only extrusion movements (with positive delta E) are considered part of a contour.
Tool changes are captured using T commands.