From 5eed8c27d801c13fa3f21818e27ae730d906ceea Mon Sep 17 00:00:00 2001 From: alavenant Date: Thu, 6 Jun 2024 14:20:57 +0200 Subject: [PATCH] Update test radius (#6) * update test radius * update test radius * delete comment * Uncomment checks in test_radius_assign * update comment + let "numeric_precision" do the job of digital precisions --------- Co-authored-by: Lea Vauchier --- test/test_radius_assign.py | 71 ++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/test/test_radius_assign.py b/test/test_radius_assign.py index 5e1ba83..3c38244 100755 --- a/test/test_radius_assign.py +++ b/test/test_radius_assign.py @@ -7,14 +7,22 @@ import numpy as np import pdal +pt_x = 1639825.1 +pt_y = 1454924.6 +pt_z = 7072.1 +pt_ini = (pt_x, pt_y, pt_z, 1) + +numeric_precision = 4 + def distance2d(pt1, pt2): - return round(math.sqrt((pt1[0] - pt2[0]) ** 2 + (pt1[1] - pt2[1]) ** 2), 2) + return round(math.sqrt((pt1[0] - pt2[0]) ** 2 + (pt1[1] - pt2[1]) ** 2), numeric_precision) def distance3d(pt1, pt2): return round( - math.sqrt((pt1[0] - pt2[0]) ** 2 + (pt1[1] - pt2[1]) ** 2 + (pt1[2] - pt2[2]) ** 2), 2 + math.sqrt((pt1[0] - pt2[0]) ** 2 + (pt1[1] - pt2[1]) ** 2 + (pt1[2] - pt2[2]) ** 2), + numeric_precision, ) @@ -65,29 +73,39 @@ def run_filter(arrays_las, distance_radius, search_3d, distance_cylinder=0.0): return nb_pts_radius_search -def build_random_points_around_one_point(test_function): - - pt_x = 1639825.15 - pt_y = 1454924.63 - pt_z = 7072.17 - pt_ini = (pt_x, pt_y, pt_z, 1) +def build_random_points_around_one_point(test_function, distance_radius): dtype = [("X", "