Class PointBoundary<P>

java.lang.Object
org.episteme.core.mathematics.geometry.boundaries.PointBoundary<P>
Type Parameters:
P - the point type
All Implemented Interfaces:
Serializable, Boundary<P>

public class PointBoundary<P> extends Object implements Boundary<P>
A zero-dimensional boundary representing a single point.

This is useful for representing exact locations, point-of-interest, or degenerate boundaries.

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

    • PointBoundary

      public PointBoundary(P point)
      Creates a point boundary with zero tolerance.
      Parameters:
      point - the point
    • PointBoundary

      public PointBoundary(P point, Real tolerance)
      Creates a point boundary with a tolerance radius. Points within tolerance distance are considered "contained".
      Parameters:
      point - the center point
      tolerance - the tolerance radius
  • Method Details

    • getDimension

      public int getDimension()
      Description copied from interface: Boundary
      Returns the dimensionality of this boundary.
      Specified by:
      getDimension in interface Boundary<P>
      Returns:
      0 for point, 1 for line, 2 for polygon, 3 for polyhedron
    • contains

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

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

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

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

      public Real getMeasure()
      Description copied from interface: Boundary
      Computes the measure (length/area/volume) of this boundary. For 2D: area, for 3D: volume, for 1D: length.
      Specified by:
      getMeasure in interface Boundary<P>
      Returns:
      the measure as a Real value
    • getBoundaryMeasure

      public Real getBoundaryMeasure()
      Description copied from interface: Boundary
      Computes the boundary measure (perimeter/surface area). For 2D: perimeter, for 3D: surface area.
      Specified by:
      getBoundaryMeasure in interface Boundary<P>
      Returns:
      the boundary measure
    • intersects

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

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

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

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

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

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

      public P getPoint()
      Returns the point.
      Returns:
      the point
    • getTolerance

      public Real getTolerance()
      Returns the tolerance radius.
      Returns:
      the tolerance
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • of2D

      public static PointBoundary<Point2D> of2D(Real x, Real y)
      Creates a 2D point boundary.
    • of2D

      public static PointBoundary<Point2D> of2D(Real x, Real y, Real tolerance)
      Creates a 2D point boundary with tolerance.
    • of3D

      public static PointBoundary<Point3D> of3D(Real x, Real y, Real z)
      Creates a 3D point boundary.
    • of3D

      public static PointBoundary<Point3D> of3D(Real x, Real y, Real z, Real tolerance)
      Creates a 3D point boundary with tolerance.