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.9.tar.gz (144.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: emeraldtriangles-0.1.9.tar.gz
  • Upload date:
  • Size: 144.0 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.9.tar.gz
Algorithm Hash digest
SHA256 31888f9708c401f82005ce7a3d88ea425c52f2420144dc592e69d89b6a48e6fa
MD5 6e9b3bab4802467d0e21094e5bb33620
BLAKE2b-256 84f6f6c79bcaaaa5edc3c1e31292e8fda6aa348d9fc6a01b27dc02093a559d1e

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