Create a fractal tree over a surface discretized by triangles
Project description
fractal-tree
This code is to create a fractal tree over a surface discretized by triangles. It was developed to create a representation of the Purkinje network in the ventricles of the human heart.
Note that this is a rewrite of the original code found at https://github.com/fsahli/fractal-tree
The details of the algorithm are presented in this article. If you are going to use this code, please cite:
Generating Purkinje networks in the human heart. F. Sahli Costabal, D. Hurtado and E. Kuhl. Journal of Biomechanics, doi:10.1016/j.jbiomech.2015.12.025
- Source code: https://github.com/finsberg/fractal-tree
- Documentation: https://github.com/finsberg/fractal-tree
Install
You can install the library with pip
python3 -m pip install fractal-tree
Note that you also need a way to load the mesh from e.g gmsh or another meshing tool. For this we recommend to use meshio as it support the most common formats.
Getting started
The following illustrates a minimal example, assuming that you have surface mesh called sphere.obj in your current directory.
import meshio
import numpy as np
from fractal_tree import generate_fractal_tree, FractalTreeParameters, Mesh
msh = meshio.read("sphere.obj")
mesh = Mesh(verts=msh.points, connectivity=msh.cells[0].data)
param = FractalTreeParameters(
filename="sphere-line",
N_it=10,
)
results = generate_fractal_tree(mesh, param)
For a more elaborate example you can checkout the gmsh example.
License
MIT
Need help or having issues
Please submit an issue
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fractal-tree-0.2.1.tar.gz.
File metadata
- Download URL: fractal-tree-0.2.1.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8a2ae1aca1aa7d0d6551536bf1da4d441e35b80f3e3128458012be5fff01d65
|
|
| MD5 |
73418834ede2b5559a6cf7f9798924e5
|
|
| BLAKE2b-256 |
624b55610c83d29a618793cc39419081e496a19d3db0a5b90fa7f6223d174144
|
File details
Details for the file fractal_tree-0.2.1-py3-none-any.whl.
File metadata
- Download URL: fractal_tree-0.2.1-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80f018211d2c9d34a91b99ccf96661afca8991ba163a9e9b19e05679114138ab
|
|
| MD5 |
5d95e616725978bb7c9b159798d82e61
|
|
| BLAKE2b-256 |
15999d55b9bbd643bc45976ca99ba19645f35e758c045270f15d6fb221b0b50f
|