Create meshes from segmented imaging data for finite element simulations using Gmsh.
Project description
biomesh
Installation
biomesh can be installed via pip as
pip install biomesh
If you want to generate a mesh with Gmsh, you also need to install the gmsh python library as
pip install gmsh
Usage
To generate a finite element mesh from multiple colored stl-files, you simply need to do
import biomesh
# note, this requires gmsh to be installed (pip install gmsh)
mesh = biomesh.mesh_colored_stl_files(
"path/to/part1.stl",
"path/to/part2.stl",
"path/to/part3.stl",
mesh_size=2.0
)
# alternatively, you can also just use meshio to load a mesh: mesh = meshio.read("path/to/mesh.vtu")
# make all elements quadratic
mesh = biomesh.lin_to_quad(mesh)
# reorder nodes to reduce bandwidth of matrix
mesh = biomesh.reorder(mesh)
The nodes of all stl-files are matched. Each stl-file will be considered as an own volume.
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 biomesh-0.4.1.tar.gz.
File metadata
- Download URL: biomesh-0.4.1.tar.gz
- Upload date:
- Size: 88.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fcf375063fbb54a8dafc2df046566219b0890651eb042d9234c01591484e7d1
|
|
| MD5 |
fedeb6c0770dbb11e5fa57395431d3da
|
|
| BLAKE2b-256 |
40470a2b7ca0d47945efb4c6e6da6f79943aef9ea95c3cecc054409afdb9f7ae
|
File details
Details for the file biomesh-0.4.1-py3-none-any.whl.
File metadata
- Download URL: biomesh-0.4.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13364cf149faf2f29d5436d51c299c8669912019f86ff550d17518c1cd8e5411
|
|
| MD5 |
4585c939c4436400ce60c48233c7fa70
|
|
| BLAKE2b-256 |
2dd1a78d7dd64484453a1dcf7d09376f81b1b8a1fba553f1d93808beeeffd651
|