Skip to main content

A Python package to build, manipulate and analyze polygonal meshes.

Project description

SigmaEpsilon.Mesh - Data Structures, Computation and Visualization for Complex Polygonal Meshes in Python

CircleCI codecov Codacy Badge Documentation Status License PyPI Python Code style: black Requirements Status

The sigmaepsilon.mesh library aims to provide the tools to build and analyse poligonal meshes with complex topologies. Meshes can be built like a dictionary, using arbitrarily nested layouts and then be translated to other formats including VTK and PyVista. For plotting, there is also support for K3D, Matplotlib and Plotly.

The data model is built around Awkward, which makes it possible to attach nested, variable-sized data to the points or the cells in a mesh, also providing interfaces to other popular libraries like Pandas or PyArrow. Implementations are fast as they rely on the vector math capabilities of NumPy, while other computationally sensitive calculations are JIT-compiled using Numba.

Here and there we also use NetworkX, SciPy, SymPy and scikit-learn.

Note Implementation of the performance critical parts of the library rely on the JIT-compilation capabilities of Numba. This means that the library performs well even for large scale problems, on the expense of a longer first call.

Highlights

  • Classes to handle points, pointclouds, reference frames and jagged topologies.
  • Array-like mesh composition with a Numba-jittable database model. Join or split meshes, attach numerical data and save to and load from disk.
  • Simplified and preconfigured plotting facility using PyVista, K3D, Plotly and Matplotlib.
  • Grid generation in 1, 2 and 3 dimensions for arbitrarily structured Lagrangian cells.
  • A mechanism for all sorts of geometrical and topological transformations.
  • A customizable nodal distribution mechanism to effortlessly pass around data between points and cells.
  • Generation of Pseudo Peripheral Nodes, Rooted Level Structures and Adjancency Matrices for arbitrary polygonal meshes.
  • Symbolic shape function generation for arbitrarily structured Lagrangian cells in 1, 2 and 3 dimensions with an extendible interpolation and extrapolation mechanism.
  • Connections to popular third party libraries like networkx, pandas, vtk, PyVista and more.
  • The ability to read from a wide range of formats thanks to the combined power of vtk, PyVista and meshio.

Projects using sigmaepsilon.mesh

  • Many of the other packages in the SigmaEpsilon ecosystem.
  • PyAxisVM - The official Python package of AxisVM, a popular structural analysis and design software.

Documentation

The documentation is built with Sphinx using the PyData Sphinx Theme and hosted on ReadTheDocs. Check it out for the user guide, an ever growing set of examples, and API Reference.

Installation

If you are a developer, skip this section and follow the instructions in this section. If you are not, follow the instructions listed in this section and forget that you ever saw this paragraph.

sigmaepsilon.mesh can be installed from PyPI using pip on Python >= 3.10:

>>> pip install sigmaepsilon.mesh

or chechkout with the following command using GitHub CLI

gh repo clone sigma-epsilon/sigmaepsilon.mesh

and install from source by typing

>>> pip install .

If you want to run the tests, you can install the package along with the necessary optional dependencies like this

>>> pip install ".[test,dev]"

This would install the library with optional dependencies required for testing and development.

Development mode

If you want to install the library in development mode, use this command:

>>> pip install "-e .[test,dev]"

Checking your installation

If everything went well, you should be able to import sigmaepsilon.mesh from the Python prompt:

$ python
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sigmaepsilon.mesh
>>> sigmaepsilon.mesh.__version__
'2.3.3'

Changes and versioning

See the changelog, for the most notable changes between releases.

The project adheres to semantic versioning.

Instructions for Developers

If you are a developer or plannign to contribute, you find all related information in the Developer Guide.

How to contribute?

Contributions are currently expected in any the following ways:

  • finding bugs If you run into trouble when using the library and you think it is a bug, feel free to raise an issue.
  • feedback All kinds of ideas are welcome. For instance if you feel like something is still shady (after reading the user guide), we want to know. Be gentle though, the development of the library is financially not supported yet.
  • feature requests Tell us what you think is missing (with realistic expectations).
  • examples If you've done something with the library and you think that it would make for a good example, get in touch with the developers and we will happily inlude it in the documention.
  • sharing is caring If you like the library, share it with your friends or colleagues so they can like it too.

In all cases, read the contributing guidelines before you do anything.

Acknowledgements

Although sigmaepsilon.mesh works without VTK or PyVista being installed, it is highly influenced by these libraries and works best with them around. Also shout-out for the developers of NumPy, Scipy, Numba, Awkward, meshio and all the third-party libraries involved in the project. Whithout these libraries the concept of writing performant, yet elegant Python code would be much more difficult.

A lot of the packages mentioned in this document here and the introduction have a citable research paper. If you use them in your work through sigmaepsilon.mesh, take a moment to check out their documentations and cite their papers.

Also, funding of these libraries is partly based on the size of the community they are able to support. If what you are doing strongly relies on these libraries, don't forget to press the :star: button to show your support.

License

This package is licensed under the MIT license.

Third-party licenses

You find license information of all the dependencies in this file.

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

sigmaepsilon_mesh-3.0.2.tar.gz (134.0 kB view details)

Uploaded Source

Built Distribution

sigmaepsilon_mesh-3.0.2-py3-none-any.whl (176.8 kB view details)

Uploaded Python 3

File details

Details for the file sigmaepsilon_mesh-3.0.2.tar.gz.

File metadata

  • Download URL: sigmaepsilon_mesh-3.0.2.tar.gz
  • Upload date:
  • Size: 134.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/5.15.0-1057-aws

File hashes

Hashes for sigmaepsilon_mesh-3.0.2.tar.gz
Algorithm Hash digest
SHA256 fc9c4d813721365fa34e06dc656065d04ae76f2643e1a858e2fbcb6c01487533
MD5 fa45e032f353b1498ad6d411f0731953
BLAKE2b-256 e5953c3e4355414869036288a416c59ee2bae3a221f0aad2b215f4ec8758c534

See more details on using hashes here.

File details

Details for the file sigmaepsilon_mesh-3.0.2-py3-none-any.whl.

File metadata

  • Download URL: sigmaepsilon_mesh-3.0.2-py3-none-any.whl
  • Upload date:
  • Size: 176.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/5.15.0-1057-aws

File hashes

Hashes for sigmaepsilon_mesh-3.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b08b0445f85f56bd3d47055cc5691508ac3486f11dca9646168c00c85bfd5418
MD5 8f492f9eb83324d497ea19ee20803261
BLAKE2b-256 5b22a436468f1cffe52a2540cea197b1b3e2536902a96c1bf703ce567c48bb78

See more details on using hashes here.

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