Class: Laser::Cutter::Notching::Shift

Inherits:
Struct
  • Object
show all
Defined in:
lib/laser-cutter/notching/path_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#deltaObject

Returns the value of attribute delta

Returns:

  • (Object)

    the current value of delta



5
6
7
# File 'lib/laser-cutter/notching/path_generator.rb', line 5

def delta
  @delta
end

#dim_indexObject

Returns the value of attribute dim_index

Returns:

  • (Object)

    the current value of dim_index



5
6
7
# File 'lib/laser-cutter/notching/path_generator.rb', line 5

def dim_index
  @dim_index
end

#directionObject

Returns the value of attribute direction

Returns:

  • (Object)

    the current value of 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