Add project takeoff verification and bearing dimensions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
CopilotandCopilot committed 2026-11-06 16:25:53 +09:00
1 parent d22c5008f0
commit 7182b6cbb4
15 files changed
+337 -28

No files matched your search

+7
View File
@@ -0,0 +1,7 @@
import type {PierModel} from '../src/core/geometry';
/** Same bearing-body dimensions as src/view/scene.ts; A/B alone are solplate inputs. */
export function bearingDimensions(model:PierModel){
const plans=model.blocks.map(b=>b.plan);
const uniform=(values:(number|undefined)[])=>values.length&&values.every(v=>v!=null&&Number.isFinite(v)&&v>0&&Math.abs(v-values[0]!)<1e-7)?values[0]!:null;
return {length:uniform(plans.map(p=>p?(p.A+p.margin)/1000-.2:undefined)),width:uniform(plans.map(p=>p?(p.B+p.margin)/1000-.2:undefined))};
}