Public Member Functions | |
def | explodeCompounds (self) |
def | indexOfPiece (self, piece_shape) |
def | indexOfSource (self, source_shape) |
def | largestOverlapCount (self) |
def | makeSplitPieces (self, shape) |
def | parse (self) |
def | parse_elements (self) |
def | piecesFromSource (self, source_shape) |
def | sourcesOfPiece (self, piece_shape) |
def | splitAggregates (self, pieces_to_split=None) |
Public Attributes | |
gfa_return | |
pieces | |
source_shapes | |
class GeneralFuseResult: helper object for obtaining info from results of Part.Shape.generalFuse() method. Usage: def myCustomFusionRoutine(list_of_shapes): generalFuse_return = list_of_shapes[0].generalFuse(list_of_shapes[1:]) ao = GeneralFuseResult(list_of_shapes, generalFuse_return) ... (use attributes and methods of ao) ...
def BOPTools.GeneralFuseResult.GeneralFuseResult.explodeCompounds | ( | self | ) |
explodeCompounds(): if any of self.pieces is a compound, the compound is exploded. After running this, 'self' is filled with new data, where pieces are updated to contain the stuff extracted from compounds.
References BOPTools.GeneralFuseResult.GeneralFuseResult._sources_of_piece, BOPTools.GeneralFuseResult.GeneralFuseResult.gfa_return, App::ObjectIdentifier.parse(), App::Expression.parse(), nlohmann::detail::parser< BasicJsonType, InputAdapterType >.parse(), Base::Quantity.parse(), e57::E57XmlParser.parse(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.parse(), BOPTools.GeneralFuseResult.GeneralFuseResult.parse(), Gui::SelectionFilter.parse(), BOPTools.GeneralFuseResult.GeneralFuseResult.pieces, BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.pieces, BOPTools.GeneralFuseResult.GeneralFuseResult.source_shapes, and BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.source_shapes.
def BOPTools.GeneralFuseResult.GeneralFuseResult.indexOfPiece | ( | self, | |
piece_shape | |||
) |
References BOPTools.GeneralFuseResult.GeneralFuseResult._piece_to_index, and BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder._piece_to_index.
Referenced by BOPTools.GeneralFuseResult.GeneralFuseResult.parse(), and BOPTools.GeneralFuseResult.GeneralFuseResult.sourcesOfPiece().
def BOPTools.GeneralFuseResult.GeneralFuseResult.indexOfSource | ( | self, | |
source_shape | |||
) |
References BOPTools.GeneralFuseResult.GeneralFuseResult._source_to_index.
Referenced by BOPTools.GeneralFuseResult.GeneralFuseResult.parse(), and BOPTools.GeneralFuseResult.GeneralFuseResult.piecesFromSource().
def BOPTools.GeneralFuseResult.GeneralFuseResult.largestOverlapCount | ( | self | ) |
largestOverlapCount(self): returns the largest overlap count. For example, if three spheres intersect and have some volume common to all three, largestOverlapCount returns 3. Note: the return value may be incorrect if some of the pieces are wires/shells/ compsolids/compounds. Please use explodeCompounds and splitAggregates before using this function.
References BOPTools.GeneralFuseResult.GeneralFuseResult._sources_of_piece.
def BOPTools.GeneralFuseResult.GeneralFuseResult.makeSplitPieces | ( | self, | |
shape | |||
) |
makeSplitPieces(self, shape): splits a shell, wire or compsolid into pieces where it intersects with other shapes. Returns list of split pieces. If no splits were done, returns list containing the original shape.
References BOPTools.GeneralFuseResult.GeneralFuseResult._element_to_source, and BOPTools.GeneralFuseResult.GeneralFuseResult.gfa_return.
Referenced by BOPTools.GeneralFuseResult.GeneralFuseResult.splitAggregates().
def BOPTools.GeneralFuseResult.GeneralFuseResult.parse | ( | self | ) |
Parses the result of generalFuse recorded into self.gfa_return. Recovers missing information. Fills in data structures. It is called automatically by class constructor.
References AttachmentEditor.TaskAttachmentEditor.AttachmentEditorTaskPanel.__define_attributes(), BOPTools.GeneralFuseResult.GeneralFuseResult.__define_attributes(), BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.__define_attributes(), BOPTools.GeneralFuseResult.GeneralFuseResult._piece_to_index, BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder._piece_to_index, BOPTools.GeneralFuseResult.GeneralFuseResult._pieces_of_source, BOPTools.GeneralFuseResult.GeneralFuseResult._source_to_index, BOPTools.GeneralFuseResult.GeneralFuseResult._sources_of_piece, BOPTools.GeneralFuseResult.GeneralFuseResult.gfa_return, BOPTools.GeneralFuseResult.GeneralFuseResult.indexOfPiece(), BOPTools.GeneralFuseResult.GeneralFuseResult.indexOfSource(), BOPTools.GeneralFuseResult.GeneralFuseResult.pieces, BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.pieces, BOPTools.GeneralFuseResult.GeneralFuseResult.source_shapes, and BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.source_shapes.
Referenced by BOPTools.GeneralFuseResult.GeneralFuseResult.explodeCompounds(), and BOPTools.GeneralFuseResult.GeneralFuseResult.splitAggregates().
def BOPTools.GeneralFuseResult.GeneralFuseResult.parse_elements | ( | self | ) |
Fills element-to-source map. Potentially slow, so separated from general parse. Needed for splitAggregates; called automatically from splitAggregates.
References BOPTools.GeneralFuseResult.GeneralFuseResult._element_to_source, BOPTools.GeneralFuseResult.GeneralFuseResult._sources_of_piece, BOPTools.GeneralFuseResult.GeneralFuseResult.pieces, and BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.pieces.
Referenced by BOPTools.GeneralFuseResult.GeneralFuseResult.splitAggregates().
def BOPTools.GeneralFuseResult.GeneralFuseResult.piecesFromSource | ( | self, | |
source_shape | |||
) |
piecesFromSource(source_shape): returns list of pieces (shapes) that came from given source shape. Note: aggregate pieces (e.g. wire, shell, compound) always have only one source - the shape they came directly from. Only after executing splitAggregates and explodeCompounds the source lists become completely populated.
References BOPTools.GeneralFuseResult.GeneralFuseResult._pieces_of_source, BOPTools.GeneralFuseResult.GeneralFuseResult.indexOfSource(), BOPTools.GeneralFuseResult.GeneralFuseResult.pieces, and BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.pieces.
def BOPTools.GeneralFuseResult.GeneralFuseResult.sourcesOfPiece | ( | self, | |
piece_shape | |||
) |
sourcesOfPiece(piece_shape): returns list of source shapes given piece came from. Note: aggregate pieces (e.g. wire, shell, compound) always have only one source - the shape they came directly from. Only after executing splitAggregates and explodeCompounds the source lists become completely populated.
References BOPTools.GeneralFuseResult.GeneralFuseResult._sources_of_piece, BOPTools.GeneralFuseResult.GeneralFuseResult.indexOfPiece(), BOPTools.GeneralFuseResult.GeneralFuseResult.source_shapes, and BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.source_shapes.
def BOPTools.GeneralFuseResult.GeneralFuseResult.splitAggregates | ( | self, | |
pieces_to_split = None |
|||
) |
splitAggregates(pieces_to_split = None): splits aggregate shapes (wires, shells, compsolids) in pieces of GF result as cut by intersections. Also splits aggregates inside compounds. After running this, 'self' is replaced with new data, where the pieces_to_split are split. 'pieces_to_split': list of shapes (from self.pieces), that are to be processed. If None, all pieces will be split if possible. Notes: * this routine is very important to functioning of Connect on shells and wires. * Warning: convoluted and slow.
References BOPTools.GeneralFuseResult.GeneralFuseResult._sources_of_piece, BOPTools.GeneralFuseResult.GeneralFuseResult._splitInCompound(), BOPTools.GeneralFuseResult.GeneralFuseResult.gfa_return, BOPTools.GeneralFuseResult.GeneralFuseResult.makeSplitPieces(), App::ObjectIdentifier.parse(), App::Expression.parse(), nlohmann::detail::parser< BasicJsonType, InputAdapterType >.parse(), Base::Quantity.parse(), e57::E57XmlParser.parse(), nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >.parse(), BOPTools.GeneralFuseResult.GeneralFuseResult.parse(), Gui::SelectionFilter.parse(), BOPTools.GeneralFuseResult.GeneralFuseResult.parse_elements(), BOPTools.GeneralFuseResult.GeneralFuseResult.pieces, BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.pieces, BOPTools.GeneralFuseResult.GeneralFuseResult.source_shapes, and BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.source_shapes.
BOPTools.GeneralFuseResult.GeneralFuseResult.gfa_return |
BOPTools.GeneralFuseResult.GeneralFuseResult.pieces |
Referenced by BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.addPiece(), BOPTools.GeneralFuseResult.GeneralFuseResult.explodeCompounds(), BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.getGFReturn(), BOPTools.GeneralFuseResult.GeneralFuseResult.parse(), BOPTools.GeneralFuseResult.GeneralFuseResult.parse_elements(), BOPTools.GeneralFuseResult.GeneralFuseResult.piecesFromSource(), BOPTools.GeneralFuseResult.GeneralFuseReturnBuilder.replacePiece(), and BOPTools.GeneralFuseResult.GeneralFuseResult.splitAggregates().
BOPTools.GeneralFuseResult.GeneralFuseResult.source_shapes |