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

Method map

cadquery/cq.py:4470–4478  ·  view source on GitHub ↗

Apply a callable to every item separately. :param f: Callable to be applied to every item separately. :return: Workplane object with f applied to all items.

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

Source from the content-addressed store, hash-verified

4468 return self.newObject(filter(f, self.objects))
4469
4470 def map(self: T, f: Callable[[CQObject], CQObject]) -> T:
4471 """
4472 Apply a callable to every item separately.
4473
4474 :param f: Callable to be applied to every item separately.
4475 :return: Workplane object with f applied to all items.
4476 """
4477
4478 return self.newObject(map(f, self.objects))
4479
4480 def apply(self: T, f: Callable[[Iterable[CQObject]], Iterable[CQObject]]) -> T:
4481 """

Callers 15

test_mapFunction · 0.45
test_replaceFunction · 0.45
test_addFunction · 0.45
test_subtractFunction · 0.45
reFunction · 0.45
vtk.jsFile · 0.45
peFunction · 0.45
geFunction · 0.45
SeFunction · 0.45
RnFunction · 0.45
BnFunction · 0.45

Calls 1

newObjectMethod · 0.95

Tested by 5

test_mapFunction · 0.36
test_replaceFunction · 0.36
test_addFunction · 0.36
test_subtractFunction · 0.36