Select the faces of objects on the stack, optionally filtering the selection. If there are multiple objects on the stack, the faces of all objects are collected and a list of all the distinct faces is returned. :param selector: optional Selector object, or string se
(
self: T,
selector: Optional[Union[Selector, str]] = None,
tag: Optional[str] = None,
)
| 824 | return self._selectObjects("Vertices", selector, tag) |
| 825 | |
| 826 | def faces( |
| 827 | self: T, |
| 828 | selector: Optional[Union[Selector, str]] = None, |
| 829 | tag: Optional[str] = None, |
| 830 | ) -> T: |
| 831 | """ |
| 832 | Select the faces of objects on the stack, optionally filtering the selection. If there are |
| 833 | multiple objects on the stack, the faces of all objects are collected and a list of all the |
| 834 | distinct faces is returned. |
| 835 | |
| 836 | :param selector: optional Selector object, or string selector expression |
| 837 | (see :class:`StringSyntaxSelector`) |
| 838 | :param tag: if set, search the tagged object instead of self |
| 839 | :return: a CQ object whose stack contains all of the *distinct* faces of *all* objects on |
| 840 | the current stack, filtered by the provided selector. |
| 841 | |
| 842 | If there are no faces for any objects on the current stack, an empty CQ object |
| 843 | is returned. |
| 844 | |
| 845 | The typical use is to select the faces of a single object on the stack. For example:: |
| 846 | |
| 847 | Workplane().box(1, 1, 1).faces("+Z").size() |
| 848 | |
| 849 | returns 1, because a cube has one face with a normal in the +Z direction. Similarly:: |
| 850 | |
| 851 | Workplane().box(1, 1, 1).faces().size() |
| 852 | |
| 853 | returns 6, because a cube has a total of 6 faces, And:: |
| 854 | |
| 855 | Workplane().box(1, 1, 1).faces("|Z").size() |
| 856 | |
| 857 | returns 2, because a cube has 2 faces having normals parallel to the z direction |
| 858 | """ |
| 859 | return self._selectObjects("Faces", selector, tag) |
| 860 | |
| 861 | def edges( |
| 862 | self: T, |