Skip to main content

Collection of explicitly constructed meshes

Project description

meshzoo

PyPi Version PyPI pyversions GitHub stars Downloads

Discord

When generating meshes for FEM/FVM computations, sometimes your geometry is so simple that you don't need a complex mesh generator (like pygmsh, MeshPy, mshr, pygalmesh, dmsh), but something simple and fast that makes use of the structure of the domain. Enter meshzoo.

Installation

Install meshzoo from PyPI with

pip install meshzoo

How to get a license

Licenses for personal and academic use can be purchased here. You'll receive a confirmation email with a license key. Install the key with

plm add <your-license-key>

on your machine and you're good to go.

For commercial use, please contact support@mondaytech.com.

Examples

Triangle

import meshzoo

bary, cells = meshzoo.triangle(8)

# corners = np.array(
#     [
#         [0.0, -0.5 * numpy.sqrt(3.0), +0.5 * numpy.sqrt(3.0)],
#         [1.0, -0.5, -0.5],
#     ]
# )
# points = np.dot(corners, bary).T

# Process the mesh, e.g., write it to a file using meshio
# meshio.write_points_cells("triangle.vtk", points, {"triangle": cells})

Rectangle

import meshzoo
import numpy as np

points, cells = meshzoo.rectangle_tri(
    np.linspace(0.0, 1.0, 11),
    np.linspace(0.0, 1.0, 11),
    variant="zigzag",  # or "up", "down", "center"
)

points, cells = meshzoo.rectangle_quad(
    np.linspace(0.0, 1.0, 11),
    np.linspace(0.0, 1.0, 11),
    cell_type="quad4",  # or "quad8", "quad9"
)

Regular polygon

meshzoo.ngon(4, 8) meshzoo.ngon(6, 8) meshzoo.ngon(9, 8)
import meshzoo

points, cells = meshzoo.ngon(5, 11)

Disk

meshzoo.disk(4, 8) meshzoo.disk(6, 8) meshzoo.disk(9, 8)

The disk meshes are inflations of regular polygons.

import meshzoo

points, cells = meshzoo.disk(6, 11)

points, cells = meshzoo.disk_quad(10, cell_type="quad4")  # or "quad8", "quad9"

Möbius strip

import meshzoo

points, cells = meshzoo.moebius(num_twists=1, nl=60, nw=11)

Sphere (surface)

import meshzoo

points, cells = meshzoo.uv_sphere(num_points_per_circle=20, num_circles=10, radius=1.0)
points, tri, quad = meshzoo.geo_sphere(
    num_points_per_circle=20, num_circles=10, radius=1.0
)

Spheres can also be generated by refining the faces of platonic solids and then "inflating" them. meshzoo implements a few of them. The sphere generated from the icosahedron has the highest-quality (most equilateral) triangles.

All cells are oriented such that its normals point outwards.

meshzoo.tetra_sphere(10) meshzoo.octa_sphere(10) meshzoo.icosa_sphere(10)

Ball (solid)

import meshzoo

points, cells = meshzoo.ball_tetra(10)
points, cells = meshzoo.ball_hexa(10)

Tube

import meshzoo

points, cells = meshzoo.tube(length=1.0, radius=1.0, n=30)

Cube

import meshzoo
import numpy as np

points, cells = meshzoo.cube_tetra(
    np.linspace(0.0, 1.0, 11), np.linspace(0.0, 1.0, 11), np.linspace(0.0, 1.0, 11)
)
points, cells = meshzoo.cube_hexa(
    np.linspace(0.0, 1.0, 11), np.linspace(0.0, 1.0, 11), np.linspace(0.0, 1.0, 11)
)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

meshzoo-0.12.1-cp314-none-any.whl (79.9 kB view details)

Uploaded CPython 3.14

meshzoo-0.12.1-cp313-none-any.whl (74.0 kB view details)

Uploaded CPython 3.13

meshzoo-0.12.1-cp312-none-any.whl (75.3 kB view details)

Uploaded CPython 3.12

meshzoo-0.12.1-cp311-none-any.whl (82.6 kB view details)

Uploaded CPython 3.11

