text: import FreeCAD, Part, Mesh, math
  
  DOC = FreeCAD.activeDocument()
  
  DOC_NAME = "part_plaque_d20"
  
  
  def clear_doc():
      # Clear the active document deleting all the objects
      for obj in DOC.Objects:
          DOC.removeObject(obj.Name)
  
  
  def setview():
      # Rearrange View
      FreeCAD.Gui.SendMsgToActiveView("ViewFit")
      FreeCAD.Gui.activeDocument().activeView().viewAxometric()
  
  
  if DOC is None:
      FreeCAD.newDocument(DOC_NAME)
      FreeCAD.setActiveDocument(DOC_NAME)
      DOC = FreeCAD.activeDocument()
  else:
      clear_doc()
  
  # EPS= tolerance to use to cut the parts
  EPS = 0.10
  EPS_C = EPS * -0.5
  
  cylinder_1 = Part.makeCylinder(100, 3)
  
  Part.show(cylinder_1)
  
  DOC.recompute()
  
  __objs__=[]
  
  __objs__.append(FreeCAD.getDocument("part_plaque_d20").getObject("Shape"))
  
  stl_file = u"part_plaque_d20.stl"
  
  Mesh.export(__objs__, stl_file)
  
  setview()
          