BOPTools.ShapeMerge Namespace Reference


def dimensionOfShapes (list_of_shapes)
def findSharedElements (shape_list, element_extractor)
def isConnected (shape1, shape2, shape_dim=-1)
def mergeShapes (list_of_shapes, flag_single=False, split_connections=[], bool_compsolid=False)
def mergeShells (list_of_faces_shells, flag_single=False, split_connections=[])
def mergeSolids (list_of_solids_compsolids, flag_single=False, split_connections=[], bool_compsolid=False)
def mergeVertices (list_of_vertices, flag_single=False, split_connections=[])
def mergeWires (list_of_edges_wires, flag_single=False, split_connections=[])
def removeDuplicates (list_of_shapes)
def splitIntoGroupsBySharing (list_of_shapes, element_extractor, split_connections=[])

Function Documentation

def BOPTools.ShapeMerge.dimensionOfShapes (   list_of_shapes)
dimensionOfShapes(list_of_shapes): returns dimension (0D, 1D, 2D, or 3D) of shapes
in the list. If dimension of shapes varies, TypeError is raised.

Referenced by BOPTools.ShapeMerge.isConnected(), and BOPTools.ShapeMerge.mergeShapes().

def BOPTools.ShapeMerge.findSharedElements (   shape_list,
def BOPTools.ShapeMerge.isConnected (   shape1,
  shape_dim = -1 
def BOPTools.ShapeMerge.mergeShapes (   list_of_shapes,
  flag_single = False,
  split_connections = [],
  bool_compsolid = False 
mergeShapes(list_of_shapes, flag_single = False, split_connections = [], bool_compsolid = False):
merges list of edges/wires into wires, faces/shells into shells, solids/compsolids
into solids or compsolids.

list_of_shapes: shapes to merge. Shapes must share elements in order to be merged.

flag_single: assume all shapes in list are connected. If False, return is a compound.
If True, return is the single piece (e.g. a shell).

split_connections: list of shapes that are excluded when searching for connections.
This can be used for example to split a wire in two by supplying vertices where to
split. If flag_single is True, this argument is ignored.

bool_compsolid: determines behavior when dealing with solids/compsolids. If True,
result is compsolid/compound of compsolids. If False, all touching solids and
compsolids are unified into single solids. If not merging solids/compsolids, this
argument is ignored.

References BOPTools.ShapeMerge.dimensionOfShapes(), BOPTools.ShapeMerge.mergeShells(), BOPTools.ShapeMerge.mergeSolids(), BOPTools.ShapeMerge.mergeVertices(), and BOPTools.ShapeMerge.mergeWires().

def BOPTools.ShapeMerge.mergeShells (   list_of_faces_shells,
  flag_single = False,
  split_connections = [] 
def BOPTools.ShapeMerge.mergeSolids (   list_of_solids_compsolids,
  flag_single = False,
  split_connections = [],
  bool_compsolid = False 
mergeSolids(list_of_solids, flag_single = False): merges touching solids that share
faces. If flag_single is True, it is assumed that all solids touch, and output is a
single solid. If flag_single is False, the output is a compound containing all
resulting solids.

Note. CompSolids are treated as lists of solids - i.e., merged into solids.

References BOPTools.ShapeMerge.splitIntoGroupsBySharing().

Referenced by BOPTools.ShapeMerge.mergeShapes().

def BOPTools.ShapeMerge.mergeVertices (   list_of_vertices,
  flag_single = False,
  split_connections = [] 
def BOPTools.ShapeMerge.mergeWires (   list_of_edges_wires,
  flag_single = False,
  split_connections = [] 
def BOPTools.ShapeMerge.removeDuplicates (   list_of_shapes)
def BOPTools.ShapeMerge.splitIntoGroupsBySharing (   list_of_shapes,
  split_connections = [] 
splitIntoGroupsBySharing(list_of_shapes, element_type, split_connections = []): find,
which shapes in list_of_shapes are connected into groups by sharing elements.

element_extractor: function that takes shape as input, and returns list of shapes.

split_connections: list of shapes to exclude when testing for connections. Use to
split groups on purpose.

return: list of lists of shapes. Top-level list is list of groups; bottom level lists
enumerate shapes of a group.

Referenced by BOPTools.ShapeMerge.mergeShells(), BOPTools.ShapeMerge.mergeSolids(), and BOPTools.ShapeMerge.mergeWires().