Class ConvexPolyhedron3D

java.lang.Object
org.episteme.core.mathematics.geometry.boundaries.ConvexPolyhedron3D
All Implemented Interfaces:
Serializable, Boundary<Point3D>, Boundary3D

public class ConvexPolyhedron3D extends Object implements Boundary3D
A convex polyhedron in 3D space.

Defined by a set of triangular faces with outward-facing normals.

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

  • Method Details

    • tetrahedron

      public static ConvexPolyhedron3D tetrahedron(Point3D a, Point3D b, Point3D c, Point3D d)
      Creates a tetrahedron from 4 points.
    • box

      public static ConvexPolyhedron3D box(Point3D min, Point3D max)
      Creates a box (rectangular parallelepiped).
    • extrude

      public static ConvexPolyhedron3D extrude(Boundary2D polygon, Real height)
      Extrudes a 2D polygon into a 3D prism.
      Parameters:
      polygon - the base polygon
      height - the extrusion height
      Returns:
      the extruded polyhedron
    • getVertices

      public List<Point3D> getVertices()
      Description copied from interface: Boundary3D
      Returns all vertices of this 3D boundary.
      Specified by:
      getVertices in interface Boundary3D
      Returns:
      list of vertices
    • getFaces

      public List<Boundary3D.Face> getFaces()
      Description copied from interface: Boundary3D
      Returns all faces of this 3D boundary.
      Specified by:
      getFaces in interface Boundary3D
      Returns:
      list of faces
    • getVolume

      public Real getVolume()
      Description copied from interface: Boundary3D
      Returns the volume of this 3D boundary.
      Specified by:
      getVolume in interface Boundary3D
      Returns:
      the volume
    • getSurfaceArea

      public Real getSurfaceArea()
      Description copied from interface: Boundary3D
      Returns the surface area.
      Specified by:
      getSurfaceArea in interface Boundary3D
      Returns:
      the surface area
    • isConvex

      public boolean isConvex()
      Description copied from interface: Boundary3D
      Checks if this is a convex polyhedron.
      Specified by:
      isConvex in interface Boundary3D
      Returns:
      true if convex
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: Boundary
      Checks if this boundary is empty.
      Specified by:
      isEmpty in interface Boundary<Point3D>
      Returns:
      true if the boundary has no extent
    • getCentroid

      public Point3D getCentroid()
      Description copied from interface: Boundary
      Returns the centroid of this boundary.
      Specified by:
      getCentroid in interface Boundary<Point3D>
      Returns:
      the geometric center
    • getBoundingBox

      public BoundingBox<Point3D> getBoundingBox()
      Description copied from interface: Boundary
      Returns the bounding box of this boundary.
      Specified by:
      getBoundingBox in interface Boundary<Point3D>
      Returns:
      an axis-aligned bounding box
    • contains

      public boolean contains(Point3D point)
      Description copied from interface: Boundary
      Checks if a point is contained within this boundary.
      Specified by:
      contains in interface Boundary<Point3D>
      Parameters:
      point - the point to test
      Returns:
      true if point is inside or on the boundary
    • intersects

      public boolean intersects(Boundary<Point3D> other)
      Description copied from interface: Boundary
      Checks if this boundary intersects with another.
      Specified by:
      intersects in interface Boundary<Point3D>
      Parameters:
      other - the other boundary
      Returns:
      true if boundaries intersect
    • union

      public Boundary<Point3D> union(Boundary<Point3D> other)
      Description copied from interface: Boundary
      Computes the union of this boundary with another.
      Specified by:
      union in interface Boundary<Point3D>
      Parameters:
      other - the other boundary
      Returns:
      the union boundary
    • intersection

      public Boundary<Point3D> intersection(Boundary<Point3D> other)
      Description copied from interface: Boundary
      Computes the intersection of this boundary with another.
      Specified by:
      intersection in interface Boundary<Point3D>
      Parameters:
      other - the other boundary
      Returns:
      the intersection boundary
    • convexHull

      public Boundary<Point3D> convexHull()
      Description copied from interface: Boundary
      Computes the convex hull of this boundary.
      Specified by:
      convexHull in interface Boundary<Point3D>
      Returns:
      the convex hull
    • translate

      public Boundary<Point3D> translate(Point3D offset)
      Description copied from interface: Boundary
      Creates a copy of this boundary translated by a vector.
      Specified by:
      translate in interface Boundary<Point3D>
      Parameters:
      offset - the translation vector (as point)
      Returns:
      translated boundary
    • scale

      public Boundary<Point3D> scale(Real factor)
      Description copied from interface: Boundary
      Creates a scaled copy of this boundary.
      Specified by:
      scale in interface Boundary<Point3D>
      Parameters:
      factor - the scaling factor
      Returns:
      scaled boundary
    • rotateX

      public Boundary3D rotateX(Real angleRadians)
      Description copied from interface: Boundary3D
      Rotates around the X axis.
      Specified by:
      rotateX in interface Boundary3D
      Parameters:
      angleRadians - rotation angle
      Returns:
      rotated boundary
    • rotateY

      public Boundary3D rotateY(Real angleRadians)
      Description copied from interface: Boundary3D
      Rotates around the Y axis.
      Specified by:
      rotateY in interface Boundary3D
      Parameters:
      angleRadians - rotation angle
      Returns:
      rotated boundary
    • rotateZ

      public Boundary3D rotateZ(Real angleRadians)
      Description copied from interface: Boundary3D
      Rotates around the Z axis.
      Specified by:
      rotateZ in interface Boundary3D
      Parameters:
      angleRadians - rotation angle
      Returns:
      rotated boundary
    • rotateAround

      public Boundary3D rotateAround(Vector3D axis, Real angleRadians)
      Description copied from interface: Boundary3D
      Rotates around an arbitrary axis.
      Specified by:
      rotateAround in interface Boundary3D
      Parameters:
      axis - the rotation axis
      angleRadians - rotation angle
      Returns:
      rotated boundary
    • projectXY

      public Boundary2D projectXY()
      Description copied from interface: Boundary3D
      Projects this 3D boundary onto the XY plane.
      Specified by:
      projectXY in interface Boundary3D
      Returns:
      a 2D boundary
    • projectXZ

      public Boundary2D projectXZ()
      Description copied from interface: Boundary3D
      Projects this 3D boundary onto the XZ plane.
      Specified by:
      projectXZ in interface Boundary3D
      Returns:
      a 2D boundary
    • projectYZ

      public Boundary2D projectYZ()
      Description copied from interface: Boundary3D
      Projects this 3D boundary onto the YZ plane.
      Specified by:
      projectYZ in interface Boundary3D
      Returns:
      a 2D boundary
    • slice

      public Boundary2D slice(Vector3D planeNormal, Point3D pointOnPlane)
      Description copied from interface: Boundary3D
      Slices this boundary with a plane.
      Specified by:
      slice in interface Boundary3D
      Parameters:
      planeNormal - the plane normal
      pointOnPlane - a point on the plane
      Returns:
      the 2D cross-section
    • toString

      public String toString()
      Overrides:
      toString in class Object