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

Method faces

cadquery/cq.py:826–859  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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,

Callers 15

testBasicLinesMethod · 0.95
testCenterNthSelectorMethod · 0.95
test_meta_step_exportFunction · 0.95
test_mirror_workplaneMethod · 0.45
test_mirror_faceMethod · 0.45
test_ctrlPtsFunction · 0.45
test_distributeFunction · 0.45
test_parrayFunction · 0.45
test_modifiersFunction · 0.45

Calls 1

_selectObjectsMethod · 0.95

Tested by 15

testBasicLinesMethod · 0.76
testCenterNthSelectorMethod · 0.76
test_meta_step_exportFunction · 0.76
test_mirror_workplaneMethod · 0.36
test_mirror_faceMethod · 0.36
test_ctrlPtsFunction · 0.36
test_distributeFunction · 0.36
test_parrayFunction · 0.36
test_modifiersFunction · 0.36