v0.4.13: opbouw buitenwand boven lager dak, latwerk-raster per gevel, dakrand 80 mm boven dakleer, lage rand loopt door

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Machiel
2026-09-30 15:33:47 +02:00
co-authored by Claude Opus 5.5
parent 373c2c2fb7
commit 94a5215f82
8 changed files with 207 additions and 46 deletions
+44 -2
View File
@@ -157,9 +157,18 @@ window.UnitModel = (() => {
const full = s.axis === 'x' ? W / 2 : D / 2;
const ext0 = Math.max(0, Math.round(s0 + full)), ext1 = Math.max(0, Math.round(full - s1));
const skinExt = s.dir > 0 ? { left: ext0, right: ext1 } : { left: ext1, right: ext0 };
// Doorlopende wand die op een hoek vervalt: de haakse wand loopt daar
// tot de vloerrand door en staat dus op deze wandlijn (endInset, u-mm
// vanaf links/rechts). Een opbouw in die naad-zone begint erna.
const through = state.layout.corners === 'zijkanten' ? s.axis === 'z' : s.axis === 'x';
const pL = s.dir > 0 ? s0 : s1, pR = s.dir > 0 ? s1 : s0;
const endInset = {
left: through && cutAt(s.key, pL) ? T[WALL_ENDS[s.key].left] : 0,
right: through && cutAt(s.key, pR) ? T[WALL_ENDS[s.key].right] : 0
};
return {
side: s.key, label: s.label, nr: s.nr, rotY: s.rotY, normal: s.normal, axis: s.axis,
thickness: T[s.key], width, cx, cz, cutsU, pieces, skinExt
thickness: T[s.key], width, cx, cz, cutsU, pieces, skinExt, endInset
};
});
@@ -170,7 +179,13 @@ window.UnitModel = (() => {
// op de volle zijde opgelost (ankers gelden voor de hele zijde) en daarna
// aan het stuk toegewezen waar ze volledig in vallen; openingen die in een
// naad vallen vervallen (dropped).
function wallPieces(wallLayout, wallState) {
// raised (optioneel): [{ u0, u1, base }] = opbouw in een naad-zone: daar
// staat de wand pas vanaf hoogte `base` (mm vanaf het loopvlak, bijv. boven
// het lagere dak van de buur-unit) tot de daklijn. Zo'n stuk heeft
// baseY = base; openingen die er volledig boven base in vallen horen erbij
// (y t.o.v. de onderkant van het stuk). Te lage opbouw vervalt.
const MIN_RAISE_MM = 150;
function wallPieces(wallLayout, wallState, raised) {
const fullConfig = WallModel.configFromState(wallState);
const W = wallLayout.width;
const hL = wallState.wall.heightLeft, hR = wallState.wall.heightRight;
@@ -200,6 +215,33 @@ window.UnitModel = (() => {
config, frame: WallModel.computeFrame(config)
};
});
const raisedList = (raised || []).filter(r => r.u1 - r.u0 >= MIN_PIECE_MM);
const ins = wallLayout.endInset || { left: 0, right: 0 };
raisedList.forEach((r, i) => {
const { u0: a, u1: b, base } = r;
const hasPeak = hM !== null && a < pU - 1 && b > pU + 1;
const hA = heightAt(a) - base, hB = heightAt(b) - base;
if (Math.min(hA, hB) < MIN_RAISE_MM) return;
const openings = fullConfig.openings
.filter(op => op.x >= a - EPS && op.x + op.w <= b + EPS && op.y >= base - EPS)
.map(op => { used.add(op.id); return { id: op.id, type: op.type, w: op.w, h: op.h, y: op.y - base, anchor: 'left', offset: op.x - a }; });
const params = Object.assign({}, wallState.wall, {
width: b - a, heightLeft: Math.round(hA), heightRight: Math.round(hB),
heightMid: hasPeak ? hM - base : null, peakX: hasPeak ? pU - a : undefined
});
const config = WallModel.buildConfig(params, openings);
pieces.push({
suffix: 'o' + (raisedList.length > 1 ? i + 1 : ''), // opbouw
u0: a, u1: b, lxCenter: -W / 2 + (a + b) / 2, baseY: Math.round(base),
// Naast de haakse wand in de hoek (endInset) bedekken de buitenlagen
// ook diens kopse kant, die boven het lage dak bloot ligt.
skinExt: {
left: ins.left > 0 && a <= ins.left + EPS ? ins.left : 0,
right: ins.right > 0 && b >= W - ins.right - EPS ? ins.right : 0
},
config, frame: WallModel.computeFrame(config)
});
});
const dropped = fullConfig.openings.filter(op => !used.has(op.id));
return { pieces, dropped, fullConfig };
}