Wall Module Schema: Difference between revisions

From Open Source Ecology
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 11: Line 11:


FreeCAD is just the rendering backend.
FreeCAD is just the rendering backend.
Once you accept that, the next obvious step is:


=Schema=
=Schema=


schema_version: "wall_module_v0.1"
[[File:wall_module_schema.yaml]]
 
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=
=Compiler=

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