本文整理匯總了Python中OpenSCADUtils.mirror2mat方法的典型用法代碼示例。如果您正苦於以下問題:Python OpenSCADUtils.mirror2mat方法的具體用法?Python OpenSCADUtils.mirror2mat怎麽用?Python OpenSCADUtils.mirror2mat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OpenSCADUtils
的用法示例。
在下文中一共展示了OpenSCADUtils.mirror2mat方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: expandplacements
# 需要導入模塊: import OpenSCADUtils [as 別名]
# 或者: from OpenSCADUtils import mirror2mat [as 別名]
def expandplacements(obj,placement):
ownplacement=placement.multiply(obj.Placement)
if obj.isDerivedFrom('Part::FeaturePython') and isinstance(obj.Proxy,MatrixTransform):
#expandplacementsmatrix(obj,ownplacement.toMatrix())
expandplacementsmatrix(obj,placement.toMatrix())
elif likeprimitive(obj,False):
obj.Placement=ownplacement
elif obj.isDerivedFrom('Part::Mirroring'):
import OpenSCADUtils
mm = OpenSCADUtils.mirror2mat(obj.Normal,obj.Base)
#todo: set the base to 0,0,0
innerp=FreeCAD.Placement(mm * ownplacement.toMatrix() *mm)
expandplacements(obj.Source,innerp)
obj.Placement=FreeCAD.Placement()
else:
for outobj in obj.OutList:
if obj.isDerivedFrom('Part::Extrusion'):
obj.Dir=ownplacement.Rotation.multVec(obj.Dir)
elif obj.isDerivedFrom('Part::Revolution'):
obj.Axis=ownplacement.Rotation.multVec(obj.Axis)
#obj.Base=ownplacement.Rotation.multVec(obj.Base)
expandplacements(outobj,ownplacement)
obj.Placement=FreeCAD.Placement()