HE_Mesh2014  2.0.11
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
wblut.hemesh.HET_STLWriter Class Reference

Classes

class  DefaultSTLColorModel
 
class  MaterialiseSTLColorModel
 
class  NoColorModel
 
interface  STLColorModel
 

Public Member Functions

 HET_STLWriter ()
 
 HET_STLWriter (final STLColorModel cm, final int bufSize)
 
void beginSave (final OutputStream stream, final int numFaces)
 
void beginSave (final String fn, final String name, final int numFaces)
 
void endSave ()
 
void face (final WB_Coord a, final WB_Coord b, final WB_Coord c, final WB_Coord normal)
 
void face (final WB_Coord a, final WB_Coord b, final WB_Coord c, final WB_Coord normal, final int rgb)
 
void setScale (final float s)
 
void setScale (final WB_Coord s)
 
void useInvertedNormals (final boolean state)
 

Static Public Member Functions

static OutputStream createOutputStream (final File file) throws IOException
 
static void createDirectories (final File file)
 

Static Public Attributes

static final int DEFAULT_RGB = -1
 
static final STLColorModel NONE = new NoColorModel()
 
static final STLColorModel DEFAULT = new DefaultSTLColorModel()
 
static final STLColorModel MATERIALISE
 
static final int DEFAULT_BUFFER = 0x10000
 

Protected Member Functions

void writeFloat (final float a) throws IOException
 
void writeHeader (final int num) throws IOException
 
void writeInt (final int a) throws IOException
 
void writeScaledVector (final WB_Coord v)
 
void writeShort (final int a) throws IOException
 
void writeVector (final WB_Coord v)
 

Protected Attributes

OutputStream ds
 
byte[] buf = new byte[4]
 
int bufferSize
 
WB_Vector scale = new WB_Vector(1, 1, 1)
 
boolean useInvertedNormals = false
 
STLColorModel colorModel
 

Private Member Functions

final void prepareBuffer (final int a)
 

Detailed Description

A simple, but flexible and memory efficient exporter for binary STL files. Custom color support is implemented via the STLcolorModel interface and the exporter comes with the 2 most common format variations defined by the DEFAULT and MATERIALISE constants.

The minimal design of this exporter means it does not build an extra list of faces in RAM and so is able to easily export models with millions of faces.

http://en.wikipedia.org/wiki/STL_(file_format)

Constructor & Destructor Documentation

wblut.hemesh.HET_STLWriter.HET_STLWriter ( )
wblut.hemesh.HET_STLWriter.HET_STLWriter ( final STLColorModel  cm,
final int  bufSize 
)
Parameters
cm
bufSize

Member Function Documentation

void wblut.hemesh.HET_STLWriter.beginSave ( final OutputStream  stream,
final int  numFaces 
)
Parameters
stream
numFaces
void wblut.hemesh.HET_STLWriter.beginSave ( final String  fn,
final String  name,
final int  numFaces 
)
Parameters
fn
name
numFaces
static void wblut.hemesh.HET_STLWriter.createDirectories ( final File  file)
static
Parameters
file
static OutputStream wblut.hemesh.HET_STLWriter.createOutputStream ( final File  file) throws IOException
static
Parameters
file
Returns
Exceptions
IOException
void wblut.hemesh.HET_STLWriter.endSave ( )
void wblut.hemesh.HET_STLWriter.face ( final WB_Coord  a,
final WB_Coord  b,
final WB_Coord  c,
final WB_Coord  normal 
)
Parameters
a
b
c
normal
void wblut.hemesh.HET_STLWriter.face ( final WB_Coord  a,
final WB_Coord  b,
final WB_Coord  c,
final WB_Coord  normal,
final int  rgb 
)
Parameters
a
b
c
normal
rgb
final void wblut.hemesh.HET_STLWriter.prepareBuffer ( final int  a)
private
Parameters
a
void wblut.hemesh.HET_STLWriter.setScale ( final float  s)
Parameters
s
void wblut.hemesh.HET_STLWriter.setScale ( final WB_Coord  s)
Parameters
s
void wblut.hemesh.HET_STLWriter.useInvertedNormals ( final boolean  state)
Parameters
state
void wblut.hemesh.HET_STLWriter.writeFloat ( final float  a) throws IOException
protected
Parameters
a
Exceptions
IOException
void wblut.hemesh.HET_STLWriter.writeHeader ( final int  num) throws IOException
protected
Parameters
num
Exceptions
IOException
void wblut.hemesh.HET_STLWriter.writeInt ( final int  a) throws IOException
protected
Parameters
a
Exceptions
IOException
void wblut.hemesh.HET_STLWriter.writeScaledVector ( final WB_Coord  v)
protected
Parameters
v
void wblut.hemesh.HET_STLWriter.writeShort ( final int  a) throws IOException
protected
Parameters
a
Exceptions
IOException
void wblut.hemesh.HET_STLWriter.writeVector ( final WB_Coord  v)
protected
Parameters
v

Member Data Documentation

byte [] wblut.hemesh.HET_STLWriter.buf = new byte[4]
protected
int wblut.hemesh.HET_STLWriter.bufferSize
protected
STLColorModel wblut.hemesh.HET_STLWriter.colorModel
protected
final STLColorModel wblut.hemesh.HET_STLWriter.DEFAULT = new DefaultSTLColorModel()
static
final int wblut.hemesh.HET_STLWriter.DEFAULT_BUFFER = 0x10000
static
final int wblut.hemesh.HET_STLWriter.DEFAULT_RGB = -1
static
OutputStream wblut.hemesh.HET_STLWriter.ds
protected
final STLColorModel wblut.hemesh.HET_STLWriter.MATERIALISE
static
Initial value:
= new MaterialiseSTLColorModel(
0xffffffff)
final STLColorModel wblut.hemesh.HET_STLWriter.NONE = new NoColorModel()
static
WB_Vector wblut.hemesh.HET_STLWriter.scale = new WB_Vector(1, 1, 1)
protected
boolean wblut.hemesh.HET_STLWriter.useInvertedNormals = false
protected

The documentation for this class was generated from the following file: