Skip to content

Commit c2ee80a

Browse files
committed
pointcloud comparison tests
1 parent f123ce2 commit c2ee80a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/compas/geometry/test_pointcloud.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import random
12
import compas
23

34
from compas.geometry import Pointcloud
@@ -11,3 +12,21 @@ def test_data():
1112
assert p == o
1213
assert not (p is o)
1314
assert o.data == o.validate_data()
15+
16+
17+
def test_equality():
18+
a = Pointcloud.from_bounds(10, 10, 10, 10)
19+
points = a.points[:]
20+
random.shuffle(points)
21+
b = Pointcloud(points)
22+
assert a == b
23+
24+
25+
def test_inequality():
26+
a = Pointcloud.from_bounds(10, 10, 10, 10)
27+
b = Pointcloud.from_bounds(10, 10, 10, 11)
28+
assert a != b
29+
b = Pointcloud.from_bounds(10, 10, 10, 9)
30+
assert a != b
31+
b = Pointcloud.from_bounds(10, 10, 10, 10)
32+
assert a != b

0 commit comments

Comments
 (0)