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

Method testLocatedMoved

tests/test_cadquery.py:4766–4787  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4764 self.assertAlmostEqual(res_fuzzy_intersect_val.Volume(), 1)
4765
4766 def testLocatedMoved(self):
4767
4768 box = Solid.makeBox(1, 1, 1, Vector(-0.5, -0.5, -0.5))
4769 loc = Location(Vector(1, 1, 1))
4770
4771 box1 = box.located(loc)
4772
4773 self.assertTupleAlmostEquals(box1.Center().toTuple(), (1, 1, 1), 6)
4774 self.assertTupleAlmostEquals(box.Center().toTuple(), (0, 0, 0), 6)
4775
4776 box.locate(loc)
4777
4778 self.assertTupleAlmostEquals(box.Center().toTuple(), (1, 1, 1), 6)
4779
4780 box2 = box.moved(loc)
4781
4782 self.assertTupleAlmostEquals(box.Center().toTuple(), (1, 1, 1), 6)
4783 self.assertTupleAlmostEquals(box2.Center().toTuple(), (2, 2, 2), 6)
4784
4785 box.move(loc)
4786
4787 self.assertTupleAlmostEquals(box.Center().toTuple(), (2, 2, 2), 6)
4788
4789 def testNullShape(self):
4790

Callers

nothing calls this directly

Calls 10

VectorClass · 0.85
LocationClass · 0.85
makeBoxMethod · 0.80
locateMethod · 0.80
locatedMethod · 0.45
toTupleMethod · 0.45
CenterMethod · 0.45
movedMethod · 0.45
moveMethod · 0.45

Tested by

no test coverage detected