diff --git a/cadquery/occ_impl/geom.py b/cadquery/occ_impl/geom.py index 1f7be5595..47af6eec5 100644 --- a/cadquery/occ_impl/geom.py +++ b/cadquery/occ_impl/geom.py @@ -133,7 +133,7 @@ def __str__(self): return 'Vector: ' + str((self.x, self.y, self.z)) def __eq__(self, other): - return self.wrapped == other.wrapped + return self.wrapped.IsEqual(other.wrapped, 0.00001, 0.00001) ''' is not implemented in OCC def __ne__(self, other): diff --git a/tests/TestCadObjects.py b/tests/TestCadObjects.py index 807d1779b..c220b96be 100644 --- a/tests/TestCadObjects.py +++ b/tests/TestCadObjects.py @@ -108,6 +108,13 @@ def testVectorAdd(self): result = Vector(1, 2, 0) + Vector(0, 0, 3) self.assertTupleAlmostEquals((1.0, 2.0, 3.0), result.toTuple(), 3) + def testVectorEquals(self): + a = Vector(1, 2, 3) + b = Vector(1, 2, 3) + c = Vector(1, 2, 3.000001) + self.assertEqual(a, b) + self.assertEqual(a, c) + def testTranslate(self): e = Edge.makeCircle(2, (1, 2, 3)) e2 = e.translate(Vector(0, 0, 1))