Skip to content

mac999/scan_to_bim_pipeline

Repository files navigation

Scan to BIM project

Scan to BIM pipieline to convert 3D scan data (point cloud data) to BIM objects.

description

Scan to BIM research project has purpose like below.

  1. 3D point cloud processsing pipeline implementation dynamically using simple SBDL(Scan to BIM Description Language. JSON format).
  2. Classification of outdoor building objects such as wall (facade), road etc.
  3. Extraction geometry information from classification.
  4. Binding BIM object with geometry information and property set.




version history

v0.1

2022.11, Scan to BIM pipeline framework released. Simple SBDL was developed considering geometry computation algorithms to extract outdoor facade object, deep learning, docker based component etc.

v0.2

2023.7, Docker image support. pipeline revision for multiple input files processing. refactoring.
2023.8, Data augumentation tool
2023.9. LiDAR simulation tool
2023.10. 3D scan data quality checker tool.
2024.2. Update pcd_to_DTM, DTM_to_geo module to fix issue, add options such as "active", "log_view", "height_building_offset", "height_ground_offest", "max_building_height".

furture update plan

v0.3

documentation to use SBDL.
simple MLOps codes for outdoor object train.


v0.4

SBDL enhancement to supporting VFP(Visual Flow Programming) or LLM(Large Language Model. ex. ChatGPT).
Update indoor Object Mapping support.
MLOps support.
Simple Scan Data Processing App using Scan to BIM application.

1) deep learing based indoor classification. 2) PCD indoor segmentation. 3) segment to geometry using ML. 4) geometry to BIM using revit plugin. 5) 3D data argumentation. 6) LiDAR simuation 7) 3D PCD quality check

v0.5

update PCD to DTM, DTM to Geometry, Geometry to BIM object source files.

setup development environment & packages

  1. install python, pip
    https://phoenixnap.com/kb/how-to-install-python-3-ubuntu
  2. install cmake
    https://www.cyberithub.com/how-to-install-cmake-on-ubuntu-20-04-lts-focal-fossa/
  3. install cuda, tensorflow, pytorch
  4. install gdal
    https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html
  5. install pdal
    https://installati.one/install-pdal-ubuntu-20-04/
    In terminal, run 'pdal' command. If there is error 'libgdal.so.29: cannot open shared object file', run the below command to make linked file name.
    sudo ln -s libgdal.so.30 libgdal.so.29
    if there is error in prebuild pdal, download, build and install pdal source files of github https://github.com/PDAL/PDAL
  6. install ifcopenshell
    https://pypi.org/project/ifcopenshell/0.7.0.230418/
    https://blenderbim.org/docs-python/ifcopenshell-python/installation.html
  7. build docker image
    cd docker
    cd build_docker_open3d
    bash build_docker.sh

PCL installation

In addition, if you use PCL, run the below commands for installing package or 'sh build_pcl.sh'.
sudo apt-get install build-essential g++ python3-dev autotools-dev libicu-dev libbz2-dev libboost-all-dev
sudo apt install libeigen3-dev
dpkg -L libeigen3-dev
sudo apt-get install -y libflann-dev
sudo apt-get install libpcap-dev
sudo apt-get install libgl1-mesa-dev
sudo apt install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
sudo apt install clang-format
sudo apt-get install libusb-1.0-0-dev
sudo apt install libvtk9.1

git clone https://github.com/PointCloudLibrary/pcl pcl-trunk
cd pcl-trunk && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make -j2
sudo make -j2 install

In detail, refer to
https://github.com/PointCloudLibrary/pcl
https://pcl.readthedocs.io/projects/tutorials/en/latest/compiling_pcl_posix.html

build & installation

Modify the below PCL_ROOT(PCL library path), VTK_INC(VTK include path), USR_LIB paths in CMakeLists.txt properly. In reference, PCL-1.13 has an memory error (handmade_aligned_free) related to eigen library(2023/4/10).
set(PCL_ROOT "/home/ktw/projects/pcl-1.12")
set(VTK_INC "/usr/include/vtk-7.1")
set(USR_LIB "/usr/lib/x86_64-linux-gnu")

In terminal, input the below commands.
git clone https://github.com/mac999/scan_to_bim_pipeline
cd scan_to_bim_pipeline
pip -r install requirements.txt
sudo apt install clang
mkdir build
cmake ..
make

If there are depandency errors in requirements.txt, use requirements_simple.txt.

run

Before run, install requirements_simple.txt(or requirements.txt) including the above packages.

  1. modify /pipeline/config.json considering your input, output folder path. In reference, root foler name is scan_to_bim_pipeline which you downloaded and installed from github.
{
    "app": "pcd_pipeline",
    "root_path": "./pipeline/",
    "bin_path": "./",
    "lib_path": "./lib/",
    "data_path": "./input/",
    "debug_gui": false
}
  1. download input sample files and copy them into ./input folder. refer to sample dataset.
  2. run app.py like below.
    python ./pipeline/app.py

  3. Or design pipeline by using SBDL(scan to bim description language) formatted by JSON like below.
    pipeline.[name]={stage*}
    stage={module_type, parameters}
    parameters={name, value}*
    module_type={python program | docker image | binary executable program}
  • parameters should be defined in module before usage.
    condition={"in_stage_return", "out_stage_return"}

In scan to BIM pipeline using SBDL example,
pipeline.indoor_obb_extraction = data_to_format > pcd_to_seg > pcd_to_clean > seg_to_geo
pipeline.indoor_obb_extraction(*.las) > *.geojson

{
    "pipeline.indoor_obb_extraction": [
        {
            "type": "data_to_format",
            "active": true,
            "output_type": ".pcd"
        },
        {
            "type": "pcd_to_seg",
            "iteration": "1000", 
            "threshold": "0.1",
            "projection": "true",
            "remove_overlap_distance": "0.10",
            "min_points_ratio": "0.2"
        },
        {
            "type": "pcd_to_clean",
            "voxel_down_size": "0.0",
            "nb_radius_points": "50",
            "nb_radius": "0.1"
        },
        {
            "type":"seg_to_geo",
            "alpha": "0.15"
        }
    ]
}

cd pipeline
python app.py

sample dataset

Download dataset and copy to /input folder.
3D point cloud sample file download
National LiDAR map National Map
Open Topolography LiDAR map
Pix4D dataset Download
LAS map files arcgis map link
LiDAR files USGS gov
Top 6 Free LiDAR Data Sources LiDAR files

architecture

SBDL concept diagram and UML architecture.

license

MIT license.

Acknowledge.

Scan To BIM Technology Development 3D Urban Building Model Process Automation, 2022
3D vision & AI based Indoor object Scan to BIM pipeline for building facility management, 2023
Funded by KICT

Organization Roles
KICT: Scan to BIM pipeline architecture design, algorithm programming, test, code management

Specially, Thanks for contribution like below
IUPUI (Prof. Koo Dan, Prof. Kwonsik Song), UNF (Prof. Jonghoon Kim: usecase, code, policy survey
Purdue University (Prof. Kyubyung Kang): deep learning train, dataset collection, labeling, analysis
Stony Brook University (Prof. Jongsung Choi): data collection using SLAM, labeling, analysis


Kang, TW., Patil, S., Kang, K., Koo, D. and Kim, J., 2020. Rule-based scan-to-BIM mapping pipeline in the plumbing system. Applied Sciences, 10(21), p.7422. https://www.mdpi.com/2076-3417/10/21/7422
Kang, TW., 2023, Scan to BIM Mapping Process Description for Building Representation in 3D GIS, Applied Sciences. 13(17), https://www.mdpi.com/2076-3417/13/17/9986