) vector);
- }
-
/** Get the offset (oriented distance) of a point.
* The offset is 0 if the point is on the underlying hyperplane,
* it is positive if the point is on one particular side of the
@@ -486,8 +457,8 @@ public double getOffset(Vector vector) {
* @return offset of the point
*/
@Override
- public double getOffset(final Point point) {
- return ((Vector3D) point).dotProduct(w) + originOffset;
+ public double getOffset(final Vector3D point) {
+ return point.dotProduct(w) + originOffset;
}
/** Check if the instance has the same orientation as another hyperplane.
@@ -496,7 +467,7 @@ public double getOffset(final Point point) {
* the same orientation
*/
@Override
- public boolean sameOrientationAs(final Hyperplane other) {
+ public boolean sameOrientationAs(final Hyperplane other) {
return (((Plane) other).w).dotProduct(w) > 0.0;
}
diff --git a/hipparchus-geometry/src/main/java/org/hipparchus/geometry/euclidean/threed/PolyhedronsSet.java b/hipparchus-geometry/src/main/java/org/hipparchus/geometry/euclidean/threed/PolyhedronsSet.java
index df70297ec..aadab7bd2 100644
--- a/hipparchus-geometry/src/main/java/org/hipparchus/geometry/euclidean/threed/PolyhedronsSet.java
+++ b/hipparchus-geometry/src/main/java/org/hipparchus/geometry/euclidean/threed/PolyhedronsSet.java
@@ -32,6 +32,7 @@
import org.hipparchus.geometry.LocalizedGeometryFormats;
import org.hipparchus.geometry.Point;
import org.hipparchus.geometry.euclidean.oned.Euclidean1D;
+import org.hipparchus.geometry.euclidean.oned.Vector1D;
import org.hipparchus.geometry.euclidean.twod.Euclidean2D;
import org.hipparchus.geometry.euclidean.twod.PolygonsSet;
import org.hipparchus.geometry.euclidean.twod.SubLine;
@@ -49,7 +50,7 @@
/** This class represents a 3D region: a set of polyhedrons.
*/
-public class PolyhedronsSet extends AbstractRegion {
+public class PolyhedronsSet extends AbstractRegion {
/** Build a polyhedrons set representing the whole real line.
* @param tolerance tolerance below which points are considered identical
@@ -78,7 +79,7 @@ public PolyhedronsSet(final double tolerance) {
* @param tree inside/outside BSP tree representing the region
* @param tolerance tolerance below which points are considered identical
*/
- public PolyhedronsSet(final BSPTree tree, final double tolerance) {
+ public PolyhedronsSet(final BSPTree tree, final double tolerance) {
super(tree, tolerance);
}
@@ -102,7 +103,7 @@ public PolyhedronsSet(final BSPTree tree, final double tolerance) {
* collection of {@link SubHyperplane SubHyperplane} objects
* @param tolerance tolerance below which points are considered identical
*/
- public PolyhedronsSet(final Collection> boundary,
+ public PolyhedronsSet(final Collection> boundary,
final double tolerance) {
super(boundary, tolerance);
}
@@ -170,13 +171,13 @@ public PolyhedronsSet(final double xMin, final double xMax,
* @param tolerance tolerance below which points are considered identical
* @return boundary tree
*/
- private static BSPTree buildBoundary(final double xMin, final double xMax,
- final double yMin, final double yMax,
- final double zMin, final double zMax,
- final double tolerance) {
+ private static BSPTree buildBoundary(final double xMin, final double xMax,
+ final double yMin, final double yMax,
+ final double zMin, final double zMax,
+ final double tolerance) {
if ((xMin >= xMax - tolerance) || (yMin >= yMax - tolerance) || (zMin >= zMax - tolerance)) {
// too thin box, build an empty polygons set
- return new BSPTree(Boolean.FALSE);
+ return new BSPTree<>(Boolean.FALSE);
}
final Plane pxMin = new Plane(new Vector3D(xMin, 0, 0), Vector3D.MINUS_I, tolerance);
final Plane pxMax = new Plane(new Vector3D(xMax, 0, 0), Vector3D.PLUS_I, tolerance);
@@ -184,8 +185,8 @@ private static BSPTree buildBoundary(final double xMin, final doubl
final Plane pyMax = new Plane(new Vector3D(0, yMax, 0), Vector3D.PLUS_J, tolerance);
final Plane pzMin = new Plane(new Vector3D(0, 0, zMin), Vector3D.MINUS_K, tolerance);
final Plane pzMax = new Plane(new Vector3D(0, 0, zMax), Vector3D.PLUS_K, tolerance);
- final Region boundary =
- new RegionFactory().buildConvex(pxMin, pxMax, pyMin, pyMax, pzMin, pzMax);
+ final Region boundary =
+ new RegionFactory().buildConvex(pxMin, pxMax, pyMin, pyMax, pzMin, pzMax);
return boundary.getTree(false);
}
@@ -196,9 +197,9 @@ private static BSPTree buildBoundary(final double xMin, final doubl
* @return boundary as a list of sub-hyperplanes
* @exception MathIllegalArgumentException if some basic sanity checks fail
*/
- private static List> buildBoundary(final List vertices,
- final List facets,
- final double tolerance) {
+ private static List> buildBoundary(final List vertices,
+ final List facets,
+ final double tolerance) {
// check vertices distances
for (int i = 0; i < vertices.size() - 1; ++i) {
@@ -239,7 +240,7 @@ private static List> buildBoundary(final List> boundary = new ArrayList<>();
+ final List> boundary = new ArrayList<>();
for (final int[] facet : facets) {
@@ -357,7 +358,7 @@ private static int[][] successors(final List vertices, final List tree) {
+ public PolyhedronsSet buildNew(final BSPTree tree) {
return new PolyhedronsSet(tree, getTolerance());
}
@@ -390,7 +391,7 @@ public BRep getBRep() throws MathRuntimeException {
}
/** Visitor extracting BRep. */
- private static class BRepExtractor implements BSPTreeVisitor {
+ private static class BRepExtractor implements BSPTreeVisitor {
/** Tolerance for vertices identification. */
private final double tolerance;
@@ -419,16 +420,16 @@ public BRep getBRep() {
/** {@inheritDoc} */
@Override
- public Order visitOrder(final BSPTree