[openscad] mirror mesh feature -- separate gui from function
This commit is contained in:
committed by
Yorik van Havre
parent
92b14ba161
commit
2c0b49ea46
@@ -298,18 +298,15 @@ def vec2householder(nv):
|
||||
nv.z*nv.x*l,nv.z*nv.y*l,nv.z*nv.z*l,0,0,0,0,0)
|
||||
return FreeCAD.Matrix()-hh
|
||||
|
||||
def mirror(msh):
|
||||
def mirror(msh,vec):
|
||||
from exportCSG import mesh2polyhedron
|
||||
from PySide import QtGui
|
||||
items=["[1,0,0]","[0,1,0]","[0,0,1]","[1,1,0]","[0,1,1]","[1,0,1]","[1,1,1]"]
|
||||
item, ok = QtGui.QInputDialog.getItem(QtGui.QApplication.activeWindow(),u'Mirror about which Axis?',u'Select Axis (or enter custom value)?',items,editable=True)
|
||||
if ok:
|
||||
param = 'mirror('+item+')'
|
||||
poly = mesh2polyhedron(msh)
|
||||
mi = callopenscadmeshstring('%s{%s}' % (param,''.join(poly)))
|
||||
mi.flipNormals()
|
||||
return mi
|
||||
return None
|
||||
poly = mesh2polyhedron(msh)
|
||||
vec_string = '['+str(vec.x)+','+str(vec.y)+','+str(vec.z)+']'
|
||||
param = 'mirror('+vec_string+')'
|
||||
mi = callopenscadmeshstring('%s{%s}' % (param,''.join(poly)))
|
||||
mi.flipNormals()
|
||||
return mi
|
||||
|
||||
|
||||
def angneg(d):
|
||||
|
||||
Reference in New Issue
Block a user