| 593 | |
| 594 | |
| 595 | def test_imprint(): |
| 596 | |
| 597 | b1 = box(1, 1, 1) |
| 598 | b2 = b1.moved(x=1) |
| 599 | b3 = box(0.5, 0.5, 0.5).moved(x=0.75) |
| 600 | |
| 601 | res = imprint(b1, b2) |
| 602 | |
| 603 | assert len(res.Faces()) == len(compound(b1, b2).Faces()) - 1 |
| 604 | |
| 605 | res_glue_full = imprint(b1, b2, glue="full") |
| 606 | |
| 607 | assert len(res_glue_full.Faces()) == len(compound(b1, b2).Faces()) - 1 |
| 608 | |
| 609 | # imprint with history |
| 610 | history = History() |
| 611 | res_glue_partial = imprint(b1, b3, glue="partial", history=history) |
| 612 | |
| 613 | b1_imp = history[0].images(b1.faces()) |
| 614 | b3_imp = history[0].images(b3.faces()) |
| 615 | |
| 616 | assert len(b1_imp.Faces()) == len(b1.Faces()) + 1 |
| 617 | assert len(res_glue_partial.Faces()) == len(b1_imp.Faces() + b3_imp.Faces()) - 1 |
| 618 | |
| 619 | |
| 620 | @fixture |