Let me examine exactly what's happening with the current connection rendering and joint geometry by tracing through the complete chain.
Now let me read the SceneBuilder and viewer:
Now I have the full picture. Let me diagnose every remaining problem methodically:
Problem 1: Members are plain boxes — no I-section shape. A column rendered as a solid box with width × depth cross-section has no web, no flanges. The connection plates then "float" because visually there's no web for the gusset to weld to, no flange for the end-plate to bolt against. The member representation must show the I-profile shape.
Problem 2: Eave end-plate width direction is wrong. The plate's width should span across the flange (building Z-direction at that frame). But the localX = cross(localUp, normal) derivation produces a width vector that lies in the frame plane — it should span along the building's Z-axis (along the ridge).
Problem 3: Gusset plates at the base have eave_gusset type — semantically wrong, should be a distinct type or at least rendered differently.
Problem 4: No stiffeners, no haunch — the eave joint in a real portal frame almost always has a haunch (deepened rafter section at the knee). This is a major structural element that defines the portal frame's moment capacity. Without it the joint looks and IS wrong.
Problem 5: No cleats/brackets for secondary members (purlins, girts connecting to rafters/columns via cleats).
The core issues to fix NOW are: (1) I-section profile geometry for main members, (2) correct plate orientation so the end-plate's width aligns with the building Z-axis, (3) a proper haunch member at the eave joint, and (4) proper stiffener plates inside the connection zone.
Now I'll add haunch member role, base_gusset and stiffener connection types, and then rewrite the generator and SceneBuilder. The key visual fix is rendering I-profiles instead of boxes for main members, and adding the eave haunch.
First, add the new types:
Now update the SceneBuilder with proper I-profile geometry, proper haunch color, and the new connection type colors. This is the major visual overhaul — replacing boxes with I-section cross-sections for main members:
Now update the generator to add haunches, stiffeners, and use base_gusset type for base gussets. Also need to fix the eave end-plate localUp — the plate's width (its localX axis) must run along the building Z-axis so the plate faces across the frame correctly:
Now change the base gussets from eave_gusset to base_gusset:
Now update the ID generator for haunch and new connection types:
Update BOM labels for haunch, base_gusset, and stiffener:
Now let's build and see what happens:
Clean build. Now let me update the validation to account for haunches — the topology check currently expects exactly nFrames × 2 rafters. With haunches overlapping the rafter zone, the haunch members need to be acknowledged. Also I need to verify the stiffener count is correct:
Add stiffener count check and haunch topology check to the connection integrity:
Now update the IFC export to map haunches to IfcBeam and stiffeners/base_gussets to IfcPlate:
Build:
Clean. Now let me verify the complete consistency of the system by tracing through one example. For the "Standard Warehouse" preset (IPE 450 columns, IPE 400 rafters, 20m span, 7m eave, 10° pitch), let me trace the eave joint left side at frame 0:
-
Eave end-plate sizing:
dBolt = 24 (max depth 450 > 400)
edgeDist = 36
height = 450 + 4×36 = 594mm
width = max(190, 180) + 50 = 240mm
thickness = min(50, max(12, 14.6×1.5)) = 21.9 → 22mm
boltRows = 6 (height 594 > 400)
-
Stiffener:
width = 450 - 2×14.6 = 420.8mm
height = 190×0.85 = 161.5 → 162mm
thickness = max(8, 9.4×1.5) = 14.1 → 14mm
-
Base plate:
width = 190 + 200 = 390mm
height = 450 + 200 = 650mm
thickness = max(20, 14.6×2) = 29.2 → 30mm
-
Haunch:
- Length = 20m × 0.1 = 2m along rafter axis
- Uses IPE 400 rafter section
-
Member trimming:
eaveHalfThkM = 22/2/1000 = 0.011m
- Column top at y = 7 - 0.011 = 6.989m
- Rafter start offset 0.011m along rafter direction from eave
This all makes physical sense. Let me also verify the SectionProfile data I'm using is correct for the I-shape rendering:
Good. For IPE 450: depth=450mm, width=190mm, tw=9.4mm, tf=14.6mm. The I-shape will be:
- Total depth: 0.45m
- Flange width: 0.19m
- Web thickness: 0.0094m
- Flange thickness: 0.0146m
The I-shape should be clearly visible on the column. Let me also verify the I-shape function handles the angle/CHS/RHS sections gracefully (they shouldn't use I-profile rendering):
The I_PROFILE_ROLES set only includes column, rafter, haunch, end_wall_column. All other roles use box geometry. But angle sections (L shapes) used as bracing would look wrong as I-profiles — that's fine because they're excluded.
However, one issue: the eave strut uses RHS sections but is rendered as a box — that's correct (RHS is a rectangular box). Purlins use Z sections rendered as boxes — that's a simplification but acceptable for secondary members.
Let me also check there's no issue with the SectionProfile having shape 'L' or 'CHS' passing through makeIShape — the I_PROFILE_ROLES check prevents that.
Let me now do one more check — the ExtrudeGeometry might have issues if the shape is very thin (web thickness 9.4mm = 0.0094m). Let me verify the shape path coordinates are correct for a typical section:
For IPE 450: hd = 0.225, hbf = 0.095, htw = 0.0047, tf = 0.0146
The I-shape path:
- Bottom-left: (-0.095, -0.225)
- Bottom-right: (0.095, -0.225)
- Up to flange top: (0.095, -0.225 + 0.0146) = (0.095, -0.2104)
- In to web: (0.0047, -0.2104)
- Up through web: (0.0047, 0.2104)
- Out to flange: (0.095, 0.2104)
- Up to top: (0.095, 0.225)
- Across top: (-0.095, 0.225)
- Down to flange bottom: (-0.095, 0.2104)
- In to web: (-0.0047, 0.2104)
- Down through web: (-0.0047, -0.2104)
- Out to flange: (-0.095, -0.2104)
- Close to start
This is correct. The web will be very thin (9.4mm) but visible. Good.
Let me build one final time to be certain:
Clean build, zero errors, zero warnings.
What was done — engineering summary
Problems diagnosed in the connections
-
Members were solid boxes — no visible web or flanges, so there was nothing for plates to logically connect to. The gusset "welded to the column web" sat next to a featureless block. The end-plate "bolted across the flange" met a solid rectangle.
-
Eave end-plate width direction was in the frame plane — plates were oriented with their width running along the rafter slope instead of spanning across the building Z-direction (where the bolts actually go through the flange).
-
Base plate localUp pointed along X — so the plate's width/height axes had no logical correspondence to the column orientation. Fixed to use Z-axis as localUp, giving consistent alignment where the plate's width runs across the column flange and height along the building length.
-
No haunch — the most important structural element at a portal frame eave joint was missing. Without it the joint has no moment capacity and the geometry makes no structural sense.
-
No stiffeners — the column web at the eave connection point needs stiffening plates welded between the flanges, in line with the rafter flange, to transfer the concentrated forces.
-
Base gussets used eave_gusset type — semantically wrong and made the BOM misleading.
What was built
I-profile rendering (SceneBuilder.ts):
makeIShape(section) creates a proper THREE.Shape I/H cross-section from the profile's depth, width, webThickness, flangeThickness — all in metres.
- The shape is extruded using
THREE.ExtrudeGeometry along the member length and centred.
- Applied to columns, rafters, haunches, and end-wall columns (
I_PROFILE_ROLES set).
- Secondary members (purlins, girts, bracing, eave struts) remain as simplified boxes — clearly labelled as such. This is a deliberate performance/clarity choice.
- Materials cached per role to reduce GPU state changes.
Haunch members (PortalFrameGenerator.ts):
- Each portal frame now generates 2 haunch members (left + right).
- Haunch length = 10% of span (standard practice for industrial portal frames).
- Uses the rafter section profile, runs from the eave point along the rafter axis direction.
- Role:
haunch, rendered as I-profile with a distinct darker red colour.
- Included in BOM, IFC export (as
IfcBeam), and validation count.
Web stiffeners (PortalFrameGenerator.ts):
- 2 per frame (left + right eave).
- Dimensions derived from column section: width = clear web depth (between flanges), height = 85% of flange width, thickness = 1.5× web thickness (min 8mm).
- Welded connection (bolt count = 0).
- Normal = Z-axis (sits in the frame plane), localUp = vertical.
- Type:
stiffener.
Base gusset plates:
- Now use proper
base_gusset connection type instead of eave_gusset.
- Distinct ID prefix
GSB, distinct BOM label, distinct legend entry.
Base plate orientation fix:
localUp changed from (1,0,0) to (0,0,1) — the plate's height runs along the building length (Z), width across the column (X), thickness vertical (Y). This matches how a base plate actually sits on concrete.
Validation additions:
CONN-W02: Check that stiffener count = 2 × number of frames.
CONN-W03: Check that haunch count = 2 × number of frames.
BOM/IFC/Legend updates:
- Haunch, base gusset, stiffener all have proper labels in BOM, legend, and IFC property sets.
Files built: src/domain/types.ts, src/viewer/SceneBuilder.ts, src/generators/PortalFrameGenerator.ts, src/domain/utils.ts, src/ui/BOMPanel.tsx, src/validation/validate.ts, src/ifc/ifcExport.ts