delaunay.js 1.0.4 → 1.0.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "delaunay.js",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Delaunay triangulation using the Bowyer-Watson algorithm, in JavaScript ",
5
5
  "keywords": [
6
6
  "triangulation",
package/triangle.js CHANGED
@@ -10,6 +10,10 @@ export default class Triangle {
10
10
  vertexes() {
11
11
  return [this.a, this.b, this.c];
12
12
  }
13
+
14
+ vertexesAsString() {
15
+ return this.vertexes().map(vertex => `${vertex.x}, ${vertex.y}`).join(", ");
16
+ }
13
17
 
14
18
  edges() {
15
19
  return [
@@ -1,37 +0,0 @@
1
- # This workflow will run tests using node and then publish a package to npm when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
- name: Publish Package to npmjs.com
5
-
6
- on:
7
- release:
8
- types: [created]
9
-
10
- permissions:
11
- id-token: write # Required for OIDC
12
- contents: read
13
-
14
- jobs:
15
- build:
16
- runs-on: ubuntu-latest
17
- steps:
18
- - uses: actions/checkout@v6
19
- - uses: actions/setup-node@v6
20
- with:
21
- node-version: 24
22
- - run: npm ci
23
- - run: npm test
24
-
25
- publish-npm:
26
- needs: build
27
- runs-on: ubuntu-latest
28
- steps:
29
- - uses: actions/checkout@v6
30
- - uses: actions/setup-node@v6
31
- with:
32
- node-version: 24
33
- registry-url: https://registry.npmjs.org/
34
- - run: npm ci
35
- - run: npm publish
36
- env:
37
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}
package/test.js DELETED
@@ -1,29 +0,0 @@
1
- import bowyerWatson from './bowyer-watson.js';
2
- import Triangle from './triangle.js';
3
- import Vector from 'vectory-lib';
4
-
5
- function getRandomPoints() {
6
- let points = [];
7
- let nrOfPoints = 10;
8
- for(let i = 0; i < nrOfPoints; i++) {
9
- points.push(new Vector(
10
- Math.random() * 100,
11
- Math.random() * 100
12
- ));
13
- }
14
- return points;
15
- }
16
-
17
- let pointList = getRandomPoints();
18
-
19
- let superTriangle = new Triangle(
20
- new Vector(-1000, 1000),
21
- new Vector(1000, 1000),
22
- new Vector(0, -1000)
23
- );
24
-
25
- let triangles = bowyerWatson(superTriangle, pointList);
26
-
27
- triangles.forEach(triangle => {
28
- console.log(triangle.vertexes());
29
- });