Class: Laser::Cutter::Sloped::RingPanel
- Inherits:
-
Object
- Object
- Laser::Cutter::Sloped::RingPanel
- Defined in:
- lib/laser/cutter/sloped/ring_panel.rb
Overview
One of the rectangular panels that wrap around the sloped box between its two side walls: the bottom, the back, a strip or the tilted panel.
In its own frame the panel is width along x, from one side wall to
the other, and length along y, from its near edge to its far edge.
far edge
3 +----------+ 2
| |
end | | end
| |
0 +----------+ 1
near edge
- A long edge is notched into the panel beyond it, or plain.
- An end is notched into the side wall from the near edge as far as
joint, and from there on covers the edge of the side wall, one thickness out. A strip ends that way, past the corner of the wall, and so does a tilted panel that lifts off, along its whole length. - A corner next to two notched edges may carry the corner cube.
Constant Summary collapse
- OUTWARDS =
Which way is out of the panel across its left end, near edge, right end and far edge. Corner n lies between entry n and the one after.
[[-1, 0], [0, -1], [1, 0], [0, 1]].freeze
Instance Method Summary collapse
-
#initialize(notcher:, width:, length:, joint:, near: nil, far: nil, corners: []) ⇒ RingPanel
constructor
A new instance of RingPanel.
-
#loop ⇒ Geometry::Loop
The outline, counter-clockwise from the near left corner.
Constructor Details
#initialize(notcher:, width:, length:, joint:, near: nil, far: nil, corners: []) ⇒ RingPanel
Returns a new instance of RingPanel.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/laser/cutter/sloped/ring_panel.rb', line 38 def initialize(notcher:, width:, length:, joint:, near: nil, far: nil, corners: []) @notcher = notcher @width = width.to_f @length = length.to_f @joint = joint.to_f @near = near @far = far @corners = corners freeze end |
Instance Method Details
#loop ⇒ Geometry::Loop
Returns the outline, counter-clockwise from the near left corner.
50 51 52 |
# File 'lib/laser/cutter/sloped/ring_panel.rb', line 50 def loop Geometry::Loop.new(near_edge + corner(1) + right_end + corner(2) + far_edge + corner(3) + left_end + corner(0)) end |