Skip to content

Commit

Permalink
FIX: add initial rotation to align_to_skeleton method
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienGilliard committed Oct 14, 2024
1 parent 7667feb commit 71c3576
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/find_multiple_trees_without_optimisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,17 @@ def main():
# at this point the reference_pc_as_list should contain the points, but they are not ordered. We need to order them.
reference_pc_as_list = geometry.sort_points(element.locations)
reference_skeleton = geometry.Pointcloud(reference_pc_as_list)
best_tree, best_rmse = element.allocate_trees(db_path=db_path, optimized=False)
best_tree, best_rmse, init_rotation = element.allocate_trees(
db_path=db_path, optimized=False
)
if best_tree is None:
print("No tree found. Skiping this element.")
continue

all_rmse.append(best_rmse)
best_tree = copy.deepcopy(best_tree)

best_tree.align_to_skeleton(reference_skeleton)
best_tree.align_to_skeleton(reference_skeleton, init_rotation)

# Create a bounding volume for the element
bounding_volume = element.create_bounding_cylinder(radius=1)
Expand Down

0 comments on commit 71c3576

Please sign in to comment.