Skip to content

Commit 7c52617

Browse files
committed
test pointcloud
1 parent 13e77de commit 7c52617

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/compas/geometry/test_pointcloud.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import compas
44
from random import random, shuffle
5+
from compas.geometry import Box
56
from compas.geometry import Point # noqa: F401
67
from compas.geometry import Pointcloud
78

@@ -54,3 +55,13 @@ def test_pointcloud__neq__():
5455
assert a != b
5556
b = Pointcloud.from_bounds(10, 10, 10, 10)
5657
assert a != b
58+
59+
60+
def test_pointcloud_from_box():
61+
x_size = 10
62+
y_size = 5
63+
z_size = 3
64+
box = Box.from_width_height_depth(x_size, z_size, y_size)
65+
pointcloud = Pointcloud.from_box(box, 100)
66+
assert len(pointcloud.points) == 100
67+
assert all((-x_size / 2 < x < x_size / 2) and (-y_size / 2 < y < y_size / 2) and (-z_size / 2 < z < z_size) for x, y, z in pointcloud.points)

0 commit comments

Comments
 (0)