def noCollision(ftrs): ftrs = ftrlist(ftrs) shps = [] for ftr in ftrs: if isDerivedFrom(ftr, ("Part::Compound", Compound)): shps.append(Shapes.fuse(outftr.Shape for outftr in ftrlist(ftr.OutList))) else: shps.append(ftr.Shape) vol_sum = sum(shp.Volume for shp in shps) vol_fus = Shapes.fuse(shps).Volume return fuzzyCompare(vol_sum, vol_fus)
def execute(self, obj): if isDerivedFrom(obj, "Part::FeaturePython"): obj.Shape = Shapes.fuse(s.Shape for s in obj.Sources) obj.Placement = FreeCAD.Placement() obj.Outfaces = trace(obj) if P.autotrace else [] elif isDerivedFrom(obj, "Mesh::FeaturePython"): obj.Mesh = Meshes.fuse(meshOf(s) for s in obj.Sources) obj.Placement = FreeCAD.Placement() else: raise TypeError