Wall Module Schema: Difference between revisions
Jump to navigation
Jump to search
(Created page with "https://chatgpt.com/share/69706dec-54ac-8010-a171-74eb64954e9a") |
(→Schema) |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
https://chatgpt.com/share/69706dec-54ac-8010-a171-74eb64954e9a | 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. | |||
=Schema= | |||
[[File:wall_module_schema.yaml]] | |||
=Compiler= | |||
[[file:wall_module_compiler.zip]] | |||
= 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.: | |||
#* <code>~/ose_wall_compiler/</code> | |||
# Save these files into that folder: | |||
#* <code>wall_module_compiler.py</code> (the compiler script) | |||
#* One or more module spec files, e.g. <code>WM_WALL_48x120.json</code>, <code>WM_WINDOW_48x120.json</code>, <code>WM_DOOR_48x96.json</code> | |||
== Step 1: Create a module specification file (JSON) == | |||
# In your working folder, create a JSON file such as <code>WM_WALL_48x120.json</code>. | |||
# Paste a minimal wall module spec: | |||
<pre> | |||
{ | |||
"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": [] | |||
} | |||
</pre> | |||
== Step 2: (Optional) Create a window module spec == | |||
# Create <code>WM_WINDOW_48x120.json</code>: | |||
<pre> | |||
{ | |||
"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" } | |||
} | |||
] | |||
} | |||
</pre> | |||
== Step 3: (Optional) Create a door module spec == | |||
# Create <code>WM_DOOR_48x96.json</code>: | |||
<pre> | |||
{ | |||
"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" } | |||
} | |||
] | |||
} | |||
</pre> | |||
== Step 4: Run the compiler (headless) to generate the FreeCAD file == | |||
# Open a terminal in the working folder. | |||
# Run FreeCAD in command-line mode (<code>freecadcmd</code>) to compile the JSON into an <code>.FCStd</code> file: | |||
=== Wall module === | |||
<pre> | |||
freecadcmd wall_module_compiler.py WM_WALL_48x120.json WM_WALL_48x120.fcstd | |||
</pre> | |||
=== Window module === | |||
<pre> | |||
freecadcmd wall_module_compiler.py WM_WINDOW_48x120.json WM_WINDOW_48x120.fcstd | |||
</pre> | |||
=== Door module === | |||
<pre> | |||
freecadcmd wall_module_compiler.py WM_DOOR_48x96.json WM_DOOR_48x96.fcstd | |||
</pre> | |||
== Step 5: If TechDraw causes issues, disable drawings == | |||
# Some FreeCAD installations may fail TechDraw in headless mode. | |||
# Re-run with drawings disabled: | |||
<pre> | |||
freecadcmd wall_module_compiler.py WM_WINDOW_48x120.json WM_WINDOW_48x120.fcstd --no-drawings | |||
</pre> | |||
== Step 6: Open the generated CAD file in FreeCAD (GUI) == | |||
# Launch FreeCAD. | |||
# File → Open → select the generated <code>.fcstd</code>. | |||
# Inspect the model tree: | |||
#* <code>WallModule</code> | |||
#* <code>Framing</code> → plates / studs / openings | |||
#* <code>Sheathing</code> → OSB panels | |||
== Step 7: Export geometry for fabrication workflows (optional) == | |||
# Export 2D/3D formats as needed: | |||
#* Select objects (or the <code>WallModule</code> group) | |||
#* File → Export | |||
#* Choose format: | |||
#** STEP (.step) for interchange | |||
#** STL for printing (if needed) | |||
#** DXF for 2D cutting (typically from TechDraw or Draft) | |||
== Troubleshooting == | |||
# <b>Command not found: freecadcmd</b> | |||
#* On some systems it is named <code>FreeCADCmd</code>. | |||
#* Try: <code>FreeCADCmd wall_module_compiler.py ...</code> | |||
# <b>JSON parse errors</b> | |||
#* Validate commas and braces; JSON must be strict. | |||
# <b>No TechDraw page appears</b> | |||
#* Use <code>--no-drawings</code>; geometry output is still correct. | |||
#* Or generate drawings from within the FreeCAD GUI. | |||
== Output Contract (What You Get) == | |||
# A deterministic FreeCAD model file: <code>*.FCStd</code> | |||
# 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 | |||
Latest revision as of 03:45, 3 March 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.
Schema
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