@jscad/core 2.6.11 → 2.6.12
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/CHANGELOG.md +8 -0
- package/LICENSE +1 -1
- package/dist/jscad-core.min.js +28 -28
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.6.12](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/core@2.6.11...@jscad/core@2.6.12) (2024-12-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @jscad/core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [2.6.11](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/core@2.6.10...@jscad/core@2.6.11) (2024-11-10)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @jscad/core
|
package/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
The MIT License (MIT)
|
|
3
3
|
|
|
4
|
-
Copyright (c) 2017-
|
|
4
|
+
Copyright (c) 2017-2024 JSCAD Organization
|
|
5
5
|
|
|
6
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
7
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/jscad-core.min.js
CHANGED
|
@@ -26,7 +26,7 @@ var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defau
|
|
|
26
26
|
},{}],8:[function(require,module,exports){
|
|
27
27
|
module.exports={
|
|
28
28
|
"name": "@jscad/core",
|
|
29
|
-
"version": "2.6.
|
|
29
|
+
"version": "2.6.12",
|
|
30
30
|
"description": "Core functionality for JSCAD Applications",
|
|
31
31
|
"homepage": "https://openjscad.xyz/",
|
|
32
32
|
"repository": "https://github.com/jscad/OpenJSCAD.org",
|
|
@@ -62,9 +62,9 @@ module.exports={
|
|
|
62
62
|
"license": "MIT",
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@jscad/array-utils": "2.1.4",
|
|
65
|
-
"@jscad/io": "2.4.
|
|
66
|
-
"@jscad/io-utils": "2.0.
|
|
67
|
-
"@jscad/modeling": "2.12.
|
|
65
|
+
"@jscad/io": "2.4.11",
|
|
66
|
+
"@jscad/io-utils": "2.0.30",
|
|
67
|
+
"@jscad/modeling": "2.12.5",
|
|
68
68
|
"json5": "2.2.3",
|
|
69
69
|
"strip-bom": "4.0.0"
|
|
70
70
|
},
|
|
@@ -196,7 +196,7 @@ const zipSync=require("fflate").zipSync,strToU8=require("fflate").strToU8,string
|
|
|
196
196
|
},{"xmlchars/xml/1.0/ed5":42,"xmlchars/xml/1.1/ed2":43,"xmlchars/xmlns/1.0/ed3":44}],46:[function(require,module,exports){
|
|
197
197
|
module.exports={
|
|
198
198
|
"name": "@jscad/amf-deserializer",
|
|
199
|
-
"version": "2.3.
|
|
199
|
+
"version": "2.3.10",
|
|
200
200
|
"description": "AMF Deserializer for JSCAD",
|
|
201
201
|
"repository": "https://github.com/jscad/OpenJSCAD.org/",
|
|
202
202
|
"main": "src/index.js",
|
|
@@ -227,8 +227,8 @@ module.exports={
|
|
|
227
227
|
],
|
|
228
228
|
"license": "MIT",
|
|
229
229
|
"dependencies": {
|
|
230
|
-
"@jscad/io-utils": "2.0.
|
|
231
|
-
"@jscad/modeling": "2.12.
|
|
230
|
+
"@jscad/io-utils": "2.0.30",
|
|
231
|
+
"@jscad/modeling": "2.12.5",
|
|
232
232
|
"saxes": "5.0.1"
|
|
233
233
|
},
|
|
234
234
|
"devDependencies": {
|
|
@@ -286,7 +286,7 @@ const{geometries:geometries,maths:maths,primitives:primitives}=require("@jscad/m
|
|
|
286
286
|
},{"./helpers":59,"@jscad/modeling":217}],62:[function(require,module,exports){
|
|
287
287
|
module.exports={
|
|
288
288
|
"name": "@jscad/dxf-deserializer",
|
|
289
|
-
"version": "2.3.
|
|
289
|
+
"version": "2.3.27",
|
|
290
290
|
"description": "DXF Deserializer for JSCAD",
|
|
291
291
|
"homepage": "https://openjscad.xyz/",
|
|
292
292
|
"repository": "https://github.com/jscad/OpenJSCAD.org",
|
|
@@ -314,8 +314,8 @@ module.exports={
|
|
|
314
314
|
],
|
|
315
315
|
"license": "MIT",
|
|
316
316
|
"dependencies": {
|
|
317
|
-
"@jscad/io-utils": "2.0.
|
|
318
|
-
"@jscad/modeling": "2.12.
|
|
317
|
+
"@jscad/io-utils": "2.0.30",
|
|
318
|
+
"@jscad/modeling": "2.12.5"
|
|
319
319
|
},
|
|
320
320
|
"devDependencies": {
|
|
321
321
|
"ava": "3.15.0",
|
|
@@ -374,7 +374,7 @@ const{flatten:flatten,toArray:toArray}=require("@jscad/array-utils"),{ensureStri
|
|
|
374
374
|
},{"./package.json":78,"@jscad/array-utils":533,"@jscad/io-utils":71}],78:[function(require,module,exports){
|
|
375
375
|
module.exports={
|
|
376
376
|
"name": "@jscad/json-deserializer",
|
|
377
|
-
"version": "2.0.
|
|
377
|
+
"version": "2.0.31",
|
|
378
378
|
"description": "JSON Deserializer for JSCAD",
|
|
379
379
|
"homepage": "https://openjscad.xyz/",
|
|
380
380
|
"repository": "https://github.com/jscad/OpenJSCAD.org",
|
|
@@ -403,10 +403,10 @@ module.exports={
|
|
|
403
403
|
"license": "MIT",
|
|
404
404
|
"dependencies": {
|
|
405
405
|
"@jscad/array-utils": "2.1.4",
|
|
406
|
-
"@jscad/io-utils": "2.0.
|
|
406
|
+
"@jscad/io-utils": "2.0.30"
|
|
407
407
|
},
|
|
408
408
|
"devDependencies": {
|
|
409
|
-
"@jscad/modeling": "2.12.
|
|
409
|
+
"@jscad/modeling": "2.12.5",
|
|
410
410
|
"ava": "3.15.0",
|
|
411
411
|
"nyc": "15.1.0"
|
|
412
412
|
},
|
|
@@ -422,7 +422,7 @@ const{colors:colors,primitives:primitives}=require("@jscad/modeling"),{ensureStr
|
|
|
422
422
|
},{"./package.json":81,"@jscad/io-utils":71,"@jscad/modeling":217}],81:[function(require,module,exports){
|
|
423
423
|
module.exports={
|
|
424
424
|
"name": "@jscad/obj-deserializer",
|
|
425
|
-
"version": "2.0.
|
|
425
|
+
"version": "2.0.30",
|
|
426
426
|
"description": "OBJ Deserializer for JSCAD",
|
|
427
427
|
"homepage": "https://openjscad.xyz/",
|
|
428
428
|
"repository": "https://github.com/jscad/OpenJSCAD.org",
|
|
@@ -454,8 +454,8 @@ module.exports={
|
|
|
454
454
|
],
|
|
455
455
|
"license": "MIT",
|
|
456
456
|
"dependencies": {
|
|
457
|
-
"@jscad/io-utils": "2.0.
|
|
458
|
-
"@jscad/modeling": "2.12.
|
|
457
|
+
"@jscad/io-utils": "2.0.30",
|
|
458
|
+
"@jscad/modeling": "2.12.5"
|
|
459
459
|
},
|
|
460
460
|
"devDependencies": {
|
|
461
461
|
"ava": "3.15.0",
|
|
@@ -473,7 +473,7 @@ const{maths:maths,primitives:primitives}=require("@jscad/modeling"),{BinaryReade
|
|
|
473
473
|
},{"./package.json":84,"@jscad/io-utils":71,"@jscad/modeling":217}],84:[function(require,module,exports){
|
|
474
474
|
module.exports={
|
|
475
475
|
"name": "@jscad/stl-deserializer",
|
|
476
|
-
"version": "2.1.
|
|
476
|
+
"version": "2.1.27",
|
|
477
477
|
"description": "STL Deserializer for JSCAD",
|
|
478
478
|
"homepage": "https://openjscad.xyz/",
|
|
479
479
|
"repository": "https://github.com/jscad/OpenJSCAD.org",
|
|
@@ -505,8 +505,8 @@ module.exports={
|
|
|
505
505
|
],
|
|
506
506
|
"license": "MIT",
|
|
507
507
|
"dependencies": {
|
|
508
|
-
"@jscad/io-utils": "2.0.
|
|
509
|
-
"@jscad/modeling": "2.12.
|
|
508
|
+
"@jscad/io-utils": "2.0.30",
|
|
509
|
+
"@jscad/modeling": "2.12.5"
|
|
510
510
|
},
|
|
511
511
|
"devDependencies": {
|
|
512
512
|
"ava": "3.15.0",
|
|
@@ -539,7 +539,7 @@ const{geometries:geometries,modifiers:modifiers}=require("@jscad/modeling"),{fla
|
|
|
539
539
|
},{"xmlchars/xml/1.0/ed5":88,"xmlchars/xml/1.1/ed2":89,"xmlchars/xmlns/1.0/ed3":90}],92:[function(require,module,exports){
|
|
540
540
|
module.exports={
|
|
541
541
|
"name": "@jscad/svg-deserializer",
|
|
542
|
-
"version": "2.5.
|
|
542
|
+
"version": "2.5.11",
|
|
543
543
|
"description": "SVG Deserializer for JSCAD",
|
|
544
544
|
"homepage": "https://openjscad.xyz/",
|
|
545
545
|
"repository": "https://github.com/jscad/OpenJSCAD.org",
|
|
@@ -572,8 +572,8 @@ module.exports={
|
|
|
572
572
|
"license": "MIT",
|
|
573
573
|
"dependencies": {
|
|
574
574
|
"@jscad/array-utils": "2.1.4",
|
|
575
|
-
"@jscad/io-utils": "2.0.
|
|
576
|
-
"@jscad/modeling": "2.12.
|
|
575
|
+
"@jscad/io-utils": "2.0.30",
|
|
576
|
+
"@jscad/modeling": "2.12.5",
|
|
577
577
|
"saxes": "5.0.1"
|
|
578
578
|
},
|
|
579
579
|
"devDependencies": {
|
|
@@ -610,7 +610,7 @@ const{geometries:geometries,maths:maths,measurements:measurements,utils:utils}=r
|
|
|
610
610
|
},{}],101:[function(require,module,exports){
|
|
611
611
|
module.exports={
|
|
612
612
|
"name": "@jscad/svg-serializer",
|
|
613
|
-
"version": "2.3.
|
|
613
|
+
"version": "2.3.18",
|
|
614
614
|
"description": "SVG Serializer for JSCAD",
|
|
615
615
|
"homepage": "https://openjscad.xyz/",
|
|
616
616
|
"repository": "https://github.com/jscad/OpenJSCAD.org",
|
|
@@ -642,7 +642,7 @@ module.exports={
|
|
|
642
642
|
],
|
|
643
643
|
"license": "MIT",
|
|
644
644
|
"dependencies": {
|
|
645
|
-
"@jscad/modeling": "2.12.
|
|
645
|
+
"@jscad/modeling": "2.12.5",
|
|
646
646
|
"onml": "1.3.0"
|
|
647
647
|
},
|
|
648
648
|
"devDependencies": {
|
|
@@ -667,7 +667,7 @@ module.exports={
|
|
|
667
667
|
},{"xmlchars/xml/1.0/ed5":102,"xmlchars/xml/1.1/ed2":103,"xmlchars/xmlns/1.0/ed3":104}],106:[function(require,module,exports){
|
|
668
668
|
module.exports={
|
|
669
669
|
"name": "@jscad/x3d-deserializer",
|
|
670
|
-
"version": "2.2.
|
|
670
|
+
"version": "2.2.10",
|
|
671
671
|
"description": "X3D Deserializer for JSCAD",
|
|
672
672
|
"repository": "https://github.com/jscad/OpenJSCAD.org/",
|
|
673
673
|
"main": "src/index.js",
|
|
@@ -694,8 +694,8 @@ module.exports={
|
|
|
694
694
|
},
|
|
695
695
|
"dependencies": {
|
|
696
696
|
"@jscad/array-utils": "2.1.4",
|
|
697
|
-
"@jscad/io-utils": "2.0.
|
|
698
|
-
"@jscad/modeling": "2.12.
|
|
697
|
+
"@jscad/io-utils": "2.0.30",
|
|
698
|
+
"@jscad/modeling": "2.12.5",
|
|
699
699
|
"saxes": "5.0.1"
|
|
700
700
|
},
|
|
701
701
|
"devDependencies": {
|
|
@@ -1926,7 +1926,7 @@ const rectangle=require("./rectangle"),{isGTE:isGTE}=require("./commonChecks"),s
|
|
|
1926
1926
|
const{TAU:TAU}=require("../maths/constants"),vec2=require("../maths/vec2"),geom2=require("../geometries/geom2"),{isGT:isGT,isGTE:isGTE,isNumberArray:isNumberArray}=require("./commonChecks"),getRadiusRatio=(e,r)=>e>0&&r>1&&r<e/2?Math.cos(Math.PI*r/e)/Math.cos(Math.PI*(r-1)/e):0,getPoints=(e,r,t,s)=>{const o=TAU/e,i=[];for(let a=0;a<e;a++){const e=vec2.fromAngleRadians(vec2.create(),o*a+t);vec2.scale(e,e,r),vec2.add(e,s,e),i.push(e)}return i},star=e=>{let{center:r,vertices:t,outerRadius:s,innerRadius:o,density:i,startAngle:a}=Object.assign({},{center:[0,0],vertices:5,outerRadius:1,innerRadius:0,density:2,startAngle:0},e);if(!isNumberArray(r,2))throw new Error("center must be an array of X and Y values");if(!isGTE(t,2))throw new Error("vertices must be two or more");if(!isGT(s,0))throw new Error("outerRadius must be greater than zero");if(!isGTE(o,0))throw new Error("innerRadius must be greater than zero");if(!isGTE(a,0))throw new Error("startAngle must be greater than zero");if(t=Math.floor(t),i=Math.floor(i),a%=TAU,0===o){if(!isGTE(i,2))throw new Error("density must be two or more");o=s*getRadiusRatio(t,i)}const n=vec2.clone(r),u=getPoints(t,s,a,n),c=getPoints(t,o,a+Math.PI/t,n),h=[];for(let e=0;e<t;e++)h.push(u[e]),h.push(c[e]);return geom2.fromPoints(h)};module.exports=star;
|
|
1927
1927
|
|
|
1928
1928
|
},{"../geometries/geom2":150,"../maths/constants":219,"../maths/vec2":316,"./commonChecks":495}],514:[function(require,module,exports){
|
|
1929
|
-
const{TAU:TAU}=require("../maths/constants"),extrudeRotate=require("../operations/extrusions/extrudeRotate"),{rotate:rotate}=require("../operations/transforms/rotate"),{translate:translate}=require("../operations/transforms/translate"),circle=require("./circle"),{isGT:isGT,isGTE:isGTE}=require("./commonChecks"),torus=e=>{const r={innerRadius:1,innerSegments:32,outerRadius:4,outerSegments:32,innerRotation:0,startAngle:0,outerRotation:TAU},{innerRadius:t,innerSegments:o,outerRadius:n,outerSegments:s,innerRotation:i,startAngle:a,outerRotation:u}=Object.assign({},r,e);if(!isGT(t,0))throw new Error("innerRadius must be greater than zero");if(!isGTE(o,3))throw new Error("innerSegments must be three or more");if(!isGT(n,0))throw new Error("outerRadius must be greater than zero");if(!isGTE(s,3))throw new Error("outerSegments must be three or more");if(!isGTE(a,0))throw new Error("startAngle must be positive");if(!isGT(u,0))throw new Error("outerRotation must be greater than zero");if(t>=n)throw new Error("inner circle is
|
|
1929
|
+
const{TAU:TAU}=require("../maths/constants"),extrudeRotate=require("../operations/extrusions/extrudeRotate"),{rotate:rotate}=require("../operations/transforms/rotate"),{translate:translate}=require("../operations/transforms/translate"),circle=require("./circle"),{isGT:isGT,isGTE:isGTE}=require("./commonChecks"),torus=e=>{const r={innerRadius:1,innerSegments:32,outerRadius:4,outerSegments:32,innerRotation:0,startAngle:0,outerRotation:TAU},{innerRadius:t,innerSegments:o,outerRadius:n,outerSegments:s,innerRotation:i,startAngle:a,outerRotation:u}=Object.assign({},r,e);if(!isGT(t,0))throw new Error("innerRadius must be greater than zero");if(!isGTE(o,3))throw new Error("innerSegments must be three or more");if(!isGT(n,0))throw new Error("outerRadius must be greater than zero");if(!isGTE(s,3))throw new Error("outerSegments must be three or more");if(!isGTE(a,0))throw new Error("startAngle must be positive");if(!isGT(u,0))throw new Error("outerRotation must be greater than zero");if(t>=n)throw new Error("inner circle is too large to rotate about the outer circle");let m=circle({radius:t,segments:o});return 0!==i&&(m=rotate([0,0,i],m)),m=translate([n,0],m),extrudeRotate({startAngle:a,angle:u,segments:s},m)};module.exports=torus;
|
|
1930
1930
|
|
|
1931
1931
|
},{"../maths/constants":219,"../operations/extrusions/extrudeRotate":441,"../operations/transforms/rotate":489,"../operations/transforms/translate":492,"./circle":494,"./commonChecks":495}],515:[function(require,module,exports){
|
|
1932
1932
|
const{NEPS:NEPS}=require("../maths/constants"),vec2=require("../maths/vec2"),geom2=require("../geometries/geom2"),{isNumberArray:isNumberArray}=require("./commonChecks"),solveAngleFromSSS=(e,r,t)=>Math.acos((e*e+r*r-t*t)/(2*e*r)),solveSideFromSAS=(e,r,t)=>r>NEPS?Math.sqrt(e*e+t*t-2*e*t*Math.cos(r)):Math.sqrt((e-t)*(e-t)+e*t*r*r*(1-r*r/12)),solveAAA=e=>{if(Math.abs(e[0]+e[1]+e[2]-Math.PI)>NEPS)throw new Error("AAA triangles require angles that sum to PI");const r=e[0],t=e[1],s=Math.PI-r-t,a=1/Math.sin(s)*Math.sin(r),n=1/Math.sin(s)*Math.sin(t);return createTriangle(r,t,s,a,n,1)},solveAAS=e=>{const r=e[0],t=e[1],s=Math.PI+NEPS-r-t;if(s<NEPS)throw new Error("AAS triangles require angles that sum to PI");const a=e[2],n=a/Math.sin(r)*Math.sin(t),o=a/Math.sin(r)*Math.sin(s);return createTriangle(r,t,s,a,n,o)},solveASA=e=>{const r=e[0],t=e[2],s=Math.PI+NEPS-r-t;if(s<NEPS)throw new Error("ASA triangles require angles that sum to PI");const a=e[1],n=a/Math.sin(s)*Math.sin(r),o=a/Math.sin(s)*Math.sin(t);return createTriangle(r,t,s,n,o,a)},solveSAS=e=>{const r=e[0],t=e[1],s=e[2],a=solveSideFromSAS(r,t,s),n=solveAngleFromSSS(a,r,s),o=Math.PI-n-t;return createTriangle(n,t,o,s,a,r)},solveSSA=e=>{const r=e[0],t=e[1],s=e[2],a=Math.asin(t*Math.sin(s)/r),n=Math.PI-a-s,o=r/Math.sin(s)*Math.sin(n);return createTriangle(a,n,s,t,o,r)},solveSSS=e=>{const r=e[1],t=e[2],s=e[0];if(r+t<=s||t+s<=r||s+r<=t)throw new Error("SSS triangle is incorrect, as the longest side is longer than the sum of the other sides");const a=solveAngleFromSSS(t,s,r),n=solveAngleFromSSS(s,r,t),o=Math.PI-a-n;return createTriangle(a,n,o,r,t,s)},createTriangle=(e,r,t,s,a,n)=>{const o=vec2.fromValues(0,0),i=vec2.fromValues(n,0),S=vec2.fromValues(s,0);return vec2.add(S,vec2.rotate(S,S,[0,0],Math.PI-r),i),geom2.fromPoints([o,i,S])},triangle=e=>{let{type:r,values:t}=Object.assign({},{type:"SSS",values:[1,1,1]},e);if("string"!=typeof r)throw new Error("triangle type must be a string");if("A"!==(r=r.toUpperCase())[0]&&"S"!==r[0]||"A"!==r[1]&&"S"!==r[1]||"A"!==r[2]&&"S"!==r[2])throw new Error("triangle type must contain three letters; A or S");if(!isNumberArray(t,3))throw new Error("triangle values must contain three values");if(!t.every(e=>e>0))throw new Error("triangle values must be greater than zero");switch(r){case"AAA":return solveAAA(t);case"AAS":return solveAAS(t);case"ASA":return solveASA(t);case"SAS":return solveSAS(t);case"SSA":return solveSSA(t);case"SSS":return solveSSS(t);default:throw new Error("invalid triangle type, try again")}};module.exports=triangle;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jscad/core",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.12",
|
|
4
4
|
"description": "Core functionality for JSCAD Applications",
|
|
5
5
|
"homepage": "https://openjscad.xyz/",
|
|
6
6
|
"repository": "https://github.com/jscad/OpenJSCAD.org",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@jscad/array-utils": "2.1.4",
|
|
39
|
-
"@jscad/io": "2.4.
|
|
40
|
-
"@jscad/io-utils": "2.0.
|
|
41
|
-
"@jscad/modeling": "2.12.
|
|
39
|
+
"@jscad/io": "2.4.11",
|
|
40
|
+
"@jscad/io-utils": "2.0.30",
|
|
41
|
+
"@jscad/modeling": "2.12.5",
|
|
42
42
|
"json5": "2.2.3",
|
|
43
43
|
"strip-bom": "4.0.0"
|
|
44
44
|
},
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"url": "https://opencollective.com/openjscad",
|
|
54
54
|
"logo": "https://opencollective.com/openjscad/logo.txt"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "d8010c4f1d70685404a510d604f8b6d5c362f93a"
|
|
57
57
|
}
|