Class: GridGenerator::Skewb::TopElementFactory

Inherits:
ElementFactory show all
Defined in:
lib/grid_generator/skewb/top_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/top_element_factory.rb', line 6

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

    top_middle: Matrix.column_vector([6*units, units]),
    left_middle: Matrix.column_vector([2*units, units]),
    right_middle: Matrix.column_vector([6*units, 3*units]),
    bottom_middle: Matrix.column_vector([2*units, 3*units])
  }
end