public class StlBoundaryWriteHandler3D extends AbstractBoundaryWriteHandler3D
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 and Description |
---|
StlBoundaryWriteHandler3D() |
Modifier and Type | Method and Description |
---|---|
GeometryFormat |
getFormat() |
int |
getinitialBufferSize()
Get the initial size of the data buffers used by this instance.
|
void |
setInitialBufferSize(int initialBufferSize)
Set the initial size of the data buffers used by this instance.
|
void |
write(BoundarySource3D src,
GeometryOutput out) |
void |
write(Stream<? extends PlaneConvexSubset> boundaries,
GeometryOutput out)
Write all boundaries in the stream to the given output using the data format supported by this
instance.
|
void |
writeFacets(Stream<? extends FacetDefinition> facets,
GeometryOutput out)
Write all
facets in the stream to the output using the data format
supported by this instance. |
writeFacets
public StlBoundaryWriteHandler3D()
public GeometryFormat getFormat()
public int getinitialBufferSize()
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.
public void setInitialBufferSize(int initialBufferSize)
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.
initialBufferSize
- initial buffer sizepublic void write(BoundarySource3D src, GeometryOutput out)
write
in interface BoundaryWriteHandler<PlaneConvexSubset,BoundarySource3D>
write
in class AbstractBoundaryWriteHandler3D
public void write(Stream<? extends PlaneConvexSubset> boundaries, GeometryOutput out)
boundaries
- stream containing boundaries to writeout
- output to write topublic void writeFacets(Stream<? extends FacetDefinition> facets, GeometryOutput out)
facets
in 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).facets
- stream containing facets to writeout
- output to write toCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.