@mlightcad/cad-simple-viewer-cli 1.7.0 → 1.7.1

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.
@@ -1,19 +1,19 @@
1
- ; Create a new drawing, then export PNG (no input file).
2
- ; Usage:
3
- ; cad-simple-viewer-cli -s examples/create-drawing-png.scr -o ./out --mode write
4
- qnew
5
- line
6
- 0,0
7
- 80,0
8
- 80,50
9
- 0,50
10
- c
11
- circle
12
- 40,25
13
- 12
14
- zoom
15
- e
16
- pngout
17
-
18
- 2048
19
- quit
1
+ ; Create a new drawing, then export PNG (no input file).
2
+ ; Usage:
3
+ ; cad-simple-viewer-cli -s examples/create-drawing-png.scr -o ./out --mode write
4
+ qnew
5
+ line
6
+ 0,0
7
+ 80,0
8
+ 80,50
9
+ 0,50
10
+ c
11
+ circle
12
+ 40,25
13
+ 12
14
+ zoom
15
+ e
16
+ pngout
17
+
18
+ 2048
19
+ quit
@@ -1,17 +1,17 @@
1
- ; Create a new drawing with a rectangle and a circle, then export DXF.
2
- ; Usage:
3
- ; cad-simple-viewer-cli -s examples/create-shapes-dxf.scr -o ./out --mode write
4
- qnew
5
- line
6
- 0,0
7
- 120,0
8
- 120,80
9
- 0,80
10
- c
11
- circle
12
- 60,40
13
- 20
14
- zoom
15
- e
16
- cdxf
17
- quit
1
+ ; Create a new drawing with a rectangle and a circle, then export DXF.
2
+ ; Usage:
3
+ ; cad-simple-viewer-cli -s examples/create-shapes-dxf.scr -o ./out --mode write
4
+ qnew
5
+ line
6
+ 0,0
7
+ 120,0
8
+ 120,80
9
+ 0,80
10
+ c
11
+ circle
12
+ 60,40
13
+ 20
14
+ zoom
15
+ e
16
+ cdxf
17
+ quit
@@ -1,5 +1,5 @@
1
- ; Export the current drawing to DXF (cdxf triggers a browser download).
2
- ; Usage:
3
- ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-dxf.scr -o ./out
4
- cdxf
5
- quit
1
+ ; Export the current drawing to DXF (cdxf triggers a browser download).
2
+ ; Usage:
3
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-dxf.scr -o ./out
4
+ cdxf
5
+ quit
@@ -0,0 +1,18 @@
1
+ ; Zoom extents, export a multi-file ACEX package zip (-chtml Multi),
2
+ ; then export a JPEG preview of the extents view.
3
+ ; Prompts for -chtml: export format / export invisible layers / export layouts /
4
+ ; initial view / viewer mode.
5
+ ; Usage:
6
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-html-multi-preview.scr -o ./out
7
+ zoom
8
+ e
9
+ -chtml
10
+ Multi
11
+ Yes
12
+ Yes
13
+ Extents
14
+ Measure
15
+ jpgout
16
+
17
+ 1024
18
+ quit
@@ -1,13 +1,13 @@
1
- ; Export a multi-file ACEX package as a zip (-chtml Multi).
2
- ; Unzip before hosting so the offline viewer can fetch chunks progressively.
3
- ; Prompts: export format / export invisible layers / export layouts /
4
- ; initial view / viewer mode.
5
- ; Usage:
6
- ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-html-multi.scr -o ./out
7
- -chtml
8
- Multi
9
- Yes
10
- Yes
11
- Extents
12
- Measure
13
- quit
1
+ ; Export a multi-file ACEX package as a zip (-chtml Multi).
2
+ ; Unzip before hosting so the offline viewer can fetch chunks progressively.
3
+ ; Prompts: export format / export invisible layers / export layouts /
4
+ ; initial view / viewer mode.
5
+ ; Usage:
6
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-html-multi.scr -o ./out
7
+ -chtml
8
+ Multi
9
+ Yes
10
+ Yes
11
+ Extents
12
+ Measure
13
+ quit
@@ -1,12 +1,12 @@
1
- ; Export a self-contained offline HTML viewer (-chtml).
2
- ; Prompts: export format / export invisible layers / export layouts /
3
- ; initial view / viewer mode.
4
- ; Usage:
5
- ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-html.scr -o ./out
6
- -chtml
7
- Single
8
- Yes
9
- Yes
10
- Extents
11
- Measure
12
- quit
1
+ ; Export a self-contained offline HTML viewer (-chtml).
2
+ ; Prompts: export format / export invisible layers / export layouts /
3
+ ; initial view / viewer mode.
4
+ ; Usage:
5
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-html.scr -o ./out
6
+ -chtml
7
+ Single
8
+ Yes
9
+ Yes
10
+ Extents
11
+ Measure
12
+ quit
@@ -0,0 +1,9 @@
1
+ ; export-pdf.scr
2
+ zoom
3
+ e
4
+ -cpdf
5
+ Extents
6
+ Yes
7
+ Text
8
+
9
+ quit
@@ -1,9 +1,9 @@
1
- ; Zoom extents, then export the drawing extents as PNG (long side 2048px).
2
- ; Usage:
3
- ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-png.scr -o ./out
4
- zoom
5
- e
6
- pngout
7
-
8
- 2048
9
- quit
1
+ ; Zoom extents, then export the drawing extents as PNG (long side 2048px).
2
+ ; Usage:
3
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-png.scr -o ./out
4
+ zoom
5
+ e
6
+ pngout
7
+
8
+ 2048
9
+ quit
@@ -1,15 +1,15 @@
1
- ; Turn off a layer via -LAYER, then export PNG.
2
- ; Requires --mode write (layer edits need Write open mode).
3
- ; Replace LAYER_NAME below with a real layer in your drawing.
4
- ; Usage:
5
- ; cad-simple-viewer-cli -i drawing.dwg -s examples/freeze-layer-png.scr -o ./out --mode write
6
- -layer
7
- Off
8
- LAYER_NAME
9
-
10
- zoom
11
- e
12
- pngout
13
-
14
- 2048
15
- quit
1
+ ; Turn off a layer via -LAYER, then export PNG.
2
+ ; Requires --mode write (layer edits need Write open mode).
3
+ ; Replace LAYER_NAME below with a real layer in your drawing.
4
+ ; Usage:
5
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/freeze-layer-png.scr -o ./out --mode write
6
+ -layer
7
+ Off
8
+ LAYER_NAME
9
+
10
+ zoom
11
+ e
12
+ pngout
13
+
14
+ 2048
15
+ quit
@@ -1,96 +1,114 @@
1
- {
2
- "fixtureDrawing": "https://cdn.jsdelivr.net/gh/mlightcad/cad-data@main/data/canteen.dwg",
3
- "defaultOutputDir": "tmp/examples-gallery",
4
- "examples": [
5
- {
6
- "id": "create-drawing-dxf",
7
- "title": "Create drawing -> DXF",
8
- "description": "qnew, draw a closed rectangle with LINE, export DXF. No input file.",
9
- "script": "create-drawing-dxf.scr",
10
- "mode": "write",
11
- "inputKind": "none",
12
- "runnable": true
13
- },
14
- {
15
- "id": "create-shapes-dxf",
16
- "title": "Create shapes -> DXF",
17
- "description": "qnew, draw a rectangle and a circle, export DXF.",
18
- "script": "create-shapes-dxf.scr",
19
- "mode": "write",
20
- "inputKind": "none",
21
- "runnable": true
22
- },
23
- {
24
- "id": "create-drawing-png",
25
- "title": "Create drawing -> PNG",
26
- "description": "qnew, draw geometry, zoom extents, export PNG.",
27
- "script": "create-drawing-png.scr",
28
- "mode": "write",
29
- "inputKind": "none",
30
- "runnable": true
31
- },
32
- {
33
- "id": "export-png",
34
- "title": "Export PNG",
35
- "description": "Zoom extents and export the drawing as PNG (long side 2048).",
36
- "script": "export-png.scr",
37
- "mode": "read",
38
- "inputKind": "file",
39
- "runnable": true
40
- },
41
- {
42
- "id": "export-html",
43
- "title": "Export HTML",
44
- "description": "Export a self-contained offline HTML viewer (-chtml).",
45
- "script": "export-html.scr",
46
- "mode": "read",
47
- "inputKind": "file",
48
- "runnable": true
49
- },
50
- {
51
- "id": "export-html-multi",
52
- "title": "Export HTML (multi-file)",
53
- "description": "Export a multi-file ACEX package zip for progressive loading (-chtml Multi).",
54
- "script": "export-html-multi.scr",
55
- "mode": "read",
56
- "inputKind": "file",
57
- "runnable": true
58
- },
59
- {
60
- "id": "export-dxf",
61
- "title": "Export DXF",
62
- "description": "Convert the open drawing to DXF (cdxf).",
63
- "script": "export-dxf.scr",
64
- "mode": "read",
65
- "inputKind": "file",
66
- "runnable": true
67
- },
68
- {
69
- "id": "freeze-layer-png",
70
- "title": "Layer off -> PNG",
71
- "description": "Turn off a layer with -LAYER, then export PNG. Edit LAYER_NAME in the script first.",
72
- "script": "freeze-layer-png.scr",
73
- "mode": "write",
74
- "inputKind": "file",
75
- "runnable": true
76
- },
77
- {
78
- "id": "batch-export-png",
79
- "title": "Batch export PNG",
80
- "description": "Scan a folder of DWG/DXF files and export each to PNG.",
81
- "script": "batch-export-png.mjs",
82
- "kind": "batch",
83
- "inputKind": "directory",
84
- "runnable": true
85
- },
86
- {
87
- "id": "batch-export-html",
88
- "title": "Batch export HTML",
89
- "description": "Scan a folder and export each drawing to HTML.",
90
- "script": "batch-export-html.mjs",
91
- "kind": "batch",
92
- "inputKind": "directory",
93
- "runnable": true
94
- }
95
- ]
96
- }
1
+ {
2
+ "fixtureDrawing": "https://cdn.jsdelivr.net/gh/mlightcad/cad-data@main/data/canteen.dwg",
3
+ "defaultOutputDir": "tmp/examples-gallery",
4
+ "examples": [
5
+ {
6
+ "id": "create-drawing-dxf",
7
+ "title": "Create drawing -> DXF",
8
+ "description": "qnew, draw a closed rectangle with LINE, export DXF. No input file.",
9
+ "script": "create-drawing-dxf.scr",
10
+ "mode": "write",
11
+ "inputKind": "none",
12
+ "runnable": true
13
+ },
14
+ {
15
+ "id": "create-shapes-dxf",
16
+ "title": "Create shapes -> DXF",
17
+ "description": "qnew, draw a rectangle and a circle, export DXF.",
18
+ "script": "create-shapes-dxf.scr",
19
+ "mode": "write",
20
+ "inputKind": "none",
21
+ "runnable": true
22
+ },
23
+ {
24
+ "id": "create-drawing-png",
25
+ "title": "Create drawing -> PNG",
26
+ "description": "qnew, draw geometry, zoom extents, export PNG.",
27
+ "script": "create-drawing-png.scr",
28
+ "mode": "write",
29
+ "inputKind": "none",
30
+ "runnable": true
31
+ },
32
+ {
33
+ "id": "export-png",
34
+ "title": "Export PNG",
35
+ "description": "Zoom extents and export the drawing as PNG (long side 2048).",
36
+ "script": "export-png.scr",
37
+ "mode": "read",
38
+ "inputKind": "file",
39
+ "runnable": true
40
+ },
41
+ {
42
+ "id": "export-html",
43
+ "title": "Export HTML",
44
+ "description": "Export a self-contained offline HTML viewer (-chtml).",
45
+ "script": "export-html.scr",
46
+ "mode": "read",
47
+ "inputKind": "file",
48
+ "runnable": true
49
+ },
50
+ {
51
+ "id": "export-html-multi",
52
+ "title": "Export HTML (multi-file)",
53
+ "description": "Export a multi-file ACEX package zip for progressive loading (-chtml Multi).",
54
+ "script": "export-html-multi.scr",
55
+ "mode": "read",
56
+ "inputKind": "file",
57
+ "runnable": true
58
+ },
59
+ {
60
+ "id": "export-html-multi-preview",
61
+ "title": "Export HTML multi + preview",
62
+ "description": "Zoom extents, export multi-file ACEX zip (-chtml Multi), then JPEG preview.",
63
+ "script": "export-html-multi-preview.scr",
64
+ "mode": "read",
65
+ "inputKind": "file",
66
+ "runnable": true
67
+ },
68
+ {
69
+ "id": "export-dxf",
70
+ "title": "Export DXF",
71
+ "description": "Convert the open drawing to DXF (cdxf).",
72
+ "script": "export-dxf.scr",
73
+ "mode": "read",
74
+ "inputKind": "file",
75
+ "runnable": true
76
+ },
77
+ {
78
+ "id": "freeze-layer-png",
79
+ "title": "Layer off -> PNG",
80
+ "description": "Turn off a layer with -LAYER, then export PNG. Edit LAYER_NAME in the script first.",
81
+ "script": "freeze-layer-png.scr",
82
+ "mode": "write",
83
+ "inputKind": "file",
84
+ "runnable": true
85
+ },
86
+ {
87
+ "id": "batch-export-png",
88
+ "title": "Batch export PNG",
89
+ "description": "Scan a folder of DWG/DXF files and export each to PNG.",
90
+ "script": "batch-export-png.mjs",
91
+ "kind": "batch",
92
+ "inputKind": "directory",
93
+ "runnable": true
94
+ },
95
+ {
96
+ "id": "batch-export-html",
97
+ "title": "Batch export HTML",
98
+ "description": "Scan a folder and export each drawing to HTML.",
99
+ "script": "batch-export-html.mjs",
100
+ "kind": "batch",
101
+ "inputKind": "directory",
102
+ "runnable": true
103
+ },
104
+ {
105
+ "id": "batch-export-html-multi-preview",
106
+ "title": "Batch export HTML multi + preview",
107
+ "description": "Scan a folder, export multi ACEX zip + extents preview, package like demo-drawings.",
108
+ "script": "batch-export-html-multi-preview.mjs",
109
+ "kind": "batch",
110
+ "inputKind": "directory",
111
+ "runnable": true
112
+ }
113
+ ]
114
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/cad-simple-viewer-cli",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "AcCoreConsole-style headless CLI: run .scr command scripts against DXF/DWG drawings",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -42,15 +42,16 @@
42
42
  "script"
43
43
  ],