meshzoo-0.12.1-cp310-none-any.whl (38.3 kB view details)

Uploaded CPython 3.10

File details

Details for the file meshzoo-0.12.1-cp314-none-any.whl.

File metadata

  • Download URL: meshzoo-0.12.1-cp314-none-any.whl
  • Upload date:
  • Size: 79.9 kB
  • Tags: CPython 3.14
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for meshzoo-0.12.1-cp314-none-any.whl
Algorithm Hash digest
SHA256 f99c0e456b6689adb6c380fcdb3a51c4f25772bfd443a4f187bc3b4ca21b555b
MD5 96c3dbc74a19eacd713e0190c0d903d3
BLAKE2b-256 f3898271b6ffab30cb63dcf87ce49ecf0c47e83db0c861dbb0e2c01360995e5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for meshzoo-0.12.1-cp314-none-any.whl:

Publisher: release.yml on meshpro/meshzoo-dev

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meshzoo-0.12.1-cp313-none-any.whl.

File metadata

  • Download URL: meshzoo-0.12.1-cp313-none-any.whl
  • Upload date:
  • Size: 74.0 kB
  • Tags: CPython 3.13
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for meshzoo-0.12.1-cp313-none-any.whl
Algorithm Hash digest
SHA256 23b871527d7e28ef527a05f342c5ac1dcea912662e2611c598ad580ab35ac88e
MD5 3398cc19231c64e797a362a46291bdef
BLAKE2b-256 bab3858cdc8405557e258b3591ec1803d7a47ecb8b05300de60b719aa884770a

See more details on using hashes here.

Provenance

The following attestation bundles were made for meshzoo-0.12.1-cp313-none-any.whl:

Publisher: release.yml on meshpro/meshzoo-dev

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meshzoo-0.12.1-cp312-none-any.whl.

File metadata

  • Download URL: meshzoo-0.12.1-cp312-none-any.whl
  • Upload date:
  • Size: 75.3 kB
  • Tags: CPython 3.12
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for meshzoo-0.12.1-cp312-none-any.whl
Algorithm Hash digest
SHA256 37647e3efeb5c68b7b10f538e1e15892544b5f36b4cc96cf23a59d6de115e3fa
MD5 6837e1669813116fa64a39913eb46293
BLAKE2b-256 90392b66470032a1b7d6bbc0c8c40e57206646ad4cdd113341b285b8f185af46

See more details on using hashes here.

Provenance

The following attestation bundles were made for meshzoo-0.12.1-cp312-none-any.whl:

Publisher: release.yml on meshpro/meshzoo-dev

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meshzoo-0.12.1-cp311-none-any.whl.

File metadata

  • Download URL: meshzoo-0.12.1-cp311-none-any.whl
  • Upload date:
  • Size: 82.6 kB
  • Tags: CPython 3.11
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for meshzoo-0.12.1-cp311-none-any.whl
Algorithm Hash digest
SHA256 e3d2818db5658ff8dfc3af31f0a829c39772d924ae0b5cbc898f3121ad5b0917
MD5 72f7a2d88bfa4eed3f113cc8f23aab41
BLAKE2b-256 8edc21f135f867c71827eb6846a0a17ba065d45741e4862a64bcdacb9ae19dd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for meshzoo-0.12.1-cp311-none-any.whl:

Publisher: release.yml on meshpro/meshzoo-dev

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file meshzoo-0.12.1-cp310-none-any.whl.

File metadata

  • Download URL: meshzoo-0.12.1-cp310-none-any.whl
  • Upload date:
  • Size: 38.3 kB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for meshzoo-0.12.1-cp310-none-any.whl
Algorithm Hash digest
SHA256 93cd49656ac66e187f8111571ab83057cfd7bafbfecc3eaf7650901286e460b9
MD5 c943ecbeacb6ec135bcb69d051140854
BLAKE2b-256 b5e2dce3b39c7223264f23f7e5d7c2f10111441edbfd33fc8631fecd38d26f3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for meshzoo-0.12.1-cp310-none-any.whl:

Publisher: release.yml on meshpro/meshzoo-dev

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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