feat(rebar): add 3D coupler modeling for P1/P2 (368) and P4/P5 (35) with separate summary table rows

This commit is contained in:
ypshim committed 2026-10-22 18:00:28 +09:00
1 parent 9900aa6d8e
commit b35f5ff0ed
5 files changed
+70 -6

No files matched your search

+56 -2
View File
@@ -25,6 +25,8 @@ const COLOR = {
shear: 0x6b3fa0,
column: 0x0f5c66,
tie: 0x6b3fa0,
couplerMain: 0x0b3f46,
couplerTie: 0x553088,
footing: 0x0f5c66,
footingBottom: 0x2e7d32,
block: 0xa07a10,
@@ -213,6 +215,52 @@ export function buildRebar3D(m: PierModel): RebarScene {
for (const z of col.p3) ring('P3', c.k, sc, base + mm(z), rt, NOMINAL_DIAMETER.H19);
for (const z of col.p5) ring('P5', c.k, sc, base + mm(z), rt, NOMINAL_DIAMETER.H19);
for (const z of col.p4) ring('P4', c.k, sc, base + mm(z), rt, NOMINAL_DIAMETER.H19);
// Main bar couplers (D32, L150 Ø60, 4단 × 46줄 × 2열 = 368개): P1 at col.couplerP1, P2 at col.couplerP2 (+150 mm)
const r1 = mm(col.r1);
const r2 = mm(col.r2);
for (let i = 0; i < COLUMN_P1.nDiv; i++) {
const th = (2 * Math.PI * i) / COLUMN_P1.nDiv;
const cosTh = Math.cos(th);
const sinTh = Math.sin(th);
// P1 couplers (184)
for (const z of col.couplerP1) {
const cx = sc + r1 * cosTh;
const cz = r1 * sinTh;
const cy = base + mm(z);
addBar('주철근 커플러', c.k, [cx, cy - 0.075, cz], [cx, cy + 0.075, cz], 60, COLOR.couplerMain);
}
// P2 couplers (184, shifted +150 mm)
for (const z of col.couplerP2) {
const cx = sc + r2 * cosTh;
const cz = r2 * sinTh;
const cy = base + mm(z);
addBar('주철근 커플러', c.k, [cx, cy - 0.075, cz], [cx, cy + 0.075, cz], 60, COLOR.couplerMain);
}
}
// Tie couplers (D19, L100 Ø40, 총 35개): P5 1개 (19개) · P4 2개 (16개)
col.p5.forEach((z, j) => {
const th = (2 * Math.PI * (j * 7 + 0.5)) / COLUMN_P1.nDiv;
const cx = sc + rt * Math.cos(th);
const cz = rt * Math.sin(th);
const cy = base + mm(z);
const dx = 0.05 * -Math.sin(th);
const dz = 0.05 * Math.cos(th);
addBar('띠철근 커플러', c.k, [cx - dx, cy, cz - dz], [cx + dx, cy, cz + dz], 40, COLOR.couplerTie);
});
col.p4.forEach((z) => {
const angles = [(2 * Math.PI * 0.5) / COLUMN_P1.nDiv, (2 * Math.PI * 0.5) / COLUMN_P1.nDiv + Math.PI];
angles.forEach((th) => {
const cx = sc + rt * Math.cos(th);
const cz = rt * Math.sin(th);
const cy = base + mm(z);
const dx = 0.05 * -Math.sin(th);
const dz = 0.05 * Math.cos(th);
addBar('띠철근 커플러', c.k, [cx - dx, cy, cz - dz], [cx + dx, cy, cz + dz], 40, COLOR.couplerTie);
});
});
const hookP6 = mm(Math.round(hookLength('tie90', NOMINAL_DIAMETER.H16))); // 135 mm
const dP6 = NOMINAL_DIAMETER.H16; // 15.9 mm
const p6Angles = [0, 46.96, 90, 133.04];
@@ -373,10 +421,16 @@ export function buildRebar3D(m: PierModel): RebarScene {
for (const [key, meshes] of byName) {
for (const mesh of meshes) {
const mat = mesh.material as THREE.MeshStandardMaterial;
const on = name === null || key === name;
const on =
name === null ||
key === name ||
(name === '커플러' && key.includes('커플러')) ||
(name === '주철근 커플러' && key === '주철근 커플러') ||
(name === '띠철근 커플러' && key === '띠철근 커플러');
mat.transparent = !on;
mat.opacity = on ? 1 : 0.18;
mat.emissive.setHex(name !== null && key === name ? 0x6b5a00 : 0x000000);
const match = name !== null && (key === name || (name === '커플러' && key.includes('커플러')));
mat.emissive.setHex(match ? 0x6b5a00 : 0x000000);
}
}
};