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

Method sort

cadquery/cq.py:4490–4498  ·  view source on GitHub ↗

Sort items using a callable. :param key: Callable to be used for sorting. :return: Workplane object with items sorted.

(self: T, key: Callable[[CQObject], Any])

Source from the content-addressed store, hash-verified

4488 return self.newObject(f(self.objects))
4489
4490 def sort(self: T, key: Callable[[CQObject], Any]) -> T:
4491 """
4492 Sort items using a callable.
4493
4494 :param key: Callable to be used for sorting.
4495 :return: Workplane object with items sorted.
4496 """
4497
4498 return self.newObject(sorted(self.objects, key=key))
4499
4500 def invoke(
4501 self: T, f: Union[Callable[[T], T], Callable[[T], None], Callable[[], None]]

Callers 15

clusterMethod · 0.45
test_sortFunction · 0.45
test_specialFunction · 0.45
reFunction · 0.45
heFunction · 0.45
XnFunction · 0.45
SuFunction · 0.45
KmFunction · 0.45
lFunction · 0.45
rFunction · 0.45
vtk.jsFile · 0.45

Calls 1

newObjectMethod · 0.95

Tested by 3

test_sortFunction · 0.36
test_specialFunction · 0.36