parameters: (mesh, fileName, binary=False)
docstring: Write :term:`STL` surface mesh and returns a :gimliapi:`GIMLI::Mesh`.
  
      Export a three dimensional boundary :gimliapi:`GIMLI::Mesh` into a
      :term:`STL` surface mesh. Boundaries with different marker
      will be separated into different STL solids.
  
      TODO:
          * ASCII=False, write binary STL
          * QuadrangleFace Boundaries
          * p2 Boundaries
  
      Parameters
      ----------
      mesh : :gimliapi:`GIMLI::Mesh`
          Mesh to be exported. Only Boundaries of type TriangleFace will be
          exported.
  
      fileName : str
          name of the .stl file containing the STL surface mesh
  
      binary : bool [False]
          Write STL binary format. TODO
docstring_summary: Write :term:`STL` surface mesh and returns a :gimliapi:`GIMLI::Mesh`.
docstring_tokens: Write : term : STL surface mesh and returns a : gimliapi : GIMLI :: Mesh .
function: def exportSTL(mesh, fileName, binary=False):
      """Write :term:`STL` surface mesh and returns a :gimliapi:`GIMLI::Mesh`.
  
      Export a three dimensional boundary :gimliapi:`GIMLI::Mesh` into a
      :term:`STL` surface mesh. Boundaries with different marker
      will be separated into different STL solids.
  
      TODO:
          * ASCII=False, write binary STL
          * QuadrangleFace Boundaries
          * p2 Boundaries
  
      Parameters
      ----------
      mesh : :gimliapi:`GIMLI::Mesh`
          Mesh to be exported. Only Boundaries of type TriangleFace will be
          exported.
  
      fileName : str
          name of the .stl file containing the STL surface mesh
  
      binary : bool [False]
          Write STL binary format. TODO
      """
      marker = pg.unique(pg.sort(mesh.boundaryMarkers()))
  
      if '.stl' not in fileName:
          fileName = fileName + '.stl'
  
      fi = open(fileName, 'w')
      for m in marker:
          me = mesh.createSubMesh(mesh.boundaries(mesh.boundaryMarkers() == m))
  
          fi.write('solid ' + str(m) + '\n')
  
          for b in me.boundaries():
              n = b.norm()
              fi.write('facet normal %f %f %f\n' % (n[0], n[1], n[2]))
              fi.write('\touter loop\n')
              fi.write('\t\tvertex %f %f %f\n' % (b.node(0).pos()[0],
                                                  b.node(0).pos()[1],
                                                  b.node(0).pos()[2]))
              fi.write('\t\tvertex %f %f %f\n' % (b.node(1).pos()[0],
                                                  b.node(1).pos()[1],
                                                  b.node(1).pos()[2]))
              fi.write('\t\tvertex %f %f %f\n' % (b.node(2).pos()[0],
                                                  b.node(2).pos()[1],
                                                  b.node(2).pos()[2]))
              fi.write('\tendloop\n')
              fi.write('endfacet\n')
  
          fi.write('endsolid\n')
  
      fi.close()
function_tokens: def exportSTL ( mesh , fileName , binary = False ) : marker = pg . unique ( pg . sort ( mesh . boundaryMarkers ( ) ) ) if '.stl' not in fileName : fileName = fileName + '.stl' fi = open ( fileName , 'w' ) for m in marker : me = mesh . createSubMesh ( mesh . boundaries ( mesh . boundaryMarkers ( ) == m ) ) fi . write ( 'solid ' + str ( m ) + '\n' ) for b in me . boundaries ( ) : n = b . norm ( ) fi . write ( 'facet normal %f %f %f\n' % ( n [ 0 ] , n [ 1 ] , n [ 2 ] ) ) fi . write ( '\touter loop\n' ) fi . write ( '\t\tvertex %f %f %f\n' % ( b . node ( 0 ) . pos ( ) [ 0 ] , b . node ( 0 ) . pos ( ) [ 1 ] , b . node ( 0 ) . pos ( ) [ 2 ] ) ) fi . write ( '\t\tvertex %f %f %f\n' % ( b . node ( 1 ) . pos ( ) [ 0 ] , b . node ( 1 ) . pos ( ) [ 1 ] , b . node ( 1 ) . pos ( ) [ 2 ] ) ) fi . write ( '\t\tvertex %f %f %f\n' % ( b . node ( 2 ) . pos ( ) [ 0 ] , b . node ( 2 ) . pos ( ) [ 1 ] , b . node ( 2 ) . pos ( ) [ 2 ] ) ) fi . write ( '\tendloop\n' ) fi . write ( 'endfacet\n' ) fi . write ( 'endsolid\n' ) fi . close ( )