@jscad/cli 3.0.0-alpha.0 → 3.0.2-alpha.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/888.js +54 -0
- package/888.svg +1 -0
- package/CHANGELOG.md +17 -0
- package/LICENSE +1 -1
- package/a.svg +3 -0
- package/b.svg +7 -0
- package/package.json +7 -7
- package/test.js +34 -0
- package/test.stl +0 -0
package/888.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//
|
|
2
|
+
// producer: JSCAD SVG Deserializer [VI]{version}[/VI]
|
|
3
|
+
// date: Sun Aug 24 2025 06:25:00 GMT+0900 (Japan Standard Time)
|
|
4
|
+
// source: 888.svg
|
|
5
|
+
//
|
|
6
|
+
const { colors, geometries, primitives, transforms } = require('@jscad/modeling')
|
|
7
|
+
|
|
8
|
+
function main(params) {
|
|
9
|
+
let levels = {}
|
|
10
|
+
let paths = {}
|
|
11
|
+
let parts
|
|
12
|
+
levels.l0 = []
|
|
13
|
+
parts = [] // line 2,557
|
|
14
|
+
paths.p01 = path2.fromPoints({}, [[1.515533214,-1.8626665199999997]])
|
|
15
|
+
paths.p01 = path2.appendPoints([[1.515533214,-1.8852442959999998]], paths.p01)
|
|
16
|
+
paths.p01 = path2.appendBezier({segments: 32, controlPoints: [[1.515533214,-2.1298368693333334], [1.464733218,-2.317985002666666], [1.363133226,-2.4496886959999995]]}, paths.p01)
|
|
17
|
+
paths.p01 = path2.appendBezier({segments: 32, controlPoints: [[1.2615332339999998,-2.581392389333333], [1.1194813933333332,-2.647244236], [0.9369777039999999,-2.647244236]]}, paths.p01)
|
|
18
|
+
paths.p01 = path2.appendPoints([[0.9369777039999999,-2.647244236]], paths.p01)
|
|
19
|
+
paths.p01 = path2.appendBezier({segments: 32, controlPoints: [[0.7845777159999998,-2.647244236], [0.6622814293333332,-2.5870368333333333], [0.5700888439999999,-2.4666220279999997]]}, paths.p01)
|
|
20
|
+
paths.p01 = path2.appendPoints([[0.5700888439999999,-2.4666220279999997]], paths.p01)
|
|
21
|
+
paths.p01 = path2.appendPoints([[0.55033329,-2.6190220159999997]], paths.p01)
|
|
22
|
+
paths.p01 = path2.appendPoints([[0.13264443399999998,-2.6190220159999997]], paths.p01)
|
|
23
|
+
paths.p01 = path2.appendPoints([[0.13264443399999998,-0.502355516]], paths.p01)
|
|
24
|
+
paths.p01 = path2.appendPoints([[0.598311064,-0.502355516]], paths.p01)
|
|
25
|
+
paths.p01 = path2.appendPoints([[0.598311064,-1.2474221239999999]], paths.p01)
|
|
26
|
+
paths.p01 = path2.appendBezier({segments: 32, controlPoints: [[0.6848592053333333,-1.1495850946666666], [0.7968073446666666,-1.10066658], [0.9341554819999999,-1.10066658]]}, paths.p01)
|
|
27
|
+
paths.p01 = path2.appendPoints([[0.9341554819999999,-1.10066658]], paths.p01)
|
|
28
|
+
paths.p01 = path2.appendBezier({segments: 32, controlPoints: [[1.1185406526666666,-1.10066658], [1.2615332339999998,-1.1665184266666664], [1.363133226,-1.2982221199999997]]}, paths.p01)
|
|
29
|
+
paths.p01 = path2.appendBezier({segments: 32, controlPoints: [[1.464733218,-1.4318072946666665], [1.515533214,-1.619955428], [1.515533214,-1.8626665199999997]]}, paths.p01)
|
|
30
|
+
paths.p01 = path2.appendPoints([[1.515533214,-1.8626665199999997]], paths.p01)
|
|
31
|
+
paths.p01 = path2.close(paths.p01)
|
|
32
|
+
parts.push(paths.p01)
|
|
33
|
+
paths.p02 = path2.fromPoints({}, [[1.0498665839999999,-1.8570220759999998]])
|
|
34
|
+
paths.p02 = path2.appendPoints([[1.0498665839999999,-1.8570220759999998]], paths.p02)
|
|
35
|
+
paths.p02 = path2.appendBezier({segments: 32, controlPoints: [[1.0498665839999999,-1.7140294946666665], [1.0301110299999998,-1.6114887619999998], [0.9905999219999998,-1.549399878]]}, paths.p02)
|
|
36
|
+
paths.p02 = path2.appendBezier({segments: 32, controlPoints: [[0.9529702953333332,-1.4891924753333332], [0.8946443739999999,-1.4590887739999998], [0.8156221579999999,-1.4590887739999998]]}, paths.p02)
|
|
37
|
+
paths.p02 = path2.appendPoints([[0.8156221579999999,-1.4590887739999998]], paths.p02)
|
|
38
|
+
paths.p02 = path2.appendBezier({segments: 32, controlPoints: [[0.7102592033333333,-1.4590887739999998], [0.6378221719999999,-1.4985998819999997], [0.598311064,-1.5776220979999998]]}, paths.p02)
|
|
39
|
+
paths.p02 = path2.appendPoints([[0.598311064,-1.5776220979999998]], paths.p02)
|
|
40
|
+
paths.p02 = path2.appendPoints([[0.598311064,-2.1702887179999997]], paths.p02)
|
|
41
|
+
paths.p02 = path2.appendBezier({segments: 32, controlPoints: [[0.637822172,-2.2493109339999995], [0.711199944,-2.2888220419999996], [0.8184443799999999,-2.2888220419999996]]}, paths.p02)
|
|
42
|
+
paths.p02 = path2.appendPoints([[0.8184443799999999,-2.2888220419999996]], paths.p02)
|
|
43
|
+
paths.p02 = path2.appendBezier({segments: 32, controlPoints: [[0.9275702973333332,-2.2888220419999996], [0.9971851066666665,-2.235199824], [1.027288808,-2.1279553879999997]]}, paths.p02)
|
|
44
|
+
paths.p02 = path2.appendPoints([[1.027288808,-2.1279553879999997]], paths.p02)
|
|
45
|
+
paths.p02 = path2.appendBezier({segments: 32, controlPoints: [[1.0423406586666666,-2.0771553919999994], [1.0498665839999999,-1.9868442879999995], [1.0498665839999999,-1.8570220759999998]]}, paths.p02)
|
|
46
|
+
paths.p02 = path2.close(paths.p02)
|
|
47
|
+
parts.push(paths.p02)
|
|
48
|
+
paths.p0 = parts
|
|
49
|
+
levels.l0 = levels.l0.concat(paths.p0)
|
|
50
|
+
|
|
51
|
+
return levels.l0
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
module.exports = { main }
|
package/888.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="5.6298828125" height="11.71875"><path d="M5.37 6.60L5.37 6.68Q5.37 7.98 4.83 8.68Q4.29 9.38 3.32 9.38L3.32 9.38Q2.51 9.38 2.02 8.74L2.02 8.74L1.95 9.28L0.47 9.28L0.47 1.78L2.12 1.78L2.12 4.42Q2.58 3.90 3.31 3.90L3.31 3.90Q4.29 3.90 4.83 4.60Q5.37 5.31 5.37 6.60L5.37 6.60ZM3.72 6.58L3.72 6.58Q3.72 5.82 3.51 5.49Q3.31 5.17 2.89 5.17L2.89 5.17Q2.33 5.17 2.12 5.59L2.12 5.59L2.12 7.69Q2.33 8.11 2.90 8.11L2.90 8.11Q3.48 8.11 3.64 7.54L3.64 7.54Q3.72 7.27 3.72 6.58Z"/></svg>
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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
|
+
## [3.0.2-alpha.0](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/cli@3.0.1-alpha.0...@jscad/cli@3.0.2-alpha.0) (2025-09-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @jscad/cli
|
|
9
|
+
|
|
10
|
+
## [3.0.1-alpha.0](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/cli@2.2.24...@jscad/cli@3.0.1-alpha.0) (2025-01-03)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **cli:** rework logic for generating blobs, both singular and multiple as parts ([f88669b](https://github.com/jscad/OpenJSCAD.org/commit/f88669b286d9564165f5c33944703fce730dfc1f))
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **3mf-deserializer:** initial version of 3MF deserializer and tests ([b22a27f](https://github.com/jscad/OpenJSCAD.org/commit/b22a27fa14c4f42b9160553cdd7b3c126ac72459))
|
|
19
|
+
* **cli:** reworked logic to use new io package exports and functions ([#1199](https://github.com/jscad/OpenJSCAD.org/issues/1199)) ([71a3d27](https://github.com/jscad/OpenJSCAD.org/commit/71a3d27a4cf416b1a9fea57a1fe40f5cfdaa905c))
|
|
20
|
+
* **modeling:** reworked exports to expose a flattened API ([8235238](https://github.com/jscad/OpenJSCAD.org/commit/8235238ad63d063f1e501478cae1208deb130a9c))
|
|
21
|
+
* **regl-renderer:** added rollup configuration to create ES6 bundle, adjusted imports and exports ([#1259](https://github.com/jscad/OpenJSCAD.org/issues/1259)) ([47a66bc](https://github.com/jscad/OpenJSCAD.org/commit/47a66bc07a137a748ce8571ea5d043ebaab9418d))
|
|
22
|
+
|
|
6
23
|
# [3.0.0-alpha.0](https://github.com/jscad/OpenJSCAD.org/compare/@jscad/cli@2.2.24...@jscad/cli@3.0.0-alpha.0) (2023-10-09)
|
|
7
24
|
|
|
8
25
|
### Bug Fixes
|
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-2025 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/a.svg
ADDED
package/b.svg
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg>
|
|
2
|
+
<path
|
|
3
|
+
style="color:#000000;fill:#000000;-inkscape-stroke:none"
|
|
4
|
+
d="m 30,24.390625 c -9.148585,0 -17.605395,4.881781 -22.1796875,12.804687 -4.5742924,7.922907 -4.5742924,17.686469 0,25.609375 C 12.394605,70.727594 20.851415,75.609375 30,75.609375 H 70 C 84.136772,75.609374 95.609375,64.136772 95.609375,50 95.609375,35.863227 84.136773,24.390625 70,24.390625 Z m 0,1.21875 H 70 C 83.477437,25.609375 94.390625,36.522563 94.390625,50 94.390625,63.477436 83.477436,74.390624 70,74.390625 H 30 c -8.714677,0 -16.765708,-4.648181 -21.1230469,-12.195313 -4.3573385,-7.547131 -4.3573385,-16.843493 0,-24.390625 C 13.234292,30.257556 21.285323,25.609375 30,25.609375 Z"
|
|
5
|
+
id="path880"
|
|
6
|
+
/>
|
|
7
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jscad/cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2-alpha.0",
|
|
4
4
|
"description": "Command Line Interface (CLI) for JSCAD",
|
|
5
5
|
"homepage": "https://openjscad.xyz/",
|
|
6
6
|
"repository": "https://github.com/jscad/OpenJSCAD.org",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
],
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@jscad/array-utils": "3.0.
|
|
40
|
-
"@jscad/core": "3.0.
|
|
41
|
-
"@jscad/io": "3.0.
|
|
42
|
-
"@jscad/io-utils": "3.0.
|
|
43
|
-
"@jscad/modeling": "3.0.
|
|
39
|
+
"@jscad/array-utils": "3.0.1-alpha.0",
|
|
40
|
+
"@jscad/core": "3.0.2-alpha.0",
|
|
41
|
+
"@jscad/io": "3.0.2-alpha.0",
|
|
42
|
+
"@jscad/io-utils": "3.0.2-alpha.0",
|
|
43
|
+
"@jscad/modeling": "3.0.2-alpha.0",
|
|
44
44
|
"jszip": "^3.10.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"url": "https://opencollective.com/openjscad",
|
|
53
53
|
"logo": "https://opencollective.com/openjscad/logo.txt"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "ac80d1a7cb0a8efb21aff9193d4a8bccb6e31f1c"
|
|
56
56
|
}
|
package/test.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { extrudeLinear } from '@jscad/modeling'
|
|
2
|
+
import { deserializers } from '@jscad/io'
|
|
3
|
+
|
|
4
|
+
export const main = () => {
|
|
5
|
+
let svg1087 = `
|
|
6
|
+
<svg>
|
|
7
|
+
<path
|
|
8
|
+
style="color:#000000;fill:#000000;-inkscape-stroke:none"
|
|
9
|
+
d="m 30,24.390625 c -9.148585,0 -17.605395,4.881781 -22.1796875,12.804687 -4.5742924,7.922907 -4.5742924,17.686469 0,25.609375 C 12.394605,70.727594 20.851415,75.609375 30,75.609375 H 70 C 84.136772,75.609374 95.609375,64.136772 95.609375,50 95.609375,35.863227 84.136773,24.390625 70,24.390625 Z m 0,1.21875 H 70 C 83.477437,25.609375 94.390625,36.522563 94.390625,50 94.390625,63.477436 83.477436,74.390624 70,74.390625 H 30 c -8.714677,0 -16.765708,-4.648181 -21.1230469,-12.195313 -4.3573385,-7.547131 -4.3573385,-16.843493 0,-24.390625 C 13.234292,30.257556 21.285323,25.609375 30,25.609375 Z"
|
|
10
|
+
id="path880"
|
|
11
|
+
/>
|
|
12
|
+
</svg>
|
|
13
|
+
`
|
|
14
|
+
let svg888 = `
|
|
15
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="5.6298828125" height="11.71875"><path d="M5.37 6.60L5.37 6.68Q5.37 7.98 4.83 8.68Q4.29 9.38 3.32 9.38L3.32 9.38Q2.51 9.38 2.02 8.74L2.02 8.74L1.95 9.28L0.47 9.28L0.47 1.78L2.12 1.78L2.12 4.42Q2.58 3.90 3.31 3.90L3.31 3.90Q4.29 3.90 4.83 4.60Q5.37 5.31 5.37 6.60L5.37 6.60ZM3.72 6.58L3.72 6.58Q3.72 5.82 3.51 5.49Q3.31 5.17 2.89 5.17L2.89 5.17Q2.33 5.17 2.12 5.59L2.12 5.59L2.12 7.69Q2.33 8.11 2.90 8.11L2.90 8.11Q3.48 8.11 3.64 7.54L3.64 7.54Q3.72 7.27 3.72 6.58Z"/></svg>
|
|
16
|
+
`
|
|
17
|
+
let sTEST = `
|
|
18
|
+
<svg>
|
|
19
|
+
<path d="m3 9h6v-6h-6v6zm1-5h4v4h-4v-4zm-4 8h12v-12h-12v12zm1-11h10v10h-10v-10" fill="#000"/>
|
|
20
|
+
</svg>
|
|
21
|
+
`
|
|
22
|
+
let s_text = `
|
|
23
|
+
<svg>
|
|
24
|
+
<path id="Triangle_stroke_MLZ" fill="none" stroke="#000000" d=" M 62.00000 56.00000 L 113.96152 146.00000 L 10.03848 146.00000 L 62.00000 56.00000 Z M 62.00000 71.00000 L 100.97114 138.50000 L 23.02886 138.50000 L 62.00000 71.00000 Z "/>
|
|
25
|
+
</svg>
|
|
26
|
+
`
|
|
27
|
+
|
|
28
|
+
let ds = deserializers['image/svg+xml']
|
|
29
|
+
console.log(ds)
|
|
30
|
+
let s = ds({ output: "geometry", target: "geom2"}, s_text)
|
|
31
|
+
s = extrudeLinear({ height: 10 }, s)
|
|
32
|
+
return s
|
|
33
|
+
}
|
|
34
|
+
|
package/test.stl
ADDED
|
Binary file
|