From ccc4ea077cda9b2dc04669bfa940282e3a9cc55f Mon Sep 17 00:00:00 2001 From: Petr Sorokoumov Date: Wed, 24 Jun 2026 12:24:11 +0300 Subject: [PATCH] bugfix --- .../gen_locations_on_mesh/gen_locations_on_mesh_node.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gen_locations_on_mesh/gen_locations_on_mesh/gen_locations_on_mesh_node.py b/gen_locations_on_mesh/gen_locations_on_mesh/gen_locations_on_mesh_node.py index ef1733a..57247e8 100644 --- a/gen_locations_on_mesh/gen_locations_on_mesh/gen_locations_on_mesh_node.py +++ b/gen_locations_on_mesh/gen_locations_on_mesh/gen_locations_on_mesh_node.py @@ -255,11 +255,13 @@ class GenLocationsOnMeshNode(Node): # загрузка кэша не удалась, обрабатываем файлы полностью self.get_logger().info('Loading data from mesh file in gen_locations_on_mesh') mesh_filename = self.get_parameter('mesh_filename').get_parameter_value().string_value - mesh = trimesh.load_mesh(mesh_filename) + file_ext = 'ply' if '.' not in mesh_filename else mesh_filename[-mesh_filename[::-1].index('.'):] + with open(mesh_filename, 'rb') as mesh_f: + mesh = trimesh.load_mesh(mesh_f, file_type=file_ext) self.vs = mesh.vertices self.trs = get_all_triangles_with_correct_orientation(mesh.vertices, - mesh.faces, - 1.5) + mesh.faces, + 1.5) #conns = calc_connections(self.trs) #pieces = calc_pieces(self.trs, conns) #self.the_piece = find_largest_piece(pieces)