Wall Module Schema: Difference between revisions
Jump to navigation
Jump to search
| Line 105: | Line 105: | ||
=Compiler= | =Compiler= | ||
[[file:wall_module_compiler | [[file:wall_module_compiler.zip]] | ||
= Generate a Wall Module CAD File in FreeCAD (Schema → Compiler → .FCStd) = | = Generate a Wall Module CAD File in FreeCAD (Schema → Compiler → .FCStd) = | ||
Latest revision as of 04:03, 22 January 2026
https://chatgpt.com/share/69706dec-54ac-8010-a171-74eb64954e9a
Steps
- Create schema
- Create compiler.
- Compile. This generated CAD in FreeCAD
Real Takeaway
You are no longer “designing wall modules.”
You are designing a wall-module language.
FreeCAD is just the rendering backend.
Once you accept that, the next obvious step is:
Schema
schema_version: "wall_module_v0.1"
units:
length: "in" # internal canonical unit display: "ft-in"
module:
id: "WM-EX-001"
type: "wall_panel"
nominal_thickness_in: 5.5 # 2x6 actual
width_in: 48 # user-selectable: 24..96 recommended
height_in: 120 # user-selectable: >= 96 recommended
stud_spacing_oc_in: 24
framing_lumber: "2x6"
plates:
top_plate_count: 2 # typical double top
bottom_plate_count: 1
sheathing:
side: "A" # sheathing on one face, A or B
material: "OSB"
thickness_in: 0.4375 # 7/16
sourcing_policy:
preferred_sheet_width_in: 48
preferred_sheet_heights_in: [96, 108, 120] # 8', 9', 10'
rule:
# described in English below; compiler implements deterministically
strategy: "single_sheet_if_possible_else_96_plus_rip"
openings:
# zero or more
- id: "W1"
type: "window"
centered_in_module: false # user controls placement if not centered
rough_opening:
width_in: 36
height_in: 48
sill_height_from_bottom_in: 36
x_from_left_in: 6 # left edge of RO from left plate
header:
type: "flush_built"
members: 2
lumber: "2x12"
bias_to_face: "A" # "A" face per your requirement
fastener_schedule: "nail-laminate-default"
framing_rules:
trimmers_each_side: 1 # jack studs each side
king_studs_each_side: 1
cripple_above_header: "auto_to_top_plate"
cripple_below_sill: "auto_to_bottom_plate"
- id: "D1"
type: "door"
centered_in_module: true # door centered for single door modules
allowed_module_widths_in: [48] # enforce unless double door
rough_opening:
width_in: 36
height_in: 80
x_from_left_in: null # null means compiler centers it
header:
type: "flush_built"
members: 2
lumber: "2x12"
bias_to_face: "A"
fastener_schedule: "nail-laminate-default"
framing_rules:
trimmers_each_side: 1
king_studs_each_side: 1
cripple_above_header: "auto_to_top_plate"
threshold_detail: "bottom_plate_removed_under_RO" # common door framing
spacers: "auto_if_needed"
manufacturing:
cut_optimization:
allow_splices: false # framing members are full-length unless constrained
waste_priority: "medium"
naming:
face_A_definition: "sheathing_face"
tolerances:
framing_length_in: 0.0625 # +/- 1/16 typical cut tolerance target
outputs:
generate:
- "framing_elevation_face_A"
- "framing_elevation_face_B"
- "osb_cut_plan"
- "cut_list"
- "bom"
- "assembly_notes"
Compiler
Generate a Wall Module CAD File in FreeCAD (Schema → Compiler → .FCStd)
Prerequisites
- Install FreeCAD (GUI and command-line support).
- Create a working folder, e.g.:
~/ose_wall_compiler/
- Save these files into that folder:
wall_module_compiler.py(the compiler script)- One or more module spec files, e.g.
WM_WALL_48x120.json,WM_WINDOW_48x120.json,WM_DOOR_48x96.json
Step 1: Create a module specification file (JSON)
- In your working folder, create a JSON file such as
WM_WALL_48x120.json. - Paste a minimal wall module spec:
{
"schema_version": "wall_module_v0.1",
"module": {
"id": "WM_WALL_48x120",
"type": "wall_panel",
"width_in": 48,
"height_in": 120,
"stud_spacing_oc_in": 24,
"plates": { "top_plate_count": 2, "bottom_plate_count": 1 },
"sheathing": { "thickness_in": 0.4375 }
},
"openings": []
}
Step 2: (Optional) Create a window module spec
- Create
WM_WINDOW_48x120.json:
{
"schema_version": "wall_module_v0.1",
"module": {
"id": "WM_WINDOW_48x120",
"type": "wall_panel",
"width_in": 48,
"height_in": 120,
"stud_spacing_oc_in": 24,
"plates": { "top_plate_count": 2, "bottom_plate_count": 1 },
"sheathing": { "thickness_in": 0.4375 }
},
"openings": [
{
"id": "W1",
"type": "window",
"rough_opening": { "width_in": 36, "height_in": 48 },
"sill_height_from_bottom_in": 36,
"x_from_left_in": 6,
"header": { "type": "flush_built", "members": 2, "lumber": "2x12", "bias_to_face": "A" }
}
]
}
Step 3: (Optional) Create a door module spec
- Create
WM_DOOR_48x96.json:
{
"schema_version": "wall_module_v0.1",
"module": {
"id": "WM_DOOR_48x96",
"type": "wall_panel",
"width_in": 48,
"height_in": 96,
"stud_spacing_oc_in": 24,
"plates": { "top_plate_count": 2, "bottom_plate_count": 1 },
"sheathing": { "thickness_in": 0.4375 }
},
"openings": [
{
"id": "D1",
"type": "door",
"centered_in_module": true,
"rough_opening": { "width_in": 36, "height_in": 80 },
"header": { "type": "flush_built", "members": 2, "lumber": "2x12", "bias_to_face": "A" }
}
]
}
Step 4: Run the compiler (headless) to generate the FreeCAD file
- Open a terminal in the working folder.
- Run FreeCAD in command-line mode (
freecadcmd) to compile the JSON into an.FCStdfile:
Wall module
freecadcmd wall_module_compiler.py WM_WALL_48x120.json WM_WALL_48x120.fcstd
Window module
freecadcmd wall_module_compiler.py WM_WINDOW_48x120.json WM_WINDOW_48x120.fcstd
Door module
freecadcmd wall_module_compiler.py WM_DOOR_48x96.json WM_DOOR_48x96.fcstd
Step 5: If TechDraw causes issues, disable drawings
- Some FreeCAD installations may fail TechDraw in headless mode.
- Re-run with drawings disabled:
freecadcmd wall_module_compiler.py WM_WINDOW_48x120.json WM_WINDOW_48x120.fcstd --no-drawings
Step 6: Open the generated CAD file in FreeCAD (GUI)
- Launch FreeCAD.
- File → Open → select the generated
.fcstd. - Inspect the model tree:
WallModuleFraming→ plates / studs / openingsSheathing→ OSB panels
Step 7: Export geometry for fabrication workflows (optional)
- Export 2D/3D formats as needed:
- Select objects (or the
WallModulegroup) - File → Export
- Choose format:
- STEP (.step) for interchange
- STL for printing (if needed)
- DXF for 2D cutting (typically from TechDraw or Draft)
- Select objects (or the
Troubleshooting
- Command not found: freecadcmd
- On some systems it is named
FreeCADCmd. - Try:
FreeCADCmd wall_module_compiler.py ...
- On some systems it is named
- JSON parse errors
- Validate commas and braces; JSON must be strict.
- No TechDraw page appears
- Use
--no-drawings; geometry output is still correct. - Or generate drawings from within the FreeCAD GUI.
- Use
Output Contract (What You Get)
- A deterministic FreeCAD model file:
*.FCStd - Model contains real solids:
- Plates, studs, king/jack studs, headers, sills, cripples
- OSB sheathing panels sized per the sourcing rules
- Optional: TechDraw page(s), depending on your FreeCAD setup