|
22 | 22 | import os |
23 | 23 | import sys |
24 | 24 | import platform |
| 25 | + |
25 | 26 | if sys.version_info >= (3, 8, 0) and platform.system() == "Windows": |
26 | | - for path in [x.strip() for x in os.environ['PATH'].split(';') if x]: |
| 27 | + for path in [x.strip() for x in os.environ["PATH"].split(";") if x]: |
27 | 28 | os.add_dll_directory(path) |
28 | 29 |
|
29 | 30 | import opengeode_py_basic as basic |
30 | 31 | import opengeode_py_geometry as geom |
31 | 32 |
|
32 | | -if __name__ == '__main__': |
33 | | - search = geom.NNSearch2D([geom.Point2D([0.1, 4.2]), geom.Point2D( |
34 | | - [5.9, 7.3]), geom.Point2D([1.8, -5]), geom.Point2D([-7.3, -1.6])]) |
| 33 | +if __name__ == "__main__": |
| 34 | + search = geom.NNSearch2D( |
| 35 | + [ |
| 36 | + geom.Point2D([0.1, 4.2]), |
| 37 | + geom.Point2D([5.9, 7.3]), |
| 38 | + geom.Point2D([1.8, -5]), |
| 39 | + geom.Point2D([-7.3, -1.6]), |
| 40 | + ] |
| 41 | + ) |
35 | 42 |
|
36 | 43 | if search.closest_neighbor(geom.Point2D([0, 0])) != 0: |
37 | 44 | raise ValueError("[Test] Error in closest neighbor") |
|
52 | 59 | p3 = geom.Point3D([3.1, 9.4, 9.7]) |
53 | 60 | colocator = geom.NNSearch3D([p0, p0, p1, p0, p2, p1, p3]) |
54 | 61 |
|
55 | | - colocated_info = colocator.colocated_index_mapping(basic.GLOBAL_EPSILON) |
| 62 | + colocated_info = colocator.radius_colocated_index_mapping(basic.GLOBAL_EPSILON) |
56 | 63 | if colocated_info.nb_colocated_points() != 3: |
57 | 64 | raise ValueError("[Test] Should be 3 colocated points") |
0 commit comments