@jgphilpott/polytree 0.1.4 → 0.1.6

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/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  <summary><h2 style="display:inline">Intro</h2></summary>
16
16
 
17
- **Polytree** is a modern, high-performance spatial querying and Constructive Solid Geometry (CSG) library for JavaScript and Node.js Built on an efficient [Octree data structure](https://en.wikipedia.org/wiki/Octree), it is designed for advanced 3D modeling, mesh analysis, geometric search, and seamless integration with [three.js](https://github.com/mrdoob/three.js).
17
+ **Polytree** is a modern, high-performance spatial querying and Constructive Solid Geometry (CSG) library for JavaScript and Node.js. Built on an efficient [Octree data structure](https://en.wikipedia.org/wiki/Octree), it is designed for advanced 3D modeling, mesh analysis, geometric search, and seamless integration with [three.js](https://github.com/mrdoob/three.js).
18
18
 
19
19
  Polytree goes beyond traditional CSG libraries by providing a comprehensive suite of spatial query functions—such as closest point, distance field, intersection testing, layer slicing, and volume analysis—making it ideal for 3D printing, CAD, simulation, and mesh analysis applications.
20
20
 
@@ -65,14 +65,14 @@ Polytree goes beyond traditional CSG libraries by providing a comprehensive suit
65
65
  #### Install
66
66
 
67
67
  ```bash
68
- npm install polytree
68
+ npm i @jgphilpott/polytree
69
69
  ```
70
70
 
71
71
  #### Import
72
72
 
73
73
  ```js
74
74
  import * as THREE from 'three';
75
- import { Polytree } from 'polytree';
75
+ import { Polytree } from '@jgphilpott/polytree';
76
76
  ```
77
77
 
78
78
  ### Browser
@@ -84,7 +84,7 @@ For browser usage, use the ES module-compatible bundle:
84
84
  {
85
85
  "imports": {
86
86
  "three": "./path/to/three.module.min.js",
87
- "polytree": "./path/to/polytree.bundle.browser.js"
87
+ "polytree": "./path/to/polytree.bundle.browser.esm.js"
88
88
  }
89
89
  }
90
90
  </script>
@@ -95,7 +95,7 @@ import Polytree from 'polytree';
95
95
  </script>
96
96
  ```
97
97
 
98
- The browser bundle (`polytree.bundle.browser.js`) is specifically designed for ES module imports in browsers, while the main bundle (`polytree.bundle.js`) is for Node.js environments.
98
+ The ESM browser bundle (`polytree.bundle.browser.esm.js`) is designed for browser `import`/`importmap` usage, while the main bundle (`polytree.bundle.js`) is for Node.js environments.
99
99
 
100
100
  </details>
101
101
 
@@ -264,7 +264,7 @@ Process multiple objects efficiently:
264
264
 
265
265
  ```js
266
266
  // Unite multiple objects asynchronously.
267
- const meshArray = [mesh1, mesh2, mesh3, mesh4 ... meshX];
267
+ const meshArray = [mesh1, mesh2, mesh3, mesh4]; // ... and more meshes
268
268
  const polytreeArray = meshArray.map(mesh => Polytree.fromMesh(mesh));
269
269
 
270
270
  Polytree.async.uniteArray(polytreeArray).then(result => {
@@ -284,7 +284,7 @@ Polytree.async.uniteArray(polytreeArray).then(result => {
284
284
 
285
285
  </details>
286
286
 
287
- <details open>
287
+ <details>
288
288
 
289
289
  <summary><h3 style="display:inline">Spatial Query Functions</h3></summary>
290
290
 
@@ -424,7 +424,7 @@ final.delete();
424
424
 
425
425
  </details>
426
426
 
427
- <details open>
427
+ <details>
428
428
 
429
429
  <summary><h2 style="display:inline">Performance</h2></summary>
430
430
 
@@ -440,7 +440,7 @@ Polytree is designed for high-performance CSG operations:
440
440
 
441
441
  </details>
442
442
 
443
- <details open>
443
+ <details>
444
444
 
445
445
  <summary><h2 style="display:inline">Applications</h2></summary>
446
446
 
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@jgphilpott/polytree",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "A modern, high-performance spatial querying library designed specifically for three.js and Node.",
5
5
  "funding": "https://github.com/sponsors/jgphilpott",
6
6
  "main": "polytree.bundle.js",
7
7
  "exports": {
8
8
  ".": {
9
+ "import": "./polytree.bundle.browser.esm.js",
9
10
  "require": "./polytree.bundle.js"
10
11
  }
11
12
  },
@@ -15,7 +16,8 @@
15
16
  "polytree.bundle.js",
16
17
  "polytree.bundle.min.js",
17
18
  "polytree.bundle.browser.js",
18
- "polytree.bundle.browser.min.js"
19
+ "polytree.bundle.browser.min.js",
20
+ "polytree.bundle.browser.esm.js"
19
21
  ],
20
22
  "directories": {
21
23
  "example": "examples"
@@ -25,9 +27,10 @@
25
27
  "pretest": "npm run build",
26
28
  "compile": "coffee -cb .",
27
29
  "compile:watch": "coffee -cbw . &",
28
- "build": "npm run compile && npm run build:node && npm run build:browser && npm run minify",
30
+ "build": "npm run compile && npm run build:node && npm run build:browser && npm run build:browser:esm && npm run minify",
29
31
  "build:node": "./scripts/bundle.sh",
30
32
  "build:browser": "node scripts/browserify.cjs",
33
+ "build:browser:esm": "esbuild polytree.bundle.browser.js --bundle --platform=browser --format=esm --outfile=polytree.bundle.browser.esm.js --external:three",
31
34
  "minify": "npm run minify:node && npm run minify:browser",
32
35
  "minify:node": "uglifyjs polytree.bundle.js -cmo polytree.bundle.min.js",
33
36
  "minify:browser": "uglifyjs polytree.bundle.browser.js -cmo polytree.bundle.browser.min.js",
@@ -38,17 +41,30 @@
38
41
  "type": "git",
39
42
  "url": "https://github.com/jgphilpott/polytree"
40
43
  },
41
- "keywords": ["Polytree", "Octree", "CSG", "BVH"],
42
- "author": { "name": "Jacob Philpott", "email": "jacob.philpott@gmx.com" },
44
+ "keywords": [
45
+ "Polytree",
46
+ "Octree",
47
+ "CSG",
48
+ "BVH"
49
+ ],
50
+ "author": {
51
+ "name": "Jacob Philpott",
52
+ "email": "jacob.philpott@gmx.com"
53
+ },
43
54
  "license": "MIT",
44
- "bugs": { "url": "https://github.com/jgphilpott/polytree/issues" },
55
+ "bugs": {
56
+ "url": "https://github.com/jgphilpott/polytree/issues"
57
+ },
45
58
  "homepage": "https://github.com/jgphilpott/polytree#readme",
59
+ "module": "polytree.bundle.browser.esm.js",
46
60
  "devDependencies": {
61
+ "baseline-browser-mapping": "^2.9.11",
47
62
  "coffeescript": "^2.7.0",
63
+ "esbuild": "^0.27.2",
48
64
  "jest": "^30.2.0",
49
65
  "uglify-js": "^3.19.3"
50
66
  },
51
67
  "dependencies": {
52
- "three": "^0.181.1"
68
+ "three": "^0.182.0"
53
69
  }
54
70
  }