How meyerls/pc-skeletor works
Project Type & Purpose
• PC Skeletor is a pure-Python algorithmic library (not a web app or microservice) for extracting curve skeletons from 3D point clouds.
• It implements two core algorithms: Laplacian-Based Contraction (LBC) and Semantic LBC (S-LBC), plus helper routines for downloading datasets, sampling, graph extraction, visualization, and export.
File Structure Analysis
• Top‐level:
• pc_skeletor/ (core package)
– base.py : abstract base classes and shared interfaces
– download.py : Dataset downloader (external data source)
– laplacian.py : Laplacian matrix computation and contraction solver
– point2skeleton.py : placeholder for future Point2Skeleton algorithm
– utility.py : sampling, weighting, I/O helpers
– L1.py, __init__.py
• example_tree.py : usage example / entry point for demo
• tests/ : unit tests (test_lbc.py, test_slbs.py)
• setup.py/pyproject.toml/requirements.txt : packaging & dependencies
• .github/workflows : CI pipelines for test & publish
• img/ : illustration assets for README
README Insights
• Confirms two primary algorithm classes: LBC and SLBC
• Lists external dependencies: Open3D, numpy, networkx, mistree (MST), robust-laplacians-py
a. Main Components
• Data Source (remote datasets; Dataset in download.py)
• Core Algorithm Module
– Laplacian Computation (laplacian.py)
– Contraction Solver (base.py subclasses LBC & SLBC)
– Semantic Weighting (SLBC)
• Sampling & Graph Extraction (utility.py + networkx)
• Visualization & Export (Open3D, gif & file I/O)
• Tests & CI/CD (tests/, GitHub Actions)
• Packaging & Distribution (PyPI, setup.py)
b. Relationships & Data Flows
1. User Code (example_tree.py or consumer code)
→ invokes Dataset.download_semantic_tree_dataset()
→ reads to Open3D point clouds
2. User instantiates LBC or SLBC
→ Core Algorithm calls Laplacian builder → constructs sparse matrix
→ Solver iterates contraction steps → yields contracted skeleton points
3. Skeleton points fed into utility methods
→ farthest-point sampling; networkx MST for topology
4. Graphs & point clouds passed to visualization methods
→ Open3D renderers & gif exporter
5. Exported files written to disk
c. Architectural Patterns
• Modular pipeline: download → preprocess → compute → postprocess → output
• Strategy pattern via base.py → LBC vs. SLBC classes
• Dependency injection for semantic weighting in SLBC
d. Technologies & Frameworks
• Python 3.8+; package managed via setuptools/pyproject.toml
• Open3D for 3D data structures & visualization
• NumPy/SciPy for numeric & sparse linear algebra
• networkx + mistree for graph extraction (MST)
• GitHub Actions for CI and PyPI publishing