Skip to main content

graham-scan-based-incremental-delaunay

Graham Scan-Based Incremental Delaunay Triangulation:

  • Sort the input points by x-coordinate
  • Select the leftmost, bottommost point as the pivot point
  • Sort the other points by angle relative to the pivot point their slopes relative to the pivot
  • Construct the base convex hull using the pivot point and the first two points sorted by angle
  • Incrementally add the next sorted point and use Graham Scan to get the convex hull, saving any edges that were made
  • Flip the current triangulation to Delaunay and repeat until done

TODO LIST:

  • Implement Halfedge data structure, with addleaf and addedge
    • get two sorting algorithms loglinear time, one for x-coord and one for slope
    • Use a stack to track points on the convex hull
    • Use a queue to track edges that need to be flipped
    • Save all the edges made during the convex hull process
    • Check the queued edges if they are locally Delaunay
    • Flip non-locally Delaunay edges
  • Work on visualization
  • Write some tests
    • Test sorting for setting up the points
    • Test Convex Hull triangulation
    • Test Locally Delaunay check
    • Test edge flipping on a simple case

Due Date: final code and presentation on April 29th

Timeline for progress:

  • 4/1
  • 4/8
  • 4/15
  • 4/22
  • 4/29 project due along with presentation

Environment and package info

Please make sure you have installed the pyglet and numpy before running the code, Those two package can be installed using pip command pip install numpy and pip install pyglet

This project has been uploaded to PyPi as a package. You can download the package by the following command: python3 -m pip install grahamscan-delaunay After install the package, you can start the project by python3 and then >>> import grahamscan_delaunay

Visualization

Once you start the program, an empty window will pop up. You can add a point by click inside the window, or randomly generate one by pressing G. Once you finish adding points, press S to start the Delaunay algorithm step-by-step visualization. To go to the next step, press the Space Bar. To reset to the start of the algorithm, press R. To clear all points, press C. The red point indicates the most recently added point. The blue edge indicates that the edge will be checked if it is Locally Delaunay. A black point indicates that the point in in the triangulation while a gray point indicates that it has not yet been added to the triangulation. When the algorithm is complete, the background will turn green. Press R or C to reset the visualization.

Metadata

Release files for grahamscan-delaunay 0.1.0

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

Source distribution (sdist)

Source distribution for grahamscan-delaunay 0.1.0
File Size Uploaded
grahamscan-delaunay-0.1.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for grahamscan-delaunay 0.1.0
File Interpreter ABI Platform
grahamscan_delaunay-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 kB

Release files / grahamscan-delaunay-0.1.0.tar.gz

Download URL grahamscan-delaunay-0.1.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
59e82e8d7618e6cab79f75aeed93fd9eb9730faa1e97643d10b2340288e7437e
BLAKE2b-256 checksum
How to use checksums
5f166d766f863181e58a3c62e54f76f55d0d53ddb512d7c264b28ea63bce4da8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.9

Release files / grahamscan_delaunay-0.1.0-py3-none-any.whl

Download URL grahamscan_delaunay-0.1.0-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5de38cf3f43307bd7898a93a1446fddc27abaea3e7ae46713ba40729434146de
BLAKE2b-256 checksum
How to use checksums
56bc480dee0ecf6e0743ee014cb6b7c9ff22e832eb9886c3be47b935ac343c97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.1

2 release files

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