Tools to segment firebrand meshes and extract geometric characteristics from .ply files.
.
├── compute.py # Extract mesh characteristics (AABB) to CSV
├── computer new backup.py # Alternative: uses oriented bounding box (OBB)
├── characteristic extract.py # Advanced: per-folder CSV output with PCA rotation
├── seperation v2.py # Utility: segments connected components
├── organize_ply_by_prefix.py # Utility: organizes outputs by prefix
├── README.md # This file
├── AGENTS.md # Detailed script documentation
└── environment.yml # Conda environment configuration
- Python 3.11.x (recommended), open3d doesn't run with newer Python
- Packages:
open3d,trimesh,numpy, plus plotting/tools as needed
If you use conda, this repo includes environment.yml.
conda env create -f environment.yml
conda activate firebrand-extractorExtract mesh characteristics from a directory of .ply files:
python compute.py /path/to/folderResults are saved to /path/to/folder/mesh_volumes_and_bboxes.csv
python compute.py /path/to/ply_filesUses axis-aligned bounding box (AABB) for Length/Width/Height.
Output location: Creates mesh_volumes_and_bboxes.csv in the input directory
Optional arguments:
-o, --output: Specify custom output CSV pathOutput will be saved to the specified path instead of the default locationpython compute.py /path/to/ply_files -o /custom/path/results.csv
python "computer new backup.py" /path/to/ply_filesUses smallest oriented bounding box (OBB) instead of AABB.
python "characteristic extract.py" /path/to/rootScans recursively, writes one CSV per folder using PCA-rotated mesh to compute smallest OBB.
Keep temp PCA exports:
python "characteristic extract.py" /path/to/root --keep-temppython "seperation v2.py" "/path/to/root"Scans recursively and writes segmented outputs into the same folder as each source file.
python "organize_ply_by_prefix.py" "/path/to/root" --dry-run
python "organize_ply_by_prefix.py" "/path/to/root"Moves <prefix>_mesh*.ply into a <prefix>/ folder and removes redundant *_mesh_1.ply when no other clusters exist.
Use any of the extraction scripts:
AABB (simplest, fastest)
python compute.py /path/to/segmented_filesOBB (oriented bounding box)
python "computer new backup.py" /path/to/segmented_filesPer-folder with PCA (most detailed)
python "characteristic extract.py" /path/to/rootCSV file includes:
- File (ID)
- Volume (mm3) — using absolute value to avoid negative volumes from flipped normals
- Surface Area (mm2)
- Length, Width, Height (mm) — from bounding box (AABB or OBB depending on script)
- Mass (g) — manual input column
- Volume is absolute (
abs(mesh.volume)) to avoid negative values from flipped normals - AABB (axis-aligned bounding box) is the default for Length/Width/Height in
compute.py - OBB (oriented bounding box) is available in
computer new backup.pyandcharacteristic extract.py - If you want different thresholds or folder rules, update script arguments and re-run