Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cadquery/occ_impl/geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
7 changes: 7 additions & 0 deletions tests/TestCadObjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down