geomui 0.5.36 → 0.5.38
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 +16 -50
- package/dist/Drawing.svelte +1 -1
- package/dist/Drawing.svelte.d.ts +1 -0
- package/dist/InputParams.svelte +7 -2
- package/dist/InputParams.svelte.d.ts +1 -0
- package/dist/OneDesign.svelte +1 -1
- package/dist/ParamDrawExport.svelte +8 -3
- package/dist/SimpleDrawing.svelte +6 -1
- package/dist/SimpleDrawing.svelte.d.ts +1 -0
- package/package.json +45 -44
package/README.md
CHANGED
|
@@ -5,64 +5,30 @@ Geomui
|
|
|
5
5
|
Presentation
|
|
6
6
|
------------
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
*Geomui* is the svelte library of [parametrix](https://charlyoleg2.github.io/parametrix/).
|
|
9
|
+
The top-level component is *OneDesign*. It expose the parameters and the rendering of a *design*.
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
SVG files
|
|
13
|
+
---------
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
The svg-files, that describe the parameters, are expected to be copied in the directory *static/pgdsvg*. Per convention, each *design-library* should provide its svg-files in the directory *dist/pgdsvg*.
|
|
14
16
|
|
|
15
|
-
Read more about creating a library [in the docs](https://kit.svelte.dev/docs/packaging).
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
If you're seeing this, you've probably already done this step. Congrats!
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
# create a new project in the current directory
|
|
23
|
-
npm create svelte@latest
|
|
24
|
-
|
|
25
|
-
# create a new project in my-app
|
|
26
|
-
npm create svelte@latest my-app
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Developing
|
|
30
|
-
|
|
31
|
-
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm run dev
|
|
35
|
-
|
|
36
|
-
# or start the server and open the app in a new browser tab
|
|
37
|
-
npm run dev -- --open
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
|
|
41
|
-
|
|
42
|
-
## Building
|
|
43
|
-
|
|
44
|
-
To build your library:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
npm run package
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
To create a production version of your showcase app:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
npm run build
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
You can preview the production build with `npm run preview`.
|
|
57
|
-
|
|
58
|
-
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
|
18
|
+
Requirements
|
|
19
|
+
------------
|
|
59
20
|
|
|
60
|
-
|
|
21
|
+
- [node](https://nodejs.org) > 20.10.0
|
|
22
|
+
- [npm](https://docs.npmjs.com/cli) > 10.5.0
|
|
61
23
|
|
|
62
|
-
Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
|
|
63
24
|
|
|
64
|
-
|
|
25
|
+
Getting started
|
|
26
|
+
---------------
|
|
65
27
|
|
|
66
28
|
```bash
|
|
67
|
-
|
|
29
|
+
git clone https://github.com/charlyoleg2/parametrix
|
|
30
|
+
cd parametrix
|
|
31
|
+
npm install
|
|
32
|
+
npm run ci
|
|
33
|
+
npm run preview
|
|
68
34
|
```
|
package/dist/Drawing.svelte
CHANGED
|
@@ -17,6 +17,7 @@ export let pDef;
|
|
|
17
17
|
export let fgeom;
|
|
18
18
|
export let optFaces;
|
|
19
19
|
export let selFace;
|
|
20
|
+
export let zAdjust;
|
|
20
21
|
export let simTime = 0;
|
|
21
22
|
const c_ParametrixAll = "ParametrixAll";
|
|
22
23
|
let windowWidth;
|
|
@@ -25,7 +26,6 @@ let canvasZoom;
|
|
|
25
26
|
const canvas_size_min = 400;
|
|
26
27
|
let aFigure;
|
|
27
28
|
let cAdjust;
|
|
28
|
-
let zAdjust;
|
|
29
29
|
function canvasRedrawFull(iLayers) {
|
|
30
30
|
const ctx1 = canvasFull.getContext("2d");
|
|
31
31
|
ctx1.clearRect(0, 0, ctx1.canvas.width, ctx1.canvas.height);
|
package/dist/Drawing.svelte.d.ts
CHANGED
package/dist/InputParams.svelte
CHANGED
|
@@ -3,7 +3,7 @@ import ModalImg from "./ModalImg.svelte";
|
|
|
3
3
|
import LocStorWrite from "./LocStorWrite.svelte";
|
|
4
4
|
import LocStorRead from "./LocStorRead.svelte";
|
|
5
5
|
import SimpleDrawing from "./SimpleDrawing.svelte";
|
|
6
|
-
import { PType, parseParamFile, createParamFile } from "geometrix";
|
|
6
|
+
import { PType, parseParamFile, createParamFile, adjustZero } from "geometrix";
|
|
7
7
|
import { storePV } from "./storePVal";
|
|
8
8
|
import { downloadParams, generateUrl } from "./downloadParams";
|
|
9
9
|
import { onMount, createEventDispatcher } from "svelte";
|
|
@@ -14,7 +14,9 @@ const dispatch = createEventDispatcher();
|
|
|
14
14
|
export let pDef;
|
|
15
15
|
export let fgeom;
|
|
16
16
|
export let selFace;
|
|
17
|
+
export let zAdjust;
|
|
17
18
|
export let simTime = 0;
|
|
19
|
+
const cAdjustZero = adjustZero();
|
|
18
20
|
let inputComment = "";
|
|
19
21
|
function paramChange() {
|
|
20
22
|
dispatch("paramChg", { foo: "bla" });
|
|
@@ -383,7 +385,10 @@ $: {
|
|
|
383
385
|
<img src={paramSvg} alt={paramSvg} />
|
|
384
386
|
</button>
|
|
385
387
|
<div class="mini-canvas">
|
|
386
|
-
<SimpleDrawing pageName={pDef.partName} {fgeom} {selFace} {simTime} />
|
|
388
|
+
<SimpleDrawing pageName={pDef.partName} {fgeom} {selFace} zAdjust={cAdjustZero} {simTime} />
|
|
389
|
+
</div>
|
|
390
|
+
<div class="mini-canvas">
|
|
391
|
+
<SimpleDrawing pageName={pDef.partName} {fgeom} {selFace} {zAdjust} {simTime} />
|
|
387
392
|
</div>
|
|
388
393
|
</section>
|
|
389
394
|
|
package/dist/OneDesign.svelte
CHANGED
|
@@ -8,7 +8,7 @@ $:
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<h1>{pageDef.pTitle}</h1>
|
|
11
|
-
<article>{pageDef.pDescription}</article>
|
|
11
|
+
<article>[{pageDef.pDef.partName}]: {pageDef.pDescription}</article>
|
|
12
12
|
<DrawingList pDef={pageDef.pDef} />
|
|
13
13
|
<ParamDrawExport pDef={pageDef.pDef} fgeom={pageDef.pGeom} {pLink} />
|
|
14
14
|
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
fileTextContent,
|
|
5
5
|
fileSuffix,
|
|
6
6
|
fileMime,
|
|
7
|
-
fileBin
|
|
7
|
+
fileBin,
|
|
8
|
+
adjustZero
|
|
8
9
|
} from "geometrix";
|
|
9
10
|
import InputParams from "./InputParams.svelte";
|
|
10
11
|
import Drawing from "./Drawing.svelte";
|
|
@@ -25,6 +26,7 @@ let optFaces = [];
|
|
|
25
26
|
let exportFace;
|
|
26
27
|
let selFace;
|
|
27
28
|
let simTime = 0;
|
|
29
|
+
let zAdjust = adjustZero();
|
|
28
30
|
let logValue = "Dummy initial\nWill be replaced during onMount\n";
|
|
29
31
|
let calcErr = false;
|
|
30
32
|
let calcWarn = false;
|
|
@@ -84,6 +86,8 @@ async function downloadExport(iExportFace) {
|
|
|
84
86
|
exportFormat = EFormat.eSVGALL;
|
|
85
87
|
} else if (iExportFace === "alldxf") {
|
|
86
88
|
exportFormat = EFormat.eDXFALL;
|
|
89
|
+
} else if (iExportFace === "compute_log") {
|
|
90
|
+
exportFormat = EFormat.eTXTLOG;
|
|
87
91
|
} else if (iExportFace === "pax") {
|
|
88
92
|
exportFormat = EFormat.ePAX;
|
|
89
93
|
} else if (iExportFace === "oscad") {
|
|
@@ -124,7 +128,7 @@ async function downloadExport2() {
|
|
|
124
128
|
}
|
|
125
129
|
</script>
|
|
126
130
|
|
|
127
|
-
<InputParams {pDef} on:paramChg={paramChange} {fgeom} {selFace} {simTime} />
|
|
131
|
+
<InputParams {pDef} on:paramChg={paramChange} {fgeom} {selFace} {zAdjust} {simTime} />
|
|
128
132
|
<section>
|
|
129
133
|
<h2>Log</h2>
|
|
130
134
|
<textarea
|
|
@@ -137,7 +141,7 @@ async function downloadExport2() {
|
|
|
137
141
|
class:colorWarn={calcWarn}
|
|
138
142
|
/>
|
|
139
143
|
</section>
|
|
140
|
-
<Drawing {pDef} {fgeom} {optFaces} bind:selFace bind:simTime />
|
|
144
|
+
<Drawing {pDef} {fgeom} {optFaces} bind:selFace bind:zAdjust bind:simTime />
|
|
141
145
|
<section>
|
|
142
146
|
<h2>Export</h2>
|
|
143
147
|
<select bind:value={exportFace}>
|
|
@@ -149,6 +153,7 @@ async function downloadExport2() {
|
|
|
149
153
|
<option value="dxf_{optFace}">face {optFace} as dxf</option>
|
|
150
154
|
{/each}
|
|
151
155
|
<option value="alldxf">all faces merged as dxf</option>
|
|
156
|
+
<option value="compute_log">compute.log as log-file</option>
|
|
152
157
|
<option value="pax">all faces as pax.json</option>
|
|
153
158
|
<option value="oscad">all faces as openscad.scad</option>
|
|
154
159
|
<option value="ojscad">all faces as OpenJScad.js</option>
|
|
@@ -5,6 +5,7 @@ import { onMount } from "svelte";
|
|
|
5
5
|
export let pageName;
|
|
6
6
|
export let fgeom;
|
|
7
7
|
export let selFace;
|
|
8
|
+
export let zAdjust;
|
|
8
9
|
export let simTime = 0;
|
|
9
10
|
let canvasMini;
|
|
10
11
|
const canvas_size_mini = 200;
|
|
@@ -15,7 +16,11 @@ function canvasRedrawMini(aFigure, iLayers) {
|
|
|
15
16
|
const ctx1 = canvasMini.getContext("2d");
|
|
16
17
|
ctx1.clearRect(0, 0, ctx1.canvas.width, ctx1.canvas.height);
|
|
17
18
|
try {
|
|
18
|
-
|
|
19
|
+
if (zAdjust.init === 0) {
|
|
20
|
+
mAdjust = aFigure.getAdjustFull(ctx1.canvas.width, ctx1.canvas.height);
|
|
21
|
+
} else {
|
|
22
|
+
mAdjust = zAdjust;
|
|
23
|
+
}
|
|
19
24
|
aFigure.draw(ctx1, mAdjust, sLayers);
|
|
20
25
|
} catch (emsg) {
|
|
21
26
|
console.log(emsg);
|
package/package.json
CHANGED
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "geomui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.38",
|
|
4
4
|
"description": "The svelte-library of the webapp-UI of Parametrix",
|
|
5
|
-
"type": "module",
|
|
6
5
|
"private": false,
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"svelte": "./dist/index.js"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"files": [
|
|
14
|
-
"dist",
|
|
15
|
-
"!dist/**/*.map",
|
|
16
|
-
"!dist/**/*.test.*",
|
|
17
|
-
"!dist/**/*.spec.*"
|
|
18
|
-
],
|
|
19
6
|
"repository": {
|
|
20
7
|
"type": "git",
|
|
21
8
|
"url": "git+https://github.com/charlyoleg2/parametrix.git"
|
|
22
9
|
},
|
|
23
10
|
"homepage": "https://charlyoleg2.github.io/parametrix/",
|
|
11
|
+
"author": "charlyoleg",
|
|
12
|
+
"license": "ISC",
|
|
24
13
|
"keywords": [
|
|
25
14
|
"cad",
|
|
26
15
|
"programmatic",
|
|
@@ -30,7 +19,36 @@
|
|
|
30
19
|
"arc",
|
|
31
20
|
"gear"
|
|
32
21
|
],
|
|
33
|
-
"
|
|
22
|
+
"type": "module",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"svelte": "./dist/index.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"!dist/**/*.map",
|
|
32
|
+
"!dist/**/*.test.*",
|
|
33
|
+
"!dist/**/*.spec.*"
|
|
34
|
+
],
|
|
35
|
+
"prettier": {
|
|
36
|
+
"useTabs": true,
|
|
37
|
+
"singleQuote": true,
|
|
38
|
+
"trailingComma": "none",
|
|
39
|
+
"printWidth": 100,
|
|
40
|
+
"plugins": [
|
|
41
|
+
"prettier-plugin-svelte"
|
|
42
|
+
],
|
|
43
|
+
"overrides": [
|
|
44
|
+
{
|
|
45
|
+
"files": "*.svelte",
|
|
46
|
+
"options": {
|
|
47
|
+
"parser": "svelte"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
34
52
|
"scripts": {
|
|
35
53
|
"cp_pgdsvg": "shx cp -r ../../node_modules/designix/dist/pgdsvg static/",
|
|
36
54
|
"dev": "vite dev",
|
|
@@ -52,48 +70,31 @@
|
|
|
52
70
|
"svelte": "^4.0.0"
|
|
53
71
|
},
|
|
54
72
|
"dependencies": {
|
|
55
|
-
"geometrix": "^0.5.
|
|
73
|
+
"geometrix": "^0.5.35"
|
|
56
74
|
},
|
|
57
75
|
"devDependencies": {
|
|
58
76
|
"@sveltejs/adapter-auto": "^3.2.0",
|
|
59
77
|
"@sveltejs/adapter-static": "^3.0.1",
|
|
60
|
-
"@sveltejs/kit": "^2.5.
|
|
78
|
+
"@sveltejs/kit": "^2.5.7",
|
|
61
79
|
"@sveltejs/package": "^2.3.1",
|
|
62
|
-
"@sveltejs/vite-plugin-svelte": "^3.0
|
|
80
|
+
"@sveltejs/vite-plugin-svelte": "^3.1.0",
|
|
63
81
|
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
|
64
82
|
"@typescript-eslint/parser": "^7.0.1",
|
|
65
|
-
"designix": "^0.5.
|
|
83
|
+
"designix": "^0.5.36",
|
|
66
84
|
"eslint": "^8.57.0",
|
|
67
85
|
"eslint-config-prettier": "^9.1.0",
|
|
68
|
-
"eslint-plugin-svelte": "^2.
|
|
86
|
+
"eslint-plugin-svelte": "^2.38.0",
|
|
69
87
|
"npm-run-all": "^4.1.5",
|
|
70
88
|
"prettier": "^3.2.5",
|
|
71
|
-
"prettier-plugin-svelte": "^3.2.
|
|
89
|
+
"prettier-plugin-svelte": "^3.2.3",
|
|
72
90
|
"publint": "^0.2.7",
|
|
73
|
-
"sass": "^1.
|
|
91
|
+
"sass": "^1.77.0",
|
|
74
92
|
"shx": "^0.3.4",
|
|
75
|
-
"svelte": "^4.2.
|
|
76
|
-
"svelte-check": "^3.
|
|
93
|
+
"svelte": "^4.2.16",
|
|
94
|
+
"svelte-check": "^3.7.1",
|
|
77
95
|
"tslib": "^2.6.2",
|
|
78
|
-
"typescript": "^5.4.
|
|
79
|
-
"vite": "^5.2.
|
|
80
|
-
"vitest": "^1.
|
|
81
|
-
},
|
|
82
|
-
"prettier": {
|
|
83
|
-
"useTabs": true,
|
|
84
|
-
"singleQuote": true,
|
|
85
|
-
"trailingComma": "none",
|
|
86
|
-
"printWidth": 100,
|
|
87
|
-
"plugins": [
|
|
88
|
-
"prettier-plugin-svelte"
|
|
89
|
-
],
|
|
90
|
-
"overrides": [
|
|
91
|
-
{
|
|
92
|
-
"files": "*.svelte",
|
|
93
|
-
"options": {
|
|
94
|
-
"parser": "svelte"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
]
|
|
96
|
+
"typescript": "^5.4.5",
|
|
97
|
+
"vite": "^5.2.11",
|
|
98
|
+
"vitest": "^1.6.0"
|
|
98
99
|
}
|
|
99
100
|
}
|