NAME

Graphics::Penplotter::GcodeXY::Split - Page-splitting role for GcodeXY

SYNOPSIS

$g->split('A4', 'output');
# Produces output_0_0.gcode, output_0_1.gcode, etc.

DESCRIPTION

A Role::Tiny role that adds the split method to Graphics::Penplotter::GcodeXY. Given a drawing on a large sheet (e.g. A0) and a target smaller sheet size (e.g. A4), split uses the Liang-Barsky line-clipping algorithm to divide the drawing across as many output files as needed to cover the big sheet, one file per sub-sheet. =head1 METHODS

split(size, filestem)

Divide the current drawing across multiple output gcode files sized to size (e.g. 'A4'). Output files are named filestem_i_j.gcode. The source object must have papersize set.

REQUIRED METHODS

This role requires the consuming class to provide: _croak, stroke, _parse, _addpath, _addtopage, output, penup, pendown, _LiangBarsky.

AUTHOR

Albert Koelmans (albert.koelmans@googlemail.com)

LICENSE

Same terms as Perl itself.