Class _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 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

      • output

        protected void output​(java.lang.String data)
        Overrides:
        output in class ___Exporter
      • 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,
                                      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)
      • 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,
                      javajs.awt.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)