Class: Geom::OrientedBounds2d

Inherits:
Object
  • Object
show all

Overview

The OrientedBounds2d class is a bounding box represented by four Point2d objects, upper left, upper right, lower left and lower right positions.

Version:

  • LayOut 2018

Instance Method Summary # collapse

Instance Method Details

#==(other) ⇒ Boolean

The #== method checks to see if the two Geom::OrientedBounds2ds are equal. This checks whether the point values are the same.

Examples:

entity.bounds == entity.untransformed_bounds

Parameters:

Returns:

  • (Boolean)

Version:

  • LayOut 2018

#lower_leftGeom::Point2d

The #lower_left method returns the Point2d of the lower left corner of the Geom::OrientedBounds2d.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
entity = doc.shared_enities.first
bounds = entity.drawing_bounds
l_l = bounds.lower_left

Returns:

Version:

  • LayOut 2018

#lower_rightGeom::Point2d

The #lower_right method returns the Point2d of the lower right corner of the Geom::OrientedBounds2d.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
entity = doc.shared_enities.first
bounds = entity.drawing_bounds
l_r = bounds.lower_right

Returns:

Version:

  • LayOut 2018

#to_aArray(Geom::Point2d, Geom::Point2d, Geom::Point2d, Geom::Point2d)

The #to_a method returns an array which contains the Point2d that define the Geom::OrientedBounds2d.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
entity = doc.shared_enities.first
bounds = entity.drawing_bounds
bounds.to_a.each { |point| p point.to_s }

Returns:

Version:

  • LayOut 2018

#upper_leftGeom::Point2d

The #upper_left method returns the Point2d of the upper left corner of the Geom::OrientedBounds2d.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
entity = doc.shared_enities.first
bounds = entity.drawing_bounds
u_l = bounds.upper_left

Returns:

Version:

  • LayOut 2018

#upper_rightGeom::Point2d

The #upper_right method returns the Point2d of the upper right corner of the Geom::OrientedBounds2d.

Examples:

doc = Layout::Document.open("C:/path/to/document.layout")
entity = doc.shared_enities.first
bounds = entity.drawing_bounds
u_r = bounds.upper_right

Returns:

Version:

  • LayOut 2018