BOPTools.Utils Namespace Reference

Classes

class  FrozenClass
 
class  HashableShape
 
class  HashableShape_Deep
 

Functions

def compoundLeaves (shape_or_compound)
 
def upgradeToAggregateIfNeeded (list_of_shapes, types=None)
 

Function Documentation

def BOPTools.Utils.compoundLeaves (   shape_or_compound)
compoundLeaves(shape_or_compound): extracts all non-compound shapes from a nested compound.
Note: shape_or_compound may be a non-compound; then, it is the only thing in the
returned list.

Referenced by BOPTools.Utils.upgradeToAggregateIfNeeded().

def BOPTools.Utils.upgradeToAggregateIfNeeded (   list_of_shapes,
  types = None 
)
upgradeToAggregateIfNeeded(list_of_shapes, types = None): upgrades non-aggregate type
shapes to aggregate-type shapes if the list has a mix of aggregate and non-aggregate
type shapes. Returns the new list. Recursively traverses into compounds.

aggregate shape types are Wire, Shell, CompSolid
non-aggregate shape types are Vertex, Edge, Face, Solid
Compounds are something special: they are recursively traversed to upgrade the
contained shapes.

Examples:
list_of_shapes contains only faces -> nothing happens
list_of_shapes contains faces and shells -> faces are converted to shells

'types' argument is needed for recursive traversal. Do not supply.

References BOPTools.Utils.compoundLeaves().