Iconic CAD Workflow Example: Difference between revisions
| Line 232: | Line 232: | ||
=Compile Inkscape SVG to Generate CAD= | =Compile Inkscape SVG to Generate CAD= | ||
*So far - icons work for square shapes. But - north and south wall are reversed - N in inkscape is south in freecad etc. And last module is missing. | |||
*Sample - [[File:project.zip]] | |||
=Post-Process Resulting CAD= | =Post-Process Resulting CAD= | ||
Add corners, blocking. | Add corners, blocking. | ||
Revision as of 05:34, 12 March 2026
Iconic CAD Workflow for Wall Modules
- Author wall family schema. Start with human language for a ChatGPT prompt. This prompt, initially, includes geometry parameters. Then it includes ports (interfaces). Then it includes build procedure information. Then it includes materials information - all materials are delineated. . Materials information includes sourcing via web links. Quality Control points including dimensional tolerance.
- Run syntactic validator
- Run semantic validator
- Compile batch of wall modules
- Publish module CAD + icon library
- Arrange icons in graphics tool
- Export to SVG
- Normalize SVG
- Parse icon positions, IDs, rotations, adjacency
- Run assembly syntax validator
- Run assembly semantic validator
- Compile full CAD assembly
- Run post-processing
- Export BOM, cut list, and reports
Iconic CAD Workflow Concept Detail.
Authoring a Wall Family Schema
(based on former design at [1] but only for wall)
Design schema: Ok, let's do wall modules, 4'x9' (wide x height) using 2x6 lumber or 2x4 lumber, which is selectable. In fact, and dimension lumber is selectable from 2x2 to 2x12 lumber. Schema allows me to do 16" or 24" on center. These have 7/16" OSB on one side - the outside. Orientation is given so that 'house faces south' - ie, if you generate the module, the exterior is south, and therefore . This schema allows me to choose module width, and module height as well. Sheets of OSB come in 8 foot lengths, but 9 foot and 10 foot lengths can also be used as standards. Module width is 4' nominal, but can be selected to be lower or larger up to 8'. For a height of 9' or less it uses a single sheet of 9' osb.
Fabrication Schema: From which partial OSB heights and widths can be cut. For anything over 10', we use 8' OSB + whatever more we need - because 8' is easiest to source. For materials, if wall modules are 8, 9, or 10' - use OSB in these dimensions but use precut studs, in which case the OSB is 3/8" longer than the resulting module. In the design of 8, 9, or 10 foot modules, the extra OSB should face up so that panels can be stood on a flat bottom. Do not cut this material off, as cutting is not needed. With moduel
Materials Schema: Lumber: anything from 2x2 to 2x12 lumber, with lengths from 4' to 20'. OSB sheets, 7/16" is the standard. Can also use 1/2", 5/8", and 3/4" OSB.
Fastener Schema: For fasteners, we use 3-1/4" ring shank nails as standard for the wood, and 2-3/8" nails for OSB. Fastener schedule is 6" on perimeter and 12" in the field.
Sourcing Schema: For every material used, we have a link to the best source on the web, + as many other links as needed.
Quality Control + Tolerance Schema: Tolerance is +/- 1/8" off the stock edge of OSB, and 1/8" from the desired length and width of module. No dimensional tolerance on the panel thicknesss because dimensional lumber is used.
Optimization Schema:
Create Part Library: 3 Parts
(just using Design Schema, not Fabrication + other schemas)
| Layer | Implementation | Input | Output | Role |
|---|---|---|---|---|
| Schema | YAML | Engineering definition of module | Parameter + interface specification | Defines the semantic contract of the module |
| Generator | Python (FreeCAD API) | Schema | Parametric geometry function | Converts schema rules into geometry construction |
| Compiler | Python assembly tool | Module instances + transforms | .FCStd assembly file | Instantiates parts and builds assemblies |
Note that to create parts for the part library, 5 files are involved:
| Stage | Type | Description |
|---|---|---|
| Schema | Software + data format | YAML specification defining module semantics |
| Geometry Generator | Software | Python program producing CAD geometry |
| Part Instances | Data artifact | Generated CAD objects or parameterized parts |
| Assembly Compiler | Software | Program assembling modules into a system |
FreeCAD .FCStd
|
Data artifact | Final CAD assembly file |
Acutal Schema
- Wall Schema for Iconic CAD Workflow in YAML
- 3 Instances of Walls in YAML
Process Evolves
| Step | Stage | Description | Example | Notes |
|---|---|---|---|---|
| 1 | Design Schema (parameter space) | Defines the allowable design space for the module family, including parameter definitions, allowed ranges, enums, relationships, and constraints. No specific design values are included. | Wall Schema for Iconic CAD Workflow - framed_wall_panel_schema.yaml - YAML | Schema asks: what is allowed? Instance asks: what is chosen? Semantic validator asks: does the chosen design make sense? -> validate_semantics.py should run on the instances. |
| 2 | Instances | Specifies concrete module designs by assigning values to the parameters defined in the schema. Each instance represents one module to be generated. | 3 Instances of Walls - wall_instances.yaml | |
| 3 | Syntactic Validator | Checks that each instance conforms structurally to the schema: required fields exist, data types are correct, and enum values and ranges are respected. | Wall Syntactic Validator - validate_syntax.py | |
| 4 | Semantic Validator | Verifies that the design is logically and structurally meaningful according to engineering rules (for example, stud spacing fits within panel width, module dimensions are feasible). | Wall Semantic Validator - validate_semantics.py | Chat - [2]. $ python validate_semantics.py wall_instances.yaml -> Semantic validation passed: 3 instance(s) validated successfully. |
| 5 | Design Compiler (derive parameters) | Computes derived design values from the instance parameters and schema rules (for example, stud count, stud locations, panel thickness, and sheathing dimensions). | Wall Design Compiler - generate_wall_library.py | Make sure you have native install of FreeCAD for CLI usage - not flatpak or appimage, which is harder to parse. On Linux Mint - sudo add-apt-repository ppa:freecad-maintainers/freecad-stable
sudo apt update -> sudo apt install freecad. Must run from command line like this - freecadcmd -c "python code here". -> freecadcmd -c "import sys; sys.argv=['generate_wall_library.py','wall_instances.yaml']; exec(open('generate_wall_library.py').read())" |
| 6 | Geometry Generator | Generates the CAD geometry for each validated instance using the derived parameters and design rules, producing CAD models for the module. | Wall Geometry Generator | |
| 7 | Geometry Validator | Verifies that the generated CAD geometry matches the intended design (correct dimensions, stud placement, panel thickness, and valid solid geometry). | Wall Geometry Validator - validate_wall_geometry.py | freecadcmd -c "import sys; sys.argv=['validate_wall_geometry.py','wall_instances.yaml']; exec(open('validate_wall_geometry.py').read())" |
| 8 | CAD Part Library | Stores the compiled CAD modules (for example, .FCStd files) representing validated parametric instances of the module family. | Wall Part Library |
Icon Library Principles
- Use separate schema, do not put this into the CAD schema. This helps to make the process formal or modular - and replicable.
- Human-visible annotation is not the source of truth. Structured schema data is the source of truth. So the right architecture is: icon + machine-readable parameters + optional human-readable annotation not icon + freeform text annotation interpreted by AI
- Summary: Schemas are the reality. Visible labels are only for human readability.
Icon Prompt
Do icon in black lines. Use style from OSE Branding 2026 - [3]. Modify so each icon has an exterior Border which is thick line with rounded corners so we have a box around whatever the icon is. Give me a 2x6 24OC icon, 2x6 16OC icon, then 2x6 3'x8.5' 16OC. You can represent 24 OC as wall module with 3 studs, and 16 OC as wall module with 4 studs. To represent 2x6, just use 2x6 as the label. To show 3'x8.5', use that as a text label.
Icons
- SVG format
- 3 examples + Inkscape snapping template - File:Iconic cad icons.zip
Manipulate Icons in Inkscape
- Imported the 64 pixel template
- File:
- Initial issue - clean snap. Deselect and hold by corner to snap to grid. But, after moving a few, one of the icons is a few pixels off grid. WT?
- Make sure to enable snapping with bounding boxes in Inkscape (upper right magnet icon)
Prompt for Taking Iconic Drawing - and Converting to FreeCAD
Prompt: Ok now to generate a house from the icons, we need AI to parse the icons for their identity. Each icon already has metadata such as wall_2x6_3x8_5_16oc. We also have a CAD library (3 parts) with corresponding names. If i give AI these files (upload of fcstd files) then AI should be able to convert the icons into full CAD. There are a few conventions, such as the wall module standard faces south (exterior OSB faces south). To represent E and W wall, we rotate 90 degrees clockwise for West walls, and 90 degrees counterclockwise for East walls. Furher, the North wall is a standard module icon rotated 180 degrees. Each CAD has 'ports' defined in the schema - attach a wall to either side (vertical studs). For the north and south wall - these protrude such that the E and W walls are inset between these. How to compile this?
Iconic CAD Compilation Pipeline
SVG assembly → parse grouped icons → read metadata / IDs → identify module family → read transform (x, y, rotation) → instantiate matching CAD part → rotate CAD to match wall orientation → compute port-to-port joins → apply corner convention → place all parts in FreeCAD → fuse or keep as assembly → export FCStd / STEP / BOM
- Needs assembly_rules.yaml
- corner rules
- wall protrusion policy
- join precedence - N + S overlap E + W corners (E and W are inset between N and S walls)
Give Me Compiler
Prompt: Give me compiler to parse the SVG file and produce real CAD from it, and instructions for how to use this compiler.
Ok, so i am providing - FreeCAD parts which have been generated before. The house1.svg which contains the layout of the house framing expressed by icons. Then the schema for the original CAD for the 3 wall modules, framed_wall_panel_schema.yaml. Then the actual 3 instances of walls - wall_instances.yaml. Compiler that I used to convert the CAD schema to the wall wall panel library is not necessary.
I have house1.svg framed_wall_panel_schema.yaml wall_instances.yaml cad_library/wall_4x8_2x6_24oc_osb716_south.FCStd, wall_4x8_2x6_16oc_osb716_south.FCStd, and wall_3x8.5_2x6_16oc_osb716_south.FCStd
NOTE: had to add icon metadata (module name) as XML inside the inkscape working doc. This could have been automated with an icon generation schema.
Process
Initially, chat gave me a postition-based compiler, not a port-based compiler. The latter is more robust - it mimics the actual build process for placing one module against the next.
Position-based compiler script converts a semantic SVG house layout into an assembled FreeCAD model by mapping wall icons to wall modules, applying placement transforms, and exporting the final assembly as a FreeCAD file.
House1meta.svg -→ finds each wall icon instance in the SVG → reads which wall module each icon represents → reads the placement of each icon → reads the rotation of each icon → opens the matching FreeCAD wall part for that module → inserts that part into a new FreeCAD document at the correct position and orientation → saves the assembled result as house.FCStd
Process 2
Above process algorithm is bad. You cannot get CAD coordinates of placement from SVG. Not all walls are same width. New algorithm: seed from the bottom-left icon, place that CAD part at (0,0,0), then place all other walls relative to already placed walls using adjacency, orientation, real part dimensions, and the inset/protrusion rule.
Precise Concept for Translation of SVG to FCSTD
- Parse identity of icon and its orientation. Note that i had to enter icon metadata automatically, because icons were generated without a schema (just AI prompt). We should use wall_instances.yaml to generate the icons as well - as we want to pass a name equivalent to the CAD file name to the SVG icons.
- Identify corresponding FreeCAD part library
- In part library schema, parse ports
- Determine how to implement ports - interface to the next file
- Continue until all icons are parsed.
Compile Inkscape SVG to Generate CAD
- So far - icons work for square shapes. But - north and south wall are reversed - N in inkscape is south in freecad etc. And last module is missing.
- Sample - File:Project.zip
Post-Process Resulting CAD
Add corners, blocking.