Class: Laser::Cutter::Sloped::Notcher
- Inherits:
-
Object
- Object
- Laser::Cutter::Sloped::Notcher
- Defined in:
- lib/laser/cutter/sloped/notcher.rb
Overview
Draws the notched path between two points of a panel, and says how it begins. Every panel of the sloped box is walked counter-clockwise, so the material a path notches into always lies to its right.
Paths are drawn without kerf: a panel is grown by half the kerf once its outline is whole.
Instance Attribute Summary collapse
-
#thickness ⇒ Float
readonly
The thickness of the material.
Instance Method Summary collapse
-
#initialize(notch_width:, thickness:) ⇒ Notcher
constructor
A new instance of Notcher.
-
#path(from, to, center_out:) ⇒ Array<Geometry::Point>
The path, from the one corner to the other.
-
#tab_first?(length, center_out:) ⇒ Boolean
Whether the side begins, and so ends, with a tab.
Constructor Details
#initialize(notch_width:, thickness:) ⇒ Notcher
Returns a new instance of Notcher.
18 19 20 21 22 |
# File 'lib/laser/cutter/sloped/notcher.rb', line 18 def initialize(notch_width:, thickness:) @notch_width = notch_width.to_f @thickness = thickness.to_f freeze end |
Instance Attribute Details
#thickness ⇒ Float (readonly)
Returns the thickness of the material.
14 15 16 |
# File 'lib/laser/cutter/sloped/notcher.rb', line 14 def thickness @thickness end |
Instance Method Details
#path(from, to, center_out:) ⇒ Array<Geometry::Point>
Returns the path, from the one corner to the other.
28 29 30 31 |
# File 'lib/laser/cutter/sloped/notcher.rb', line 28 def path(from, to, center_out:) lines = edge(from, to, center_out).lines lines.map(&:p1) << lines.last.p2 end |