Class: GridGenerator::RediCube::LeftElementFactory

Inherits:
ElementFactory show all
Defined in:
lib/grid_generator/redi_cube/left_element_factory.rb

Instance Attribute Summary

Attributes inherited from ElementFactory

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

Instance Method Summary collapse

Methods inherited from ElementFactory

#build, #initialize, #offset, #points

Constructor Details

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

Instance Method Details

#anchorsObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/grid_generator/redi_cube/left_element_factory.rb', line 6

def anchors
  @anchors ||= {
    top_left_corner_top_left: Matrix.column_vector([0, 0]),
    top_left_corner_top_right: Matrix.column_vector([units, 0.5*units]),
    top_left_corner_bottom_left: Matrix.column_vector([0, units]),
    top_left_corner_bottom_right: Matrix.column_vector([units, 1.5*units]),

    top_right_corner_top_left: Matrix.column_vector([2*units, units]),
    top_right_corner_top_right: Matrix.column_vector([3*units, 1.5*units]),
    top_right_corner_bottom_left: Matrix.column_vector([2*units, 2*units]),
    top_right_corner_bottom_right: Matrix.column_vector([3*units, 2.5*units]),

    bottom_left_corner_top_left: Matrix.column_vector([0, 2*units]),
    bottom_left_corner_top_right: Matrix.column_vector([units, 2.5*units]),
    bottom_left_corner_bottom_left: Matrix.column_vector([0, 3*units]),
    bottom_left_corner_bottom_right: Matrix.column_vector([units, 3.5*units]),

    bottom_right_corner_top_left: Matrix.column_vector([2*units, 3*units]),
    bottom_right_corner_top_right: Matrix.column_vector([3*units, 3.5*units]),
    bottom_right_corner_bottom_left: Matrix.column_vector([2*units, 4*units]),
    bottom_right_corner_bottom_right: Matrix.column_vector([3*units, 4.5*units]),

    center: Matrix.column_vector([1.5*units, 2.25*units])
  }
end