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 withBoundaryIOManager3D
.Implementation note: implementations of this interface must be thread-safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FacetDefinitionReader
facetDefinitionReader(GeometryInput in)
Return aFacetDefinitionReader
for reading rawfacets
from the given input stream.java.util.stream.Stream<FacetDefinition>
facets(GeometryInput in)
Return aStream
that can be used to access all facet information from the given input stream.TriangleMesh
readTriangleMesh(GeometryInput in, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision)
Read a triangle mesh from the given input.-
Methods inherited from interface org.apache.commons.geometry.io.core.BoundaryReadHandler
boundaries, getFormat, read
-
-
-
-
Method Detail
-
facetDefinitionReader
FacetDefinitionReader facetDefinitionReader(GeometryInput in)
Return aFacetDefinitionReader
for reading rawfacets
from the given input stream.- Parameters:
in
- input stream to read from- Returns:
- facet definition reader instance
- Throws:
java.lang.IllegalStateException
- if a data format error occursjava.io.UncheckedIOException
- if an I/O error occurs
-
facets
java.util.stream.Stream<FacetDefinition> facets(GeometryInput in)
Return aStream
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:
IllegalArgumentException
if mathematically invalid data is encounteredIllegalStateException
if a parsing or syntax error occursUncheckedIOException
if an I/O error occurs
- 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:
java.io.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 fromprecision
- precision context used for floating point comparisons- Returns:
- triangle mesh containing the data from the given input stream
- Throws:
java.lang.IllegalStateException
- if a parsing or syntax error occursjava.io.UncheckedIOException
- if an I/O error occurs
-
-