@jgphilpott/polytree 0.0.6 → 0.0.8
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 +31 -1
- package/package.json +18 -11
- package/polytree.bundle.browser.js +3453 -0
- package/polytree.bundle.browser.min.js +1 -0
- package/polytree.bundle.js +3653 -0
- package/polytree.bundle.min.js +1 -0
- package/polytree.js +0 -2938
package/README.md
CHANGED
|
@@ -8,10 +8,16 @@
|
|
|
8
8
|
|
|
9
9
|
## Getting Started
|
|
10
10
|
|
|
11
|
+
### Node.js
|
|
12
|
+
|
|
13
|
+
##### Install
|
|
14
|
+
|
|
11
15
|
```bash
|
|
12
16
|
npm install polytree
|
|
13
17
|
```
|
|
14
18
|
|
|
19
|
+
##### Import
|
|
20
|
+
|
|
15
21
|
```js
|
|
16
22
|
import * as THREE from 'three';
|
|
17
23
|
import { Polytree } from 'polytree';
|
|
@@ -19,6 +25,30 @@ import { Polytree } from 'polytree';
|
|
|
19
25
|
// Example usage coming soon!
|
|
20
26
|
```
|
|
21
27
|
|
|
28
|
+
### Browser
|
|
29
|
+
|
|
30
|
+
For browser usage, use the ES module-compatible bundle:
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<script type="importmap">
|
|
34
|
+
{
|
|
35
|
+
"imports": {
|
|
36
|
+
"three": "./path/to/three.module.min.js",
|
|
37
|
+
"polytree": "./path/to/polytree.bundle.browser.js"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<script type="module">
|
|
43
|
+
import * as THREE from 'three';
|
|
44
|
+
import Polytree from 'polytree';
|
|
45
|
+
|
|
46
|
+
// Example usage coming soon!
|
|
47
|
+
</script>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
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.
|
|
51
|
+
|
|
22
52
|
## Applications
|
|
23
53
|
|
|
24
54
|
- 3D modeling and design for 3D printing.
|
|
@@ -31,4 +61,4 @@ Contributions, issues, and feature requests are welcome! Please [open an issue](
|
|
|
31
61
|
|
|
32
62
|
---
|
|
33
63
|
|
|
34
|
-
**Polytree** is developed and maintained by [@jgphilpott](https://github.com/jgphilpott).
|
|
64
|
+
**Polytree** is developed and maintained by [@jgphilpott](https://github.com/jgphilpott).
|
package/package.json
CHANGED
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jgphilpott/polytree",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "A Constructive Solid Geometry (CSG) library using Octree data structure.",
|
|
5
5
|
"funding": "https://github.com/sponsors/jgphilpott",
|
|
6
|
-
"main": "polytree.js",
|
|
6
|
+
"main": "polytree.bundle.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"require": "./polytree.js"
|
|
9
|
+
"require": "./polytree.bundle.js"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
|
-
"
|
|
13
|
+
"LICENSE",
|
|
14
14
|
"README.md",
|
|
15
|
-
"
|
|
15
|
+
"polytree.bundle.js",
|
|
16
|
+
"polytree.bundle.min.js",
|
|
17
|
+
"polytree.bundle.browser.js",
|
|
18
|
+
"polytree.bundle.browser.min.js"
|
|
16
19
|
],
|
|
17
20
|
"directories": {
|
|
18
21
|
"example": "examples"
|
|
19
22
|
},
|
|
20
23
|
"scripts": {
|
|
21
24
|
"test": "jest",
|
|
22
|
-
"pretest": "npm run
|
|
25
|
+
"pretest": "npm run build",
|
|
23
26
|
"compile": "coffee -cb .",
|
|
24
27
|
"compile:watch": "coffee -cbw . &",
|
|
25
|
-
"build": "npm run compile && npm
|
|
28
|
+
"build": "npm run compile && npm run build:node && npm run build:browser && npm run minify",
|
|
29
|
+
"build:node": "cat app/imports.js app/polytree.js app/intersection.js app/exports.js > polytree.bundle.js",
|
|
30
|
+
"build:browser": "node scripts/browserify.cjs",
|
|
31
|
+
"minify": "uglifyjs polytree.bundle.js --compress --mangle -o polytree.bundle.min.js && uglifyjs polytree.bundle.browser.js --compress --mangle -o polytree.bundle.browser.min.js",
|
|
26
32
|
"prepare": "npm run build",
|
|
27
33
|
"prepublishOnly": "npm run build"
|
|
28
34
|
},
|
|
@@ -36,11 +42,12 @@
|
|
|
36
42
|
"bugs": { "url": "https://github.com/jgphilpott/polytree/issues" },
|
|
37
43
|
"homepage": "https://github.com/jgphilpott/polytree#readme",
|
|
38
44
|
"devDependencies": {
|
|
45
|
+
"browserify": "^17.0.1",
|
|
39
46
|
"coffeescript": "^2.7.0",
|
|
40
|
-
"jest": "^30.1.3"
|
|
47
|
+
"jest": "^30.1.3",
|
|
48
|
+
"uglify-js": "^3.19.3"
|
|
41
49
|
},
|
|
42
|
-
"
|
|
50
|
+
"dependencies": {
|
|
43
51
|
"three": "^0.180.0"
|
|
44
|
-
}
|
|
45
|
-
"dependencies": {}
|
|
52
|
+
}
|
|
46
53
|
}
|