Class: GridGenerator::Skewb::RightElementFactory

Inherits:
ElementFactory show all
Defined in:
lib/grid_generator/skewb/right_element_factory.rb

Instance Attribute Summary

Attributes inherited from ElementFactory

#col_num, #colour, #grid_x, #grid_y, #opacity, #row_num, #side_size, #units

Instance Method Summary collapse

Methods inherited from ElementFactory

#build, #initialize, #offset, #points

Constructor Details

This class inherits a constructor from GridGenerator::Skewb::ElementFactory

Instance Method Details

#anchorsObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/grid_generator/skewb/right_element_factory.rb', line 6

def anchors
  @anchors ||= {
    top_left_corner: Matrix.column_vector([0, 2*units]),
    top_right_corner: Matrix.column_vector([4*units, 0]),
    bottom_left_corner: Matrix.column_vector([0, 6*units]),
    bottom_right_corner: Matrix.column_vector([4*units, 4*units]),

    top_middle: Matrix.column_vector([2*units, units]),
    left_middle: Matrix.column_vector([0, 4*units]),
    right_middle: Matrix.column_vector([4*units, 2*units]),
    bottom_middle: Matrix.column_vector([2*units, 5*units])
  }
end