Skip to main content

A command-line interface to extract mesh-mesh collision information from GLB files

Project description

hra_glb_mesh_collisions

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install hra-glb-mesh-collisions

License

hra-glb-mesh-collisions is distributed under the terms of the MIT license.

Dependencies

System packages:

You may need to install libfcl liboctomap if the program does not work right away using this command (on Ubuntu):

$ sudo apt install liboctomap-dev libfcl-dev

For Python library:

  1. pygltflib
  2. trimesh

Install python dependencies with:

pip install -r requirements.txt

Usage

Example usage:

python3 mesh-mesh-collisions.py ./examples/VH_F_Kidney_Left.glb collision_result.csv

For help documentation:

$ python3 mesh-mesh-collisions.py --help

usage: mesh-mesh-collisions.py [-h] [--include-distances] [-v] input_glb output_csv

positional arguments:
  input_glb            path to input glb file
  output_csv           path to output collisions csv file

options:
  -h, --help           show this help message and exit
  --include-distances  include distances even if they dont' colide
  -v, --verbose

Sample result ouptut csv:

Notes about the distance colum:

  • distance is in meters
  • -1 = intersection
  • distance measured between two closest points
source,target,distance
VHF_hilum_of_kidney_L,VHF_kidney_capsule_L,-1
VHF_hilum_of_kidney_L,VHF_major_calyx_L_a,-1
VHF_hilum_of_kidney_L,VHF_major_calyx_L_b,0.0014157565638410548
VHF_hilum_of_kidney_L,VHF_major_calyx_L_c,-1
VHF_hilum_of_kidney_L,VHF_major_calyx_L_d,-1
VHF_hilum_of_kidney_L,VHF_minor_calyx_L_a,0.011878771067593177
VHF_hilum_of_kidney_L,VHF_minor_calyx_L_b,0.014892350577084101
VHF_hilum_of_kidney_L,VHF_minor_calyx_L_c,0.01049842653752553
VHF_hilum_of_kidney_L,VHF_minor_calyx_L_d,0.013852964218697942
VHF_hilum_of_kidney_L,VHF_minor_calyx_L_e,-1
VHF_hilum_of_kidney_L,VHF_minor_calyx_L_f,0.0003293750826728972
VHF_hilum_of_kidney_L,VHF_minor_calyx_L_g,0.0013917394770369632
VHF_hilum_of_kidney_L,VHF_minor_calyx_L_h,0.002076302121193277
VHF_hilum_of_kidney_L,VHF_minor_calyx_L_i,0.0001650410537290576
VHF_hilum_of_kidney_L,VHF_minor_calyx_L_j,0.0026597163618629024

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hra_glb_mesh_collisions-0.1.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

hra_glb_mesh_collisions-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file hra_glb_mesh_collisions-0.1.0.tar.gz.

File metadata

File hashes

Hashes for hra_glb_mesh_collisions-0.1.0.tar.gz
Algorithm Hash digest
SHA256 520f6deb5c10641a28e7f8c19d8f9626ffbf013a9b984363dd6f96e7fc03d63f
MD5 e6f91748c4d217b65377e77a8a201b6f
BLAKE2b-256 37e26786b39df93f3e1341449fee083da91679ee9fe72247e9f812a70eeb2249

See more details on using hashes here.

File details

Details for the file hra_glb_mesh_collisions-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hra_glb_mesh_collisions-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcf04979bf36dec5c01cb7f8390e2af4274303d31c1f43b4b82daf4044a21e77
MD5 bee4957096ef0f63286630ba99a8f518
BLAKE2b-256 464696877abf3c5476ffd2d181c5d53c4702df9be590b508bdb263384d5f498c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page