Skip to main content

tetgen python wrapper for points, PLCs and tetmesh inputs

Project description

tetgenpy

main PyPI version

tetgenpy is a python wrapper for Hang Si's TetGen - A Quality Tetrahedral Mesh Generator and a 3D Delaunay Triangulator. It helps to prepare various types of inputs - points, piecewise linear complexes (PLCs), and tetmesh - for tetrahedron mesh generation based on simple python types, such as list and numpy.ndarray.

Install

pip install tetgenpy

For current development version,

pip install git+https://github.com/tataratat/tetgenpy.git@main

Quick Start

Following is an example for tetrahedralization of a unit cube defined as PLCs. Alternatively, you could also use tetgenpy.PLC class to prepare TetgenIO.

import tetgenpy
import numpy as np

# tetrahedralize unit cube
# define points
points=[
    [0.0, 0.0, 0.0],
    [1.0, 0.0, 0.0],
    [0.0, 1.0, 0.0],
    [1.0, 1.0, 0.0],
    [0.0, 0.0, 1.0],
    [1.0, 0.0, 1.0],
    [0.0, 1.0, 1.0],
    [1.0, 1.0, 1.0],
]

# define facets - it can be list of polygons.
# here, they are hexa faces
facets = [
    [1, 0, 2, 3],
    [0, 1, 5, 4],
    [2, 0, 4, 6],
    [1, 3, 7, 5],
    [3, 2, 6, 7],
    [4, 5, 7, 6],
]

# prepare TetgenIO - input for tetgen
tetgen_in = tetgenpy.TetgenIO()

# set points, facets, and facet_markers.
# facet_markers can be useful for setting boundary conditions
tetgen_in.setup_plc(
    points=points,
    facets=facets,
    facet_markers=[[i] for i in range(1, len(facets) + 1)],
)

# tetgen's tetraheralize function with switches
tetgen_out = tetgenpy.tetrahedralize("qa.05", tetgen_in)

# unpack output
print(tetgen_out.points())
print(tetgen_out.tetrahedra())
print(tetgen_out.trifaces())
print(tetgen_out.trifacemarkers())

This package also provides access to tetgen's binary executable. Try:

$ tetgen -h

Dependencies

c++

python

build

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

tetgenpy-0.0.1.tar.gz (24.7 kB view hashes)

Uploaded Source

Built Distributions

tetgenpy-0.0.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (446.6 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

tetgenpy-0.0.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (435.3 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

tetgenpy-0.0.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (429.9 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

tetgenpy-0.0.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (447.7 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

tetgenpy-0.0.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (435.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

tetgenpy-0.0.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (429.9 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

tetgenpy-0.0.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (446.6 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

tetgenpy-0.0.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (434.7 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

tetgenpy-0.0.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (429.9 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

tetgenpy-0.0.1-cp312-cp312-win_amd64.whl (350.3 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

tetgenpy-0.0.1-cp312-cp312-win32.whl (315.7 kB view hashes)

Uploaded CPython 3.12 Windows x86

tetgenpy-0.0.1-cp311-cp311-win_amd64.whl (349.4 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

tetgenpy-0.0.1-cp311-cp311-win32.whl (315.3 kB view hashes)

Uploaded CPython 3.11 Windows x86

tetgenpy-0.0.1-cp311-cp311-musllinux_1_1_x86_64.whl (974.0 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

tetgenpy-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (447.2 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

tetgenpy-0.0.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (508.5 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ppc64le

tetgenpy-0.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (435.0 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

tetgenpy-0.0.1-cp311-cp311-macosx_11_0_arm64.whl (396.0 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

tetgenpy-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl (430.9 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

tetgenpy-0.0.1-cp310-cp310-win_amd64.whl (349.5 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

tetgenpy-0.0.1-cp310-cp310-win32.whl (315.1 kB view hashes)

Uploaded CPython 3.10 Windows x86

tetgenpy-0.0.1-cp310-cp310-musllinux_1_1_x86_64.whl (974.1 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

tetgenpy-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (447.3 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

tetgenpy-0.0.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (508.5 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ppc64le

tetgenpy-0.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (434.9 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

tetgenpy-0.0.1-cp310-cp310-macosx_11_0_arm64.whl (396.0 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

tetgenpy-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl (431.0 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

tetgenpy-0.0.1-cp39-cp39-win_amd64.whl (349.7 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

tetgenpy-0.0.1-cp39-cp39-win32.whl (315.1 kB view hashes)

Uploaded CPython 3.9 Windows x86

tetgenpy-0.0.1-cp39-cp39-musllinux_1_1_x86_64.whl (974.5 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

tetgenpy-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (447.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

tetgenpy-0.0.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (507.6 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ppc64le

tetgenpy-0.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (435.1 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

tetgenpy-0.0.1-cp39-cp39-macosx_11_0_arm64.whl (396.0 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

tetgenpy-0.0.1-cp39-cp39-macosx_10_9_x86_64.whl (431.1 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

tetgenpy-0.0.1-cp38-cp38-win_amd64.whl (349.3 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

tetgenpy-0.0.1-cp38-cp38-win32.whl (315.0 kB view hashes)

Uploaded CPython 3.8 Windows x86

tetgenpy-0.0.1-cp38-cp38-musllinux_1_1_x86_64.whl (973.9 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

tetgenpy-0.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (447.1 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

tetgenpy-0.0.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (508.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ppc64le

tetgenpy-0.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (435.4 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

tetgenpy-0.0.1-cp38-cp38-macosx_11_0_arm64.whl (396.0 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

tetgenpy-0.0.1-cp38-cp38-macosx_10_9_x86_64.whl (430.9 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

tetgenpy-0.0.1-cp37-cp37m-win_amd64.whl (349.9 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

tetgenpy-0.0.1-cp37-cp37m-win32.whl (316.2 kB view hashes)

Uploaded CPython 3.7m Windows x86

tetgenpy-0.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl (979.4 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

tetgenpy-0.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (451.4 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

tetgenpy-0.0.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (512.9 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ppc64le

tetgenpy-0.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (441.1 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

tetgenpy-0.0.1-cp37-cp37m-macosx_10_9_x86_64.whl (429.7 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

tetgenpy-0.0.1-cp36-cp36m-win_amd64.whl (349.9 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

tetgenpy-0.0.1-cp36-cp36m-win32.whl (316.2 kB view hashes)

Uploaded CPython 3.6m Windows x86

tetgenpy-0.0.1-cp36-cp36m-musllinux_1_1_x86_64.whl (979.2 kB view hashes)

Uploaded CPython 3.6m musllinux: musl 1.1+ x86-64

tetgenpy-0.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (451.4 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

tetgenpy-0.0.1-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (512.8 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ppc64le

tetgenpy-0.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (441.1 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

tetgenpy-0.0.1-cp36-cp36m-macosx_10_9_x86_64.whl (429.7 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

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