v0.6.2: dakaansluiting L/T (vleugel met nokdak loopt het hoofddak in met kilkepers, of de kop wordt een schild met hoekkeper; eigen dakdeel en PDF-blad per unit, ook in de kosten), model IJssel (L-vorm met zadeldaken in riet), unit max 4,7 m breed; mansarde vervallen (oude ontwerpen worden een zadeldak met dezelfde nok); gevelbekleding volgt voorbij het wandeinde de daklijn (geen blok meer boven een steil dakvlak) en bij een bolle daklijn per punt de bovenkant van het dak; gevellampen standaard min. 500 mm h.o.h. (geen samengevoegde lamp meer boven een smal raam)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
bd084e4a96
commit
b137a458d4
+12
-19
@@ -306,8 +306,8 @@ window.UnitModel = (() => {
|
||||
return Math.max(w.heightLeft, w.heightRight, w.heightMid > 0 ? w.heightMid : 0, ...(w.topPts || []).map(q => q.h));
|
||||
}
|
||||
|
||||
// kneeRatio / cutRatio gaan voor kneeH / cut, zodat ze meeschalen als goot of nok verandert.
|
||||
const LIMITS = { ridge: 5000, eave: 3000, short: 4300, long: 14000 };
|
||||
// cutRatio gaat voor cut, zodat ze meeschalen als goot of nok verandert.
|
||||
const LIMITS = { ridge: 5000, eave: 3000, short: 4700, long: 14000 };
|
||||
function clampSize(floor, keep) {
|
||||
floor.width = Math.min(LIMITS.long, floor.width);
|
||||
floor.depth = Math.min(LIMITS.long, floor.depth);
|
||||
@@ -317,9 +317,9 @@ window.UnitModel = (() => {
|
||||
}
|
||||
return floor;
|
||||
}
|
||||
const ROOF_TYPES = { plat: 'Plat', lessenaar: 'Lessenaar', zadel: 'Zadel', mansarde: 'Mansarde', wolf: 'Wolfsdak' };
|
||||
const ROOF_TYPES = { plat: 'Plat', lessenaar: 'Lessenaar', zadel: 'Zadel', wolf: 'Wolfsdak' };
|
||||
const RIDGES = { z: 'Noord–zuid', x: 'West–oost' };
|
||||
const hasRidge = (type) => type === 'zadel' || type === 'mansarde' || type === 'wolf';
|
||||
const hasRidge = (type) => type === 'zadel' || type === 'wolf';
|
||||
function gableOf(form) {
|
||||
if (hasRidge(form.type)) return form.ridge === 'x' ? 'links' : 'achter';
|
||||
if (form.type === 'lessenaar') return form.dir === 'links' || form.dir === 'rechts' ? 'achter' : 'links';
|
||||
@@ -333,10 +333,8 @@ window.UnitModel = (() => {
|
||||
const full = fullTopLine(w, gableSpan(unitState, side));
|
||||
const F = full[full.length - 1].u, inner = full.slice(1, -1);
|
||||
const L = full[0], R = full[full.length - 1], low = Math.round(Math.min(L.h, R.h));
|
||||
if (inner.length === 3) {
|
||||
const high = Math.round(inner[1].h);
|
||||
return { type: 'mansarde', ridge, low, high, kneeH: Math.round(inner[0].h), kneeIn: Math.round(inner[0].u), kneeRatio: (inner[0].h - low) / Math.max(1, high - low) };
|
||||
}
|
||||
// v0.6.2: mansarde vervallen; een opgeslagen mansarde wordt een zadeldak met dezelfde nok.
|
||||
if (inner.length === 3) return { type: 'zadel', ridge, low, high: Math.round(inner[1].h) };
|
||||
if (inner.length === 2 && Math.abs(inner[0].h - inner[1].h) < 0.5) {
|
||||
const slope = (inner[0].h - L.h) / Math.max(1, inner[0].u);
|
||||
const high = Math.round(L.h + slope * F / 2);
|
||||
@@ -351,6 +349,10 @@ window.UnitModel = (() => {
|
||||
const h = Math.max(...Object.values(W).map(wallTopOf));
|
||||
return { type: 'plat', low: h, high: h };
|
||||
}
|
||||
function dropMansarde(unitState) {
|
||||
const f = roofForm(unitState), side = f.type === 'zadel' ? gableOf(f) : null;
|
||||
if (side && fullTopLine(unitState.walls[side].wall, gableSpan(unitState, side)).length === 5) applyRoofForm(unitState, f);
|
||||
}
|
||||
function applyRoofForm(unitState, form) {
|
||||
const side = form.type !== 'plat' ? gableOf(form) : 'achter';
|
||||
const g = gableSpan(unitState, side);
|
||||
@@ -365,16 +367,7 @@ window.UnitModel = (() => {
|
||||
const half = F / 2;
|
||||
let line = [{ u: 0, h: low }, { u: F, h: low }];
|
||||
if (sloped && form.type === 'zadel') line = [{ u: 0, h: low }, { u: half, h: high }, { u: F, h: low }];
|
||||
else if (sloped && form.type === 'mansarde') {
|
||||
// Knik altijd boven de rechte lijn goot–nok, anders wordt het een hol dak.
|
||||
const kIn = Math.max(eMin + 100, Math.min(half - 100, Math.round(form.kneeIn || F * 0.18)));
|
||||
const minK = low + (high - low) * kIn / half + 20;
|
||||
const want = form.kneeRatio > 0 ? low + form.kneeRatio * (high - low) : form.kneeH;
|
||||
const kH = Math.round(Math.min(high - 20, Math.max(minK, want || minK)));
|
||||
line = kH > minK - 1 && high - kH >= 20
|
||||
? [{ u: 0, h: low }, { u: kIn, h: kH }, { u: half, h: high }, { u: F - kIn, h: kH }, { u: F, h: low }]
|
||||
: [{ u: 0, h: low }, { u: half, h: high }, { u: F, h: low }];
|
||||
} else if (sloped && form.type === 'wolf') {
|
||||
else if (sloped && form.type === 'wolf') {
|
||||
const minR = (eMin + 50) / half;
|
||||
const ratio = form.cutRatio > 0 ? form.cutRatio : form.cut ? (form.cut - low) / (high - low) : 0.6;
|
||||
const cut = Math.round(Math.max(low + 50, Math.min(high - 50, low + Math.max(0.05, minR, Math.min(0.95, ratio)) * (high - low))));
|
||||
@@ -401,5 +394,5 @@ window.UnitModel = (() => {
|
||||
}
|
||||
}
|
||||
|
||||
return { WALL_SIDES, CORNER_MODES, ROOF_TYPES, RIDGES, LIMITS, clampSize, hasRidge, clone, createDefaultState, localToWorld, computeLayout, normalizeSplits, splitFacadeAt, topLineOn, topParamsOn, topParamsFromLayout, wallPieces, syncWallHeights, wallTopOf, gableOf, roofForm, applyRoofForm, formLine, validateState };
|
||||
return { WALL_SIDES, CORNER_MODES, ROOF_TYPES, RIDGES, LIMITS, clampSize, hasRidge, clone, createDefaultState, localToWorld, computeLayout, normalizeSplits, splitFacadeAt, topLineOn, topParamsOn, topParamsFromLayout, wallPieces, syncWallHeights, wallTopOf, gableOf, roofForm, dropMansarde, applyRoofForm, formLine, validateState };
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user