Interface BoundaryReadHandler3D

All Superinterfaces:
BoundaryReadHandler<PlaneConvexSubset,BoundarySource3D>
All Known Implementing Classes:
AbstractBoundaryReadHandler3D, CsvBoundaryReadHandler3D, ObjBoundaryReadHandler3D, StlBoundaryReadHandler3D, TextBoundaryReadHandler3D

public interface BoundaryReadHandler3D extends BoundaryReadHandler<PlaneConvexSubset,BoundarySource3D>
Basic interface for reading 3D geometric boundary representations (B-reps) from a specific data storage format. This interface is primarily intended for use with BoundaryIOManager3D.

Implementation note: implementations of this interface must be thread-safe.

See Also:
  • Method Details

    • facetDefinitionReader

      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
      Throws:
      IllegalStateException - if a data format error occurs
      UncheckedIOException - if an I/O error occurs
    • facets

      Return a Stream that can be used to access all facet information from the given input stream. The input stream is expected to contain data in the format supported by this handler.

      The underlying input stream is closed when the returned stream is closed. Callers should therefore use the returned stream in a try-with-resources statement to ensure that all resources are properly released.

        try (Stream<FacetDefinition> stream = handler.facets(in)) {
            // access stream content
        }
       

      The following exceptions may be thrown during stream iteration:

      Parameters:
      in - input stream to read from; this is not closed when the returned stream is closed
      Returns:
      stream providing access to the facet information from the given input stream
      Throws:
      UncheckedIOException - if an I/O error occurs during stream creation
    • readTriangleMesh

      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.
      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
      Throws:
      IllegalStateException - if a parsing or syntax error occurs
      UncheckedIOException - if an I/O error occurs