From 2db7676287efd5fbb8198cdc9440822cd19ca7ae Mon Sep 17 00:00:00 2001 From: Brent Yi Date: Wed, 21 Aug 2024 01:35:25 -0700 Subject: [PATCH] Fix pyright error --- examples/20_scene_pointer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/20_scene_pointer.py b/examples/20_scene_pointer.py index 1069c302..6d5a2e90 100644 --- a/examples/20_scene_pointer.py +++ b/examples/20_scene_pointer.py @@ -71,7 +71,7 @@ def _(event: viser.ScenePointerEvent) -> None: client.scene.remove_pointer_callback() # Get the first hit position (based on distance from the ray origin). - hit_pos = min(hit_pos, key=lambda x: onp.linalg.norm(x - origin)) + hit_pos = hit_pos[onp.argmin(onp.sum((hit_pos - origin) ** 2, axis=-1))] # Create a sphere at the hit location. hit_pos_mesh = trimesh.creation.icosphere(radius=0.1)