tetgen 0.1.2
pip install tetgen==0.1.2
Released:
Python interface to pytetgen
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Alex Kaszynski
- Tags TetGen
Classifiers
- Development Status
- Intended Audience
- License
- Programming Language
Project description
This python module is a python interface to Hang Si’s tetgen C++ software. This module combines speed of C++ with the portability and ease of installation of Python along integration with the visualization toolkit VTK . See the tetgen GitHub page for more details on the creator.
The last update to the original C++ software was on 19 January 2011, but the software remains relevant today. Brief description from Weierstrass Institute Software:
TetGen is a program to generate tetrahedral meshes of any 3D polyhedral domains. TetGen generates exact constrained Delaunay tetrahedralization, boundary conforming Delaunay meshes, and Voronoi partitions.
TetGen provides various features to generate good quality and adaptive tetrahedral meshes suitable for numerical methods, such as finite element or finite volume methods. For more information of TetGen, please take a look at a list of features.
Installation
From PyPI
pip install tetgen --user
From source at GitHub
git clone https://github.com/akaszynski/tetgen
cd tetgen
pip install . --user
Basic Example
The features of the C++ TetGen software implemented in this module are primarily focused on the tetrahedralization a manifold triangular surface. This basic example demonstrates how to tetrahedralize a manifold surface and plot part of the mesh.
from vtkInterface import examples
import vtkInterface as vtki
import tetgen
import numpy as np
sphere = vtki.PolyData(examples.spherefile)
tet = tetgen.TetGen(sphere)
tet.Tetrahedralize(order=1, mindihedral=20, minratio=1.5)
grid = tet.grid
grid.Plot()
Tetrahedralized Sphere
Extract a portion of the sphere’s tetrahedral mesh below the xy plane and plot the mesh quality.
# get cell centroids
cells = grid.cells.reshape(-1, 5)[:, 1:]
cell_center = grid.points[cells].mean(1)
# extract cells below the 0 xy plane
mask = cell_center[:, 2] < 0
cell_ind = mask.nonzero()[0]
subgrid = grid.ExtractSelectionCells(cell_ind)
# advanced plotting
plotter = vtki.PlotClass()
plotter.SetBackground('w')
plotter.AddMesh(subgrid, 'lightgrey', lighting=True)
plotter.AddMesh(sphere, 'r', 'wireframe')
plotter.AddLegend([[' Input Mesh ', 'r'],
[' Tesselated Mesh ', 'black']])
plotter.Plot()
Cell quality scalars can be obtained and plotted with:
cell_qual = subgrid.quality
# plot quality
subgrid.Plot(scalars=cell_qual, stitle='quality', colormap='bwr', flipscalars=True)
Acknowledgments
Software was originally created by Hang Si based on work published in TetGen, a Delaunay-Based Quality Tetrahedral Mesh Generator.
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License (MIT)
- Author: Alex Kaszynski
- Tags TetGen
Classifiers
- Development Status
- Intended Audience
- License
- Programming Language
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 Distributions
File details
Details for the file tetgen-0.1.2.tar.gz
.
File metadata
- Download URL: tetgen-0.1.2.tar.gz
- Upload date:
- Size: 275.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91089a4070651f97868e65e2405a3203f442bfc0794cadc2c03f987e5b89a981 |
|
MD5 | 0ebfdbe254e053b2f70b054622376e57 |
|
BLAKE2b-256 | bb2d7c8c1060e76351234fc31ec17270bf8f8b04b5b0ca3ea50b2875914a76df |
File details
Details for the file tetgen-0.1.2-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: tetgen-0.1.2-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 294.0 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 396a3b2c58ca7082337fb154fd77ca353e86172fd2c45fabaf2cb7dcb98a2421 |
|
MD5 | 23f6b0fbbbb5b49a4871e0d272ec9859 |
|
BLAKE2b-256 | 1119b18ec09d4974edbea3660b053952d3bceed0aadda8fc062c2117ba9344c4 |
File details
Details for the file tetgen-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: tetgen-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0fbd210f3bb76e96703cffd80b2351d49647dfffb7a192919998e272ba21575 |
|
MD5 | 71c593f3781cdc3d7723d30e97423ca9 |
|
BLAKE2b-256 | dd9a2d14004c44fc490615578a914915c45f5b57f2518b89c328dc1d3f36d379 |
File details
Details for the file tetgen-0.1.2-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: tetgen-0.1.2-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 292.9 kB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/2.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6d20aab37f2dcb2385eb859f9a9bfe3bc61aa38b5f025f8b0c9573d94508645 |
|
MD5 | 361213ac32aa08a668de65b03e3beb4b |
|
BLAKE2b-256 | 6bb1b6aa6e35dc60813cbabb63ec1a469c419482686d467d8593c4fa8bb71929 |
File details
Details for the file tetgen-0.1.2-cp35-cp35m-manylinux1_x86_64.whl
.
File metadata
- Download URL: tetgen-0.1.2-cp35-cp35m-manylinux1_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68c8c3205984a1122613cc6dd0d3b42cbf387448ae0e29e6ed1648dd2b653d8d |
|
MD5 | 0229b49d2206ee0afc3f63ae2fbc1160 |
|
BLAKE2b-256 | d46305f1516810dbeabcc1364bd5e5a8382efcb41a2c6d8dfd46728e98729687 |
File details
Details for the file tetgen-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl
.
File metadata
- Download URL: tetgen-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 2.7mu
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db43368e77964404784cf11fe772f6105caeed9f85acd12b3eceec996d56a9c8 |
|
MD5 | a3f72d765697ef6a3470d8b0b2eea0af |
|
BLAKE2b-256 | 31c20d0bcaefef091a7b7c220c8bab5c3baa3969ef835a6edb7e281e5fc4b385 |
File details
Details for the file tetgen-0.1.2-cp27-cp27m-manylinux1_x86_64.whl
.
File metadata
- Download URL: tetgen-0.1.2-cp27-cp27m-manylinux1_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 2.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/38.2.4 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c9b8548c68532847bf2b6bcad5e52c01e878b89f4dc3135a16199be43820638 |
|
MD5 | ac53b169b921f1acf04f80d363e3a8a3 |
|
BLAKE2b-256 | 0e5c920c22825839b99307f2c52055286574f0aa9eadb2dd5cbf08576c189ce5 |