Class SimpleFacetDefinition
- java.lang.Object
-
- org.apache.commons.geometry.io.euclidean.threed.SimpleFacetDefinition
-
- All Implemented Interfaces:
FacetDefinition
- Direct Known Subclasses:
BinaryStlFacetDefinition
public class SimpleFacetDefinition extends java.lang.Object implements FacetDefinition
SimpleFacetDefinitionimplementation that stores a list of vertices and optional normal.
-
-
Constructor Summary
Constructors Constructor Description SimpleFacetDefinition(java.util.List<Vector3D> vertices)Construct a new instance with the given vertices and no defined normal.SimpleFacetDefinition(java.util.List<Vector3D> vertices, Vector3D normal)Construct a new instance with the given vertices and normal.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector3DgetNormal()Get the normal defined for the facet or null if one has not been explicitly specified.java.util.List<Vector3D>getVertices()Get the facet vertices.java.lang.StringtoString()
-
-
-
Constructor Detail
-
SimpleFacetDefinition
public SimpleFacetDefinition(java.util.List<Vector3D> vertices)
Construct a new instance with the given vertices and no defined normal.- Parameters:
vertices- facet vertices- Throws:
java.lang.IllegalArgumentException- ifverticescontains fewer than 3 elements
-
SimpleFacetDefinition
public SimpleFacetDefinition(java.util.List<Vector3D> vertices, Vector3D normal)
Construct a new instance with the given vertices and normal.- Parameters:
vertices- facet verticesnormal- facet normal; may be null- Throws:
java.lang.IllegalArgumentException- ifverticescontains fewer than 3 elements
-
-
Method Detail
-
getVertices
public java.util.List<Vector3D> getVertices()
Get the facet vertices.- Specified by:
getVerticesin interfaceFacetDefinition- Returns:
- facet vertices
-
getNormal
public Vector3D getNormal()
Get the normal defined for the facet or null if one has not been explicitly specified. No guarantees are made regarding the properties of the normal or its relationship to the vertices.- Specified by:
getNormalin interfaceFacetDefinition- Returns:
- the defined normal for the facet or null if one has not been explicitly specified
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-