Class StlBoundaryWriteHandler3D
java.lang.Object
org.apache.commons.geometry.io.euclidean.threed.AbstractBoundaryWriteHandler3D
org.apache.commons.geometry.io.euclidean.threed.stl.StlBoundaryWriteHandler3D
- All Implemented Interfaces:
BoundaryWriteHandler<PlaneConvexSubset, BoundarySource3D>, BoundaryWriteHandler3D
BoundaryWriteHandler3D
implementation for writing STL content. Because of its compact nature, all STL content is written in
binary format, as opposed the text (i.e. "ASCII") format. Callers should use the TextStlWriter
class directly in order to create text STL content.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet thedata formatsupported by this handler.intGet the initial size of the data buffers used by this instance.voidsetInitialBufferSize(int initialBufferSize) Set the initial size of the data buffers used by this instance.voidwrite(Stream<? extends PlaneConvexSubset> boundaries, GeometryOutput out) Write all boundaries in the stream to the given output using the data format supported by this instance.voidwrite(BoundarySource3D src, GeometryOutput out) Write all boundaries fromsrcto the given output, using the data format for the instance.voidwriteFacets(Stream<? extends FacetDefinition> facets, GeometryOutput out) Write allfacetsin the stream to the output using the data format supported by this instance.Methods inherited from class AbstractBoundaryWriteHandler3D
writeFacets
-
Constructor Details
-
StlBoundaryWriteHandler3D
public StlBoundaryWriteHandler3D()
-
-
Method Details
-
getFormat
Get thedata formatsupported by this handler.- Returns:
- data format supported by this handler
-
getinitialBufferSize
Get the initial size of the data buffers used by this instance.The buffer is used in situations where it is not clear how many triangles will ultimately be written to the output. In these cases, the triangle data is first written to an internal buffer. Once all triangles are written, the STL header containing the total triangle count is written to the output, followed by the buffered triangle data.
- Returns:
- initial buffer size
-
setInitialBufferSize
Set the initial size of the data buffers used by this instance.The buffer is used in situations where it is not clear how many triangles will ultimately be written to the output. In these cases, the triangle data is first written to an internal buffer. Once all triangles are written, the STL header containing the total triangle count is written to the output, followed by the buffered triangle data.
- Parameters:
initialBufferSize- initial buffer size
-
write
Write all boundaries fromsrcto the given output, using the data format for the instance.- Specified by:
writein interfaceBoundaryWriteHandler<PlaneConvexSubset, BoundarySource3D>- Overrides:
writein classAbstractBoundaryWriteHandler3D- Parameters:
src- boundary sourceout- output to write to
-
write
Write all boundaries in the stream to the given output using the data format supported by this instance. The stream passed as an argument is not closed, meaning that callers are responsible for closing the stream if necessary (for example, if the stream fetches data from the file system).- Parameters:
boundaries- stream containing boundaries to writeout- output to write to
-
writeFacets
Write allfacetsin the stream to the output using the data format supported by this instance. The stream passed as an argument is not closed, meaning that callers are responsible for closing the stream if necessary (for example, if the stream fetches data from the file system).- Parameters:
facets- stream containing facets to writeout- output to write to
-