How kigster/laser-cutter works
LaserCutter is a Ruby library and CLI for designing custom notched box panels and returning or writing PDF/SVG output. The principal workflow is to supply and validate box options, generate panel geometry, arrange it for a page, and render the document; CLI commands expose generation, saved configuration, page sizes, examples, help, version, and shell completion. The graph preserves those documented capabilities and the sampled geometry/rendering layers. Some links are dashed because the relevant implementations were indexed but not excerpted.
Main entry points: command.rb Command framework · renderer Document rendering · cutter.rb Ruby API · box.rb Box panels
Components 26
Entry points
- Ruby API
lib/laser/cutter.rb
Box design
- Typed options
lib/laser/cutter/options.rb - Configuration
lib/laser/cutter/configuration.rb - Box panels
lib/laser/cutter/box.rb
Geometry engine
- Notch paths
lib/laser/cutter/notching/path_generator.rb - Edge parameters
lib/laser/cutter/notching/edge.rb - Geometry primitives
lib/laser/cutter/geometry - Line aggregation
lib/laser/cutter/aggregator.rb
Page and rendering
- Page sizes and units
lib/laser/cutter/page_manager.rb - Page layout
lib/laser/cutter/renderer/layout_renderer.rb - Document rendering
lib/laser/cutter/renderer - PDF output
- SVG output
CLI features
- CLI commands
lib/laser/cutter/cli.rb - CLI launcher
lib/laser/cutter/launcher.rb - Command framework
lib/laser/cutter/cli/command.rb - Generate command
lib/laser/cutter/cli/generate.rb - Config files
lib/laser/cutter/cli/config_file.rb - Page-size command
lib/laser/cutter/cli/page_sizes.rb - Usage examples
lib/laser/cutter/cli/examples.rb - Help command
lib/laser/cutter/cli/help.rb - Shell completion
lib/laser/cutter/cli/completion.rb - Version command
lib/laser/cutter/cli/version.rb
Other components
- Ruby user / CLI user
- Prawn
- Victor
Connections 26
- Ruby user / CLI user → Ruby API: calls
lib/laser/cutter.rb - Ruby API → Typed options: validates options
lib/laser/cutter.rb - Ruby API → Document rendering: selects renderer
lib/laser/cutter.rb - Ruby user / CLI user → CLI launcher: runs CLI
- CLI launcher → CLI commands: dispatches commands
- CLI commands → Command framework: registers commands
- Command framework → Generate command: dispatches
- Command framework → Page-size command: dispatches
- Command framework → Usage examples: dispatches
- Command framework → Help command: dispatches
- Command framework → Shell completion: dispatches
- Command framework → Version command: dispatches
- Generate command → Typed options: builds options
- Generate command → Config files: reads or saves
- Typed options → Box panels: configures design
- Box panels → Notch paths: generates notches
- Notch paths → Edge parameters: reads edge data
lib/laser/cutter/notching/path_generator.rb - Notch paths → Geometry primitives: creates lines and rectangles
lib/laser/cutter/notching/path_generator.rb - Box panels → Line aggregation: collects geometry
- Page layout → Page sizes and units: uses page dimensions
- Document rendering → Page layout: lays out panels
- Document rendering → PDF output: renders PDF
- Document rendering → SVG output: renders SVG
- Document rendering → Prawn: uses PDF engine
- Document rendering → Victor: uses SVG engine
- Page-size command → Page sizes and units: lists sizes