gscrib.hooks

Common hooks for standard operations.

This module provides methods to create hooks for common operations. Currently only a basic extrusion hook is available.

gscrib.hooks.extrusion_hook(layer_height, nozzle_diameter, filament_diameter)

Creates a hook function to automatically extrude filament.

Parameters:
  • layer_height (float) – Height of each layer in work units

  • nozzle_diameter (float) – Diameter of the nozzle in work units

  • filament_diameter (float) – Diameter of the filament in work units

Returns:

A hook function that calculates extrusion amounts

Return type:

Callable

Example

>>> g.add_hook(extrusion_hook(
...    layer_height = 0.2,
...    nozzle_diameter = 0.4,
...    filament_diameter = 1.75
... ))