math.geom3d
Class Box3D
- java.lang.Object
-
- math.geom3d.Box3D
-
public class Box3D extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor and Description Box3D()Empty constructor (size and position zero)Box3D(double x0, double x1, double y0, double y1, double z0, double z1)Main constructor, given bounds for x coord, bounds for y coord, and bounds for z coord.Box3D(Point3D p1, Point3D p2)Constructor from 2 points, giving extreme coordinates of the box.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetDepth()Returns the depth, i.e.doublegetHeight()Returns the height, i.e.doublegetMaxX()doublegetMaxY()doublegetMaxZ()doublegetMinX()doublegetMinY()doublegetMinZ()doublegetWidth()Returns the width, i.e.Box3Dintersection(Box3D box)Returns the Box2D which is contained both by this box and by the specified box.Box3Dunion(Box3D box)Returns the Box2D which contains both this box and the specified box.
-
-
-
Constructor Detail
-
Box3D
public Box3D()
Empty constructor (size and position zero)
-
Box3D
public Box3D(double x0, double x1, double y0, double y1, double z0, double z1)Main constructor, given bounds for x coord, bounds for y coord, and bounds for z coord. A check is performed to ensure first bound is lower than second bound.
-
-
Method Detail
-
getMinX
public double getMinX()
-
getMaxX
public double getMaxX()
-
getMinY
public double getMinY()
-
getMaxY
public double getMaxY()
-
getMinZ
public double getMinZ()
-
getMaxZ
public double getMaxZ()
-
getWidth
public double getWidth()
Returns the width, i.e. the difference between the min and max x coord
-
getHeight
public double getHeight()
Returns the height, i.e. the difference between the min and max y coord
-
getDepth
public double getDepth()
Returns the depth, i.e. the difference between the min and max z coord
-
union
public Box3D union(Box3D box)
Returns the Box2D which contains both this box and the specified box.- Parameters:
box- the bounding box to include- Returns:
- this
-
-
DMelt 3.0 © DataMelt by jWork.ORG