Skip to main content

Triangle mesh transforms

Project description

EmeraldTriangles

This library provides transformations for 2d triangle meshes built on top of scipy.spatial.Delaunay and Triangle:

  • Insert points (nodes) in an existing mesh, splitting any triangles that points fall into.
    • Meshes created this way might not be Delaunay, but any new connected set of triangles added will be Delaunay if viewed in isolation (without the pre-existing mesh).
  • Extend a mesh outwards to include new points.
    • The extension to the mesh will be a constrained delaunay.
  • Calculate the boundary polygon of a mesh.

This library uses a similar data structure to the Triangles library above, but replaces numpy arrays with pandas dataframes, preserving any extra columns across operations. It also contains a plotting function similar to the one in the Triangle library, that supports color attributes for vertices as well as triangle faces.

In addition, EmeraldTriangles provides import and export functionality for

  • LandXML (import and export, no extra columns)
  • SQL (import and export, same supported databases as pandas)
  • PyVista (Only export)
    • VTK (only export)

as well as some data transforms

  • Reprojection of coordinates using pyproj
  • Spatial interpolation (Kriging) of data using scikit-gstat
  • Sampling of data from a raster to triangulation vertices using RasterIO
  • Sampling of data from a triangulation to new point locations (linear interpolation between vertices of the surrounding triangle)

Documentation

Documentation is provided in the form of a jupyter notebook with example usages as well as in docstrings accesible with the python help() function.

Installation tips

Users have experience issues with using the setup.py develop option due to some strange behaviour from cython. Using pip instead seems to do this trick.

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

emeraldtriangles-0.1.10.tar.gz (143.9 kB view details)

Uploaded Source

File details

Details for the file emeraldtriangles-0.1.10.tar.gz.

File metadata

  • Download URL: emeraldtriangles-0.1.10.tar.gz
  • Upload date:
  • Size: 143.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for emeraldtriangles-0.1.10.tar.gz
Algorithm Hash digest
SHA256 5f7356378ae8ef89e959da004ee81712e0c174aa50e7cb344cc919486cea916d
MD5 8a85a987fd0eeaa67191f330e1d5b73d
BLAKE2b-256 68350430ac451215dff0339e409f155aea6b35755dca36fdbc5587d0b596e92c

See more details on using hashes here.

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