Package eu.svjatoslav.sixth.e3d.geometry
Class Box
java.lang.Object
eu.svjatoslav.sixth.e3d.geometry.Box
- All Implemented Interfaces:
Cloneable
Same as: 3D rectangle, rectangular box, rectangular parallelopiped, cuboid,
rhumboid, hexahedron, rectangular prism.
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
p1
The first point of the box. -
p2
The second point of the box.
-
-
Constructor Details
-
Box
public Box()Creates a new box with two points at the origin. -
Box
Creates a new box with two points at the specified coordinates.
-
-
Method Details
-
enlarge
Enlarges the box by the specified border in all directions.- Parameters:
border
- The border to enlarge the box by. If the border is negative, the box will be shrunk.- Returns:
- The current box.
-
clone
-
getDepth
public double getDepth()- Returns:
- The depth of the box. The depth is the distance between the two points on the z-axis.
-
getHeight
public double getHeight()- Returns:
- The height of the box. The height is the distance between the two points on the y-axis.
-
getWidth
public double getWidth()- Returns:
- The width of the box. The width is the distance between the two points on the x-axis.
-
setBoxSize
Sets the size of the box. The box will be centered at the origin. Previous size and position of the box will be lost.- Parameters:
size
-Point3D
specifies box size in x, y and z axis.
-