Here is my session info:
OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4671 (Git)
Branch: releases/FreeCAD-0-15
Hash: 244b3aef360841646cbfe80a1b225c8b39c8380c
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
OpenSCAD version is 2015.03-2.
Python code looks like this:
Code: Select all
import WebGui
from StartPage import StartPage
WebGui.openBrowserHTML(StartPage.handle(),'file://' + App.getResourceDir() + 'Mod/Start/StartPage/','Start page')
App.newDocument("Unnamed")
App.setActiveDocument("Unnamed")
App.ActiveDocument=App.getDocument("Unnamed")
Gui.ActiveDocument=Gui.getDocument("Unnamed")
Gui.activateWorkbench("PartWorkbench")
App.ActiveDocument.addObject("Part::Box","Box")
App.ActiveDocument.ActiveObject.Label = "Cube"
App.ActiveDocument.recompute()
Gui.SendMsgToActiveView("ViewFit")
App.ActiveDocument.addObject("Part::Sphere","Sphere")
App.ActiveDocument.ActiveObject.Label = "Sphere"
App.ActiveDocument.recompute()
Gui.SendMsgToActiveView("ViewFit")
Gui.activateWorkbench("MeshWorkbench")
import MeshPartGui, FreeCADGui
FreeCADGui.runCommand('MeshPart_Mesher')
import Mesh
import MeshPart
__doc__=FreeCAD.getDocument("Unnamed")
__mesh__=__doc__.addObject("Mesh::Feature","Mesh")
__mesh__.Mesh=MeshPart.meshFromShape(Shape=__doc__.getObject("Box").Shape,MaxLength=1)
__mesh__.Label="Cube (Meshed)"
__mesh__.ViewObject.CreaseAngle=25.0
del __doc__, __mesh__
import MeshPartGui, FreeCADGui
FreeCADGui.runCommand('MeshPart_Mesher')
import Mesh
import MeshPart
__doc__=FreeCAD.getDocument("Unnamed")
__mesh__=__doc__.addObject("Mesh::Feature","Mesh")
__mesh__.Mesh=MeshPart.meshFromShape(Shape=__doc__.getObject("Sphere").Shape,MaxLength=1)
__mesh__.Label="Sphere (Meshed)"
__mesh__.ViewObject.CreaseAngle=25.0
del __doc__, __mesh__
import OpenSCADUtils
mesh = OpenSCADUtils.meshoptempfile('difference',(App.ActiveDocument.Mesh.Mesh,App.ActiveDocument.Mesh001.Mesh))
App.ActiveDocument.addObject("Mesh::Feature","Difference")
App.ActiveDocument.Difference.Mesh = mesh
Thanks,
Takeo