public final class VolumesBD extends Object
Functions over volumes.
These functions operate using the concepts of minimum-x, maximum-x, minimum-y, maximum-y, minimum-z, maximum-z, edges. It is up to individual applications to assign meaning to these edges such as "left" for minimum-x, "top" for minimum-y, or "far" for minimum-z.
| Modifier and Type | Method and Description |
|---|---|
static VolumeBD |
containing(VolumeBD a,
VolumeBD b)
Construct a volume that will contain both
a and b. |
static boolean |
contains(VolumeBD a,
VolumeBD b)
Determine whether or not one volume contains another.
|
static boolean |
containsPoint(VolumeBD a,
BigDecimal x,
BigDecimal y,
BigDecimal z)
Determine whether or not a volume contains a given point.
|
static boolean |
couldFitInside(VolumeBD a,
VolumeBD b)
Determine whether or not one volume could fit inside another.
|
static VolumeBD |
create(BigDecimal x,
BigDecimal y,
BigDecimal z,
BigDecimal size_x,
BigDecimal size_y,
BigDecimal size_z)
Create a volume of size (
size_x, size_y, size_z)
placing the minimum corner at (x, y, z). |
static VolumeBD |
moveAbsolute(VolumeBD volume,
BigDecimal x,
BigDecimal y,
BigDecimal z)
Move the given volume to
(x, y, z). |
static VolumeBD |
moveRelative(VolumeBD volume,
BigDecimal x,
BigDecimal y,
BigDecimal z)
Move the given volume by
(x, y, z). |
static VolumeBD |
moveToOrigin(VolumeBD volume)
Move the given volume to
(0, 0, 0). |
static boolean |
overlaps(VolumeBD a,
VolumeBD b)
Determine whether or not two volumes overlap.
|
static String |
show(VolumeBD volume) |
static String |
showToBuilder(VolumeBD volume,
StringBuilder sb) |
static VolumeSizeBD |
size(VolumeBD volume) |
static VolumeXYZSplitBD<VolumeBD> |
splitAtXYZ(VolumeBD v,
BigDecimal x,
BigDecimal y,
BigDecimal z)
Split the given volume at point
(x, y, z). |
public static VolumeBD create(BigDecimal x, BigDecimal y, BigDecimal z, BigDecimal size_x, BigDecimal size_y, BigDecimal size_z)
size_x, size_y, size_z)
placing the minimum corner at (x, y, z).x - The X value of the minimum cornery - The Y value of the minimum cornerz - The Z value of the minimum cornersize_x - The size of the volume on the X axissize_y - The size of the volume on the Y axissize_z - The size of the volume on the Z axispublic static boolean contains(VolumeBD a, VolumeBD b)
Determine whether or not one volume contains another.
Containing is reflexive: contains(a, a) == true.
Containing is transitive: contains(a, b) → contains(b, c) →
contains(a, c).
Containing is not necessarily symmetric.
a - Volume Ab - Volume Btrue iff a contains bpublic static VolumeBD moveRelative(VolumeBD volume, BigDecimal x, BigDecimal y, BigDecimal z)
(x, y, z).volume - The volumex - The amount to move on the X axisy - The amount to move on the Y axisz - The amount to move on the Z axispublic static VolumeBD moveAbsolute(VolumeBD volume, BigDecimal x, BigDecimal y, BigDecimal z)
(x, y, z).volume - The volumex - The position to which to move on the X axisy - The position to which to move on the Y axisz - The position to which to move on the Z axispublic static VolumeBD moveToOrigin(VolumeBD volume)
(0, 0, 0).volume - The volumepublic static boolean overlaps(VolumeBD a, VolumeBD b)
Determine whether or not two volumes overlap.
Overlapping is reflexive: overlaps(a, a) == true.
Overlapping is symmetric: overlaps(a, b) == overlaps(b, a).
Overlapping is not necessarily transitive.
a - A volumeb - A volumetrue iff a overlaps bpublic static boolean couldFitInside(VolumeBD a, VolumeBD b)
Determine whether or not one volume could fit inside another.
Fitting is reflexive: couldFitInside(a, a) == true.
Fitting is transitive: couldFitInside(a, b) → couldFitInside(b,
c) → couldFitInside(a, c).
Fitting is not necessarily symmetric.
a - A volumeb - A volumetrue iff a could fit inside bpublic static VolumeBD containing(VolumeBD a, VolumeBD b)
a and b.a - A volumeb - A volumea and bpublic static boolean containsPoint(VolumeBD a, BigDecimal x, BigDecimal y, BigDecimal z)
Determine whether or not a volume contains a given point.
a - A volumex - The X coordinate of the pointy - The Y coordinate of the pointz - The Z coordinate of the pointtrue iff a contains (x, y, z)public static VolumeXYZSplitBD<VolumeBD> splitAtXYZ(VolumeBD v, BigDecimal x, BigDecimal y, BigDecimal z)
Split the given volume at point (x, y, z).
v - A volumex - The X coordinate of the pointy - The Y coordinate of the pointz - The Z coordinate of the pointtrue iff a contains (x, y, z)public static String show(VolumeBD volume)
volume - The volumepublic static VolumeSizeBD size(VolumeBD volume)
volume - The volumepublic static String showToBuilder(VolumeBD volume, StringBuilder sb)
volume - The volumesb - A string builderCopyright © 2017 <code@io7m.com> http://io7m.com