本文整理汇总了Python中PathScripts.PathUtil.isValidBaseObject方法的典型用法代码示例。如果您正苦于以下问题:Python PathUtil.isValidBaseObject方法的具体用法?Python PathUtil.isValidBaseObject怎么用?Python PathUtil.isValidBaseObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathScripts.PathUtil
的用法示例。
在下文中一共展示了PathUtil.isValidBaseObject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test00
# 需要导入模块: from PathScripts import PathUtil [as 别名]
# 或者: from PathScripts.PathUtil import isValidBaseObject [as 别名]
def test00(self):
'''Check that isValidBaseObject detects solids.'''
box = self.doc.addObject('Part::Box', 'Box')
cylinder = self.doc.addObject('Part::Cylinder', 'Cylinder')
self.doc.recompute()
self.assertTrue(PathUtil.isValidBaseObject(box))
self.assertTrue(PathUtil.isValidBaseObject(cylinder))
示例2: test03
# 需要导入模块: from PathScripts import PathUtil [as 别名]
# 或者: from PathScripts.PathUtil import isValidBaseObject [as 别名]
def test03(self):
'''Check that isValidBaseObject ignores sketches.'''
body = self.doc.addObject('PartDesign::Body', 'Body')
sketch = self.doc.addObject('Sketcher::SketchObject', 'Sketch')
body.addObject(sketch)
TestSketcherApp.CreateSlotPlateSet(sketch)
self.doc.recompute()
pad = self.doc.addObject('PartDesign::Pad', 'Pad')
body.addObject(pad)
pad.Profile = sketch
self.doc.recompute()
# the body and the pad are solids
self.assertTrue(PathUtil.isValidBaseObject(pad))
self.assertTrue(PathUtil.isValidBaseObject(body))
# however, the sketch is no
self.assertFalse(PathUtil.isValidBaseObject(sketch))
示例3: test01
# 需要导入模块: from PathScripts import PathUtil [as 别名]
# 或者: from PathScripts.PathUtil import isValidBaseObject [as 别名]
def test01(self):
'''Check that isValidBaseObject detects PDs.'''
body = self.doc.addObject('PartDesign::Body', 'Body')
box = self.doc.addObject('PartDesign::AdditiveBox', 'Box')
body.addObject(box)
self.doc.recompute()
self.assertTrue(PathUtil.isValidBaseObject(body))
示例4: test02
# 需要导入模块: from PathScripts import PathUtil [as 别名]
# 或者: from PathScripts.PathUtil import isValidBaseObject [as 别名]
def test02(self):
'''Check that isValidBaseObject detects compounds.'''
box = self.doc.addObject('Part::Box', 'Box')
box.Length = 10
box.Width = 10
box.Height = 1
box.Placement = FreeCAD.Placement(FreeCAD.Vector(-5,-5,0), FreeCAD.Rotation(FreeCAD.Vector(0,0,1), 0))
cyl = self.doc.addObject('Part::Cylinder', 'Cylinder')
cyl.Radius = 1
cyl.Height = 10
box.Placement = FreeCAD.Placement(FreeCAD.Vector(0,0,-5), FreeCAD.Rotation(FreeCAD.Vector(0,0,1), 0))
cut = self.doc.addObject('Part::Cut', 'Cut')
cut.Base = box
cut.Tool = cyl
self.doc.recompute()
self.assertTrue(PathUtil.isValidBaseObject(cut))
示例5: isBaseCandidate
# 需要导入模块: from PathScripts import PathUtil [as 别名]
# 或者: from PathScripts.PathUtil import isValidBaseObject [as 别名]
def isBaseCandidate(cls, obj):
'''Answer true if the given object can be used as a Base for a job.'''
return PathUtil.isValidBaseObject(obj) or isArchPanelSheet(obj)
示例6: isBaseCandidate
# 需要导入模块: from PathScripts import PathUtil [as 别名]
# 或者: from PathScripts.PathUtil import isValidBaseObject [as 别名]
def isBaseCandidate(cls, obj):
'''Answer true if the given object can be used as a Base for a job.'''
return PathUtil.isValidBaseObject(obj) or (hasattr(obj, 'Proxy') and isinstance(obj.Proxy, ArchPanel.PanelSheet))