Skip to content

Make meshes manifold and filling holes. Generate OFF file for a single mesh from GLB

Notifications You must be signed in to change notification settings

cns-iu/hra-glb-preprocessor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

hra-glb-preprocessor

Version: 1.0.0

Release date: 15 June 2024

Overview:

hra-glb-preprocessor project includes:

  1. Preprocess (fix non-manifold meshes and filling holes) 3D models using Blender Python API.
  2. Generate OFF file for a single mesh from GLB if needed.

Installation Instructions

  1. Install Blender

  2. Install Pandas in Blender Python

    • Linux & MacOS & Windows
      blender --background --python install_package.py

Usage

  1. Change directory to mesh_processing_blender

    cd mesh_processing_blender
  2. To pre-process a single model, run glb_preprocessor.py by specifying input_glb_path and output_glb_path

    python3 glb_preprocessor.py input_glb_path output_glb_path

    e.g.,

    python3 glb_preprocessor.py ../model/3d-vh-f-blood-vasculature.glb ../output/3d-vh-f-blood-vasculature.glb
  3. Download and pre-process all organ models

    python3 glb_preprocessor_all_organs.py --url url --downloaded_dir downloaded_dir --output_glb_model_dir preprocessed_glb_model_dir --output_off_model_dir preprocessed_off_model_dir

    There are three arguments:

    • url is the endpoint to download all the latest reference organ models; the default value is https://apps.humanatlas.io/api/v1/reference-organs.
    • downloaded_dir is the directory to cache all the models; the default value is downloaded_organs/.
    • output_glb_model_dir is the output diretory to store all the preprocessed GLB models; the default value is all_preprocessed_glb_models/.
    • output_off_model_dir is the output directory to store all the preprocessed OFF models, which are generated based on the GLB models; the default value is all_preprocessed_off_models.

    e.g.,

    python3 glb_preprocessor_all_organs.py --url https://apps.humanatlas.io/api/v1/reference-organs --downloaded_dir downloaded_folder/ --output_glb_model_dir all_preprocessed_glb_models/ --output_off_model_dir all_preprocessed_off_models/

About

Make meshes manifold and filling holes. Generate OFF file for a single mesh from GLB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages