Merge branch 'master' of ssh://git.code.sf.net/p/free-cad/code
This commit is contained in:
commit
da515effff
|
@ -211,7 +211,7 @@ class AddSCADTask:
|
|||
return True
|
||||
|
||||
def addelement(self):
|
||||
scadstr=unicode(self.form.textEdit.toPlainText())
|
||||
scadstr=unicode(self.form.textEdit.toPlainText()).encode('utf8')
|
||||
asmesh=self.form.checkboxmesh.checkState()
|
||||
import OpenSCADUtils, os
|
||||
extension= 'stl' if asmesh else 'csg'
|
||||
|
|
|
@ -75,6 +75,9 @@ class ViewProviderTree:
|
|||
objs.extend(self.Object.Objects)
|
||||
if hasattr(self.Object,"Components"):
|
||||
objs.extend(self.Object.Components)
|
||||
if hasattr(self.Object,"Children"):
|
||||
objs.extend(self.Object.Children)
|
||||
|
||||
return objs
|
||||
|
||||
def getIcon(self):
|
||||
|
@ -215,6 +218,19 @@ static char * openscadlogo_xpm[] = {
|
|||
"4444444444444444"};
|
||||
"""
|
||||
|
||||
class OpenSCADPlaceholder:
|
||||
def __init__(self,obj,children=None,arguments=None):
|
||||
obj.addProperty("App::PropertyLinkList",'Children','OpenSCAD',"Base Objects")
|
||||
obj.addProperty("App::PropertyString",'Arguments','OpenSCAD',"Arguments")
|
||||
obj.Proxy = self
|
||||
if children:
|
||||
obj.Children = children
|
||||
if arguments:
|
||||
obj.Arguments = arguments
|
||||
|
||||
def execute(self,fp):
|
||||
import Part
|
||||
fp.Shape = Part.Compound([]) #empty Shape
|
||||
|
||||
class MatrixTransform:
|
||||
def __init__(self, obj,matrix=None,child=None):
|
||||
|
|
|
@ -109,9 +109,9 @@ def callopenscad(inputfilename,outputfilename=None,outputext='csg',keepname=Fals
|
|||
else:
|
||||
outputfilename=os.path.join(dir1,'output-%d.%s' % \
|
||||
(int(time.time()*100) % 1000000,outputext))
|
||||
check_output2([osfilename,'-o',outputfilename, inputfilename],\
|
||||
stderr=subprocess.STDOUT)
|
||||
return outputfilename
|
||||
check_output2([osfilename,'-o',outputfilename, inputfilename],\
|
||||
stderr=subprocess.STDOUT)
|
||||
return outputfilename
|
||||
|
||||
def callopenscadstring(scadstr,outputext='csg'):
|
||||
'''create a tempfile and call the open scad binary
|
||||
|
|
|
@ -341,16 +341,32 @@ def p_operation(p):
|
|||
| projection_action
|
||||
'''
|
||||
p[0] = p[1]
|
||||
|
||||
|
||||
|
||||
def p_not_supported(p):
|
||||
'''
|
||||
not_supported : hull LPAREN RPAREN OBRACE block_list EBRACE
|
||||
not_supported : hull LPAREN keywordargument_list RPAREN OBRACE block_list EBRACE
|
||||
| minkowski LPAREN keywordargument_list RPAREN OBRACE block_list EBRACE
|
||||
| glide LPAREN RPAREN OBRACE block_list EBRACE
|
||||
| glide LPAREN keywordargument_list RPAREN OBRACE block_list EBRACE
|
||||
'''
|
||||
if gui:
|
||||
if gui and not FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/OpenSCAD").\
|
||||
GetBool('usePlaceholderForUnsupported'):
|
||||
from PyQt4 import QtGui
|
||||
QtGui.QMessageBox.critical(None, unicode(translate('OpenSCAD',"Unsupported Function"))+" : "+p[1],unicode(translate('OpenSCAD',"Press OK")))
|
||||
else:
|
||||
from OpenSCADFeatures import OpenSCADPlaceholder
|
||||
newobj=doc.addObject("Part::FeaturePython",p[1])
|
||||
OpenSCADPlaceholder(newobj,p[6],str(p[3]))
|
||||
if gui:
|
||||
if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/OpenSCAD").\
|
||||
GetBool('useViewProviderTree'):
|
||||
from OpenSCADFeatures import ViewProviderTree
|
||||
ViewProviderTree(newobj.ViewObject)
|
||||
else:
|
||||
newobj.ViewObject.Proxy = 0
|
||||
#don't hide the children
|
||||
p[0] = [newobj]
|
||||
|
||||
|
||||
def p_size_vector(p):
|
||||
'size_vector : OSQUARE NUMBER COMMA NUMBER COMMA NUMBER ESQUARE'
|
||||
|
|
Loading…
Reference in New Issue
Block a user