Class FacetDefinitions
- java.lang.Object
-
- org.apache.commons.geometry.io.euclidean.threed.FacetDefinitions
-
public final class FacetDefinitions extends java.lang.Object
Class containing static methods that operate onFacetDefinition
instances.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
FacetDefinitions()
Utility class; no instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConvexPolygon3D
toPolygon(java.util.Collection<Vector3D> vertices, Vector3D normal, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Construct aConvexPolygon3D
from the given facet vertices and optional normal.static ConvexPolygon3D
toPolygon(FacetDefinition facet, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Construct aConvexPolygon3D
from the vertices of the given facet.
-
-
-
Method Detail
-
toPolygon
public static ConvexPolygon3D toPolygon(java.util.Collection<Vector3D> vertices, Vector3D normal, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Construct aConvexPolygon3D
from the given facet vertices and optional normal. If the normal is non-null, this method attempts to honor it by making the polygon point in a similar (but not necessarily equal) direction, reversing the order of vertices if needed.- Parameters:
vertices
- facet verticesnormal
- facet normal; may be nullprecision
- precision context used for floating point comparisons- Returns:
- convex polygon constructed from the vertices and normal
- Throws:
java.lang.IllegalArgumentException
- if a valid convex polygon cannot be constructed
-
toPolygon
public static ConvexPolygon3D toPolygon(FacetDefinition facet, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Construct aConvexPolygon3D
from the vertices of the given facet. This method attempts to honor any normal defined for the facet by making the polygon point in a similar (but not necessarily equal) direction by reversing the order of vertices if needed.- Parameters:
facet
- facet to convert to a polygon instanceprecision
- precision context used for floating point comparisons- Returns:
- convex polygon constructed from the facet
- Throws:
java.lang.NullPointerException
- if either argument is nulljava.lang.IllegalArgumentException
- if a valid convex polygon cannot be constructed
-
-