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

Function test_special

tests/test_shapes.py:390–402  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

388
389
390def test_special():
391
392 c = compound(box(1, 1, 1), box(2, 2, 2), box(3, 3, 3))
393
394 assert isinstance(c[0], Solid)
395 assert isinstance(c[-1], Solid)
396 assert isinstance(c[:2], Compound)
397
398 cf = c.filter(lambda x: x.Volume() <= 1)
399 assert len(cf.Solids()) == 1
400
401 cs = c.sort(lambda x: -x.Volume())
402 assert cs[0].Volume() == approx(3 ** 3)
403
404
405def test_center():

Callers

nothing calls this directly

Calls 6

compoundFunction · 0.90
boxFunction · 0.90
VolumeMethod · 0.80
SolidsMethod · 0.80
filterMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected