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

Function test_history_bool

tests/test_free_functions.py:1235–1255  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1233
1234# %% history
1235def test_history_bool():
1236
1237 b1 = box(1, 1, 1)
1238 b2 = box(1, 0.5, 0.1)
1239
1240 hist = History()
1241 res = cut(b1, b2, history=hist, name="cut")
1242
1243 assert hist[0] == hist["cut"]
1244 assert b2.face("<Z") in hist["cut"].deleted()
1245 assert hist["cut"].modified(b1.face("<Z")).size() == 2
1246 assert hist["cut"].modified(b1.face("<Z").edge(">X")).size() == 2
1247
1248 with pytest.raises(KeyError):
1249 hist["cut"].generated(b1.face(">Z"))
1250
1251 res2 = imprint(res, b2, history=hist, name="imprint")
1252
1253 op = hist["imprint"]
1254
1255 assert isSubshape(op.images(b1.face(">Z")), res2.solid(">Z"))
1256
1257
1258def test_history_extrude():

Callers

nothing calls this directly

Calls 13

HistoryClass · 0.90
boxFunction · 0.85
cutFunction · 0.85
isSubshapeFunction · 0.85
deletedMethod · 0.80
modifiedMethod · 0.80
generatedMethod · 0.80
imagesMethod · 0.80
solidMethod · 0.80
imprintFunction · 0.50
faceMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected