You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
example_intersection();
'''
import OpenSCADUtils, importCSG
doc=FreeCAD.activeDocument() or FreeCAD.newDocument()
obj = doc.getObject('OpenSCADPart')
if obj:
for o in App.getDependentObjects(obj.Group, 1):
doc.removeObject(o.Name)
doc.removeObject(obj.Name)
covert the above OpenSCAD script into CSG script
tmpfilename=OpenSCADUtils.callopenscadstring(scadstr,'csg')
try:
# remember the existing objects
objset = set(doc.Objects)
# import CSG file
importCSG.insert(tmpfilename, doc.Name)
# find all new objects
objs = [obj for obj in doc.Objects if obj not in objset]
# create a part contain to hold new objects
group = doc.addObject('App::Part', 'OpenSCADPart')
group.Group = objs
# recompute and adjust the view to include the newly created objects
doc.recompute()
Gui.Selection.addSelection(group)
Gui.runCommand('Std_ViewSelectionExtend')
Gui.Selection.clearSelection()
finally:
os.unlink(tmpfilename)`
~/Library/Preferences/FreeCAD/Mod/OpenSCAD_Alt_Import/OpenSCADUtils.py in
31
32 try:
---> 33 from PySide import QtGui
34 _encoding = QtGui.QApplication.UnicodeUTF8
35 def translate(context, text):
/Applications/FreeCAD_0.19-E.app/Contents/Resources/Ext/PySide/init.py in
1 # PySide wrapper
----> 2 from PySide2 import version
3 from PySide2 import version_info
/Applications/FreeCAD_0.19-E.app/Contents/Resources/lib/python3.8/site-packages/PySide2/init.py in
49 os.environ['PATH'] = path
50
---> 51 _setupQtDirectories()
/Applications/FreeCAD_0.19-E.app/Contents/Resources/lib/python3.8/site-packages/PySide2/init.py in _setupQtDirectories()
19 # loads the libraries into the process memory beforehand, and
20 # thus takes care of it for us.
---> 21 import shiboken2
22 # Trigger signature initialization.
23 type.signature
/Applications/FreeCAD_0.19-E.app/Contents/Resources/lib/python3.8/site-packages/shiboken2/init.py in
25 import typing
26
---> 27 from .shiboken2 import *
28
29 # Trigger signature initialization.
ModuleNotFoundError: No module named 'shiboken2.shiboken2'
`
The text was updated successfully, but these errors were encountered:
ln[1] : `import sys, os
#JUPYTER_REPO_PATH = "/opt/jupyter_freecad/"
JUPYTER_REPO_PATH = "/Users/keithsloan/Jupyter_FreeCAD"
#sys.path.append("/opt/freecad/freecad_build/lib")
sys.path.append("/Applications/FreeCAD_0.19-E.app/Contents/Resources/lib/python3.8/site-packages")
sys.path.append(JUPYTER_REPO_PATH + "IPythonFreeCADViewer")
import FreeCAD, FreeCADGui
from pivy import coin
from freecadviewer import render_document, get_document_renderer
FreeCADGui.setupWithoutGUI()
`
ln[2] : `scadstr='''
module example_intersection()
{
intersection() {
difference() {
union() {
cube([30, 30, 30], center = true);
translate([0, 0, -25])
cube([15, 15, 50], center = true);
}
union() {
cube([50, 10, 10], center = true);
cube([10, 50, 10], center = true);
cube([10, 10, 50], center = true);
}
}
translate([0, 0, 5])
cylinder(h = 50, r1 = 20, r2 = 5, center = true);
}
}
example_intersection();
'''
import OpenSCADUtils, importCSG
doc=FreeCAD.activeDocument() or FreeCAD.newDocument()
obj = doc.getObject('OpenSCADPart')
if obj:
for o in App.getDependentObjects(obj.Group, 1):
doc.removeObject(o.Name)
doc.removeObject(obj.Name)
covert the above OpenSCAD script into CSG script
tmpfilename=OpenSCADUtils.callopenscadstring(scadstr,'csg')
try:
# remember the existing objects
objset = set(doc.Objects)
# import CSG file
importCSG.insert(tmpfilename, doc.Name)
# find all new objects
objs = [obj for obj in doc.Objects if obj not in objset]
# create a part contain to hold new objects
group = doc.addObject('App::Part', 'OpenSCADPart')
group.Group = objs
# recompute and adjust the view to include the newly created objects
doc.recompute()
Gui.Selection.addSelection(group)
Gui.runCommand('Std_ViewSelectionExtend')
Gui.Selection.clearSelection()
finally:
os.unlink(tmpfilename)`
Gives error `ModuleNotFoundError Traceback (most recent call last)
in
22 example_intersection();
23 '''
---> 24 import OpenSCADUtils, importCSG
25 doc=FreeCAD.activeDocument() or FreeCAD.newDocument()
26 obj = doc.getObject('OpenSCADPart')
~/Library/Preferences/FreeCAD/Mod/OpenSCAD_Alt_Import/OpenSCADUtils.py in
31
32 try:
---> 33 from PySide import QtGui
34 _encoding = QtGui.QApplication.UnicodeUTF8
35 def translate(context, text):
/Applications/FreeCAD_0.19-E.app/Contents/Resources/Ext/PySide/init.py in
1 # PySide wrapper
----> 2 from PySide2 import version
3 from PySide2 import version_info
/Applications/FreeCAD_0.19-E.app/Contents/Resources/lib/python3.8/site-packages/PySide2/init.py in
49 os.environ['PATH'] = path
50
---> 51 _setupQtDirectories()
/Applications/FreeCAD_0.19-E.app/Contents/Resources/lib/python3.8/site-packages/PySide2/init.py in _setupQtDirectories()
19 # loads the libraries into the process memory beforehand, and
20 # thus takes care of it for us.
---> 21 import shiboken2
22 # Trigger signature initialization.
23 type.signature
/Applications/FreeCAD_0.19-E.app/Contents/Resources/lib/python3.8/site-packages/shiboken2/init.py in
25 import typing
26
---> 27 from .shiboken2 import *
28
29 # Trigger signature initialization.
ModuleNotFoundError: No module named 'shiboken2.shiboken2'
`
The text was updated successfully, but these errors were encountered: