Method: ChemScanner::ChemDraw::BaseValue#polygon_from_bb
- Defined in:
- lib/chem_scanner/chem_draw/node/base_value.rb
#polygon_from_bb(data) ⇒ Object
Get polygon based on bounding box data
110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/chem_scanner/chem_draw/node/base_value.rb', line 110 def polygon_from_bb(data) btop, left, bbottom, right = read_bounding_box(data) top = - btop bottom = - bbottom points = [ Geometry::Point.new(left, bottom), Geometry::Point.new(left, top), Geometry::Point.new(right, top), Geometry::Point.new(right, bottom) ] Geometry::Polygon.new(points) end |