Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 4, 2025

Tree branch generation often produces intersecting geometry. This adds a post-processing script that detects and removes smaller intersecting branches from PLY output files.

Changes

  • New script: lpy_treesim/tree_generation/remove_intersecting_branches.py

    • Parses PLY files, grouping vertices/faces by color (each branch has unique color)
    • Detects intersections via AABB tests between branch meshes
    • Removes lower-priority branch (Trunk > Branch > TertiaryBranch > Spur); falls back to volume comparison
    • Updates metadata JSON to reflect removed branches
  • Documentation: Added usage section to README

Usage

python -m lpy_treesim.tree_generation.remove_intersecting_branches \
    --ply dataset/lpy_UFO_00000.ply \
    --metadata dataset/lpy_UFO_00000_metadata.json \
    --output cleaned.ply \
    --verbose
Original prompt

This section details on the original issue you should resolve

<issue_title>Intersection of tertiary and secondary branches</issue_title>
<issue_description>When branches grow they often intersect with each other. Write a post-processing script that removes the smaller intersecting branch by going through the output ply file</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 4, 2025 23:17
…iles

Co-authored-by: abhinavj98 <25354763+abhinavj98@users.noreply.github.com>
Co-authored-by: abhinavj98 <25354763+abhinavj98@users.noreply.github.com>
Copilot AI changed the title [WIP] Add script to remove smaller intersecting branches Add post-processing script to remove intersecting branches from PLY files Dec 4, 2025
Copilot AI requested a review from abhinavj98 December 4, 2025 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intersection of tertiary and secondary branches

2 participants