Skip to main content

Tri - (Constrained) Delaunay Triangulation of Planar Straight Line Graphs

Installation

  • Download the source

  • Run python setup.py install (or python setup.py develop)

Usage

To triangulate a polygon with one outer and one inner shell:

from tri import ToPointsAndSegments, triangulate
from tri.delaunay import output_triangles, TriangleIterator

# create points and segments for triangulation
pts_segs = ToPointsAndSegments()
pts_segs.add_polygon([[(0,0), (10,0), (5,10), (0,0)],
                      [(0,0), (8,2), (6,4), (5,7), (0,0)]
                      ],
                     )

# triangulate the points and segments
dt = triangulate(pts_segs.points, pts_segs.infos, pts_segs.segments)

# write the output
with open("tris.wkt", "w") as fh:
    output_triangles([t for t in TriangleIterator(dt)], fh)

The resulting file is readable with QGIS (Add Delimited Text Layer).

Changelog

See CHANGES.txt.

Bug reports

If you discover any bugs, feel free to create an issue on Bitbucket.

Please add as much information as possible to help us fixing the possible bug. We also encourage you to help even more by forking and sending us a pull request.

The issue tracker lives here.

Maintainers

Contributors

License

MIT License

Metadata

Release files for tri 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tri 0.3
File Size Uploaded Provenance Actions
tri-0.3.tar.gz 26.5 kB Without provenance Details for tri-0.3.tar.gz

Release files / tri-0.3.tar.gz

Download URL tri-0.3.tar.gz
Size 26.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bea99e539e91414178fe5c54ee164e9cee1538c7d1c121a9dec24165f7a9a4b4
BLAKE2b-256 checksum
How to use checksums
89a3d965d71161b911fc2db4626444587ba01759eb5057fbdc74664b738f8a08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for tri 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page