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 Summary
Modifier and TypeMethodDescriptionReturn aFacetDefinitionReader
for reading rawfacets
from the given input stream.facets
(GeometryInput in) Return aStream
that can be used to access all facet information from the given input stream.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 Details
-
facetDefinitionReader
Return aFacetDefinitionReader
for reading rawfacets
from the given input stream.- Parameters:
in
- input stream to read from- Returns:
- facet definition reader instance
- Throws:
IllegalStateException
- if a data format error occursUncheckedIOException
- if an I/O error occurs
-
facets
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:
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:
IllegalStateException
- if a parsing or syntax error occursUncheckedIOException
- if an I/O error occurs
-