Class BoundaryConverter

java.lang.Object
org.episteme.core.mathematics.geometry.boundaries.BoundaryConverter

public final class BoundaryConverter extends Object
Utility class for converting between boundary dimensions.

Provides methods to:

  • Lift 2D boundaries to 3D (on a plane)
  • Project 3D boundaries to 2D
  • Extrude 2D to 3D volumes
  • Convert between coordinate systems
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • liftToXY

      public static Boundary3D liftToXY(Boundary2D boundary2D)
      Lifts a 2D boundary onto the XY plane at z=0.
      Parameters:
      boundary2D - the 2D boundary
      Returns:
      the 3D boundary on the XY plane
    • liftToXY

      public static Boundary3D liftToXY(Boundary2D boundary2D, Real z)
      Lifts a 2D boundary onto a plane parallel to XY at given z.
      Parameters:
      boundary2D - the 2D boundary
      z - the z-coordinate of the plane
      Returns:
      the 3D boundary
    • liftToXZ

      public static Boundary3D liftToXZ(Boundary2D boundary2D)
      Lifts a 2D boundary onto the XZ plane at y=0.
      Parameters:
      boundary2D - the 2D boundary
      Returns:
      the 3D boundary on the XZ plane
    • liftToXZ

      public static Boundary3D liftToXZ(Boundary2D boundary2D, Real y)
      Lifts a 2D boundary onto a plane parallel to XZ at given y.
      Parameters:
      boundary2D - the 2D boundary
      y - the y-coordinate of the plane
      Returns:
      the 3D boundary
    • liftToYZ

      public static Boundary3D liftToYZ(Boundary2D boundary2D)
      Lifts a 2D boundary onto the YZ plane at x=0.
      Parameters:
      boundary2D - the 2D boundary
      Returns:
      the 3D boundary on the YZ plane
    • liftToYZ

      public static Boundary3D liftToYZ(Boundary2D boundary2D, Real x)
      Lifts a 2D boundary onto a plane parallel to YZ at given x.
      Parameters:
      boundary2D - the 2D boundary
      x - the x-coordinate of the plane
      Returns:
      the 3D boundary
    • extrude

      public static Boundary3D extrude(Boundary2D boundary2D, Real height)
      Extrudes a 2D boundary into a 3D prism.
      Parameters:
      boundary2D - the 2D boundary
      height - the extrusion height
      Returns:
      the 3D prism
    • extrudeAlong

      public static Boundary3D extrudeAlong(Boundary2D boundary2D, Vector3D direction)
      Extrudes along a vector direction.
      Parameters:
      boundary2D - the 2D boundary
      direction - the extrusion direction vector
      Returns:
      the 3D boundary
    • projectToXY

      public static Boundary2D projectToXY(Boundary3D boundary3D)
      Projects a 3D boundary onto the XY plane.
      Parameters:
      boundary3D - the 3D boundary
      Returns:
      the 2D projection
    • projectToXZ

      public static Boundary2D projectToXZ(Boundary3D boundary3D)
      Projects a 3D boundary onto the XZ plane.
      Parameters:
      boundary3D - the 3D boundary
      Returns:
      the 2D projection
    • projectToYZ

      public static Boundary2D projectToYZ(Boundary3D boundary3D)
      Projects a 3D boundary onto the YZ plane.
      Parameters:
      boundary3D - the 3D boundary
      Returns:
      the 2D projection
    • projectToPlane

      public static Boundary2D projectToPlane(Boundary3D boundary3D, Vector3D planeNormal)
      Projects a 3D boundary onto an arbitrary plane.
      Parameters:
      boundary3D - the 3D boundary
      planeNormal - the plane normal
      Returns:
      the 2D projection
    • toPoint3D

      public static Point3D toPoint3D(Point2D point2D)
      Converts a 2D point to 3D on the XY plane (z=0).
      Parameters:
      point2D - the 2D point
      Returns:
      the 3D point
    • toPoint3D

      public static Point3D toPoint3D(Point2D point2D, Real z)
      Converts a 2D point to 3D with specified z.
      Parameters:
      point2D - the 2D point
      z - the z coordinate
      Returns:
      the 3D point
    • toPoint2D

      public static Point2D toPoint2D(Point3D point3D)
      Projects a 3D point to 2D on the XY plane.
      Parameters:
      point3D - the 3D point
      Returns:
      the 2D point
    • toPoint2DXZ

      public static Point2D toPoint2DXZ(Point3D point3D)
      Projects a 3D point to 2D on the XZ plane.
      Parameters:
      point3D - the 3D point
      Returns:
      the 2D point (x, z)
    • toPoint2DYZ

      public static Point2D toPoint2DYZ(Point3D point3D)
      Projects a 3D point to 2D on the YZ plane.
      Parameters:
      point3D - the 3D point
      Returns:
      the 2D point (y, z)
    • toCrisp

      public static Boundary2D toCrisp(FuzzyBoundary2D fuzzy, Real alpha)
      Converts a fuzzy 2D boundary to crisp by alpha-cut.
      Parameters:
      fuzzy - the fuzzy boundary
      alpha - the alpha threshold [0, 1]
      Returns:
      the crisp boundary
    • toFuzzy

      public static FuzzyBoundary2D toFuzzy(Boundary2D crisp, Real bufferWidth)
      Creates a fuzzy boundary from a crisp boundary with a buffer.
      Parameters:
      crisp - the crisp boundary
      bufferWidth - the width of the fuzzy transition zone
      Returns:
      the fuzzy boundary
    • toConvexHull

      public static Boundary2D toConvexHull(CompositeBoundary2D composite)
      Flattens a composite boundary to a single convex hull.
      Parameters:
      composite - the composite boundary
      Returns:
      the convex hull containing all regions
    • toIndividualRegions

      public static List<Boundary2D> toIndividualRegions(CompositeBoundary2D composite)
      Splits a composite boundary into its individual regions.
      Parameters:
      composite - the composite boundary
      Returns:
      list of individual boundaries