Class ObjBoundaryReadHandler3D

java.lang.Object
org.apache.commons.geometry.io.euclidean.threed.AbstractBoundaryReadHandler3D
org.apache.commons.geometry.io.euclidean.threed.obj.ObjBoundaryReadHandler3D
All Implemented Interfaces:
BoundaryReadHandler<PlaneConvexSubset,BoundarySource3D>, BoundaryReadHandler3D

public class ObjBoundaryReadHandler3D extends AbstractBoundaryReadHandler3D
BoundaryReadHandler3D implementation for reading OBJ data. Input is read using the UTF-8 charset by default.
  • Field Details

    • defaultCharset

      private Charset defaultCharset
      Charset for reading text input.
  • Constructor Details

    • ObjBoundaryReadHandler3D

      public ObjBoundaryReadHandler3D()
  • Method Details

    • getFormat

      public GeometryFormat getFormat()
      Get the data format supported by this handler.
      Returns:
      data format supported by this handler
    • getDefaultCharset

      public Charset getDefaultCharset()
      Get the text input default charset, used if the input does not specify a charset.
      Returns:
      text input default charset
    • setDefaultCharset

      public void setDefaultCharset(Charset charset)
      Set the text input default charset, used if the input does not specify a charset.
      Parameters:
      charset - text input default charset
    • facetDefinitionReader

      public FacetDefinitionReader facetDefinitionReader(GeometryInput in)
      Return a FacetDefinitionReader for reading raw facets from the given input stream.
      Parameters:
      in - input stream to read from
      Returns:
      facet definition reader instance
    • readTriangleMesh

      public TriangleMesh readTriangleMesh(GeometryInput in, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
      Read a triangle mesh from the given input. Implementations may throw runtime exceptions if mathematically invalid boundaries are encountered.
      Specified by:
      readTriangleMesh in interface BoundaryReadHandler3D
      Overrides:
      readTriangleMesh in class AbstractBoundaryReadHandler3D
      Parameters:
      in - input stream to read from
      precision - precision context used for floating point comparisons
      Returns:
      triangle mesh containing the data from the given input stream
    • createReader

      private Reader createReader(GeometryInput in)
      Create a Reader for reading character data from the given input.
      Parameters:
      in - input to read from
      Returns:
      reader instance
      Throws:
      UncheckedIOException - if an I/O error occurs