Class: Laser::Cutter::Notching::Shift
- Inherits:
-
Struct
- Object
- Struct
- Laser::Cutter::Notching::Shift
- Defined in:
- lib/laser-cutter/notching/path_generator.rb
Instance Attribute Summary collapse
-
#delta ⇒ Object
Returns the value of attribute delta.
-
#dim_index ⇒ Object
Returns the value of attribute dim_index.
-
#direction ⇒ Object
Returns the value of attribute direction.
Instance Method Summary collapse
Instance Attribute Details
#delta ⇒ Object
Returns the value of attribute delta
5 6 7 |
# File 'lib/laser-cutter/notching/path_generator.rb', line 5 def delta @delta end |
#dim_index ⇒ Object
Returns the value of attribute dim_index
5 6 7 |
# File 'lib/laser-cutter/notching/path_generator.rb', line 5 def dim_index @dim_index end |
#direction ⇒ Object
Returns the value of attribute direction
5 6 7 |
# File 'lib/laser-cutter/notching/path_generator.rb', line 5 def direction @direction end |
Instance Method Details
#next_point_after(point) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/laser-cutter/notching/path_generator.rb', line 6 def next_point_after point p = point.clone shift = [] shift[dim_index] = delta * direction shift[(dim_index + 1) % 2] = 0 p.plus *shift end |