Package com.treasure.hunt.jts.geom
Class Polyhedron
- java.lang.Object
-
- com.treasure.hunt.jts.geom.Polyhedron
-
public class Polyhedron extends java.lang.ObjectPolyhedron defined by a list ofHalfPlanes.
-
-
Constructor Summary
Constructors Constructor Description Polyhedron()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAngle(GeometryAngle angle)Adds aGeometryAngleas twoHalfPlanes to the polyhedron.voidaddHalfPlane(HalfPlane halfPlane)Adds a half plane to the polyhedron.org.locationtech.jts.geom.GeometrygetConvexHull()Convex hull of the (potentially unbound) polyhedron.booleaninside(org.locationtech.jts.geom.Coordinate c)Tests, if aCoordinatelays inside of the polyhedron.voidresolve()Resolve the vertex-representation from the half-plane representation.voidsetUnboundExtend(double unboundExtend)Factor of the extend of the unbound section.
-
-
-
Method Detail
-
addHalfPlane
public void addHalfPlane(HalfPlane halfPlane)
Adds a half plane to the polyhedron. Automatically resolves the vertex-representation and filters out degenerate half planes.- Parameters:
halfPlane- half plane to be added- See Also:
resolve(),filterDegenerate()
-
resolve
public void resolve()
Resolve the vertex-representation from the half-plane representation. We compute naively all of the intersections filtering them on whether they are inside. Also, we add two unbound section coordinates.
-
addAngle
public void addAngle(GeometryAngle angle)
Adds aGeometryAngleas twoHalfPlanes to the polyhedron.- Parameters:
angle- geometry angle to add
-
inside
public boolean inside(org.locationtech.jts.geom.Coordinate c)
Tests, if aCoordinatelays inside of the polyhedron.- Parameters:
c- tested coordinate- Returns:
- whether the tested coordinate lays inside of the polyhedron
-
getConvexHull
public org.locationtech.jts.geom.Geometry getConvexHull()
Convex hull of the (potentially unbound) polyhedron. By default extend the polyhedron 10 length units into the unbound region. This extension factor can be manipulated usingunboundExtend.
-
setUnboundExtend
public void setUnboundExtend(double unboundExtend)
Factor of the extend of the unbound section.
-
-