1- import e57
21import numpy as np
2+ import pytest
3+
4+ import e57
35
46
57def test_raw_xml ():
@@ -11,3 +13,23 @@ def test_read_points():
1113 pointcloud = e57 .read_points (r"testdata/bunnyFloat.e57" )
1214 assert isinstance (pointcloud , np .ndarray )
1315 assert len (pointcloud ) == 30_571
16+
17+
18+ def test_box_dimensions ():
19+ pointcloud : np .ndarray = e57 .read_points (r"testdata/bunnyFloat.e57" )
20+ max_coords = pointcloud .max (0 , None , False , - np .inf )
21+ min_coords = pointcloud .min (0 , None , False , np .inf )
22+ X , Y , Z = max_coords - min_coords
23+ assert X == pytest .approx (0.155698 )
24+ assert Y == pytest .approx (0.14731 )
25+ assert Z == pytest .approx (0.120672 )
26+
27+
28+ def test_global_box_center ():
29+ pointcloud : np .ndarray = e57 .read_points (r"testdata/bunnyFloat.e57" )
30+ max_coords = pointcloud .max (0 , None , False , - np .inf )
31+ min_coords = pointcloud .min (0 , None , False , np .inf )
32+ X , Y , Z = (max_coords + min_coords ) / 2
33+ assert X == pytest .approx (- 0.016840 )
34+ assert Y == pytest .approx (0.113666 )
35+ assert Z == pytest .approx (- 0.001537 )
0 commit comments