当前位置: 首页>>代码示例>>Python>>正文


Python PathUtil.isValidBaseObject方法代码示例

本文整理汇总了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))
开发者ID:itain,项目名称:FreeCAD,代码行数:9,代码来源:TestPathUtil.py

示例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))
开发者ID:itain,项目名称:FreeCAD,代码行数:18,代码来源:TestPathUtil.py

示例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))
开发者ID:itain,项目名称:FreeCAD,代码行数:9,代码来源:TestPathUtil.py

示例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))
开发者ID:itain,项目名称:FreeCAD,代码行数:18,代码来源:TestPathUtil.py

示例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)
开发者ID:AjinkyaDahale,项目名称:FreeCAD,代码行数:5,代码来源:PathJob.py

示例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))
开发者ID:itain,项目名称:FreeCAD,代码行数:5,代码来源:PathJob.py


注:本文中的PathScripts.PathUtil.isValidBaseObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。