Class BinaryStlFacetDefinition

java.lang.Object
org.apache.commons.geometry.io.euclidean.threed.SimpleFacetDefinition
org.apache.commons.geometry.io.euclidean.threed.stl.BinaryStlFacetDefinition
All Implemented Interfaces:
FacetDefinition

public class BinaryStlFacetDefinition extends SimpleFacetDefinition
Facet definition class that provides access to the 2-byte attribute value stored with each triangle in the binary STL format.
  • Field Details

    • attributeValue

      private final int attributeValue
      Attribute value for the facet (2 bytes).
  • Constructor Details

    • BinaryStlFacetDefinition

      public BinaryStlFacetDefinition(List<Vector3D> vertices, Vector3D normal, int attributeValue)
      Construct a new instance.
      Parameters:
      vertices - facet vertices
      normal - facet normal
      attributeValue - 2-byte attribute value
  • Method Details

    • getAttributeValue

      public int getAttributeValue()
      Get the 2-byte attribute value (known as the "attribute byte count") stored at the end of the STL facet definition binary representation. This value is typically set to zero but non-standard implementations may choose to store other values here.

      The bytes are stored with the first byte in the upper portion (bits 8-15) of the int and the second byte in the lower portion (bits 0-7).

      Returns:
      2-byte attribute value for the facet