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

Method _selectObjects

cadquery/cq.py:753–776  ·  view source on GitHub ↗

Filters objects of the selected type with the specified selector,and returns results :param objType: the type of object we are searching for :type objType: string: (Vertex|Edge|Wire|Solid|Shell|Compound|CompSolid) :param tag: if set, search the tagged CQ object inst

(
        self: T,
        objType: Any,
        selector: Optional[Union[Selector, str]] = None,
        tag: Optional[str] = None,
    )

Source from the content-addressed store, hash-verified

751 return found
752
753 def _selectObjects(
754 self: T,
755 objType: Any,
756 selector: Optional[Union[Selector, str]] = None,
757 tag: Optional[str] = None,
758 ) -> T:
759 """
760 Filters objects of the selected type with the specified selector,and returns results
761
762 :param objType: the type of object we are searching for
763 :type objType: string: (Vertex|Edge|Wire|Solid|Shell|Compound|CompSolid)
764 :param tag: if set, search the tagged CQ object instead of self
765 :return: a CQ object with the selected objects on the stack.
766
767 **Implementation Note**: This is the base implementation of the vertices,edges,faces,
768 solids,shells, and other similar selector methods. It is a useful extension point for
769 plugin developers to make other selector methods.
770 """
771 cq_obj = self._getTagged(tag) if tag else self
772
773 # A single list of all faces from all objects on the stack
774 toReturn = cq_obj._collectProperty(objType)
775
776 return self.newObject(self._filter(toReturn, selector))
777
778 def _filter(self, objs, selector: Optional[Union[Selector, str]]):
779

Callers 7

verticesMethod · 0.95
facesMethod · 0.95
edgesMethod · 0.95
wiresMethod · 0.95
solidsMethod · 0.95
shellsMethod · 0.95
compoundsMethod · 0.95

Calls 4

_getTaggedMethod · 0.95
newObjectMethod · 0.95
_filterMethod · 0.95
_collectPropertyMethod · 0.80

Tested by

no test coverage detected