Module: Gcodify::OpsMixin

Included in:
Program
Defined in:
lib/gcodify/opsmixin.rb

Overview

OpsMixin is used as a Mixin to Program for the DSL - all of the DSL's methods, ie. hole, pocket, face, etc. are implemented here, and then `import`ed into Program, for DRYness and reusability. All methods contained in OpsMixin return a subclass of Op, ie. HoleOp, PocketOp, and so on.

Instance Method Summary collapse

Instance Method Details

#circular_pocket(options) ⇒ HoleOp, PocketOp

options is a Hash standard stuff in options for all these functions not every op will use all of these. :at - where to put the feature :depth - how deep the feature should be :radius - radius of the feature :diameter - diameter of the feature, behavior is undefined when specified at the same time as :radius :peck - peck step depth for peck drilling :return_height - return height for pecking during peck drilling. if not specified, pecking will not return to a constant height


23
24
# File 'lib/gcodify/opsmixin.rb', line 23

def circular_pocket(options)
end

#face(options) ⇒ HoleOp, FaceOp

options is a Hash standard stuff in options for all these functions not every op will use all of these. :at - where to put the feature :depth - how deep the feature should be :radius - radius of the feature :diameter - diameter of the feature, behavior is undefined when specified at the same time as :radius :peck - peck step depth for peck drilling :return_height - return height for pecking during peck drilling. if not specified, pecking will not return to a constant height


28
29
# File 'lib/gcodify/opsmixin.rb', line 28

def face(options)
end

#gcode(code) ⇒ Object

#gcode is a passthrough for gcode, used when Gcodify doesn't provide some feature of gcode that you might want to use.


36
37
38
# File 'lib/gcodify/opsmixin.rb', line 36

def gcode(code)
  @ops << Gcodify::Ops::GcodeOp(code)
end

#hole(options) ⇒ HoleOp

options is a Hash standard stuff in options for all these functions not every op will use all of these. :at - where to put the feature :depth - how deep the feature should be :radius - radius of the feature :diameter - diameter of the feature, behavior is undefined when specified at the same time as :radius :peck - peck step depth for peck drilling :return_height - return height for pecking during peck drilling. if not specified, pecking will not return to a constant height


17
18
19
# File 'lib/gcodify/opsmixin.rb', line 17

def hole(options)
  @ops << Gcodify::Ops::HoleOp.new(options)
end