Wall Module Schema: Difference between revisions

From Open Source Ecology
Jump to navigation Jump to search
(Created page with "https://chatgpt.com/share/69706dec-54ac-8010-a171-74eb64954e9a")
 
 
(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

  1. Create schema
  2. Create compiler.
  3. 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

  1. Install FreeCAD (GUI and command-line support).
  2. Create a working folder, e.g.:
    • ~/ose_wall_compiler/
  3. 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)

  1. In your working folder, create a JSON file such as WM_WALL_48x120.json.
  2. 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

  1. 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

  1. 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

  1. Open a terminal in the working folder.
  2. Run FreeCAD in command-line mode (freecadcmd) to compile the JSON into an .FCStd file:

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

  1. Some FreeCAD installations may fail TechDraw in headless mode.
  2. 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)

  1. Launch FreeCAD.
  2. File → Open → select the generated .fcstd.
  3. Inspect the model tree:
    • WallModule
    • Framing → plates / studs / openings
    • Sheathing → OSB panels

Step 7: Export geometry for fabrication workflows (optional)

  1. Export 2D/3D formats as needed:
    • Select objects (or the WallModule group)
    • File → Export
    • Choose format:
      • STEP (.step) for interchange
      • STL for printing (if needed)
      • DXF for 2D cutting (typically from TechDraw or Draft)

Troubleshooting

  1. Command not found: freecadcmd
    • On some systems it is named FreeCADCmd.
    • Try: FreeCADCmd wall_module_compiler.py ...
  2. JSON parse errors
    • Validate commas and braces; JSON must be strict.
  3. No TechDraw page appears
    • Use --no-drawings; geometry output is still correct.
    • Or generate drawings from within the FreeCAD GUI.

Output Contract (What You Get)

  1. A deterministic FreeCAD model file: *.FCStd
  2. Model contains real solids:
    • Plates, studs, king/jack studs, headers, sills, cripples
    • OSB sheathing panels sized per the sourcing rules
  3. Optional: TechDraw page(s), depending on your FreeCAD setup