Class SimpleFacetDefinition
java.lang.Object
org.apache.commons.geometry.io.euclidean.threed.SimpleFacetDefinition
- All Implemented Interfaces:
FacetDefinition
- Direct Known Subclasses:
BinaryStlFacetDefinition
Simple
FacetDefinition
implementation that stores a list of vertices and
optional normal.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSimpleFacetDefinition
(List<Vector3D> vertices) Construct a new instance with the given vertices and no defined normal.SimpleFacetDefinition
(List<Vector3D> vertices, Vector3D normal) Construct a new instance with the given vertices and normal. -
Method Summary
-
Field Details
-
vertices
Facet vertices. -
normal
Facet normal; may be null.
-
-
Constructor Details
-
SimpleFacetDefinition
Construct a new instance with the given vertices and no defined normal.- Parameters:
vertices
- facet vertices- Throws:
IllegalArgumentException
- ifvertices
contains fewer than 3 elements
-
SimpleFacetDefinition
Construct a new instance with the given vertices and normal.- Parameters:
vertices
- facet verticesnormal
- facet normal; may be null- Throws:
IllegalArgumentException
- ifvertices
contains fewer than 3 elements
-
-
Method Details
-
getVertices
Get the facet vertices.- Specified by:
getVertices
in interfaceFacetDefinition
- Returns:
- facet vertices
-
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
-