delaunay.js 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +5 -2
  2. package/readme.md +13 -3
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "delaunay.js",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Delaunay triangulation using the Bowyer-Watson algorithm, in JavaScript ",
5
5
  "keywords": [
6
6
  "triangulation",
7
+ "triangulate",
8
+ "triangles",
7
9
  "delaunay",
8
- "bowyer-watson"
10
+ "bowyer-watson",
11
+ "javascript"
9
12
  ],
10
13
  "homepage": "https://github.com/DonKarlssonSan/Delaunay.js#readme",
11
14
  "bugs": {
package/readme.md CHANGED
@@ -1,7 +1,14 @@
1
+ # About
2
+ This is a JavaScript library for performing Delaunay triangulation for a set of points. It is implemented using the Bowyer-Watson algorithm.
3
+
4
+ ## Live demos
5
+
6
+ - Colorful Triangle Pattern Generator, draws a pattern using canvas in the browser: [live demo](https://donkarlssonsan.github.io/colorful-triangle-pattern/), [(source code)](https://github.com/DonKarlssonSan/colorful-triangle-pattern)
7
+
1
8
  # Installation
2
9
 
3
10
  ```
4
- npm install delaunay
11
+ npm install delaunay.js
5
12
  ```
6
13
 
7
14
  # Usage
@@ -17,8 +24,8 @@ let triangles = bowyerWatson(superTriangle, pointList);
17
24
  A more complete example:
18
25
 
19
26
  ```JavaScript
20
- import bowyerWatson from './bowyer-watson.js';
21
- import Triangle from './triangle.js';
27
+ import bowyerWatson from 'delaunay.js';
28
+ import Triangle from 'delaunay.js/triangle.js';
22
29
  import Vector from 'vectory-lib';
23
30
 
24
31
  function getRandomPoints() {
@@ -43,6 +50,9 @@ let superTriangle = new Triangle(
43
50
 
44
51
  let triangles = bowyerWatson(superTriangle, pointList);
45
52
  ```
53
+ - `vectory-lib` is another library written by me, it contains basic vector math, exposed via the `Vector` JavaScript class.
54
+ - `Triangle` is included in the delaunay.js library, it contains math operations on triangles like `circumcenter`, `centroid` and `pointIsInsideCircumcircle` which are needed by the Bowyer-Watson algorithm.
55
+
46
56
 
47
57
  # Referenses
48
58
  https://en.wikipedia.org/wiki/Delaunay_triangulation