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,
)
| 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, |