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

Method vertices

cadquery/cq.py:792–824  ·  view source on GitHub ↗

Select the vertices of objects on the stack, optionally filtering the selection. If there are multiple objects on the stack, the vertices of all objects are collected and a list of all the distinct vertices is returned. :param selector: optional Selector object, or

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

Source from the content-addressed store, hash-verified

790 return toReturn
791
792 def vertices(
793 self: T,
794 selector: Optional[Union[Selector, str]] = None,
795 tag: Optional[str] = None,
796 ) -> T:
797 """
798 Select the vertices of objects on the stack, optionally filtering the selection. If there
799 are multiple objects on the stack, the vertices of all objects are collected and a list of
800 all the distinct vertices is returned.
801
802 :param selector: optional Selector object, or string selector expression
803 (see :class:`StringSyntaxSelector`)
804 :param tag: if set, search the tagged object instead of self
805 :return: a CQ object whose stack contains the *distinct* vertices of *all* objects on the
806 current stack, after being filtered by the selector, if provided
807
808 If there are no vertices for any objects on the current stack, an empty CQ object
809 is returned
810
811 The typical use is to select the vertices of a single object on the stack. For example::
812
813 Workplane().box(1, 1, 1).faces("+Z").vertices().size()
814
815 returns 4, because the topmost face of a cube will contain four vertices. While this::
816
817 Workplane().box(1, 1, 1).faces().vertices().size()
818
819 returns 8, because a cube has a total of 8 vertices
820
821 **Note** Circles are peculiar, they have a single vertex at the center!
822
823 """
824 return self._selectObjects("Vertices", selector, tag)
825
826 def faces(
827 self: T,

Callers 15

testPlaneMethodsMethod · 0.95
testBaseDirSelectorMethod · 0.95
testCenterNthSelectorMethod · 0.95
testCompoundCenterMethod · 0.45
test_face_interfaceFunction · 0.45
test_distributeFunction · 0.45
test_rarrayFunction · 0.45
test_parrayFunction · 0.45
test_modifiersFunction · 0.45
test_deleteFunction · 0.45
test_selectorsFunction · 0.45
test_edge_interfaceFunction · 0.45

Calls 1

_selectObjectsMethod · 0.95

Tested by 15

testPlaneMethodsMethod · 0.76
testBaseDirSelectorMethod · 0.76
testCenterNthSelectorMethod · 0.76
testCompoundCenterMethod · 0.36
test_face_interfaceFunction · 0.36
test_distributeFunction · 0.36
test_rarrayFunction · 0.36
test_parrayFunction · 0.36
test_modifiersFunction · 0.36
test_deleteFunction · 0.36
test_selectorsFunction · 0.36
test_edge_interfaceFunction · 0.36