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
SimpleFacetDefinition
implementation 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 Vector3D
getNormal()
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.String
toString()
-
-
-
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
- ifvertices
contains 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
- ifvertices
contains fewer than 3 elements
-
-
Method Detail
-
getVertices
public java.util.List<Vector3D> getVertices()
Get the facet vertices.- Specified by:
getVertices
in 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:
getNormal
in interfaceFacetDefinition
- Returns:
- the defined normal for the facet or null if one has not been explicitly specified
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-