@jwc/jscad-utils 4.8.3 → 4.9.0
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 +4 -4
- package/dist/compat.js +349 -480
- package/dist/examples/bisect.jscad +254 -259
- package/dist/examples/boxes.jscad +254 -259
- package/dist/examples/chamfer.jscad +254 -259
- package/dist/examples/fillet.jscad +254 -259
- package/dist/examples/fit.jscad +254 -259
- package/dist/examples/groups.jscad +254 -259
- package/dist/examples/midlineTo.jscad +254 -259
- package/dist/examples/parts-hexagon.jscad +254 -259
- package/dist/examples/rabett-tb.jscad +254 -259
- package/dist/examples/rabett.jscad +254 -259
- package/dist/examples/rabett2.jscad +254 -259
- package/dist/examples/retraction-test.jscad +254 -259
- package/dist/examples/size.jscad +254 -259
- package/dist/examples/snap.jscad +254 -259
- package/dist/examples/text.jscad +254 -259
- package/dist/examples/wedge.jscad +254 -259
- package/dist/index.js +349 -480
- package/package.json +4 -14
- package/src/boxes.js +1 -1
- package/src/util.js +11 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jwc/jscad-utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.0",
|
|
4
4
|
"description": "Utilities for use in a jscad script.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
"test": "ava -v",
|
|
14
14
|
"test:cov": "nyc --reporter=html --reporter=lcov --reporter=text ava",
|
|
15
15
|
"build": "gulp all",
|
|
16
|
-
"start": "gulp"
|
|
17
|
-
"docs": "vuepress-jsdoc --source ./srcx --dist ./docs && npx vuepress build ./docs",
|
|
18
|
-
"serve": "vuepress-jsdoc --source ./srcx --dist ./docs && vuepress dev ./docs"
|
|
16
|
+
"start": "gulp"
|
|
19
17
|
},
|
|
20
18
|
"keywords": [
|
|
21
19
|
"jscad"
|
|
@@ -40,14 +38,10 @@
|
|
|
40
38
|
"@babel/core": "7.20.7",
|
|
41
39
|
"@babel/preset-env": "7.20.2",
|
|
42
40
|
"@babel/register": "7.18.9",
|
|
43
|
-
"@jwc/jscad-test-utils": "1.0.7",
|
|
44
|
-
"@vuepress/plugin-active-header-links": "1.9.7",
|
|
45
|
-
"@vuepress/plugin-google-analytics": "1.9.7",
|
|
46
41
|
"ava": "3.15.0",
|
|
47
42
|
"del": "6.1.1",
|
|
48
43
|
"eslint": "7.32.0",
|
|
49
44
|
"eslint-plugin-ava": "11.0.0",
|
|
50
|
-
"fsevents": "2.3.2",
|
|
51
45
|
"gulp": "4.0.2",
|
|
52
46
|
"gulp-debug": "4.0.0",
|
|
53
47
|
"gulp-eslint": "6.0.0",
|
|
@@ -64,7 +58,8 @@
|
|
|
64
58
|
"rollup-plugin-babel": "4.4.0",
|
|
65
59
|
"rollup-plugin-commonjs": "4.1.0",
|
|
66
60
|
"rollup-plugin-node-resolve": "5.2.0",
|
|
67
|
-
"
|
|
61
|
+
"vitepress": "1.6.4",
|
|
62
|
+
"vitepress-jsdoc": "1.0.4"
|
|
68
63
|
},
|
|
69
64
|
"ava": {
|
|
70
65
|
"files": [
|
|
@@ -82,10 +77,5 @@
|
|
|
82
77
|
"presets": [
|
|
83
78
|
"@babel/preset-env"
|
|
84
79
|
]
|
|
85
|
-
},
|
|
86
|
-
"optionalDependencies": {},
|
|
87
|
-
"peerDependencies": {
|
|
88
|
-
"gl": "6.0.2",
|
|
89
|
-
"vuepress": "^1.0.3"
|
|
90
80
|
}
|
|
91
81
|
}
|
package/src/boxes.js
CHANGED
|
@@ -54,7 +54,7 @@ export function topMiddleBottom(box, thickness) {
|
|
|
54
54
|
* This will bisect an object using a rabett join. Returns a
|
|
55
55
|
* `group` object with `positive` and `negative` parts.
|
|
56
56
|
*
|
|
57
|
-
* * 
|
|
58
58
|
* @example
|
|
59
59
|
*include('dist/jscad-utils.jscad');
|
|
60
60
|
*
|
package/src/util.js
CHANGED
|
@@ -540,9 +540,9 @@ export function calcSnap(moveobj, withobj, axes, orientation, delta = 0) {
|
|
|
540
540
|
|
|
541
541
|
error(
|
|
542
542
|
'calcSnap: invalid side: ' +
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
543
|
+
orientation +
|
|
544
|
+
' should be ' +
|
|
545
|
+
fix['' + orientation + delta]
|
|
546
546
|
);
|
|
547
547
|
}
|
|
548
548
|
|
|
@@ -560,8 +560,8 @@ export function calcSnap(moveobj, withobj, axes, orientation, delta = 0) {
|
|
|
560
560
|
|
|
561
561
|
return delta
|
|
562
562
|
? axisApply(axes, function (i) {
|
|
563
|
-
|
|
564
|
-
|
|
563
|
+
return t[i] + delta;
|
|
564
|
+
})
|
|
565
565
|
: t;
|
|
566
566
|
}
|
|
567
567
|
|
|
@@ -716,7 +716,7 @@ export function getDelta(size, bounds, axis, offset, nonzero) {
|
|
|
716
716
|
*
|
|
717
717
|
* You can angle the cut plane and position the rotation point.
|
|
718
718
|
*
|
|
719
|
-
* 
|
|
720
720
|
* @param {CSG} object object to bisect
|
|
721
721
|
* @param {string} axis axis to cut along
|
|
722
722
|
* @param {number} [offset] offset to cut at
|
|
@@ -903,7 +903,7 @@ export function slice(
|
|
|
903
903
|
* Creates a `JsCadUtilsGroup` object that has `body` and `wedge` objects. The `wedge` object
|
|
904
904
|
* is created by radially cutting the object from the `start` to the `end` angle.
|
|
905
905
|
*
|
|
906
|
-
* 
|
|
907
907
|
*
|
|
908
908
|
*
|
|
909
909
|
* @example
|
|
@@ -1063,11 +1063,11 @@ export function slices2poly(slices, options, axis) {
|
|
|
1063
1063
|
var rotate =
|
|
1064
1064
|
twistangle === 0
|
|
1065
1065
|
? function rotateZero(v) {
|
|
1066
|
-
|
|
1067
|
-
|
|
1066
|
+
return v;
|
|
1067
|
+
}
|
|
1068
1068
|
: function rotate(v, angle, percent) {
|
|
1069
|
-
|
|
1070
|
-
|
|
1069
|
+
return v[rotateAxis](angle * percent);
|
|
1070
|
+
};
|
|
1071
1071
|
|
|
1072
1072
|
// walls
|
|
1073
1073
|
var connectorAxis = last.offset.minus(first.offset).abs();
|