Class: Geom::BoundingBox
- Inherits:
-
Object
- Object
- Geom::BoundingBox
- Defined in:
- lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb
Overview
that the bounding box returned for face-me components is the center of its entire range of motion. This behavior changed in SketchUp 7.1. In 7.0 and earlier, the .bounds method would return the bounds around the face-me component’s current, visible center.
Bounding boxes are three-dimensional boxes (eight corners), aligned with the global axes, that surround entities within your model. There is a default bounding box for any new model that will surround all entities, including all groups and components. Additionally, there are bounding boxes for Drawingelement objects, including components and groups. Bounding boxes are only large enough to exactly bound the entities within your model, group, or component.
You can also create arbitrary BoundingBox objects by calling BoundingBox.new.
Instance Method Summary collapse
-
#add(*args) ⇒ Geom::BoundingBox
The add method is used to add a point, vertex, or other bounding boxes to the bounding box.
-
#center ⇒ Geom::Point3d
The center method is used to retrieve the Point3d object at the center of the bounding box.
-
#clear ⇒ Geom::BoundingBox
The clear method is used to clear a bounding box.
-
#contains?(point_or_bb) ⇒ Boolean
This method is used to determine if a bounding box contains a specific Point3d or BoundingBox object.
-
#corner(corner_index) ⇒ Geom::Point3d
The corner method is used to retrieve a point object at a specified corner of the bounding box.
-
#depth ⇒ Length
The #depth method is used to retrieve the depth of the bounding box.
-
#diagonal ⇒ Length
The #diagonal method is used to get the length of the diagonal of the bounding box.
-
#empty? ⇒ Boolean
The empty? method is used to determine if a bounding box is empty (such as if the bounds have not been set.) This returns the opposite of the valid? method.
-
#height ⇒ Length
The #height method is used to retrieve the height of the bounding box.
-
#initialize ⇒ Geom::BoundingBox
constructor
The new method is used to create a new, empty, bounding box.
-
#intersect(boundingbox) ⇒ Geom::BoundingBox
The intersect method is used to retrieve a bounding box that is the result of intersecting one bounding box with another.
-
#max ⇒ Geom::Point3d
The max method is used to retrieve the Point3d object where x, y and z are maximum in the bounding box.
-
#min ⇒ Geom::Point3d
The min method is used to retrieve the Point3d where x, y and z are minimum in the bounding box.
-
#valid? ⇒ Boolean
The valid method is used to determine if a bounding box is valid (contains points).
-
#width ⇒ Length
The #width method is used to retrieve the width of the bounding box.
Constructor Details
#initialize ⇒ Geom::BoundingBox
The new method is used to create a new, empty, bounding box.
225 226 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 225 def initialize end |
Instance Method Details
#add(point_or_bb) ⇒ Geom::BoundingBox #add(points_or_bb) ⇒ Geom::BoundingBox
The add method is used to add a point, vertex, or other bounding boxes to the bounding box. The size of the bounding box will increase as necessary to accommodate the new items.
Adding one point to an empty bounding box does not increase the size of the bounding box. You must add at least two points before methods such as BoundingBox.diagonal will return a size greater than zero.
63 64 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 63 def add(*args) end |
#center ⇒ Geom::Point3d
The center method is used to retrieve the Point3d object at the center of the bounding box.
79 80 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 79 def center end |
#clear ⇒ Geom::BoundingBox
The clear method is used to clear a bounding box.
A cleared BoundingBox does not have a size greater than zero until you add at least two points or another bounding box.
101 102 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 101 def clear end |
#contains?(point_or_bb) ⇒ Boolean
This method is used to determine if a bounding box contains a specific Point3d or BoundingBox object.
120 121 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 120 def contains?(point_or_bb) end |
#corner(corner_index) ⇒ Geom::Point3d
The corner method is used to retrieve a point object at a specified corner of the bounding box.
There are 8 corners to a bounding box, identified by the numbers 0 through 7. Points are returned in the currently set units (inches, by default). These are which index refers to which corner:
- 0 = [0, 0, 0] (left front bottom)
- 1 = [1, 0, 0] (right front bottom)
- 2 = [0, 1, 0] (left back bottom)
- 3 = [1, 1, 0] (right back bottom)
- 4 = [0, 0, 1] (left front top)
- 5 = [1, 0, 1] (right front top)
- 6 = [0, 1, 1] (left back top)
- 7 = [1, 1, 1] (right back top)
154 155 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 154 def corner(corner_index) end |
#depth ⇒ Length
The #depth method is used to retrieve the depth of the bounding box.
168 169 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 168 def depth end |
#diagonal ⇒ Length
The #diagonal method is used to get the length of the diagonal of the bounding box.
184 185 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 184 def diagonal end |
#empty? ⇒ Boolean
The empty? method is used to determine if a bounding box is empty (such as if the bounds have not been set.) This returns the opposite of the valid? method.
200 201 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 200 def empty? end |
#height ⇒ Length
The #height method is used to retrieve the height of the bounding box.
214 215 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 214 def height end |
#intersect(boundingbox) ⇒ Geom::BoundingBox
Prior to SU2015 this method would return incorrect result in some cases. For correct result in these versions you must first check if the boundingboxes actually overlap - then call this to get the resulting boundingbox.
The intersect method is used to retrieve a bounding box that is the result of intersecting one bounding box with another.
251 252 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 251 def intersect(boundingbox) end |
#max ⇒ Geom::Point3d
The max method is used to retrieve the Point3d object where x, y and z are maximum in the bounding box.
If you attempt to call the max method on an empty bounding box, you will receive a very large negative number.
270 271 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 270 def max end |
#min ⇒ Geom::Point3d
The min method is used to retrieve the Point3d where x, y and z are minimum in the bounding box.
286 287 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 286 def min end |
#valid? ⇒ Boolean
The valid method is used to determine if a bounding box is valid (contains points).
301 302 |
# File 'lib/sketchup-api-stubs/stubs/Geom/BoundingBox.rb', line 301 def valid? end |