Skip to content

Commit b783c28

Browse files
authored
description edit (#1)
* Add files via upload * add images * Delete voronoi_img3.jpg * Add files via upload * Update README.md * Update README.md
1 parent 49ddb13 commit b783c28

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

Images/voronoi_img1.jpg

394 KB
Loading

Images/voronoi_img2.jpg

482 KB
Loading

Images/voronoi_img3.jpg

352 KB
Loading

Images/voronoi_img4.jpg

692 KB
Loading

README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
FortuneSwift is a swift framework that uses Fortune's Algorithm to generate Voronoi diagrams and Delaunay triangulations from a set of points on a 2D plane. Fortune's Algorithm has a time complexity of `O(n log n)`, and a space complexity of `O(n)`. This framework is compatible with iOS 8+, macOS 10.13+.
44

5+
## Examples
6+
<p align="left">
7+
<img src="https://github.com/TateLiang/FortuneSwift/blob/TateLiang-description-edit/Images/voronoi_img1.jpg" width="400">
8+
<img src="https://github.com/TateLiang/FortuneSwift/blob/TateLiang-description-edit/Images/voronoi_img2.jpg" width="400">
9+
<img src="https://github.com/TateLiang/FortuneSwift/blob/TateLiang-description-edit/Images/voronoi_img3.jpg" width="400">
10+
<img src="https://github.com/TateLiang/FortuneSwift/blob/TateLiang-description-edit/Images/voronoi_img4.jpg" width="400">
11+
</p>
12+
513

614
## Installation
715

@@ -11,7 +19,6 @@ Or alternatively:
1119
- Add `.package(url: "https://github.com/TateLiang/FortuneSwift.git", from: "1.1.5")` to your `Package.swift` file's `dependencies`.
1220
- Update your packages using `$ swift package update`.
1321

14-
1522
## Usage
1623

1724
### Setup
@@ -80,9 +87,16 @@ func walk() -> [HalfEdge]?
8087
- `incidentSite` is `nil` if it is an edge on the exterior border of the bounding rectangle.
8188
- `walk()` outputs an ring of the `HalfEdges` defining the cell, or `nil` if the edges don't form a ring (should not happen)
8289

90+
## Details
91+
92+
##### Problem Definition
93+
A voronoi diagram is a tesselation of cells in a plane, representing the points closest to a particular point. For each voronoi "site", its region is defined as the points closer to it than any other site. Voronoi diagrams are also dual-graphs of the Delaunay triangulation, where each edge of the Voronoi diagram corresponds to an adjacent edge in the Delaunay triangulation between the two incident points. Voronoi diagrams have a variety of applications including in Astronomy, Art, Biology, Robotics, and Physics.
94+
95+
##### Algorithm
96+
[Fortune's Algorithm](https://en.wikipedia.org/wiki/Fortune%27s_algorithm) is a sweep line algorithm in computational geometry. Like problems such as convex hulls or segment intersection, an event queue is maintained through a priority queue data structure. Fortune's Algorithm makes use of a binary search tree to also maintain a "beach line", representing the currently known cells based on the location of the sweep line. At the end of the algorithm, the infinite edges can be bounded by a polygon, in this case, a rectangle.
97+
8398
## Issues
8499

85100
- Points outside of the bounding box will still effect the voronoi diagram, as the box simply bounds all of the infinite edges.
86101
- The algorithm does not work with the edge case where all points are collinear.
87102
- The algorithm does not work with the edge case where there are multiple sites at the same location.
88-

0 commit comments

Comments
 (0)