Package eu.svjatoslav.sixth.e3d.geometry
Class Plane
java.lang.Object
eu.svjatoslav.sixth.e3d.geometry.Plane
Represents an infinite plane in 3D space using the Hesse normal form.
Planes are fundamental to BSP (Binary Space Partitioning) tree operations in CSG. They divide 3D space into two half-spaces.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a deep clone of this plane.voidflip()Flips the plane orientation by negating the normal and distance.static PlanefromPoints(Point3D a, Point3D b, Point3D c) Creates a plane from three non-collinear points.voidsplitPolygon(SolidPolygon polygon, List<SolidPolygon> coplanarFront, List<SolidPolygon> coplanarBack, List<SolidPolygon> front, List<SolidPolygon> back) Splits a polygon by this plane, classifying and potentially dividing it.
-
Field Details
-
EPSILON
public static final double EPSILONEpsilon value used for floating-point comparisons in BSP operations. Smaller values provide higher precision but may cause issues with near-coplanar polygons. 1e-5 is a good balance for most 3D geometry.- See Also:
-
normal
The unit normal vector perpendicular to the plane surface. -
distance
public double distanceThe signed distance from the origin to the plane along the normal.
-
-
Constructor Details
-
Plane
Creates a plane with the given normal and distance.- Parameters:
normal- the unit normal vectordistance- the signed distance from origin to the plane
-
-
Method Details
-
fromPoints
Creates a plane from three non-collinear points.- Parameters:
a- the first point on the planeb- the second point on the planec- the third point on the plane- Returns:
- a new Plane passing through the three points
-
clone
Creates a deep clone of this plane. -
flip
public void flip()Flips the plane orientation by negating the normal and distance. -
splitPolygon
public void splitPolygon(SolidPolygon polygon, List<SolidPolygon> coplanarFront, List<SolidPolygon> coplanarBack, List<SolidPolygon> front, List<SolidPolygon> back) Splits a polygon by this plane, classifying and potentially dividing it.- Parameters:
polygon- the polygon to classify and potentially splitcoplanarFront- list to receive coplanar polygons with same-facing normalscoplanarBack- list to receive coplanar polygons with opposite-facing normalsfront- list to receive polygons in the front half-spaceback- list to receive polygons in the back half-space
-