1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#!/bin/bash
set -e
cd "$AUTOPKGTEST_TMP"
cat > "cloud.xyz" << EOF
0 1 2
3 4 5
6 7 8
9 0 1
EOF
cat > "test.py" << EOF
import open3d as o3d
import numpy as np
pc = o3d.io.read_point_cloud("cloud.xyz")
pts = np.asarray(pc.points)
assert pts.shape == (4, 3)
assert np.allclose(pts[0], [0, 1, 2])
assert np.allclose(pts[1], [3, 4, 5])
assert np.allclose(pts[2], [6, 7, 8])
assert np.allclose(pts[3], [9, 0, 1])
print("OK")
EOF
echo '$' python3 test.py
python3 test.py
|