Class Graster
In: lib/graster.rb
lib/graster/runner.rb
lib/graster/gcode_file.rb
lib/graster/gmask_file.rb
lib/graster/image.rb
Parent: Object

Methods

Classes and Modules

Class Graster::GcodeFile
Class Graster::GmaskFile
Class Graster::Image
Class Graster::InvalidConfig
Class Graster::Runner

Constants

ROOT2 = Math.sqrt(2)
OPTIONS = { :dpi => [[Float],"X,Y","Dots per inch of your device"], :on_range => [[Float], "MIN,MAX","Luminosity range for which the", "laser should be on"], :overshoot => [Float,"INCHES", "Distance the X axis should travel", "past the outer boundaries of the outer", "images. This needs to be wide enough", "so that the X axis doesn't start", "decelerating until after it has", "cleared the image"], :offset => [[Float],"X,Y", "Location for the bottom left corner", "of the bottom left tile. The X", "component of this setting must be", "equal to or greater than overshoot"], :repeat => [[Integer],"X,Y", "Number of times to repeat the image", "in the X and Y axes, respectively.", "Size of the tile(s) inches. Any nil", "value is calculated from the size of", "the bitmap"], :tile_spacing => [[Float],"X,Y", "X,Y gap between repeated tiles in", "inches"], :feed => [Float,"N", "Speed to move the X axis while", "burning, in inches/minute"], :cut_feed => [Float,"N", "Speed at which to cut out tiles"], :corner_radius => [Float,"N", "Radius of rounded corners for", "cutout, 0 for pointy corners"]
DEFAULTS = { :dpi => [500,500], # X,Y dots per inch of your device :on_range => [0.0,0.5], # Luminosity range for which the laser should be on :overshoot => 0.5, # Distance the X axis should travel past the outer boundaries of the outer images. # This needs to be wide enough so that the X axis doesn't start decelerating # until after it has cleared the image. :offset => [1.0,1.0], # X,Y location for the bottom left corner of the bottom left tile. # The X component of this setting must be equal to or greater than :overshoot. :repeat => [1,1], # Number of times to repeat the image in the X and Y axes, respectively. :tile_size => [false,false], # Size of the tile(s) inches. Any nil value is calculated from # the size of the bitmap. :tile_spacing => [0.125,0.125], # X,Y gap between repeated tiles in inches :feed => 120, # Speed to move the X axis while burning, in inches/minute :cut_feed => 20, # Speed at which to cut out tiles :corner_radius => 0

Attributes

config  [R] 
image  [R] 

Public Class methods

Public Instance methods

convert tile + pixel coordinates to inches

generate a unique id for this job

render gcode to cut out the tiles

cut out the tile with bottom left at x,y

render a complete tiled image to gcode and gmask streams

return a complete tiled row of spans converted to inches

[Validate]