desi77 0.1.0 → 0.1.4

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.
Files changed (3) hide show
  1. package/README.md +3 -3
  2. package/dist/index.js +28 -15
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -13,8 +13,8 @@ It contains the some 3D-shapes.
13
13
  Links
14
14
  -----
15
15
 
16
- - [desi77-ui](https://MYNAME.github.io/parame77/) : public instance of the UI
17
- - [sources](https://github.com/MYNAME/parame77) : git-repository
16
+ - [desi77-ui](https://charlyoleg2.github.io/parame77/) : public instance of the UI
17
+ - [sources](https://github.com/charlyoleg2/parame77) : git-repository
18
18
  - [pkg](https://www.npmjs.com/package/desi77) : desi77 as npm-package
19
19
  - [pkg-cli](https://www.npmjs.com/package/desi77-cli) : desi77-cli as npm-package
20
20
  - [pkg-uis](https://www.npmjs.com/package/desi77-uis) : desi77-uis as npm-package
@@ -24,7 +24,7 @@ Getting started
24
24
  ---------------
25
25
 
26
26
  ```bash
27
- git clone https://github.com/MYNAME/parame77
27
+ git clone https://github.com/charlyoleg2/parame77
28
28
  cd parame77
29
29
  npm -w desi77 install
30
30
  npm -w desi77 run ci
package/dist/index.js CHANGED
@@ -112,7 +112,8 @@ function pGeom(t, param, suffix = "") {
112
112
  const lBA = lBC / Math.cos(aDBE);
113
113
  const R1 = lBA;
114
114
  const lEG = lBA - Hvault - param.Hc;
115
- const aMGF = Math.atan2(lEG, param.W1 / 2);
115
+ const lEG0 = Math.max(lEG, 0);
116
+ const aMGF = Math.atan2(lEG0, param.W1 / 2);
116
117
  const aFGD = Math.PI - 2 * aMGF;
117
118
  const Lmax = Math.max(calcGL(aMGF, R1, param.Hc), R1 - param.Hc);
118
119
  let nVaultStone = Math.ceil(aFGD * (Lmax + param.vL) / param.vW);
@@ -144,19 +145,27 @@ function pGeom(t, param, suffix = "") {
144
145
  if (param.H2p < 1) {
145
146
  throw `err167: H2p ${param.H2p} is too small`;
146
147
  }
147
- if (lEG < 1) {
148
- throw `err170: lEG ${lEG} is negative or almost zero`;
148
+ if (lEG < -0.1) {
149
+ throw `err170: lEG ${lEG} is negative`;
149
150
  }
150
151
  const bHs = param.bH - 2 * param.jW;
151
152
  if (bHs < 1) {
152
153
  throw `err192: bHs ${ffix(bHs)} is negative or almost zero`;
153
154
  }
155
+ const withSV = aMGF > 0.1 ? true : false;
154
156
  rGeome.logstr += `Hdoor ${ffix(Hdoor)}, Hvault ${ffix(Hvault)} mm
155
157
  `;
156
158
  rGeome.logstr += `nVaultStone ${ffix(nVaultStone)} vault-stones
157
159
  `;
158
160
  rGeome.logstr += `aVaultStone ${ffix(radToDeg(aVaultStone))} degree ${ffix(aVaultStone * Lmax)} ${ffix(aVaultStone * (Lmax + param.vL))} mm
159
161
  `;
162
+ if (withSV) {
163
+ rGeome.logstr += `including side-vault stone with aMGF ${ffix(radToDeg(aMGF))} degree
164
+ `;
165
+ } else {
166
+ rGeome.logstr += `without side-vault stone because too small aMGF ${ffix(radToDeg(aMGF))} degree
167
+ `;
168
+ }
160
169
  const ctrDoor = contour(0, 0, "green").addSegStrokeR(param.W1, 0).addSegStrokeR(0, param.H1).addPointR(-param.W1 / 2, Hvault).addPointR(-param.W1, 0).addSegArc2().closeSegStroke();
161
170
  figFace.addSecond(ctrDoor);
162
171
  const ccx = param.W1 / 2;
@@ -187,21 +196,25 @@ function pGeom(t, param, suffix = "") {
187
196
  }
188
197
  const posXBottom = -bL2 + firstBottomW + nBottomStone * 2 * bL2;
189
198
  figFace.addMainO(ctrBrick2(posXBottom, -param.bH, firstBottomW));
190
- for (let idxY = 0; idxY < nSVy; idxY++) {
191
- const posY = (idxY + nSideStone) * param.bH;
192
- for (let idxX = 0; idxX < nSVx; idxX++) {
193
- const posX1 = (idxX - nSVx) * 2 * bL2;
194
- const posX2 = param.W1 + idxX * 2 * bL2;
195
- figFace.addSecond(ctrBrick2(posX1, posY, 2 * bL2));
196
- figFace.addSecond(ctrBrick2(posX2, posY, 2 * bL2));
199
+ if (withSV) {
200
+ for (let idxY = 0; idxY < nSVy; idxY++) {
201
+ const posY = (idxY + nSideStone) * param.bH;
202
+ for (let idxX = 0; idxX < nSVx; idxX++) {
203
+ const posX1 = (idxX - nSVx) * 2 * bL2;
204
+ const posX2 = param.W1 + idxX * 2 * bL2;
205
+ figFace.addSecond(ctrBrick2(posX1, posY, 2 * bL2));
206
+ figFace.addSecond(ctrBrick2(posX2, posY, 2 * bL2));
207
+ }
208
+ }
209
+ for (let idxX = 0; idxX < nTVx0; idxX++) {
210
+ const posY = (nSideStone + nSVy - 1) * param.bH;
211
+ figFace.addSecond(ctrBrick2(idxX * vW0, posY, vW0));
197
212
  }
198
213
  }
199
- for (let idxX = 0; idxX < nTVx0; idxX++) {
200
- const posY = (nSideStone + nSVy - 1) * param.bH;
201
- figFace.addSecond(ctrBrick2(idxX * vW0, posY, vW0));
214
+ if (withSV) {
215
+ figFace.addMainO(ctrFirstSV2(0, 1));
216
+ figFace.addMainO(ctrFirstSV2(param.W1, -1));
202
217
  }
203
- figFace.addMainO(ctrFirstSV2(0, 1));
204
- figFace.addMainO(ctrFirstSV2(param.W1, -1));
205
218
  for (let idxY = 0; idxY < nTVy; idxY++) {
206
219
  const posY = (idxY + nSideStone + nSVy) * param.bH;
207
220
  const ibW = idxY % 2 === 1 ? 2 * bL2 : bL2;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "desi77",
3
- "version": "0.1.0",
3
+ "version": "0.1.4",
4
4
  "description": "A collection of 3D-designs",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/MYNAME/parame77.git"
8
+ "url": "git+https://github.com/charlyoleg2/parame77.git"
9
9
  },
10
- "homepage": "https://MYNAME.github.io/parame77/",
11
- "author": "MYNAME",
10
+ "homepage": "https://charlyoleg2.github.io/parame77/",
11
+ "author": "charlyoleg2",
12
12
  "license": "ISC",
13
13
  "keywords": [
14
14
  "parametrix",