Home Page > KernelCAD Models > Mathematical Objects > Oriented Boxes
Geometric Boxes
Oriented Boxes
Oriented Boxes
pure geometric objects represent a 3D box defined by its ranges in three axes. By default the
box is axis-aligned with the global axes. Some of boxes can be moved freely in
3D. Such boxes have a local frame assigned to it, in which case location and
orientation of the object can be manipulated by moving its local frame. Methods
in this case take local (related to the attached frame) coordinates.
Boxes can be manipulated via IBox
interface.
Boxes can be created with
IDIObjGenerator.Create* methods with eType
parameter set to eObjTypeBox
member of EObjectType
enumeration. There are also some other ways to create boxes related to
specific types objects
Query IFrame
from IBox to access the local frame. If the query fails the object does not have
the local frame and is normally considered as aligned with the global axes.
If the object implements IFrame
normally it also implements IFrame2 and
IMetrics.
IBox
can also be obtained from ISection
via query: ISection
> IPropertyArray
> GetProperty("BoundingBox", ...)
> IBox.
IBox
obtained this way is called Bounding Box of the KernelCAD section (the minimal box containing it)
aligned with the local axes of the section. The frame attached to the box is a
copy of local frame of the section. This box allows approximation of location of
the object and its dimensions. For example, if
IMetrix.GetPointLocation(pt)
() returns code indication that the point is outside the box than pt
can not belong to surface or internal area of the object.
IMetrics Interface
Location codes returned by
IMetrics.GetPointLocation
for boxes are
- 0 - Invalid location (error code)
- 1 - Inside internal area of the box but not on its surface
- 2 - At one of eight corners of the box
- 3 - On one of twelve edges
- 4 - Internal to one of six faces, but not at an edge nor in a
corner
- 5 - At unknown location on the external surface of the box
(one of 2, 3, or 4)
- 6 - Inside the closed box ( one of 1 through to 5)
- 7 - outside of the box
|