Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .pnpm-store/v11/index.db
Binary file not shown.
Binary file added .pnpm-store/v11/index.db-shm
Binary file not shown.
Binary file added .pnpm-store/v11/index.db-wal
Binary file not shown.
18 changes: 11 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,22 @@
</div>
<div id="analysis" class="bg-gray-400 p-3 py-2">
<div class="border-b-2 text-lg"> Analysis </div>
<div class="grid grid-cols-4 gap-1 grid-flow-row py-2 p-1">
<div class="col-start-1 col-end-3">
<button id="generatePMM-button" class="block uppercase border-2 tracking-wide text-gray-700 text-xs font-bold bg-white rounded py-2 hover:bg-gray-900 hover:text-white">Generate PM</button>
</div>
<div class="col-start-3 col-end-5">
<button id="analyze-button" class="block uppercase border-2 tracking-wide text-gray-700 text-xs font-bold bg-white rounded py-2 hover:bg-gray-900 hover:text-white" >Analysis Pane</button>
</div>
<div class="grid grid-cols-1 gap-1 py-2 p-1">
<button id="generatePMM-button" class="block w-full uppercase border-2 tracking-wide text-gray-700 text-xs font-bold bg-white rounded py-2 hover:bg-gray-900 hover:text-white">Generate PM</button>
</div>
</div>
</div>

<div id="middleColumn">
<nav id="workflowTabs" aria-label="Design workflow" role="tablist">
<button id="designModeTab" class="workflow-tab" type="button" role="tab" aria-selected="true">
Design Inputs
</button>
<button id="analysisModeTab" class="workflow-tab" type="button" role="tab" aria-selected="false" disabled>
Analysis Results
</button>
Comment on lines +156 to +162
<span id="workflowModeStatus" aria-live="polite">Editing section</span>
</nav>
<div id="concGui" class="relative">
<div id="windowProps" class="absolute bottom-0 text-black p-2">
<div id="userInputProps">
Expand Down
Binary file not shown.
83 changes: 83 additions & 0 deletions outputs/analysis-excel-export/build-sample.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { mkdir, writeFile } from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'node:path';
import { buildAnalysisWorkbookBytes } from '../../src/analysis/AnalysisExcelExporter.js';
import sharp from 'sharp';
Comment on lines +1 to +5

const outputDirectory = dirname(fileURLToPath(import.meta.url));
await mkdir(outputDirectory, { recursive: true });

const sampleSectionSvg = `
<svg xmlns="http://www.w3.org/2000/svg" width="960" height="640" viewBox="0 0 960 640">
<rect width="960" height="640" fill="white"/>
<text x="72" y="52" font-family="Arial" font-size="28" font-weight="bold" fill="#102a43">Concrete Section and Reinforcement</text>
<rect x="250" y="90" width="460" height="460" fill="#cbd5e1" stroke="#334e68" stroke-width="6"/>
<g fill="#dc2626" stroke="#7f1d1d" stroke-width="3">
<circle cx="290" cy="130" r="13"/><circle cx="480" cy="130" r="13"/><circle cx="670" cy="130" r="13"/>
<circle cx="290" cy="320" r="13"/><circle cx="670" cy="320" r="13"/>
<circle cx="290" cy="510" r="13"/><circle cx="480" cy="510" r="13"/><circle cx="670" cy="510" r="13"/>
</g>
<path d="M465 320h30M480 305v30" stroke="#2563eb" stroke-width="4"/>
<text x="370" y="600" font-family="Arial" font-size="22" fill="#334e68">Overall width: 24.00 in</text>
</svg>`;
const pngBuffer = await sharp(Buffer.from(sampleSectionSvg)).png().toBuffer();
const png = `data:image/png;base64,${pngBuffer.toString('base64')}`;
const selectedRows = Array.from({ length: 8 }, (_, index) => ({
index,
angle: 30,
slope: -0.0002 + index * 0.00005,
intercept: -0.003 + index * 0.0008,
p: -900 + index * 180,
mx: 50 + index * 22,
my: 20 + index * 9,
maxStrain: 0.001 + index * 0.0007,
phi: 0.65 + index * 0.03,
phiP: -585 + index * 120,
phiMx: 33 + index * 16,
phiMy: 13 + index * 7
}));
const mmRows = Array.from({ length: 12 }, (_, index) => {
const angle = index * 30;
const radians = angle * Math.PI / 180;
return {
index,
angle,
nominalP: 0,
nominalMx: 200 * Math.cos(radians),
nominalMy: 150 * Math.sin(radians),
nominalSlope: -0.00025,
nominalIntercept: 0.001,
phiP: index < 9 ? 0 : undefined,
phiMx: index < 9 ? 150 * Math.cos(radians) : undefined,
phiMy: index < 9 ? 110 * Math.sin(radians) : undefined,
phiSlope: index < 9 ? -0.0002 : undefined,
phiIntercept: index < 9 ? 0.0015 : undefined
};
});

const model = {
generated: new Date('2026-08-15T12:00:00-04:00'),
selectedAngle: 30,
mm: { axialLoad: 0 },
selectedRows,
mmRows,
imageDataUrl: png,
parameters: {
concreteMaterial: 'fc4ksi',
width: 24,
height: 24,
concreteArea: 576,
rebarCount: 8,
steelArea: 7.995,
reinforcementRatio: 7.995 / 576,
centroidX: 0,
centroidY: 0,
rebarSizes: '8 × #9',
rebarMaterials: '8 × fy60ksi',
edgeSpacing: 1,
interiorSpacing: 1
}
};

const bytes = buildAnalysisWorkbookBytes(model);
await writeFile(join(outputDirectory, 'analysis-export-sample.xlsx'), bytes);
23 changes: 23 additions & 0 deletions outputs/analysis-excel-export/inspect-sample.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import fs from 'node:fs/promises';
import { FileBlob, SpreadsheetFile } from '@oai/artifact-tool';

const input = await FileBlob.load('analysis-export-sample.xlsx');
const workbook = await SpreadsheetFile.importXlsx(input);
Comment on lines +1 to +5
const inspection = await workbook.inspect({
kind: 'workbook,sheet,region,drawing,formula',
range: 'A1:L25',
maxChars: 8000,
tableMaxRows: 8,
tableMaxCols: 12,
options: { maxResults: 80 }
});
console.log(inspection.ndjson ?? inspection);

const preview = await workbook.render({
sheetName: 'Summary',
autoCrop: 'all',
scale: 1,
format: 'png'
});
await fs.writeFile('summary-preview.png', new Uint8Array(await preview.arrayBuffer()));

Binary file added outputs/analysis-excel-export/summary-preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading