Class FacetDefinitions

java.lang.Object
org.apache.commons.geometry.io.euclidean.threed.FacetDefinitions

public final class FacetDefinitions extends Object
Class containing static methods that operate on FacetDefinition instances.
  • 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 a ConvexPolygon3D 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 vertices
      normal - facet normal; may be null
      precision - 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 a ConvexPolygon3D 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 instance
      precision - precision context used for floating point comparisons
      Returns:
      convex polygon constructed from the facet
      Throws:
      NullPointerException - if either argument is null
      IllegalArgumentException - if a valid convex polygon cannot be constructed