How vaclavnezerka/cloud2bim works
Purpose and Entry Point
Cloud2BIM is a Python Scan-to-BIM research pipeline that converts large point clouds into parametric building entities and IFC output. Its CLI entry point is cloud2entities.py, which accepts a YAML configuration path and defaults to config.yaml.
Input, Configuration, and Workspace Boundaries
Source scans are expected in E57 or XYZ form under input_e57/ and input_xyz/. Runtime parameters—including processing choices and paths—are centralized in config.yaml. Intermediate or processed point-cloud results are separated into output_xyz/; IFC artifacts are written to output_IFC/. These directory boundaries support file-based, batch-oriented execution rather than a service or web runtime.
Point-Cloud-to-Entity Orchestration
cloud2entities.py is the top-level controller for the extraction workflow. It coordinates loading/conversion of point-cloud data, density-based segmentation, geometry processing, entity generation, and IFC export. The README identifies target classes as slabs, walls, windows, and doors, derived using point-density analysis augmented by image and morphological operations.
Spatial Segmentation and Geometry Extraction
The core reconstruction logic is distributed between cloud2entities.py and space_generator.py. This stage transforms raw spatial samples into segmented regions and inferred building spaces/elements. aux_functions.py supplies shared processing utilities, while plotting_functions.py supports visual inspection of point clouds, segmentation, or generated geometry—important for a research pipeline whose parameterization may require manual tuning.
Parametric BIM / IFC Generation
generate_ifc.py forms the output boundary from extracted geometric entities to IFC-compatible BIM data. It consumes inferred geometry from the prior stages and emits model files under output_IFC/. This is the principal interoperability boundary: upstream logic operates on point-cloud and image-like representations, while downstream consumers receive industry-standard IFC.
Optional Deep-Learning Assets
DL_module/ contains a distinct ML component with pretrained checkpoints such as DL_module/weights/run_20260804_1517/best.pth and training logs. Its separate README and weights hierarchy indicate that neural inference/training is an optional or separately managed capability rather than the visible primary CLI entry point. The main documented method remains density-, image-, and morphology-based segmentation.
Runtime and External Dependencies
The project runs as a local Python application, installed through requirements.txt; no deployed infrastructure, database, or API service is represented in the repository. External inputs may be obtained from the Zenodo-hosted Kladno station dataset. IFC files are the key external output contract, while E57/XYZ are the input data contracts.
Main entry points: cloud2entities.py CLI controller · space_generator.py Spatial reconstruction · aux_functions.py Processing utilities · generate_ifc.py IFC generator
Components 13
Inputs & Configuration
- Runtime configuration
config.yaml - E57 scans
- XYZ scans
Reconstruction Pipeline
- CLI controller · Loads YAML settings and coordinates batch reconstruction.
cloud2entities.py - Spatial reconstruction · Converts samples into regions, spaces, and building-element geometry.
space_generator.py - Processing utilities
aux_functions.py - Visual inspection · Supports tuning and inspection of point clouds and inferred geometry.
plotting_functions.py - Building entities · Inferred slabs, walls, windows, and doors.
Output Contracts
- Processed point clouds
- IFC generator · Maps extracted geometry to IFC-compatible BIM data.
generate_ifc.py - IFC artifacts
Optional ML Assets
- Deep-learning module · Separately managed training and inference capability.
- Pretrained checkpoint
DL_module/weights/run_20260804_1517/best.pth
Connections 13
- Runtime configuration → CLI controller: configures
- E57 scans → CLI controller: loads / converts
- XYZ scans → CLI controller: loads
- CLI controller → Spatial reconstruction: orchestrates
- Processing utilities → CLI controller: supports
- Processing utilities → Spatial reconstruction: supports
- Spatial reconstruction → Building entities: infers
- CLI controller → Processed point clouds: writes
- Spatial reconstruction → Visual inspection: inspected through
- Building entities → IFC generator: exports
- IFC generator → IFC artifacts: writes
- Pretrained checkpoint → Deep-learning module: loads
- Deep-learning module → Spatial reconstruction: optional inference