Package com.treasure.hunt.jts.geom
Class Polyhedron
- java.lang.Object
-
- com.treasure.hunt.jts.geom.Polyhedron
-
public class Polyhedron extends java.lang.Object
Polyhedron defined by a list ofHalfPlane
s.
-
-
Constructor Summary
Constructors Constructor Description Polyhedron()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAngle(GeometryAngle angle)
Adds aGeometryAngle
as twoHalfPlane
s to the polyhedron.void
addHalfPlane(HalfPlane halfPlane)
Adds a half plane to the polyhedron.org.locationtech.jts.geom.Geometry
getConvexHull()
Convex hull of the (potentially unbound) polyhedron.boolean
inside(org.locationtech.jts.geom.Coordinate c)
Tests, if aCoordinate
lays inside of the polyhedron.void
resolve()
Resolve the vertex-representation from the half-plane representation.void
setUnboundExtend(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 aGeometryAngle
as twoHalfPlane
s to the polyhedron.- Parameters:
angle
- geometry angle to add
-
inside
public boolean inside(org.locationtech.jts.geom.Coordinate c)
Tests, if aCoordinate
lays 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.
-
-