File: test-py

package info (click to toggle)
open3d 0.19.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 83,496 kB
  • sloc: cpp: 206,543; python: 27,254; ansic: 8,356; javascript: 1,883; sh: 1,527; makefile: 259; xml: 69
file content (28 lines) | stat: -rwxr-xr-x 468 bytes parent folder | download | duplicates (3)
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