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

Method apply

cadquery/cq.py:4480–4488  ·  view source on GitHub ↗

Apply a callable to all items at once. :param f: Callable to be applied. :return: Workplane object with f applied to all items.

(self: T, f: Callable[[Iterable[CQObject]], Iterable[CQObject]])

Source from the content-addressed store, hash-verified

4478 return self.newObject(map(f, self.objects))
4479
4480 def apply(self: T, f: Callable[[Iterable[CQObject]], Iterable[CQObject]]) -> T:
4481 """
4482 Apply a callable to all items at once.
4483
4484 :param f: Callable to be applied.
4485 :return: Workplane object with f applied to all items.
4486 """
4487
4488 return self.newObject(f(self.objects))
4489
4490 def sort(self: T, key: Callable[[CQObject], Any]) -> T:
4491 """

Callers 15

test_applyFunction · 0.45
CFunction · 0.45
PFunction · 0.45
FFunction · 0.45
nFunction · 0.45
vtk.jsFile · 0.45
LFunction · 0.45
HFunction · 0.45
KFunction · 0.45
XFunction · 0.45
JFunction · 0.45

Calls 2

newObjectMethod · 0.95
fFunction · 0.50

Tested by 2

test_applyFunction · 0.36