desi77 0.1.3 → 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.
- package/dist/index.js +28 -15
- package/package.json +1 -1
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
|
|
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
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
figFace.
|
|
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;
|