v0.4.12: dak volgt wandvorm (plat/lessenaar/zadel), dakrand per hoogte, naadwand midden of geheel in unit A/B

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Machiel
2026-09-30 14:43:42 +02:00
co-authored by Claude Opus 5.5
parent 001206a108
commit 373c2c2fb7
10 changed files with 627 additions and 274 deletions
+16 -14
View File
@@ -274,7 +274,7 @@ function mountWallEditor(container, callbacks) {
// Dichtheden/gewichten: zie WallModel (wall/wall-model.js).
let CONFIG = {};
let calcData = { fullStuds: [], jackStuds: [] };
let calcData = { fullStuds: [], studs: [] };
let wallGroup3D = null;
let lastBaseHeight = 2400;
@@ -759,7 +759,7 @@ function mountWallEditor(container, callbacks) {
readInputs();
calcData = WallModel.computeFrame(CONFIG);
setSpecAll('vert-beams', (calcData.fullStuds.length + calcData.jackStuds.length) + ' stuks');
setSpecAll('vert-beams', calcData.studs.length + ' stuks');
setSpecAll('roof-angle', calcData.angleDeg + '°');
}
@@ -811,8 +811,10 @@ function mountWallEditor(container, callbacks) {
ctx.strokeRect(screenX, screenY, studWidthPx, studDepthPx);
};
calcData.fullStuds.forEach(x => drawStud2D(x, false));
calcData.jackStuds.forEach(j => drawStud2D(j.x, true));
// Bovenaanzicht: één doorsnede per stijlpositie (kreupel alleen als er
// op die plek geen volle stijl staat).
const fullXs = new Set(calcData.studs.filter(st => st.kind !== 'kreupel').map(st => st.x));
[...new Set(calcData.studs.map(st => st.x))].forEach(x => drawStud2D(x, !fullXs.has(x)));
const startX = -CONFIG.wallWidth / 2;
CONFIG.openings.forEach(op => {
@@ -949,22 +951,22 @@ function mountWallEditor(container, callbacks) {
ctxFront.textAlign = 'start';
}
const drawStudFront = (xMM, isJack) => {
const xLeft = xMM - CONFIG.studWidth / 2;
const xRight = xMM + CONFIG.studWidth / 2;
const yBot = CONFIG.plateThick;
ctxFront.fillStyle = isJack ? '#a37c45' : '#c29b62';
// Stijlstuk van y0 tot y1 (of tot de daklijn), zie WallModel.computeFrame.
const drawStudFront = (st) => {
const xLeft = st.x - CONFIG.studWidth / 2;
const xRight = st.x + CONFIG.studWidth / 2;
ctxFront.fillStyle = st.kind === 'kreupel' ? '#a37c45' : '#c29b62';
ctxFront.strokeStyle = '#8a6836';
ctxFront.beginPath();
ctxFront.moveTo(toCanvasX(xLeft), toCanvasY(yBot));
ctxFront.lineTo(toCanvasX(xRight), toCanvasY(yBot));
tl.underPts(xLeft, xRight).reverse().forEach(p => ctxFront.lineTo(toCanvasX(p.x), toCanvasY(p.y)));
ctxFront.moveTo(toCanvasX(xLeft), toCanvasY(st.y0));
ctxFront.lineTo(toCanvasX(xRight), toCanvasY(st.y0));
if (st.y1 === null) tl.underPts(xLeft, xRight).reverse().forEach(p => ctxFront.lineTo(toCanvasX(p.x), toCanvasY(p.y)));
else { ctxFront.lineTo(toCanvasX(xRight), toCanvasY(st.y1)); ctxFront.lineTo(toCanvasX(xLeft), toCanvasY(st.y1)); }
ctxFront.closePath();
ctxFront.fill();
ctxFront.stroke();
};
calcData.fullStuds.forEach(x => drawStudFront(x, false));
calcData.jackStuds.forEach(j => drawStudFront(j.x, true));
calcData.studs.forEach(drawStudFront);
const startXMM = -halfWMM;
frontOpeningRects = [];