MCPcopy
hub / github.com/CadQuery/cadquery / findSolid

Method findSolid

cadquery/cq.py:721–751  ·  view source on GitHub ↗

Finds the first solid object in the chain, searching from the current node backwards through parents until one is found. :param searchStack: should objects on the stack be searched first? :param searchParents: should parents be searched? :raises ValueError:

(
        self, searchStack: bool = True, searchParents: bool = True
    )

Source from the content-addressed store, hash-verified

719 return None
720
721 def findSolid(
722 self, searchStack: bool = True, searchParents: bool = True
723 ) -> Union[Solid, Compound]:
724 """
725 Finds the first solid object in the chain, searching from the current node
726 backwards through parents until one is found.
727
728 :param searchStack: should objects on the stack be searched first?
729 :param searchParents: should parents be searched?
730 :raises ValueError: if no solid is found
731
732 This function is very important for chains that are modifying a single parent object,
733 most often a solid.
734
735 Most of the time, a chain defines or selects a solid, and then modifies it using workplanes
736 or other operations.
737
738 Plugin Developers should make use of this method to find the solid that should be modified,
739 if the plugin implements a unary operation, or if the operation will automatically merge its
740 results with an object already on the stack.
741 """
742
743 found = self._findType((Solid,), searchStack, searchParents)
744
745 if found is None:
746 message = "on the stack or " if searchStack else ""
747 raise ValueError(
748 "Cannot find a solid {}in the parent chain".format(message)
749 )
750
751 return found
752
753 def _selectObjects(
754 self: T,

Callers 15

splitMethod · 0.95
ancestorsMethod · 0.95
siblingsMethod · 0.95
shellMethod · 0.95
filletMethod · 0.95
chamferMethod · 0.95
largestDimensionMethod · 0.95
cutEachMethod · 0.95
cutMethod · 0.95
intersectMethod · 0.95
cutBlindMethod · 0.95
cutThruAllMethod · 0.95

Calls 1

_findTypeMethod · 0.95

Tested by 13

test_mirrorMethod · 0.64
test_all_planesMethod · 0.64
test_mirror_axisMethod · 0.64
test_mirror_workplaneMethod · 0.64
test_mirror_faceMethod · 0.64
test_bezier_curveMethod · 0.64
importBoxMethod · 0.64
importCompoundMethod · 0.64
testImportDXFMethod · 0.64