44
44
  "dependencies": {
45
- "@mlightcad/data-model": "^1.14.5",
46
- "@mlightcad/libredwg-converter": "^3.14.5",
47
- "@mlightcad/mtext-renderer": "^0.12.7",
45
+ "@mlightcad/data-model": "^1.14.8",
46
+ "@mlightcad/libredwg-converter": "^3.14.8",
47
+ "@mlightcad/mtext-renderer": "^0.12.12",
48
48
  "commander": "^12.1.0",
49
49
  "playwright": "^1.49.1",
50
- "@mlightcad/cad-html-plugin": "1.7.0",
51
- "@mlightcad/cad-svg-plugin": "1.7.0",
52
- "@mlightcad/cad-simple-viewer": "1.7.0",
53
- "@mlightcad/cad-pdf-plugin": "1.7.0"
50
+ "@mlightcad/cad-html-plugin": "1.7.1",
51
+ "@mlightcad/cad-simple-viewer": "1.7.1",
52
+ "@mlightcad/cad-pdf-plugin": "1.7.1",
53
+ "@mlightcad/pdf-renderer": "1.7.1",
54
+ "@mlightcad/cad-svg-plugin": "1.7.1"
54
55
  },
55
56
  "devDependencies": {
56
57
  "@types/node": "^20.14.9",