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

Function test_replace

tests/test_shapes.py:327–341  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

325
326
327def test_replace():
328
329 b = box(1, 1, 1)
330 f_top = b.faces(">Z")
331 f_top_split = f_top / plane(0.5, 0.5).moved(f_top.Center())
332
333 br1 = b.replace(f_top, f_top_split)
334
335 assert len(br1.Faces()) == len(b.Faces()) + 1
336 assert br1.isValid()
337
338 br2 = b.replace(f_top, *f_top_split) # invoke with individual faces
339
340 assert len(br2.Faces()) == len(b.Faces()) + 1
341 assert br2.isValid()
342
343
344def test_addHole():

Callers

nothing calls this directly

Calls 8

boxFunction · 0.90
planeFunction · 0.90
isValidMethod · 0.80
facesMethod · 0.45
movedMethod · 0.45
CenterMethod · 0.45
replaceMethod · 0.45
FacesMethod · 0.45

Tested by

no test coverage detected