vpype_gscrib.renderer.racks

Handles tool changes and rack operations.

This module provides implementations for tool rack management, specifically handling tool changes. Each implementation generates the necessary G-code for performing tool change operations.

class vpype_gscrib.renderer.racks.AutomaticRack

Bases: BaseRack

Automatic tool rack implementation.

This class handles tool changes automatically using the machine’s built-in tool change capabilities.

change_tool(ctx: GContext)

Execute an automatic tool change operation.

Generates G-code commands to perform a tool change using the machine’s automatic tool changer.

Parameters:

ctx (GContext) – The G-code generation context

class vpype_gscrib.renderer.racks.BaseRack

Bases: ABC

Base class for tool rack implementations.

This abstract base class defines the interface for tool rack operations. Rack implementations handle tool changes and related operations.

abstractmethod change_tool(ctx: GContext)

Execute a tool change operation.

This method generates the necessary G-code commands to perform a complete tool change operation, excluding movements to safe positions which must be handled by the caller.

Parameters:

ctx (GContext) – The G-code generation context

class vpype_gscrib.renderer.racks.ManualRack

Bases: BaseRack

Manual tool rack implementation.

This class handles tool changes manually, requiring operator intervention to change tools.

change_tool(ctx: GContext)

Execute a manual tool change operation.

Generates G-code commands to pause the program and prompt the operator to change the tool manually.

Parameters:

ctx (GContext) – The G-code generation context

class vpype_gscrib.renderer.racks.NoRack

Bases: BaseRack

No-op tool rack implementation.

This class does not perform any tool management operations, effectively disabling tool change operations.

change_tool(ctx: GContext)

Execute a tool change operation.

This method generates the necessary G-code commands to perform a complete tool change operation, excluding movements to safe positions which must be handled by the caller.

Parameters:

ctx (GContext) – The G-code generation context

class vpype_gscrib.renderer.racks.RackFactory

Bases: object

A factory for creating tool rack managers.

This factory creates specialized managers that handle tool rack operations. Rack managers control the tool in use and the changing process, including picking up and putting away tools from/to an automatic tool changer (ATC) or providing instructions for manual tool changes.

classmethod create(rack_type: RackType) BaseRack

Create a new tool rack manger instance.

Parameters:

rack_type (RackType) – Rack type.

Returns:

Rack manger instance.

Return type:

BaseRack

Raises:

KeyError – If type is not valid.