Class FacetDefinitions
java.lang.Object
org.apache.commons.geometry.io.euclidean.threed.FacetDefinitions
Class containing static methods that operate on
FacetDefinition
instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConvexPolygon3D
toPolygon
(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.
-
Constructor Details
-
FacetDefinitions
private FacetDefinitions()Utility class; no instantiation.
-
-
Method Details
-
toPolygon
public static ConvexPolygon3D toPolygon(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:
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:
NullPointerException
- if either argument is nullIllegalArgumentException
- if a valid convex polygon cannot be constructed
-