vpype_gscrib.renderer.coolants

Coolant system activation and control.

This module provides implementations for various coolant systems in CNC machines, each generating specific G-code for controlling different cooling mechanisms such as mist coolant or flood coolant.

class vpype_gscrib.renderer.coolants.BaseCoolant

Bases: ABC

Base class for coolant system implementations.

This abstract base class defines the interface for controlling machine coolant systems. It handles the activation and deactivation of cooling mechanisms like mist coolant, flood coolant, or air blast systems.

Different machines may implement cooling differently:

  • Some machines support multiple coolant types (mist/flood)

  • Some machines might require warmup or cooldown sequences

  • Air blast systems might need pressure ramping

abstractmethod turn_off(ctx: GContext)

Deactivate the coolant system.

Generates G-code commands to stop the coolant flow.

Parameters:

ctx (GContext) – The G-code generation context

abstractmethod turn_on(ctx: GContext)

Activate the coolant system.

Generates G-code commands to start the coolant flow.

Parameters:

ctx (GContext) – The G-code generation context

class vpype_gscrib.renderer.coolants.CoolantFactory

Bases: object

A factory for creating coolant managers.

This factory creates specialized coolant managers that handle the control of coolant systems in CNC machines. Coolant managers control the flow of cutting fluid or coolant during machining operations to reduce heat, clear chips, and extend tool life.

classmethod create(coolant_type: CoolantType) BaseCoolant

Create a new coolant manger instance.

Parameters:

coolant_type (CoolantType) – Coolant type.

Returns:

Coolant manger instance.

Return type:

BaseCoolant

Raises:

KeyError – If type is not valid.

class vpype_gscrib.renderer.coolants.FloodCoolant

Bases: BaseCoolant

Flood coolant system implementation.

This class handles operations for a flood coolant system, including activation and deactivation.

turn_off(ctx: GContext)

Deactivate the flood coolant system.

turn_on(ctx: GContext)

Activate the flood coolant system.

class vpype_gscrib.renderer.coolants.MistCoolant

Bases: BaseCoolant

Mist coolant system implementation.

This class handles operations for a mist coolant system, including activation and deactivation.

turn_off(ctx: GContext)

Deactivate the mist coolant system.

turn_on(ctx: GContext)

Activate the mist coolant system.

class vpype_gscrib.renderer.coolants.NoCoolant

Bases: BaseCoolant

No-op coolant system implementation.

This class does not perform any coolant operations, effectively disabling coolant control.

turn_off(ctx: GContext)

Deactivate the coolant system.

Generates G-code commands to stop the coolant flow.

Parameters:

ctx (GContext) – The G-code generation context

turn_on(ctx: GContext)

Activate the coolant system.

Generates G-code commands to start the coolant flow.

Parameters:

ctx (GContext) – The G-code generation context