|
|
|
@ -255,11 +255,13 @@ class GenLocationsOnMeshNode(Node):
|
|
|
|
# загрузка кэша не удалась, обрабатываем файлы полностью
|
|
|
|
# загрузка кэша не удалась, обрабатываем файлы полностью
|
|
|
|
self.get_logger().info('Loading data from mesh file in gen_locations_on_mesh')
|
|
|
|
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_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.vs = mesh.vertices
|
|
|
|
self.trs = get_all_triangles_with_correct_orientation(mesh.vertices,
|
|
|
|
self.trs = get_all_triangles_with_correct_orientation(mesh.vertices,
|
|
|
|
mesh.faces,
|
|
|
|
mesh.faces,
|
|
|
|
1.5)
|
|
|
|
1.5)
|
|
|
|
#conns = calc_connections(self.trs)
|
|
|
|
#conns = calc_connections(self.trs)
|
|
|
|
#pieces = calc_pieces(self.trs, conns)
|
|
|
|
#pieces = calc_pieces(self.trs, conns)
|
|
|
|
#self.the_piece = find_largest_piece(pieces)
|
|
|
|
#self.the_piece = find_largest_piece(pieces)
|
|
|
|
|