_StlExporter
Date: 2019-10-22

org.jmol.export

## Class _StlExporter

- java.lang.Object
- - org.jmol.export.___Exporter
  - - org.jmol.export.__CartesianExporter
    - - org.jmol.export._VrmlExporter
      - - org.jmol.export._StlExporter

-     public class _StlExporter
      extends _VrmlExporter

  STereoLithography file format exporter for 3D printing. Based on _VrmlExporter by Bob Hanson; diverts the output() method to do nothing and delivers only triangle sets. Note that no attempt is made here to ensure that surfaces are closed. Also, an inefficient mechanism that involves creating a full in-memory representation of the data is used. If this turns out to be problematic, it might be possible to use random access, but the applet does not have that capability, and certainly JavaScript does not.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.io.ByteArrayOutputStream` | `bos`
    `private java.lang.String` | `header`
    `private boolean` | `isDebug`
    `(package private) javajs.util.Lst<javajs.util.M4>` | `lstMatrix`
    `private javajs.util.M4` | `m4`
    `private javajs.util.M4` | `m4a`
    `private int` | `nTri`
    `private javajs.util.OC` | `oc`

    - ### Fields inherited from class org.jmol.export._VrmlExporter

      `fontChild, fontFace, fontSize, fontStyle, tempQ1, tempQ2, tempQ3, useTable`

    - ### Fields inherited from class org.jmol.export.__CartesianExporter

      `canCapCylinders, noColor, sphereMatrix, viewpoint`

    - ### Fields inherited from class org.jmol.export.___Exporter

      `apertureAngle, backgroundColix, cameraDistance, cameraPosition, center, commandLineOptions, commentChar, degreesPerRadian, depthZ, export3D, exportScale, exportType, fileName, fixedRotationCenter, gdata, lightSource, lineWidthMad, out, privateKey, referenceCenter, scalePixelsPerAngstrom, screenHeight, screenWidth, slabZ, solidOnly, tempP1, tempP2, tempP3, tempV1, tempV2, tm, vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `_StlExporter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected java.lang.String` | `finalizeOutput()`
    `protected void` | `output(java.lang.String data)`
    `protected void` | `outputAttr(java.lang.String attr, float x, float y, float z)`
    `protected void` | `outputAttrPt(java.lang.String attr, javajs.util.T3 pt)`
    `protected void` | `outputChildClose()`
    `protected void` | `outputChildStart()`
    `protected void` | `outputCircle(javajs.util.P3 pt1, javajs.util.P3 pt2, float radius, short colix, boolean doFill)`
    `protected void` | `outputGeometry(javajs.util.T3[] vertices, javajs.util.T3[] normals, short[] colixes, int[][] indices, short[] polygonColixes, int nVertices, int nPolygons, javajs.util.BS bsPolygons, int faceVertexMax, javajs.util.Lst<java.lang.Short> colorList, java.util.Map<java.lang.Short,java.lang.Integer> htColixes, javajs.util.P3 offset)`
    `protected void` | `outputHeader()`
    `protected void` | `outputRotation(javajs.util.A4 a)`
    `(package private) void` | `plotText(int x, int y, int z, short colix, java.lang.String text, Font font3d)`
    `protected void` | `popMatrix()`
    `protected void` | `pushMatrix()`
    `private void` | `writeFacet(javajs.util.T3[] vertices, int[] face, int i, int j, int k)`
    `private void` | `writeFloat(float f)`
    `private void` | `writePoint(java.lang.String s, javajs.util.T3 p)`

    - ### Methods inherited from class org.jmol.export._VrmlExporter

      `getDef, getViewpoint, output, outputAppearance, outputChildShapeClose, outputChildShapeStart, outputCloseTag, outputColorIndices, outputColors, outputCone, outputCylinder, outputCylinderChildScaled, outputDefChildFaceSet, outputEllipsoid, outputFace, outputFaceSetClose, outputFaceSetStart, outputFooter, outputInitialTransform, outputNormals, outputQuaternionFrame, outputShapeClose, outputShapeStart, outputSolidPlate, outputSphere, outputSurface, outputTextPixel, outputTransRot, outputTriangle, outputUseChildClose`

    - ### Methods inherited from class org.jmol.export.__CartesianExporter

      `drawAtom, drawCircle, drawCylinder, drawEllipse, drawPixel, drawTextPixel, fillConeScreen, fillCylinderScreen, fillCylinderScreenMad, fillEllipsoid, fillSphere, fillTriangle, getCameraPosition, getCoordinateMap, getModelCenter, getNormalMap, outputIndices, plotImage, setSphereMatrix`

    - ### Methods inherited from class org.jmol.export.___Exporter

      `drawFilledCircle, drawSurface, finalizeOutput2, fixScreenZ, getByteCount, getColorList, getConeMesh, getExportDate, getJmolPerspective, getRotationMatrix, getRotationMatrix, getTriad, getTriadC, initializeOutput, initOutput, opacityFractionalFromArgb, opacityFractionalFromColix, outputComment, outputJmolPerspective, outputVertex, outputVertices, rgbFractionalFromArgb, rgbFractionalFromColix, round, round, setTempVertex, translucencyFractionalFromColix`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### isDebug

          private boolean isDebug

    - #### header

          private java.lang.String header

    - #### oc

          private javajs.util.OC oc

    - #### bos

          private java.io.ByteArrayOutputStream bos

    - #### m4

          private javajs.util.M4 m4

    - #### lstMatrix

          javajs.util.Lst<javajs.util.M4> lstMatrix

    - #### m4a

          private javajs.util.M4 m4a

    - #### nTri

          private int nTri

  - ### Constructor Detail

    - #### _StlExporter

          public _StlExporter()

  - ### Method Detail

    - #### outputHeader

          protected void outputHeader()

      Overrides:
        `outputHeader` in class `_VrmlExporter`

    - #### pushMatrix

          protected void pushMatrix()

      Overrides:
        `pushMatrix` in class `_VrmlExporter`

    - #### popMatrix

          protected void popMatrix()

      Overrides:
        `popMatrix` in class `_VrmlExporter`

    - #### output

          protected void output(java.lang.String data)

      Overrides:
        `output` in class `___Exporter`

    - #### outputChildStart

          protected void outputChildStart()

      Overrides:
        `outputChildStart` in class `_VrmlExporter`

    - #### outputChildClose

          protected void outputChildClose()

      Overrides:
        `outputChildClose` in class `_VrmlExporter`

    - #### outputRotation

          protected void outputRotation(javajs.util.A4 a)

      Overrides:
        `outputRotation` in class `_VrmlExporter`

    - #### outputAttrPt

          protected void outputAttrPt(java.lang.String attr,
                                      javajs.util.T3 pt)

      Overrides:
        `outputAttrPt` in class `_VrmlExporter`

    - #### outputAttr

          protected void outputAttr(java.lang.String attr,
                                    float x,
                                    float y,
                                    float z)

      Overrides:
        `outputAttr` in class `_VrmlExporter`

    - #### outputGeometry

          protected void outputGeometry(javajs.util.T3[] vertices,
                                        javajs.util.T3[] normals,
                                        short[] colixes,
                                        int[][] indices,
                                        short[] polygonColixes,
                                        int nVertices,
                                        int nPolygons,
                                        javajs.util.BS bsPolygons,
                                        int faceVertexMax,
                                        javajs.util.Lst<java.lang.Short> colorList,
                                        java.util.Map<java.lang.Short,java.lang.Integer> htColixes,
                                        javajs.util.P3 offset)

      Overrides:
        `outputGeometry` in class `_VrmlExporter`

    - #### writeFacet

          private void writeFacet(javajs.util.T3[] vertices,
                                  int[] face,
                                  int i,
                                  int j,
                                  int k)

    - #### finalizeOutput

          protected java.lang.String finalizeOutput()

      Overrides:
        `finalizeOutput` in class `___Exporter`

    - #### outputCircle

          protected void outputCircle(javajs.util.P3 pt1,
                                      javajs.util.P3 pt2,
                                      float radius,
                                      short colix,
                                      boolean doFill)

      Overrides:
        `outputCircle` in class `_VrmlExporter`

    - #### plotText

          void plotText(int x,
                        int y,
                        int z,
                        short colix,
                        java.lang.String text,
                        Font font3d)

      Overrides:
        `plotText` in class `_VrmlExporter`

    - #### writePoint

          private void writePoint(java.lang.String s,
                                  javajs.util.T3 p)

    - #### writeFloat

          private void writeFloat(float f)