{"id": 2, "family": "u_channel", "params": {"L": 83.2, "H": 35.1, "W": 36.0, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.2, 'H': 35.1, 'W': 36.0, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.2, 'H': 35.1, 'W': 36.0, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2153.6, "safety_factor": 0.116, "max_disp_mm": 5.8659, "max_strain": 0.015394139781185541, "peak": {"node": 281, "coords_mm": [45.07, 1.64, 3.2], "vm_mpa": 2153.6}, "volume_mm3": 810.0, "bbox_mm": [47.2, 35.1, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.0, "safety_factor": 1.938, "max_disp_mm": 0.1068, "max_strain": 0.0009220145190793536, "volume_mm3": 6187.2, "bbox_mm": [47.2, 35.1, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.822, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1, "family": "l_bracket", "params": {"L": 55.7, "H": 50.2, "W": 50.5, "T": 3.8, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.7, 'H': 50.2, 'W': 50.5, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.7, 'H': 50.2, 'W': 50.5, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 224.8, "safety_factor": 1.112, "max_disp_mm": 0.5394, "max_strain": 0.0016066934768740094, "peak": {"node": 1340, "coords_mm": [2.06, -25.1, 54.0], "vm_mpa": 224.8}, "volume_mm3": 21051.4, "bbox_mm": [59.5, 50.5, 54.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 89.2, "safety_factor": 2.801, "max_disp_mm": 0.1162, "max_strain": 0.000637943429134049, "volume_mm3": 50972.7, "bbox_mm": [64.5, 50.5, 59.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.689, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 0, "family": "plate_holes", "params": {"L": 101.4, "H": null, "W": 52.8, "T": 3.6, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.4, 'H': None, 'W': 52.8, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.4, 'H': None, 'W': 52.8, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 402.9, "safety_factor": 0.62, "max_disp_mm": 2.0492, "max_strain": 0.0028800889875610003, "peak": {"node": 2363, "coords_mm": [-49.19, -8.4, 3.6], "vm_mpa": 402.9}, "volume_mm3": 19070.5, "bbox_mm": [101.4, 52.8, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 131.5, "safety_factor": 1.9, "max_disp_mm": 0.5361, "max_strain": 0.0009402974605860944, "volume_mm3": 40260.0, "bbox_mm": [101.4, 52.8, 7.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.28, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 3, "family": "rib_bracket", "params": {"L": 56.4, "H": 46.6, "W": 47.6, "T": 4.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.4, 'H': 46.6, 'W': 47.6, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.4, 'H': 46.6, 'W': 47.6, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 301.2, "safety_factor": 0.83, "max_disp_mm": 0.7912, "max_strain": 0.0021529796468943035, "peak": {"node": 1785, "coords_mm": [8.01, -6.02, 50.9], "vm_mpa": 301.2}, "volume_mm3": 21962.2, "bbox_mm": [60.7, 47.6, 50.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.1, "safety_factor": 2.685, "max_disp_mm": 0.1095, "max_strain": 0.0006656774786608526, "volume_mm3": 55548.7, "bbox_mm": [66.7, 47.6, 56.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.855, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 4, "family": "plate_holes", "params": {"L": 110.9, "H": null, "W": 62.3, "T": 4.8, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.9, 'H': None, 'W': 62.3, 'T': 4.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.9, 'H': None, 'W': 62.3, 'T': 4.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 311.5, "safety_factor": 0.802, "max_disp_mm": 2.2717, "max_strain": 0.0022268360566145553, "peak": {"node": 1682, "coords_mm": [-54.0, -14.9, 0.0], "vm_mpa": 311.5}, "volume_mm3": 32681.0, "bbox_mm": [110.9, 62.3, 4.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.8, "safety_factor": 2.216, "max_disp_mm": 0.499, "max_strain": 0.0008064438975176586, "volume_mm3": 59915.1, "bbox_mm": [110.9, 62.3, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.413, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 6, "family": "u_channel", "params": {"L": 95.9, "H": 41.4, "W": 42.3, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.9, 'H': 41.4, 'W': 42.3, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.9, 'H': 41.4, 'W': 42.3, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1702.8, "safety_factor": 0.147, "max_disp_mm": 5.6167, "max_strain": 0.012172163467767429, "peak": {"node": 101, "coords_mm": [48.59, 3.8, 0.0], "vm_mpa": 1702.8}, "volume_mm3": 1316.9, "bbox_mm": [53.6, 41.4, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 157.4, "safety_factor": 1.588, "max_disp_mm": 0.1499, "max_strain": 0.0011251274978945512, "volume_mm3": 8182.6, "bbox_mm": [53.6, 41.4, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.441, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 5, "family": "l_bracket", "params": {"L": 69.9, "H": 59.7, "W": 58.4, "T": 4.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.9, 'H': 59.7, 'W': 58.4, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.9, 'H': 59.7, 'W': 58.4, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 282.9, "safety_factor": 0.884, "max_disp_mm": 1.0549, "max_strain": 0.0020218643087495697, "peak": {"node": 1680, "coords_mm": [7.14, -30.37, 59.7], "vm_mpa": 282.9}, "volume_mm3": 37675.0, "bbox_mm": [74.7, 58.4, 64.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.5, "safety_factor": 2.514, "max_disp_mm": 0.1915, "max_strain": 0.0007108851053251187, "volume_mm3": 79781.4, "bbox_mm": [79.7, 58.4, 69.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.63, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 7, "family": "rib_bracket", "params": {"L": 69.1, "H": 53.0, "W": 53.9, "T": 5.2, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.1, 'H': 53.0, 'W': 53.9, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.1, 'H': 53.0, 'W': 53.9, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 331.8, "safety_factor": 0.754, "max_disp_mm": 1.1173, "max_strain": 0.002371610759139006, "peak": {"node": 1604, "coords_mm": [8.58, -7.31, 53.0], "vm_mpa": 331.8}, "volume_mm3": 35679.6, "bbox_mm": [74.3, 53.9, 58.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.1, "safety_factor": 2.27, "max_disp_mm": 0.181, "max_strain": 0.0007872404931841202, "volume_mm3": 80470.5, "bbox_mm": [80.3, 53.9, 64.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.516, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 8, "family": "plate_holes", "params": {"L": 120.4, "H": null, "W": 71.8, "T": 6.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.4, 'H': None, 'W': 71.8, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.4, 'H': None, 'W': 71.8, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 221.9, "safety_factor": 1.126, "max_disp_mm": 1.5698, "max_strain": 0.001586366613570083, "peak": {"node": 3303, "coords_mm": [-58.07, 22.29, 6.1], "vm_mpa": 221.9}, "volume_mm3": 51774.6, "bbox_mm": [120.4, 71.8, 6.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.0, "safety_factor": 2.525, "max_disp_mm": 0.4586, "max_strain": 0.0007077954616631204, "volume_mm3": 85725.2, "bbox_mm": [120.4, 71.8, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.398, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 10, "family": "u_channel", "params": {"L": 108.6, "H": 47.7, "W": 48.7, "T": 4.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.6, 'H': 47.7, 'W': 48.7, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.6, 'H': 47.7, 'W': 48.7, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 832.9, "safety_factor": 0.3, "max_disp_mm": 2.6293, "max_strain": 0.00595399665113824, "peak": {"node": 307, "coords_mm": [59.22, 2.41, 0.0], "vm_mpa": 832.9}, "volume_mm3": 2087.8, "bbox_mm": [59.9, 47.7, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.7, "safety_factor": 2.41, "max_disp_mm": 0.1074, "max_strain": 0.0007415052825049913, "volume_mm3": 10705.3, "bbox_mm": [59.9, 47.7, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.11, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 9, "family": "l_bracket", "params": {"L": 84.2, "H": 69.2, "W": 66.4, "T": 5.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 84.2, 'H': 69.2, 'W': 66.4, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 84.2, 'H': 69.2, 'W': 66.4, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 238.5, "safety_factor": 1.048, "max_disp_mm": 0.9942, "max_strain": 0.001704639652201016, "peak": {"node": 2331, "coords_mm": [9.03, -4.64, 69.2], "vm_mpa": 238.5}, "volume_mm3": 60216.2, "bbox_mm": [89.9, 66.4, 74.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.3, "safety_factor": 2.444, "max_disp_mm": 0.2277, "max_strain": 0.0007312643678002046, "volume_mm3": 116589.8, "bbox_mm": [94.9, 66.4, 79.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.395, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 13, "family": "l_bracket", "params": {"L": 53.5, "H": 48.7, "W": 49.3, "T": 3.7, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 53.5, 'H': 48.7, 'W': 49.3, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 53.5, 'H': 48.7, 'W': 49.3, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 235.9, "safety_factor": 1.06, "max_disp_mm": 0.4896, "max_strain": 0.0016860374758385585, "peak": {"node": 1726, "coords_mm": [1.76, -18.49, 52.4], "vm_mpa": 235.9}, "volume_mm3": 19317.2, "bbox_mm": [57.2, 49.3, 52.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 81.4, "safety_factor": 3.072, "max_disp_mm": 0.1084, "max_strain": 0.000581657132116359, "volume_mm3": 47566.1, "bbox_mm": [62.2, 49.3, 57.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.012, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 11, "family": "rib_bracket", "params": {"L": 81.7, "H": 59.3, "W": 40.3, "T": 3.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.7, 'H': 59.3, 'W': 40.3, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.7, 'H': 59.3, 'W': 40.3, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 782.7, "safety_factor": 0.319, "max_disp_mm": 4.8877, "max_strain": 0.0055951613599625315, "peak": {"node": 1399, "coords_mm": [1.74, -20.29, 62.5], "vm_mpa": 782.7}, "volume_mm3": 18596.0, "bbox_mm": [84.9, 40.3, 62.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 132.2, "safety_factor": 1.892, "max_disp_mm": 0.291, "max_strain": 0.0009446290819083858, "volume_mm3": 68697.0, "bbox_mm": [92.9, 40.3, 70.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.572, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 14, "family": "u_channel", "params": {"L": 81.2, "H": 34.1, "W": 35.0, "T": 3.1, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.2, 'H': 34.1, 'W': 35.0, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.2, 'H': 34.1, 'W': 35.0, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2029.7, "safety_factor": 0.123, "max_disp_mm": 6.0497, "max_strain": 0.014508368645293422, "peak": {"node": 246, "coords_mm": [39.03, 1.6, 0.0], "vm_mpa": 2029.7}, "volume_mm3": 741.9, "bbox_mm": [46.2, 34.1, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.3, "safety_factor": 1.949, "max_disp_mm": 0.1024, "max_strain": 0.000916881901595222, "volume_mm3": 5896.1, "bbox_mm": [46.2, 34.1, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.826, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 12, "family": "plate_holes", "params": {"L": 129.9, "H": null, "W": 51.3, "T": 3.4, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.9, 'H': None, 'W': 51.3, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.9, 'H': None, 'W': 51.3, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 540.2, "safety_factor": 0.463, "max_disp_mm": 5.333, "max_strain": 0.003861081152970547, "peak": {"node": 133, "coords_mm": [-64.95, -13.44, 3.4], "vm_mpa": 540.2}, "volume_mm3": 22464.9, "bbox_mm": [129.9, 51.3, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.2, "safety_factor": 2.247, "max_disp_mm": 0.6497, "max_strain": 0.0007951364710415374, "volume_mm3": 62108.8, "bbox_mm": [129.9, 51.3, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.785, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 15, "family": "rib_bracket", "params": {"L": 54.4, "H": 45.6, "W": 46.6, "T": 4.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.4, 'H': 45.6, 'W': 46.6, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.4, 'H': 45.6, 'W': 46.6, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 257.1, "safety_factor": 0.972, "max_disp_mm": 0.5618, "max_strain": 0.0018376957152921045, "peak": {"node": 1185, "coords_mm": [2.1, -15.99, 49.7], "vm_mpa": 257.1}, "volume_mm3": 19889.3, "bbox_mm": [58.5, 46.6, 49.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 89.7, "safety_factor": 2.788, "max_disp_mm": 0.1059, "max_strain": 0.0006410058254111108, "volume_mm3": 51819.7, "bbox_mm": [64.5, 46.6, 55.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.815, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 16, "family": "plate_holes", "params": {"L": 109.4, "H": null, "W": 60.8, "T": 4.6, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.4, 'H': None, 'W': 60.8, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.4, 'H': None, 'W': 60.8, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 351.5, "safety_factor": 0.711, "max_disp_mm": 2.5325, "max_strain": 0.0025127918626054245, "peak": {"node": 438, "coords_mm": [-53.15, 9.78, 0.0], "vm_mpa": 351.5}, "volume_mm3": 30134.5, "bbox_mm": [109.4, 60.8, 4.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.3, "safety_factor": 2.078, "max_disp_mm": 0.5213, "max_strain": 0.0008600177579238156, "volume_mm3": 56338.5, "bbox_mm": [109.4, 60.8, 8.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.367, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 18, "family": "u_channel", "params": {"L": 93.9, "H": 40.4, "W": 41.3, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.9, 'H': 40.4, 'W': 41.3, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.9, 'H': 40.4, 'W': 41.3, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1559.4, "safety_factor": 0.16, "max_disp_mm": 4.8817, "max_strain": 0.01114660048403301, "peak": {"node": 278, "coords_mm": [46.86, 1.81, 0.0], "vm_mpa": 1559.4}, "volume_mm3": 1222.5, "bbox_mm": [52.6, 40.4, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.4, "safety_factor": 2.06, "max_disp_mm": 0.1229, "max_strain": 0.0008675013972761398, "volume_mm3": 7837.7, "bbox_mm": [52.6, 40.4, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.9, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 17, "family": "l_bracket", "params": {"L": 67.7, "H": 58.2, "W": 57.2, "T": 4.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.7, 'H': 58.2, 'W': 57.2, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.7, 'H': 58.2, 'W': 57.2, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 319.1, "safety_factor": 0.784, "max_disp_mm": 1.096, "max_strain": 0.0022807858280155108, "peak": {"node": 2035, "coords_mm": [11.14, -49.69, 62.8], "vm_mpa": 319.1}, "volume_mm3": 34337.2, "bbox_mm": [72.3, 57.2, 62.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.8, "safety_factor": 2.481, "max_disp_mm": 0.1885, "max_strain": 0.0007202379928123203, "volume_mm3": 74405.8, "bbox_mm": [77.3, 57.2, 67.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.698, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 19, "family": "rib_bracket", "params": {"L": 67.1, "H": 52.0, "W": 52.9, "T": 5.1, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.1, 'H': 52.0, 'W': 52.9, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.1, 'H': 52.0, 'W': 52.9, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 349.5, "safety_factor": 0.715, "max_disp_mm": 1.0925, "max_strain": 0.0024983266715140964, "peak": {"node": 1389, "coords_mm": [7.28, -39.95, 52.0], "vm_mpa": 349.5}, "volume_mm3": 33507.9, "bbox_mm": [72.2, 52.9, 57.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.7, "safety_factor": 2.072, "max_disp_mm": 0.1743, "max_strain": 0.0008626011539073896, "volume_mm3": 76452.1, "bbox_mm": [78.2, 52.9, 63.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.356, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 20, "family": "plate_holes", "params": {"L": 118.9, "H": null, "W": 70.4, "T": 5.9, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.9, 'H': None, 'W': 70.4, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.9, 'H': None, 'W': 70.4, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 252.5, "safety_factor": 0.99, "max_disp_mm": 1.7043, "max_strain": 0.0018047860786421274, "peak": {"node": 3304, "coords_mm": [-57.46, -2.4, 5.9], "vm_mpa": 252.5}, "volume_mm3": 48459.5, "bbox_mm": [118.9, 70.4, 5.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.0, "safety_factor": 2.314, "max_disp_mm": 0.4757, "max_strain": 0.000772118674455666, "volume_mm3": 81313.5, "bbox_mm": [118.9, 70.4, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.324, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 22, "family": "u_channel", "params": {"L": 106.6, "H": 46.7, "W": 47.7, "T": 4.4, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.6, 'H': 46.7, 'W': 47.7, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.6, 'H': 46.7, 'W': 47.7, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1208.3, "safety_factor": 0.207, "max_disp_mm": 4.0923, "max_strain": 0.008637359459984187, "peak": {"node": 347, "coords_mm": [53.79, 2.11, 4.4], "vm_mpa": 1208.3}, "volume_mm3": 1959.2, "bbox_mm": [58.9, 46.7, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 134.7, "safety_factor": 1.856, "max_disp_mm": 0.1579, "max_strain": 0.0009627186351620151, "volume_mm3": 10296.8, "bbox_mm": [58.9, 46.7, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.649, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 21, "family": "l_bracket", "params": {"L": 82.0, "H": 67.7, "W": 65.1, "T": 5.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.0, 'H': 67.7, 'W': 65.1, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.0, 'H': 67.7, 'W': 65.1, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 230.4, "safety_factor": 1.085, "max_disp_mm": 0.9981, "max_strain": 0.001646875653977547, "peak": {"node": 2230, "coords_mm": [9.47, -28.91, 67.7], "vm_mpa": 230.4}, "volume_mm3": 56616.2, "bbox_mm": [87.6, 65.1, 73.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.0, "safety_factor": 2.55, "max_disp_mm": 0.2213, "max_strain": 0.0007008609321853715, "volume_mm3": 110616.6, "bbox_mm": [92.6, 65.1, 78.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.465, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 23, "family": "rib_bracket", "params": {"L": 79.7, "H": 58.3, "W": 59.3, "T": 3.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.7, 'H': 58.3, 'W': 59.3, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.7, 'H': 58.3, 'W': 59.3, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 443.4, "safety_factor": 0.564, "max_disp_mm": 2.8787, "max_strain": 0.003169347793621818, "peak": {"node": 2475, "coords_mm": [2.14, -43.27, 61.3], "vm_mpa": 443.4}, "volume_mm3": 25083.9, "bbox_mm": [82.7, 59.3, 61.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.7, "safety_factor": 2.021, "max_disp_mm": 0.3161, "max_strain": 0.0008840586194104315, "volume_mm3": 78453.9, "bbox_mm": [88.7, 59.3, 67.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.458, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 25, "family": "l_bracket", "params": {"L": 51.2, "H": 47.2, "W": 48.0, "T": 3.5, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 51.2, 'H': 47.2, 'W': 48.0, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 51.2, 'H': 47.2, 'W': 48.0, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 210.9, "safety_factor": 1.186, "max_disp_mm": 0.531, "max_strain": 0.001507364559828545, "peak": {"node": 1214, "coords_mm": [2.14, -32.17, 50.7], "vm_mpa": 210.9}, "volume_mm3": 17119.2, "bbox_mm": [54.7, 48.0, 50.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 88.5, "safety_factor": 2.825, "max_disp_mm": 0.1058, "max_strain": 0.0006326018301593498, "volume_mm3": 43615.2, "bbox_mm": [59.7, 48.0, 55.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.639, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 24, "family": "plate_holes", "params": {"L": 128.4, "H": null, "W": 79.9, "T": 3.2, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.4, 'H': None, 'W': 79.9, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.4, 'H': None, 'W': 79.9, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 387.5, "safety_factor": 0.645, "max_disp_mm": 3.1821, "max_strain": 0.0027699696653059646, "peak": {"node": 140, "coords_mm": [-64.2, -17.48, 3.2], "vm_mpa": 387.5}, "volume_mm3": 32648.4, "bbox_mm": [128.4, 79.9, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.2, "safety_factor": 2.189, "max_disp_mm": 0.7993, "max_strain": 0.0008164565112791547, "volume_mm3": 73458.8, "bbox_mm": [128.4, 79.9, 7.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.544, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 26, "family": "u_channel", "params": {"L": 79.2, "H": 33.1, "W": 34.0, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.2, 'H': 33.1, 'W': 34.0, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.2, 'H': 33.1, 'W': 34.0, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1962.2, "safety_factor": 0.127, "max_disp_mm": 5.3279, "max_strain": 0.014026259616810652, "peak": {"node": 262, "coords_mm": [37.88, 1.5, 3.0], "vm_mpa": 1962.2}, "volume_mm3": 677.7, "bbox_mm": [45.2, 33.1, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.9, "safety_factor": 2.384, "max_disp_mm": 0.0798, "max_strain": 0.0007497394478040311, "volume_mm3": 5613.3, "bbox_mm": [45.2, 33.1, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.256, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 27, "family": "rib_bracket", "params": {"L": 52.4, "H": 44.7, "W": 45.6, "T": 4.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.4, 'H': 44.7, 'W': 45.6, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.4, 'H': 44.7, 'W': 45.6, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 263.3, "safety_factor": 0.949, "max_disp_mm": 0.6335, "max_strain": 0.0018822535754964094, "peak": {"node": 1133, "coords_mm": [2.08, -15.6, 48.7], "vm_mpa": 263.3}, "volume_mm3": 18440.6, "bbox_mm": [56.4, 45.6, 48.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 94.8, "safety_factor": 2.636, "max_disp_mm": 0.1003, "max_strain": 0.0006779449920000589, "volume_mm3": 48837.6, "bbox_mm": [62.4, 45.6, 54.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.687, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 28, "family": "plate_holes", "params": {"L": 107.9, "H": null, "W": 59.4, "T": 4.4, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.9, 'H': None, 'W': 59.4, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.9, 'H': None, 'W': 59.4, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 374.5, "safety_factor": 0.667, "max_disp_mm": 2.7626, "max_strain": 0.0026772618095070567, "peak": {"node": 2505, "coords_mm": [-51.85, -3.66, 4.4], "vm_mpa": 374.5}, "volume_mm3": 27758.4, "bbox_mm": [107.9, 59.4, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.2, "safety_factor": 1.997, "max_disp_mm": 0.5483, "max_strain": 0.000894724675421853, "volume_mm3": 52993.3, "bbox_mm": [107.9, 59.4, 8.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.33, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 30, "family": "u_channel", "params": {"L": 91.9, "H": 39.4, "W": 40.4, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.9, 'H': 39.4, 'W': 40.4, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.9, 'H': 39.4, 'W': 40.4, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1809.9, "safety_factor": 0.138, "max_disp_mm": 4.9695, "max_strain": 0.012937710633742586, "peak": {"node": 269, "coords_mm": [45.32, 2.21, 0.0], "vm_mpa": 1809.9}, "volume_mm3": 1131.4, "bbox_mm": [51.5, 39.4, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.2, "safety_factor": 2.012, "max_disp_mm": 0.1185, "max_strain": 0.0008880559473606951, "volume_mm3": 7492.6, "bbox_mm": [51.5, 39.4, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.874, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 29, "family": "l_bracket", "params": {"L": 65.5, "H": 56.7, "W": 56.0, "T": 4.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.5, 'H': 56.7, 'W': 56.0, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.5, 'H': 56.7, 'W': 56.0, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 316.7, "safety_factor": 0.789, "max_disp_mm": 1.0599, "max_strain": 0.002263722377971091, "peak": {"node": 2003, "coords_mm": [7.85, -30.13, 61.2], "vm_mpa": 316.7}, "volume_mm3": 31928.4, "bbox_mm": [70.0, 56.0, 61.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.9, "safety_factor": 2.501, "max_disp_mm": 0.1804, "max_strain": 0.0007144258244714042, "volume_mm3": 70064.4, "bbox_mm": [75.0, 56.0, 66.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.712, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 31, "family": "rib_bracket", "params": {"L": 65.1, "H": 51.0, "W": 51.9, "T": 4.9, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.1, 'H': 51.0, 'W': 51.9, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.1, 'H': 51.0, 'W': 51.9, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 371.0, "safety_factor": 0.674, "max_disp_mm": 1.1623, "max_strain": 0.0026522191894591384, "peak": {"node": 1781, "coords_mm": [7.75, -17.29, 55.9], "vm_mpa": 371.0}, "volume_mm3": 30771.5, "bbox_mm": [70.0, 51.9, 55.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.2, "safety_factor": 2.133, "max_disp_mm": 0.1708, "max_strain": 0.0008376106370138813, "volume_mm3": 71845.2, "bbox_mm": [76.0, 51.9, 61.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.46, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 32, "family": "plate_holes", "params": {"L": 117.4, "H": null, "W": 68.9, "T": 5.7, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.4, 'H': None, 'W': 68.9, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.4, 'H': None, 'W': 68.9, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 288.9, "safety_factor": 0.865, "max_disp_mm": 1.8462, "max_strain": 0.0020649578855416657, "peak": {"node": 3481, "coords_mm": [-57.23, 1.23, 5.7], "vm_mpa": 288.9}, "volume_mm3": 45211.1, "bbox_mm": [117.4, 68.9, 5.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.5, "safety_factor": 2.243, "max_disp_mm": 0.4936, "max_strain": 0.0007967911021863109, "volume_mm3": 76938.3, "bbox_mm": [117.4, 68.9, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.377, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 34, "family": "u_channel", "params": {"L": 104.6, "H": 45.7, "W": 46.7, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.6, 'H': 45.7, 'W': 46.7, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.6, 'H': 45.7, 'W': 46.7, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1475.8, "safety_factor": 0.169, "max_disp_mm": 4.2046, "max_strain": 0.01054902249655376, "peak": {"node": 307, "coords_mm": [52.73, 2.04, 0.0], "vm_mpa": 1475.8}, "volume_mm3": 1836.1, "bbox_mm": [57.9, 45.7, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 145.9, "safety_factor": 1.713, "max_disp_mm": 0.156, "max_strain": 0.0010432206812413629, "volume_mm3": 9898.2, "bbox_mm": [57.9, 45.7, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.544, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 33, "family": "l_bracket", "params": {"L": 79.7, "H": 66.2, "W": 63.9, "T": 5.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.7, 'H': 66.2, 'W': 63.9, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.7, 'H': 66.2, 'W': 63.9, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 243.7, "safety_factor": 1.026, "max_disp_mm": 1.0292, "max_strain": 0.0017420095979594756, "peak": {"node": 2145, "coords_mm": [8.88, -46.64, 66.2], "vm_mpa": 243.7}, "volume_mm3": 52207.6, "bbox_mm": [85.1, 63.9, 71.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.2, "safety_factor": 2.469, "max_disp_mm": 0.2182, "max_strain": 0.0007236418506783244, "volume_mm3": 103870.7, "bbox_mm": [90.1, 63.9, 76.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.444, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 35, "family": "rib_bracket", "params": {"L": 77.8, "H": 57.3, "W": 58.3, "T": 5.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.8, 'H': 57.3, 'W': 58.3, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.8, 'H': 57.3, 'W': 58.3, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 211.9, "safety_factor": 1.18, "max_disp_mm": 0.7815, "max_strain": 0.0015145288460665426, "peak": {"node": 1060, "coords_mm": [7.72, -47.33, 57.3], "vm_mpa": 211.9}, "volume_mm3": 48499.8, "bbox_mm": [83.7, 58.3, 63.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 82.4, "safety_factor": 3.034, "max_disp_mm": 0.149, "max_strain": 0.000589007951729315, "volume_mm3": 101984.2, "bbox_mm": [89.7, 58.3, 69.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.854, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 38, "family": "u_channel", "params": {"L": 77.3, "H": 32.1, "W": 33.0, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.3, 'H': 32.1, 'W': 33.0, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.3, 'H': 32.1, 'W': 33.0, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2160.1, "safety_factor": 0.116, "max_disp_mm": 5.2421, "max_strain": 0.015440267413713534, "peak": {"node": 262, "coords_mm": [36.95, 1.49, 2.9], "vm_mpa": 2160.1}, "volume_mm3": 618.1, "bbox_mm": [44.3, 32.1, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.9, "safety_factor": 2.36, "max_disp_mm": 0.0802, "max_strain": 0.0007572494183129888, "volume_mm3": 5346.7, "bbox_mm": [44.3, 32.1, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.244, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 37, "family": "l_bracket", "params": {"L": 94.0, "H": 45.7, "W": 46.8, "T": 3.4, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.0, 'H': 45.7, 'W': 46.8, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.0, 'H': 45.7, 'W': 46.8, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 489.9, "safety_factor": 0.51, "max_disp_mm": 3.5397, "max_strain": 0.0035016494537817348, "peak": {"node": 2375, "coords_mm": [1.8, -10.51, 49.1], "vm_mpa": 489.9}, "volume_mm3": 22770.1, "bbox_mm": [97.4, 46.8, 49.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.0, "safety_factor": 1.953, "max_disp_mm": 0.3587, "max_strain": 0.0009150336436925692, "volume_mm3": 73056.7, "bbox_mm": [104.4, 46.8, 56.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.443, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 39, "family": "rib_bracket", "params": {"L": 50.4, "H": 43.7, "W": 44.6, "T": 3.8, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.4, 'H': 43.7, 'W': 44.6, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.4, 'H': 43.7, 'W': 44.6, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 291.4, "safety_factor": 0.858, "max_disp_mm": 0.5656, "max_strain": 0.0020830840429085936, "peak": {"node": 1358, "coords_mm": [2.05, -33.45, 47.5], "vm_mpa": 291.4}, "volume_mm3": 16592.1, "bbox_mm": [54.2, 44.6, 47.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 81.6, "safety_factor": 3.064, "max_disp_mm": 0.097, "max_strain": 0.00058320854298063, "volume_mm3": 45412.6, "bbox_mm": [60.2, 44.6, 53.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.206, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 40, "family": "plate_holes", "params": {"L": 106.4, "H": null, "W": 57.9, "T": 4.2, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.4, 'H': None, 'W': 57.9, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.4, 'H': None, 'W': 57.9, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 389.6, "safety_factor": 0.642, "max_disp_mm": 2.6558, "max_strain": 0.002784768785980302, "peak": {"node": 1493, "coords_mm": [-51.56, 1.32, 0.0], "vm_mpa": 389.6}, "volume_mm3": 25452.1, "bbox_mm": [106.4, 57.9, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 136.0, "safety_factor": 1.839, "max_disp_mm": 0.5762, "max_strain": 0.0009718920784473432, "volume_mm3": 49692.2, "bbox_mm": [106.4, 57.9, 8.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.197, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 42, "family": "u_channel", "params": {"L": 89.9, "H": 38.4, "W": 39.4, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.9, 'H': 38.4, 'W': 39.4, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.9, 'H': 38.4, 'W': 39.4, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1645.3, "safety_factor": 0.152, "max_disp_mm": 5.4455, "max_strain": 0.011760834202568935, "peak": {"node": 266, "coords_mm": [45.89, 1.71, 0.0], "vm_mpa": 1645.3}, "volume_mm3": 1046.2, "bbox_mm": [50.5, 38.4, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.5, "safety_factor": 2.058, "max_disp_mm": 0.1152, "max_strain": 0.0008682534574443877, "volume_mm3": 7165.9, "bbox_mm": [50.5, 38.4, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.906, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 41, "family": "l_bracket", "params": {"L": 63.2, "H": 55.2, "W": 54.7, "T": 4.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 63.2, 'H': 55.2, 'W': 54.7, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 63.2, 'H': 55.2, 'W': 54.7, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 242.1, "safety_factor": 1.032, "max_disp_mm": 0.7558, "max_strain": 0.0017308329120639782, "peak": {"node": 1200, "coords_mm": [10.78, -28.32, 55.2], "vm_mpa": 242.1}, "volume_mm3": 28860.3, "bbox_mm": [67.5, 54.7, 59.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 72.7, "safety_factor": 3.441, "max_disp_mm": 0.1324, "max_strain": 0.0005193133278584471, "volume_mm3": 64962.3, "bbox_mm": [72.5, 54.7, 64.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.409, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 43, "family": "rib_bracket", "params": {"L": 63.1, "H": 50.0, "W": 50.9, "T": 4.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.1, 'H': 50.0, 'W': 50.9, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.1, 'H': 50.0, 'W': 50.9, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 356.8, "safety_factor": 0.701, "max_disp_mm": 1.1434, "max_strain": 0.002550693379655903, "peak": {"node": 1379, "coords_mm": [6.46, -40.13, 50.0], "vm_mpa": 356.8}, "volume_mm3": 28805.3, "bbox_mm": [67.9, 50.9, 54.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.2, "safety_factor": 2.097, "max_disp_mm": 0.1637, "max_strain": 0.0008520068494281503, "volume_mm3": 68110.3, "bbox_mm": [73.9, 50.9, 60.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.397, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 44, "family": "plate_holes", "params": {"L": 115.9, "H": null, "W": 67.4, "T": 5.5, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.9, 'H': None, 'W': 67.4, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.9, 'H': None, 'W': 67.4, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 288.1, "safety_factor": 0.868, "max_disp_mm": 2.021, "max_strain": 0.0020592545161664546, "peak": {"node": 2010, "coords_mm": [-55.95, -0.07, 5.5], "vm_mpa": 288.1}, "volume_mm3": 42100.2, "bbox_mm": [115.9, 67.4, 5.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.0, "safety_factor": 2.232, "max_disp_mm": 0.5165, "max_strain": 0.0008005480083567349, "volume_mm3": 72718.5, "bbox_mm": [115.9, 67.4, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.364, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 46, "family": "u_channel", "params": {"L": 102.6, "H": 44.7, "W": 45.7, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.6, 'H': 44.7, 'W': 45.7, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.6, 'H': 44.7, 'W': 45.7, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1501.5, "safety_factor": 0.166, "max_disp_mm": 4.5243, "max_strain": 0.0107332636702942, "peak": {"node": 85, "coords_mm": [52.3, 4.2, 4.2], "vm_mpa": 1501.5}, "volume_mm3": 1718.1, "bbox_mm": [56.9, 44.7, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 154.7, "safety_factor": 1.616, "max_disp_mm": 0.1545, "max_strain": 0.0011058266515642553, "volume_mm3": 9509.3, "bbox_mm": [56.9, 44.7, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.45, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 45, "family": "l_bracket", "params": {"L": 77.5, "H": 64.7, "W": 62.6, "T": 5.3, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 77.5, 'H': 64.7, 'W': 62.6, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 77.5, 'H': 64.7, 'W': 62.6, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 264.4, "safety_factor": 0.946, "max_disp_mm": 1.0248, "max_strain": 0.00188967804504071, "peak": {"node": 2617, "coords_mm": [6.11, -35.29, 70.0], "vm_mpa": 264.4}, "volume_mm3": 48937.5, "bbox_mm": [82.8, 62.6, 70.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.2, "safety_factor": 2.4, "max_disp_mm": 0.211, "max_strain": 0.0007445421051987361, "volume_mm3": 98328.9, "bbox_mm": [87.8, 62.6, 75.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.455, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 50, "family": "u_channel", "params": {"L": 75.3, "H": 31.1, "W": 32.0, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.3, 'H': 31.1, 'W': 32.0, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.3, 'H': 31.1, 'W': 32.0, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2093.8, "safety_factor": 0.119, "max_disp_mm": 5.7779, "max_strain": 0.014966891468555297, "peak": {"node": 231, "coords_mm": [35.99, 1.53, 0.0], "vm_mpa": 2093.8}, "volume_mm3": 561.3, "bbox_mm": [43.3, 31.1, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.3, "safety_factor": 2.542, "max_disp_mm": 0.0771, "max_strain": 0.0007028922062069856, "volume_mm3": 5080.1, "bbox_mm": [43.3, 31.1, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.423, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 47, "family": "rib_bracket", "params": {"L": 75.8, "H": 56.3, "W": 57.3, "T": 5.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.8, 'H': 56.3, 'W': 57.3, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.8, 'H': 56.3, 'W': 57.3, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 302.7, "safety_factor": 0.826, "max_disp_mm": 1.0796, "max_strain": 0.002163814460969982, "peak": {"node": 1478, "coords_mm": [7.62, -8.71, 56.3], "vm_mpa": 302.7}, "volume_mm3": 45006.9, "bbox_mm": [81.5, 57.3, 62.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.3, "safety_factor": 2.542, "max_disp_mm": 0.1956, "max_strain": 0.0007029924703621594, "volume_mm3": 96405.0, "bbox_mm": [87.5, 57.3, 68.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.716, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 51, "family": "rib_bracket", "params": {"L": 48.4, "H": 42.7, "W": 43.6, "T": 3.7, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.4, 'H': 42.7, 'W': 43.6, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.4, 'H': 42.7, 'W': 43.6, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 267.3, "safety_factor": 0.935, "max_disp_mm": 0.513, "max_strain": 0.0019106737314116815, "peak": {"node": 1457, "coords_mm": [3.34, -21.78, 46.4], "vm_mpa": 267.3}, "volume_mm3": 15293.1, "bbox_mm": [52.1, 43.6, 46.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.0, "safety_factor": 2.777, "max_disp_mm": 0.0914, "max_strain": 0.0006435938345820295, "volume_mm3": 42630.3, "bbox_mm": [58.1, 43.6, 52.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.841, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 52, "family": "plate_holes", "params": {"L": 105.0, "H": null, "W": 56.4, "T": 4.0, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.0, 'H': None, 'W': 56.4, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.0, 'H': None, 'W': 56.4, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 374.0, "safety_factor": 0.668, "max_disp_mm": 2.2015, "max_strain": 0.002673596217380002, "peak": {"node": 1442, "coords_mm": [-50.98, 19.64, 0.0], "vm_mpa": 374.0}, "volume_mm3": 23285.9, "bbox_mm": [105.0, 56.4, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 143.3, "safety_factor": 1.744, "max_disp_mm": 0.6061, "max_strain": 0.0010244088180884224, "volume_mm3": 46571.8, "bbox_mm": [105.0, 56.4, 8.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.076, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 49, "family": "l_bracket", "params": {"L": 91.7, "H": 74.2, "W": 45.6, "T": 3.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.7, 'H': 74.2, 'W': 45.6, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.7, 'H': 74.2, 'W': 45.6, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 481.0, "safety_factor": 0.52, "max_disp_mm": 4.7288, "max_strain": 0.0034382879337367897, "peak": {"node": 2567, "coords_mm": [1.45, -27.6, 77.4], "vm_mpa": 481.0}, "volume_mm3": 24675.1, "bbox_mm": [94.9, 45.6, 77.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.9, "safety_factor": 1.986, "max_disp_mm": 0.3599, "max_strain": 0.000899630286680775, "volume_mm3": 81907.6, "bbox_mm": [101.9, 45.6, 84.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.467, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 54, "family": "u_channel", "params": {"L": 87.9, "H": 37.4, "W": 38.4, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.9, 'H': 37.4, 'W': 38.4, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.9, 'H': 37.4, 'W': 38.4, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1940.1, "safety_factor": 0.129, "max_disp_mm": 5.4729, "max_strain": 0.013868442937790985, "peak": {"node": 92, "coords_mm": [44.23, 3.4, 0.0], "vm_mpa": 1940.1}, "volume_mm3": 965.3, "bbox_mm": [49.5, 37.4, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 130.0, "safety_factor": 1.924, "max_disp_mm": 0.1135, "max_strain": 0.0009289219740003212, "volume_mm3": 6847.9, "bbox_mm": [49.5, 37.4, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.795, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 53, "family": "l_bracket", "params": {"L": 61.0, "H": 53.7, "W": 53.5, "T": 4.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.0, 'H': 53.7, 'W': 53.5, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.0, 'H': 53.7, 'W': 53.5, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 235.0, "safety_factor": 1.064, "max_disp_mm": 0.73, "max_strain": 0.0016801728876854089, "peak": {"node": 1203, "coords_mm": [23.76, -50.42, 53.7], "vm_mpa": 235.0}, "volume_mm3": 26716.8, "bbox_mm": [65.2, 53.5, 57.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.1, "safety_factor": 3.008, "max_disp_mm": 0.1267, "max_strain": 0.0005940402857357263, "volume_mm3": 60983.6, "bbox_mm": [70.2, 53.5, 62.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.945, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 55, "family": "rib_bracket", "params": {"L": 61.1, "H": 49.0, "W": 49.9, "T": 4.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.1, 'H': 49.0, 'W': 49.9, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.1, 'H': 49.0, 'W': 49.9, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 387.5, "safety_factor": 0.645, "max_disp_mm": 1.1679, "max_strain": 0.002769982905411014, "peak": {"node": 1154, "coords_mm": [6.59, -18.69, 49.0], "vm_mpa": 387.5}, "volume_mm3": 26328.2, "bbox_mm": [65.7, 49.9, 53.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.2, "safety_factor": 2.151, "max_disp_mm": 0.1603, "max_strain": 0.000830929217646774, "volume_mm3": 63843.1, "bbox_mm": [71.7, 49.9, 59.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.506, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 58, "family": "u_channel", "params": {"L": 100.6, "H": 43.8, "W": 44.7, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.6, 'H': 43.8, 'W': 44.7, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.6, 'H': 43.8, 'W': 44.7, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1630.0, "safety_factor": 0.153, "max_disp_mm": 4.5082, "max_strain": 0.011651758252670279, "peak": {"node": 290, "coords_mm": [55.37, 2.02, 0.0], "vm_mpa": 1630.0}, "volume_mm3": 1607.0, "bbox_mm": [55.9, 43.8, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 148.5, "safety_factor": 1.684, "max_disp_mm": 0.152, "max_strain": 0.001061201699564142, "volume_mm3": 9140.1, "bbox_mm": [55.9, 43.8, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.531, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 56, "family": "plate_holes", "params": {"L": 114.5, "H": null, "W": 65.9, "T": 5.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.5, 'H': None, 'W': 65.9, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.5, 'H': None, 'W': 65.9, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 323.2, "safety_factor": 0.774, "max_disp_mm": 2.2031, "max_strain": 0.0023099324683769945, "peak": {"node": 1862, "coords_mm": [-55.67, 7.3, 0.0], "vm_mpa": 323.2}, "volume_mm3": 39158.9, "bbox_mm": [114.5, 65.9, 5.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.8, "safety_factor": 2.052, "max_disp_mm": 0.5384, "max_strain": 0.0008707919235677831, "volume_mm3": 68712.8, "bbox_mm": [114.5, 65.9, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.279, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 57, "family": "l_bracket", "params": {"L": 75.3, "H": 63.3, "W": 61.4, "T": 5.1, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 75.3, 'H': 63.3, 'W': 61.4, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 75.3, 'H': 63.3, 'W': 61.4, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 280.2, "safety_factor": 0.892, "max_disp_mm": 1.0797, "max_strain": 0.0020028048994872867, "peak": {"node": 1983, "coords_mm": [8.96, -34.56, 63.3], "vm_mpa": 280.2}, "volume_mm3": 44998.2, "bbox_mm": [80.4, 61.4, 68.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.9, "safety_factor": 2.43, "max_disp_mm": 0.2088, "max_strain": 0.0007355032034629577, "volume_mm3": 92214.8, "bbox_mm": [85.4, 61.4, 73.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.537, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 59, "family": "rib_bracket", "params": {"L": 73.8, "H": 55.3, "W": 56.3, "T": 5.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.8, 'H': 55.3, 'W': 56.3, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.8, 'H': 55.3, 'W': 56.3, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 308.3, "safety_factor": 0.811, "max_disp_mm": 1.0657, "max_strain": 0.0022038221751373532, "peak": {"node": 1738, "coords_mm": [8.98, -12.22, 55.3], "vm_mpa": 308.3}, "volume_mm3": 42468.2, "bbox_mm": [79.4, 56.3, 60.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.7, "safety_factor": 2.435, "max_disp_mm": 0.1896, "max_strain": 0.000733910433203534, "volume_mm3": 91888.4, "bbox_mm": [85.4, 56.3, 66.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.624, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 62, "family": "u_channel", "params": {"L": 113.3, "H": 30.1, "W": 31.0, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.3, 'H': 30.1, 'W': 31.0, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.3, 'H': 30.1, 'W': 31.0, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4350.6, "safety_factor": 0.057, "max_disp_mm": 42.6004, "max_strain": 0.031098546806344954, "peak": {"node": 357, "coords_mm": [42.33, 1.37, 2.7], "vm_mpa": 4350.6}, "volume_mm3": 799.7, "bbox_mm": [82.3, 30.1, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 135.6, "safety_factor": 1.844, "max_disp_mm": 0.2626, "max_strain": 0.000968957480090783, "volume_mm3": 11643.6, "bbox_mm": [82.3, 30.1, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.787, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 61, "family": "l_bracket", "params": {"L": 89.5, "H": 72.8, "W": 69.3, "T": 3.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 89.5, 'H': 72.8, 'W': 69.3, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 89.5, 'H': 72.8, 'W': 69.3, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 318.3, "safety_factor": 0.785, "max_disp_mm": 2.4541, "max_strain": 0.002275528625766639, "peak": {"node": 2525, "coords_mm": [2.15, -33.4, 75.9], "vm_mpa": 318.3}, "volume_mm3": 35532.9, "bbox_mm": [92.6, 69.3, 75.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.2, "safety_factor": 2.248, "max_disp_mm": 0.3934, "max_strain": 0.0007951178744042483, "volume_mm3": 95650.6, "bbox_mm": [97.6, 69.3, 80.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.462, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 63, "family": "rib_bracket", "params": {"L": 46.5, "H": 41.7, "W": 42.6, "T": 3.5, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.5, 'H': 41.7, 'W': 42.6, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.5, 'H': 41.7, 'W': 42.6, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 271.0, "safety_factor": 0.922, "max_disp_mm": 0.637, "max_strain": 0.0019372047266408474, "peak": {"node": 829, "coords_mm": [9.36, -40.64, 41.7], "vm_mpa": 271.0}, "volume_mm3": 13672.5, "bbox_mm": [50.0, 42.6, 45.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.0, "safety_factor": 2.632, "max_disp_mm": 0.088, "max_strain": 0.0006789460161049039, "volume_mm3": 39539.2, "bbox_mm": [56.0, 42.6, 51.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.71, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 64, "family": "plate_holes", "params": {"L": 103.5, "H": null, "W": 54.9, "T": 3.8, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.5, 'H': None, 'W': 54.9, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.5, 'H': None, 'W': 54.9, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 410.6, "safety_factor": 0.609, "max_disp_mm": 2.2238, "max_strain": 0.002935207108004884, "peak": {"node": 2462, "coords_mm": [-49.9, 13.19, 3.8], "vm_mpa": 410.6}, "volume_mm3": 21377.3, "bbox_mm": [103.5, 54.9, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 149.3, "safety_factor": 1.675, "max_disp_mm": 0.6375, "max_strain": 0.0010671820793801028, "volume_mm3": 43879.7, "bbox_mm": [103.5, 54.9, 7.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.066, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 66, "family": "u_channel", "params": {"L": 86.0, "H": 36.4, "W": 37.4, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.0, 'H': 36.4, 'W': 37.4, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.0, 'H': 36.4, 'W': 37.4, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2264.6, "safety_factor": 0.11, "max_disp_mm": 5.6977, "max_strain": 0.016187579946992818, "peak": {"node": 301, "coords_mm": [43.9, 1.69, 3.3], "vm_mpa": 2264.6}, "volume_mm3": 889.7, "bbox_mm": [48.6, 36.4, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.8, "safety_factor": 1.972, "max_disp_mm": 0.1115, "max_strain": 0.0009064295650339395, "volume_mm3": 6547.3, "bbox_mm": [48.6, 36.4, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.861, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 67, "family": "rib_bracket", "params": {"L": 59.1, "H": 48.0, "W": 49.0, "T": 4.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.1, 'H': 48.0, 'W': 49.0, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.1, 'H': 48.0, 'W': 49.0, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 422.7, "safety_factor": 0.591, "max_disp_mm": 1.1316, "max_strain": 0.003021773558529079, "peak": {"node": 1282, "coords_mm": [7.92, -21.72, 48.0], "vm_mpa": 422.7}, "volume_mm3": 24607.8, "bbox_mm": [63.6, 49.0, 52.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.5, "safety_factor": 2.146, "max_disp_mm": 0.1525, "max_strain": 0.0008326980624473096, "volume_mm3": 60505.2, "bbox_mm": [69.6, 49.0, 58.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.555, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 68, "family": "plate_holes", "params": {"L": 113.0, "H": null, "W": 64.4, "T": 5.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.0, 'H': None, 'W': 64.4, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.0, 'H': None, 'W': 64.4, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 340.9, "safety_factor": 0.733, "max_disp_mm": 2.4007, "max_strain": 0.002436827407468394, "peak": {"node": 504, "coords_mm": [-54.45, -1.18, 0.0], "vm_mpa": 340.9}, "volume_mm3": 36601.0, "bbox_mm": [113.0, 64.4, 5.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.0, "safety_factor": 1.954, "max_disp_mm": 0.5619, "max_strain": 0.000914737193412545, "volume_mm3": 65307.7, "bbox_mm": [113.0, 64.4, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.22, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 70, "family": "u_channel", "params": {"L": 98.6, "H": 42.8, "W": 43.7, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.6, 'H': 42.8, 'W': 43.7, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.6, 'H': 42.8, 'W': 43.7, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1525.4, "safety_factor": 0.164, "max_disp_mm": 4.8098, "max_strain": 0.010903478849765403, "peak": {"node": 326, "coords_mm": [51.65, 2.08, 4.0], "vm_mpa": 1525.4}, "volume_mm3": 1499.2, "bbox_mm": [54.9, 42.8, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.9, "safety_factor": 1.702, "max_disp_mm": 0.1473, "max_strain": 0.0010500966432487153, "volume_mm3": 8770.0, "bbox_mm": [54.9, 42.8, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.538, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 69, "family": "l_bracket", "params": {"L": 73.0, "H": 61.8, "W": 60.1, "T": 5.0, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.0, 'H': 61.8, 'W': 60.1, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.0, 'H': 61.8, 'W': 60.1, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 283.2, "safety_factor": 0.883, "max_disp_mm": 1.0463, "max_strain": 0.00202426918492928, "peak": {"node": 2407, "coords_mm": [6.43, -39.98, 66.8], "vm_mpa": 283.2}, "volume_mm3": 42009.9, "bbox_mm": [78.0, 60.1, 66.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.1, "safety_factor": 2.547, "max_disp_mm": 0.2011, "max_strain": 0.0007014928384994816, "volume_mm3": 87024.8, "bbox_mm": [83.0, 60.1, 71.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.665, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 71, "family": "rib_bracket", "params": {"L": 71.8, "H": 54.3, "W": 55.3, "T": 5.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.8, 'H': 54.3, 'W': 55.3, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.8, 'H': 54.3, 'W': 55.3, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 314.4, "safety_factor": 0.795, "max_disp_mm": 1.0947, "max_strain": 0.0022475948198505714, "peak": {"node": 1678, "coords_mm": [8.59, -38.52, 54.3], "vm_mpa": 314.4}, "volume_mm3": 39268.5, "bbox_mm": [77.2, 55.3, 59.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.9, "safety_factor": 2.295, "max_disp_mm": 0.1866, "max_strain": 0.0007787481125874846, "volume_mm3": 86682.8, "bbox_mm": [83.2, 55.3, 65.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.5, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 72, "family": "plate_holes", "params": {"L": 122.5, "H": null, "W": 73.9, "T": 6.4, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.5, 'H': None, 'W': 73.9, 'T': 6.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.5, 'H': None, 'W': 73.9, 'T': 6.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 209.0, "safety_factor": 1.196, "max_disp_mm": 1.42, "max_strain": 0.001493808067779921, "peak": {"node": 2176, "coords_mm": [-59.29, 8.95, 0.0], "vm_mpa": 209.0}, "volume_mm3": 56932.3, "bbox_mm": [122.5, 73.9, 6.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.0, "safety_factor": 2.603, "max_disp_mm": 0.4325, "max_strain": 0.0006864453662503665, "volume_mm3": 92515.0, "bbox_mm": [122.5, 73.9, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.407, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 74, "family": "u_channel", "params": {"L": 111.3, "H": 49.1, "W": 30.0, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.3, 'H': 49.1, 'W': 30.0, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.3, 'H': 49.1, 'W': 30.0, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4665.6, "safety_factor": 0.054, "max_disp_mm": 47.5752, "max_strain": 0.033350267817868824, "peak": {"node": 438, "coords_mm": [36.24, 1.31, 2.6], "vm_mpa": 4665.6}, "volume_mm3": 863.9, "bbox_mm": [81.3, 49.1, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 137.5, "safety_factor": 1.818, "max_disp_mm": 0.2615, "max_strain": 0.0009830381481319476, "volume_mm3": 13460.7, "bbox_mm": [81.3, 49.1, 10.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.764, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 76, "family": "plate_holes", "params": {"L": 102.0, "H": null, "W": 53.4, "T": 3.6, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.0, 'H': None, 'W': 53.4, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.0, 'H': None, 'W': 53.4, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 379.3, "safety_factor": 0.659, "max_disp_mm": 2.0411, "max_strain": 0.0027114524680465807, "peak": {"node": 2398, "coords_mm": [-49.61, -13.41, 3.6], "vm_mpa": 379.3}, "volume_mm3": 19404.9, "bbox_mm": [102.0, 53.4, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.8, "safety_factor": 1.972, "max_disp_mm": 0.5342, "max_strain": 0.0009062630749855356, "volume_mm3": 40965.9, "bbox_mm": [102.0, 53.4, 7.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.313, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 78, "family": "u_channel", "params": {"L": 84.0, "H": 35.4, "W": 36.4, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.0, 'H': 35.4, 'W': 36.4, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.0, 'H': 35.4, 'W': 36.4, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1890.4, "safety_factor": 0.132, "max_disp_mm": 6.2291, "max_strain": 0.013512534287512364, "peak": {"node": 71, "coords_mm": [42.07, 3.2, 3.2], "vm_mpa": 1890.4}, "volume_mm3": 817.2, "bbox_mm": [47.6, 35.4, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.3, "safety_factor": 1.995, "max_disp_mm": 0.1101, "max_strain": 0.0008955648447768505, "volume_mm3": 6246.4, "bbox_mm": [47.6, 35.4, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.863, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 75, "family": "rib_bracket", "params": {"L": 84.5, "H": 40.7, "W": 41.6, "T": 3.4, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.5, 'H': 40.7, 'W': 41.6, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.5, 'H': 40.7, 'W': 41.6, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 627.4, "safety_factor": 0.398, "max_disp_mm": 3.5393, "max_strain": 0.004484790525655394, "peak": {"node": 1887, "coords_mm": [2.12, -23.26, 44.1], "vm_mpa": 627.4}, "volume_mm3": 18189.2, "bbox_mm": [87.9, 41.6, 44.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 136.3, "safety_factor": 1.834, "max_disp_mm": 0.2958, "max_strain": 0.0009744651138119981, "volume_mm3": 64781.2, "bbox_mm": [95.9, 41.6, 52.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.435, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 79, "family": "rib_bracket", "params": {"L": 57.1, "H": 47.0, "W": 48.0, "T": 4.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.1, 'H': 47.0, 'W': 48.0, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.1, 'H': 47.0, 'W': 48.0, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 319.9, "safety_factor": 0.781, "max_disp_mm": 0.8081, "max_strain": 0.002286901282311928, "peak": {"node": 1204, "coords_mm": [5.83, -37.2, 47.0], "vm_mpa": 319.9}, "volume_mm3": 22373.8, "bbox_mm": [61.4, 48.0, 51.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.3, "safety_factor": 2.739, "max_disp_mm": 0.1108, "max_strain": 0.0006523272637990688, "volume_mm3": 56559.4, "bbox_mm": [67.4, 48.0, 57.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.958, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 80, "family": "plate_holes", "params": {"L": 111.5, "H": null, "W": 62.9, "T": 4.9, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.5, 'H': None, 'W': 62.9, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.5, 'H': None, 'W': 62.9, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 326.2, "safety_factor": 0.767, "max_disp_mm": 2.1954, "max_strain": 0.002331384007327306, "peak": {"node": 3059, "coords_mm": [-54.15, 6.05, 4.9], "vm_mpa": 326.2}, "volume_mm3": 33872.8, "bbox_mm": [111.5, 62.9, 4.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.5, "safety_factor": 2.241, "max_disp_mm": 0.4876, "max_strain": 0.0007972883763417068, "volume_mm3": 61524.1, "bbox_mm": [111.5, 62.9, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.475, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 81, "family": "l_bracket", "params": {"L": 70.8, "H": 60.3, "W": 58.9, "T": 4.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 70.8, 'H': 60.3, 'W': 58.9, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 70.8, 'H': 60.3, 'W': 58.9, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 285.8, "safety_factor": 0.875, "max_disp_mm": 1.0764, "max_strain": 0.002043239123803346, "peak": {"node": 2426, "coords_mm": [6.37, -15.94, 65.1], "vm_mpa": 285.8}, "volume_mm3": 38421.6, "bbox_mm": [75.6, 58.9, 65.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.6, "safety_factor": 2.461, "max_disp_mm": 0.1978, "max_strain": 0.0007261887610625583, "volume_mm3": 81330.3, "bbox_mm": [80.6, 58.9, 70.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.586, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 82, "family": "u_channel", "params": {"L": 96.6, "H": 41.8, "W": 42.7, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.6, 'H': 41.8, 'W': 42.7, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.6, 'H': 41.8, 'W': 42.7, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1580.0, "safety_factor": 0.158, "max_disp_mm": 5.0437, "max_strain": 0.0112938565868892, "peak": {"node": 320, "coords_mm": [50.91, 1.91, 3.9], "vm_mpa": 1580.0}, "volume_mm3": 1396.3, "bbox_mm": [53.9, 41.8, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 158.2, "safety_factor": 1.58, "max_disp_mm": 0.1458, "max_strain": 0.001130964841072424, "volume_mm3": 8409.3, "bbox_mm": [53.9, 41.8, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.422, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 83, "family": "rib_bracket", "params": {"L": 69.8, "H": 53.3, "W": 54.3, "T": 5.3, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.8, 'H': 53.3, 'W': 54.3, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.8, 'H': 53.3, 'W': 54.3, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 330.6, "safety_factor": 0.756, "max_disp_mm": 1.0935, "max_strain": 0.0023634401704567517, "peak": {"node": 1683, "coords_mm": [8.53, -12.3, 58.6], "vm_mpa": 330.6}, "volume_mm3": 36952.2, "bbox_mm": [75.1, 54.3, 58.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.8, "safety_factor": 2.141, "max_disp_mm": 0.1802, "max_strain": 0.0008345699533659527, "volume_mm3": 82466.5, "bbox_mm": [81.1, 54.3, 64.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.385, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 84, "family": "plate_holes", "params": {"L": 121.0, "H": null, "W": 72.4, "T": 6.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.0, 'H': None, 'W': 72.4, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.0, 'H': None, 'W': 72.4, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 236.4, "safety_factor": 1.058, "max_disp_mm": 1.5119, "max_strain": 0.0016898724442972375, "peak": {"node": 3739, "coords_mm": [-58.96, -14.98, 6.2], "vm_mpa": 236.4}, "volume_mm3": 53340.6, "bbox_mm": [121.0, 72.4, 6.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.6, "safety_factor": 2.561, "max_disp_mm": 0.4487, "max_strain": 0.0006977962481646745, "volume_mm3": 87753.9, "bbox_mm": [121.0, 72.4, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.503, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 86, "family": "u_channel", "params": {"L": 109.3, "H": 48.1, "W": 49.0, "T": 4.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.3, 'H': 48.1, 'W': 49.0, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.3, 'H': 48.1, 'W': 49.0, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1002.3, "safety_factor": 0.249, "max_disp_mm": 2.706, "max_strain": 0.007164307641656717, "peak": {"node": 307, "coords_mm": [55.03, 2.09, 0.0], "vm_mpa": 1002.3}, "volume_mm3": 2104.0, "bbox_mm": [60.3, 48.1, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.1, "safety_factor": 2.498, "max_disp_mm": 0.1093, "max_strain": 0.000715439703558737, "volume_mm3": 10793.5, "bbox_mm": [60.3, 48.1, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.248, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 85, "family": "l_bracket", "params": {"L": 85.0, "H": 69.8, "W": 66.8, "T": 5.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.0, 'H': 69.8, 'W': 66.8, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.0, 'H': 69.8, 'W': 66.8, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 245.3, "safety_factor": 1.019, "max_disp_mm": 0.9753, "max_strain": 0.0017531126587722189, "peak": {"node": 2323, "coords_mm": [9.34, -44.83, 69.8], "vm_mpa": 245.3}, "volume_mm3": 62222.9, "bbox_mm": [90.8, 66.8, 75.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.5, "safety_factor": 2.59, "max_disp_mm": 0.2265, "max_strain": 0.0006899758939615685, "volume_mm3": 119470.5, "bbox_mm": [95.8, 66.8, 80.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.571, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 88, "family": "plate_holes", "params": {"L": 100.5, "H": null, "W": 51.9, "T": 3.4, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.5, 'H': None, 'W': 51.9, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.5, 'H': None, 'W': 51.9, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 437.9, "safety_factor": 0.571, "max_disp_mm": 2.3864, "max_strain": 0.00313013173181854, "peak": {"node": 2350, "coords_mm": [-48.95, -19.77, 3.4], "vm_mpa": 437.9}, "volume_mm3": 17542.0, "bbox_mm": [100.5, 51.9, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 144.2, "safety_factor": 1.734, "max_disp_mm": 0.5648, "max_strain": 0.0010305081238480105, "volume_mm3": 38179.6, "bbox_mm": [100.5, 51.9, 7.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.163, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 89, "family": "l_bracket", "params": {"L": 54.3, "H": 49.3, "W": 49.7, "T": 3.7, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 54.3, 'H': 49.3, 'W': 49.7, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 54.3, 'H': 49.3, 'W': 49.7, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 216.3, "safety_factor": 1.156, "max_disp_mm": 0.5229, "max_strain": 0.0015463173914729603, "peak": {"node": 1632, "coords_mm": [2.7, -20.36, 53.0], "vm_mpa": 216.3}, "volume_mm3": 19731.4, "bbox_mm": [58.0, 49.7, 53.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 80.5, "safety_factor": 3.106, "max_disp_mm": 0.1128, "max_strain": 0.000575387161142394, "volume_mm3": 48557.4, "bbox_mm": [63.0, 49.7, 58.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.95, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 90, "family": "u_channel", "params": {"L": 82.0, "H": 34.4, "W": 35.4, "T": 3.1, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.0, 'H': 34.4, 'W': 35.4, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.0, 'H': 34.4, 'W': 35.4, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2070.3, "safety_factor": 0.121, "max_disp_mm": 6.2128, "max_strain": 0.014798857275396819, "peak": {"node": 87, "coords_mm": [40.92, 3.1, 0.0], "vm_mpa": 2070.3}, "volume_mm3": 748.6, "bbox_mm": [46.6, 34.4, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.9, "safety_factor": 1.924, "max_disp_mm": 0.107, "max_strain": 0.0009287482955020815, "volume_mm3": 5954.0, "bbox_mm": [46.6, 34.4, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.803, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 87, "family": "rib_bracket", "params": {"L": 82.5, "H": 59.7, "W": 40.6, "T": 3.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.5, 'H': 59.7, 'W': 40.6, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.5, 'H': 59.7, 'W': 40.6, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 586.8, "safety_factor": 0.426, "max_disp_mm": 5.1132, "max_strain": 0.0041943158231832435, "peak": {"node": 1999, "coords_mm": [1.9, -29.98, 62.9], "vm_mpa": 586.8}, "volume_mm3": 18890.4, "bbox_mm": [85.7, 40.6, 62.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 140.2, "safety_factor": 1.783, "max_disp_mm": 0.2962, "max_strain": 0.001002436407745254, "volume_mm3": 69754.0, "bbox_mm": [93.7, 40.6, 70.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.357, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 91, "family": "rib_bracket", "params": {"L": 55.1, "H": 46.0, "W": 47.0, "T": 4.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.1, 'H': 46.0, 'W': 47.0, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.1, 'H': 46.0, 'W': 47.0, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 295.0, "safety_factor": 0.848, "max_disp_mm": 0.6218, "max_strain": 0.0021085372565928353, "peak": {"node": 1648, "coords_mm": [6.2, -8.69, 50.2], "vm_mpa": 295.0}, "volume_mm3": 20786.2, "bbox_mm": [59.3, 47.0, 50.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.2, "safety_factor": 2.771, "max_disp_mm": 0.1057, "max_strain": 0.000644871949544703, "volume_mm3": 53357.2, "bbox_mm": [65.3, 47.0, 56.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.924, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 92, "family": "plate_holes", "params": {"L": 110.0, "H": null, "W": 61.4, "T": 4.7, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.0, 'H': None, 'W': 61.4, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.0, 'H': None, 'W': 61.4, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 332.0, "safety_factor": 0.753, "max_disp_mm": 2.4255, "max_strain": 0.00237292559266295, "peak": {"node": 1607, "coords_mm": [-53.47, 12.37, 0.0], "vm_mpa": 332.0}, "volume_mm3": 31271.3, "bbox_mm": [110.0, 61.4, 4.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.3, "safety_factor": 2.168, "max_disp_mm": 0.5093, "max_strain": 0.0008241263540981919, "volume_mm3": 57885.2, "bbox_mm": [110.0, 61.4, 8.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.415, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 94, "family": "u_channel", "params": {"L": 94.6, "H": 40.8, "W": 41.7, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.6, 'H': 40.8, 'W': 41.7, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.6, 'H': 40.8, 'W': 41.7, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1624.1, "safety_factor": 0.154, "max_disp_mm": 5.1287, "max_strain": 0.011609340654057894, "peak": {"node": 273, "coords_mm": [52.17, 1.86, 0.0], "vm_mpa": 1624.1}, "volume_mm3": 1298.2, "bbox_mm": [52.9, 40.8, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 154.4, "safety_factor": 1.619, "max_disp_mm": 0.1443, "max_strain": 0.001103773155376327, "volume_mm3": 8057.8, "bbox_mm": [52.9, 40.8, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.465, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 93, "family": "l_bracket", "params": {"L": 68.5, "H": 58.8, "W": 57.7, "T": 4.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.5, 'H': 58.8, 'W': 57.7, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.5, 'H': 58.8, 'W': 57.7, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 299.8, "safety_factor": 0.834, "max_disp_mm": 1.073, "max_strain": 0.002142905552597938, "peak": {"node": 2209, "coords_mm": [4.93, -32.41, 63.5], "vm_mpa": 299.8}, "volume_mm3": 35797.1, "bbox_mm": [73.2, 57.7, 63.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.9, "safety_factor": 2.36, "max_disp_mm": 0.19, "max_strain": 0.0007573327930405759, "volume_mm3": 76677.5, "bbox_mm": [78.2, 57.7, 68.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.526, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 95, "family": "rib_bracket", "params": {"L": 67.8, "H": 52.4, "W": 53.3, "T": 5.1, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.8, 'H': 52.4, 'W': 53.3, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.8, 'H': 52.4, 'W': 53.3, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 338.4, "safety_factor": 0.739, "max_disp_mm": 1.1326, "max_strain": 0.002419047577938276, "peak": {"node": 910, "coords_mm": [7.2, -8.48, 52.4], "vm_mpa": 338.4}, "volume_mm3": 34060.3, "bbox_mm": [72.9, 53.3, 57.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.4, "safety_factor": 2.205, "max_disp_mm": 0.1777, "max_strain": 0.0008104505638701665, "volume_mm3": 77681.0, "bbox_mm": [78.9, 53.3, 63.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.466, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 96, "family": "plate_holes", "params": {"L": 119.5, "H": null, "W": 70.9, "T": 6.0, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.5, 'H': None, 'W': 70.9, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.5, 'H': None, 'W': 70.9, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 250.0, "safety_factor": 1.0, "max_disp_mm": 1.6322, "max_strain": 0.001786867746256319, "peak": {"node": 2168, "coords_mm": [-57.68, 9.62, 6.0], "vm_mpa": 250.0}, "volume_mm3": 49892.8, "bbox_mm": [119.5, 70.9, 6.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.6, "safety_factor": 2.437, "max_disp_mm": 0.466, "max_strain": 0.0007332568901461724, "volume_mm3": 83154.7, "bbox_mm": [119.5, 70.9, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.437, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 98, "family": "u_channel", "params": {"L": 107.3, "H": 47.1, "W": 48.0, "T": 4.4, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.3, 'H': 47.1, 'W': 48.0, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.3, 'H': 47.1, 'W': 48.0, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1523.1, "safety_factor": 0.164, "max_disp_mm": 4.1852, "max_strain": 0.010887663584363588, "peak": {"node": 312, "coords_mm": [56.57, 2.12, 0.0], "vm_mpa": 1523.1}, "volume_mm3": 1974.7, "bbox_mm": [59.3, 47.1, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.2, "safety_factor": 1.698, "max_disp_mm": 0.162, "max_strain": 0.0010523757131110625, "volume_mm3": 10383.4, "bbox_mm": [59.3, 47.1, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.534, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 97, "family": "l_bracket", "params": {"L": 82.8, "H": 68.3, "W": 65.6, "T": 5.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.8, 'H': 68.3, 'W': 65.6, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.8, 'H': 68.3, 'W': 65.6, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 241.8, "safety_factor": 1.034, "max_disp_mm": 1.0088, "max_strain": 0.0017281014080013362, "peak": {"node": 2298, "coords_mm": [7.22, -25.51, 68.3], "vm_mpa": 241.8}, "volume_mm3": 57565.3, "bbox_mm": [88.4, 65.6, 73.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.4, "safety_factor": 2.621, "max_disp_mm": 0.2254, "max_strain": 0.0006817138556890077, "volume_mm3": 112439.7, "bbox_mm": [93.4, 65.6, 78.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.587, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 101, "family": "l_bracket", "params": {"L": 52.0, "H": 47.8, "W": 48.5, "T": 3.6, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 52.0, 'H': 47.8, 'W': 48.5, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 52.0, 'H': 47.8, 'W': 48.5, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 228.9, "safety_factor": 1.092, "max_disp_mm": 0.4904, "max_strain": 0.0016362553572754834, "peak": {"node": 1580, "coords_mm": [1.98, -18.22, 51.4], "vm_mpa": 228.9}, "volume_mm3": 18053.6, "bbox_mm": [55.6, 48.5, 51.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 82.1, "safety_factor": 3.044, "max_disp_mm": 0.1051, "max_strain": 0.0005870394184291323, "volume_mm3": 45213.6, "bbox_mm": [60.6, 48.5, 56.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.952, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 99, "family": "rib_bracket", "params": {"L": 80.5, "H": 58.7, "W": 59.6, "T": 3.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.5, 'H': 58.7, 'W': 59.6, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.5, 'H': 58.7, 'W': 59.6, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 490.2, "safety_factor": 0.51, "max_disp_mm": 3.0871, "max_strain": 0.0035043481012674033, "peak": {"node": 1976, "coords_mm": [2.15, -50.91, 61.8], "vm_mpa": 490.2}, "volume_mm3": 26291.3, "bbox_mm": [83.6, 59.6, 61.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.4, "safety_factor": 2.026, "max_disp_mm": 0.3154, "max_strain": 0.0008821346086910741, "volume_mm3": 80432.0, "bbox_mm": [89.6, 59.6, 67.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.516, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 102, "family": "u_channel", "params": {"L": 80.0, "H": 33.4, "W": 34.4, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.0, 'H': 33.4, 'W': 34.4, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.0, 'H': 33.4, 'W': 34.4, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2296.7, "safety_factor": 0.109, "max_disp_mm": 5.3686, "max_strain": 0.016417140889017592, "peak": {"node": 278, "coords_mm": [38.32, 1.53, 3.0], "vm_mpa": 2296.7}, "volume_mm3": 684.0, "bbox_mm": [45.6, 33.4, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.7, "safety_factor": 2.321, "max_disp_mm": 0.0822, "max_strain": 0.000769866870222508, "volume_mm3": 5670.0, "bbox_mm": [45.6, 33.4, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.212, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 100, "family": "plate_holes", "params": {"L": 129.0, "H": null, "W": 50.4, "T": 3.2, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.0, 'H': None, 'W': 50.4, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.0, 'H': None, 'W': 50.4, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 581.1, "safety_factor": 0.43, "max_disp_mm": 6.2707, "max_strain": 0.004153728207161166, "peak": {"node": 153, "coords_mm": [-64.5, -13.2, 0.0], "vm_mpa": 581.1}, "volume_mm3": 20624.2, "bbox_mm": [129.0, 50.4, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.9, "safety_factor": 2.138, "max_disp_mm": 0.6907, "max_strain": 0.0008357412156530832, "volume_mm3": 59294.5, "bbox_mm": [129.0, 50.4, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.708, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 103, "family": "rib_bracket", "params": {"L": 53.2, "H": 45.0, "W": 46.0, "T": 4.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.2, 'H': 45.0, 'W': 46.0, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.2, 'H': 45.0, 'W': 46.0, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 262.9, "safety_factor": 0.951, "max_disp_mm": 0.5284, "max_strain": 0.001879070232040584, "peak": {"node": 1157, "coords_mm": [2.26, -22.89, 49.0], "vm_mpa": 262.9}, "volume_mm3": 18804.8, "bbox_mm": [57.2, 46.0, 49.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.5, "safety_factor": 2.733, "max_disp_mm": 0.104, "max_strain": 0.0006539359230826171, "volume_mm3": 49772.0, "bbox_mm": [63.2, 46.0, 55.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.782, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 106, "family": "u_channel", "params": {"L": 92.7, "H": 39.8, "W": 40.7, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.7, 'H': 39.8, 'W': 40.7, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.7, 'H': 39.8, 'W': 40.7, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1754.8, "safety_factor": 0.142, "max_disp_mm": 4.6259, "max_strain": 0.01254319627027423, "peak": {"node": 269, "coords_mm": [45.71, 2.27, 0.0], "vm_mpa": 1754.8}, "volume_mm3": 1206.1, "bbox_mm": [52.0, 39.8, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.7, "safety_factor": 2.021, "max_disp_mm": 0.117, "max_strain": 0.0008841421129409043, "volume_mm3": 7724.8, "bbox_mm": [52.0, 39.8, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.879, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 104, "family": "plate_holes", "params": {"L": 108.5, "H": null, "W": 59.9, "T": 4.5, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.5, 'H': None, 'W': 59.9, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.5, 'H': None, 'W': 59.9, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 361.0, "safety_factor": 0.693, "max_disp_mm": 2.5936, "max_strain": 0.0025803410039066175, "peak": {"node": 1656, "coords_mm": [-52.09, 1.25, 4.5], "vm_mpa": 361.0}, "volume_mm3": 28793.8, "bbox_mm": [108.5, 59.9, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.7, "safety_factor": 2.055, "max_disp_mm": 0.5315, "max_strain": 0.0008696719969781935, "volume_mm3": 54388.3, "bbox_mm": [108.5, 59.9, 8.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.362, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 105, "family": "l_bracket", "params": {"L": 66.3, "H": 57.3, "W": 56.4, "T": 4.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.3, 'H': 57.3, 'W': 56.4, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.3, 'H': 57.3, 'W': 56.4, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 331.2, "safety_factor": 0.755, "max_disp_mm": 1.1157, "max_strain": 0.0023676828008415427, "peak": {"node": 2054, "coords_mm": [5.11, -28.12, 61.8], "vm_mpa": 331.2}, "volume_mm3": 32511.8, "bbox_mm": [70.8, 56.4, 61.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.6, "safety_factor": 2.461, "max_disp_mm": 0.1852, "max_strain": 0.0007260268019001274, "volume_mm3": 71315.0, "bbox_mm": [75.8, 56.4, 66.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.707, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 107, "family": "rib_bracket", "params": {"L": 65.8, "H": 51.4, "W": 52.3, "T": 5.0, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.8, 'H': 51.4, 'W': 52.3, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.8, 'H': 51.4, 'W': 52.3, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 349.2, "safety_factor": 0.716, "max_disp_mm": 1.1219, "max_strain": 0.002496478081587462, "peak": {"node": 1240, "coords_mm": [9.26, -32.08, 51.4], "vm_mpa": 349.2}, "volume_mm3": 31955.3, "bbox_mm": [70.8, 52.3, 56.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.4, "safety_factor": 2.224, "max_disp_mm": 0.1699, "max_strain": 0.0008033798325600496, "volume_mm3": 73753.5, "bbox_mm": [76.8, 52.3, 62.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.509, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 108, "family": "plate_holes", "params": {"L": 118.0, "H": null, "W": 69.4, "T": 5.8, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.0, 'H': None, 'W': 69.4, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.0, 'H': None, 'W': 69.4, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 254.0, "safety_factor": 0.984, "max_disp_mm": 1.7769, "max_strain": 0.001815514004819434, "peak": {"node": 3155, "coords_mm": [-56.53, -1.12, 5.8], "vm_mpa": 254.0}, "volume_mm3": 46586.3, "bbox_mm": [118.0, 69.4, 5.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 106.7, "safety_factor": 2.343, "max_disp_mm": 0.4868, "max_strain": 0.0007626026109981363, "volume_mm3": 78714.8, "bbox_mm": [118.0, 69.4, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.359, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 110, "family": "u_channel", "params": {"L": 105.3, "H": 46.1, "W": 47.1, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.3, 'H': 46.1, 'W': 47.1, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.3, 'H': 46.1, 'W': 47.1, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1514.2, "safety_factor": 0.165, "max_disp_mm": 4.3182, "max_strain": 0.01082341233415115, "peak": {"node": 348, "coords_mm": [55.49, 2.08, 4.3], "vm_mpa": 1514.2}, "volume_mm3": 1849.0, "bbox_mm": [58.2, 46.1, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.5, "safety_factor": 1.695, "max_disp_mm": 0.1592, "max_strain": 0.0010542409687511547, "volume_mm3": 9972.5, "bbox_mm": [58.2, 46.1, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.53, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 109, "family": "l_bracket", "params": {"L": 80.6, "H": 66.8, "W": 64.3, "T": 5.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.6, 'H': 66.8, 'W': 64.3, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.6, 'H': 66.8, 'W': 64.3, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 223.3, "safety_factor": 1.12, "max_disp_mm": 0.9932, "max_strain": 0.00159625434467347, "peak": {"node": 2111, "coords_mm": [9.82, -41.94, 66.8], "vm_mpa": 223.3}, "volume_mm3": 54073.1, "bbox_mm": [86.1, 64.3, 72.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.2, "safety_factor": 2.77, "max_disp_mm": 0.2182, "max_strain": 0.0006450246547896204, "volume_mm3": 106606.2, "bbox_mm": [91.1, 64.3, 77.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.651, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 114, "family": "u_channel", "params": {"L": 78.0, "H": 32.4, "W": 33.4, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.0, 'H': 32.4, 'W': 33.4, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.0, 'H': 32.4, 'W': 33.4, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2107.5, "safety_factor": 0.119, "max_disp_mm": 5.3717, "max_strain": 0.015064701764318216, "peak": {"node": 259, "coords_mm": [39.83, 1.48, 2.9], "vm_mpa": 2107.5}, "volume_mm3": 623.2, "bbox_mm": [44.6, 32.4, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.9, "safety_factor": 2.384, "max_disp_mm": 0.0813, "max_strain": 0.0007497030821637679, "volume_mm3": 5394.2, "bbox_mm": [44.6, 32.4, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.265, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 112, "family": "plate_holes", "params": {"L": 127.5, "H": null, "W": 78.9, "T": 3.0, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.5, 'H': None, 'W': 78.9, 'T': 3.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.5, 'H': None, 'W': 78.9, 'T': 3.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 460.4, "safety_factor": 0.543, "max_disp_mm": 4.5071, "max_strain": 0.0032913267152488404, "peak": {"node": 2324, "coords_mm": [-62.06, -16.1, 0.0], "vm_mpa": 460.4}, "volume_mm3": 30009.6, "bbox_mm": [127.5, 78.9, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 122.4, "safety_factor": 2.042, "max_disp_mm": 0.8368, "max_strain": 0.000875242446963571, "volume_mm3": 70022.4, "bbox_mm": [127.5, 78.9, 7.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.499, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 115, "family": "rib_bracket", "params": {"L": 51.2, "H": 44.0, "W": 45.0, "T": 3.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.2, 'H': 44.0, 'W': 45.0, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.2, 'H': 44.0, 'W': 45.0, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 253.4, "safety_factor": 0.986, "max_disp_mm": 0.4945, "max_strain": 0.0018115143568907446, "peak": {"node": 1089, "coords_mm": [2.17, -13.73, 47.9], "vm_mpa": 253.4}, "volume_mm3": 17392.0, "bbox_mm": [55.1, 45.0, 47.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 88.4, "safety_factor": 2.829, "max_disp_mm": 0.0976, "max_strain": 0.0006316226321842179, "volume_mm3": 46822.0, "bbox_mm": [61.1, 45.0, 53.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.843, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 113, "family": "l_bracket", "params": {"L": 94.8, "H": 46.3, "W": 47.3, "T": 3.4, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.8, 'H': 46.3, 'W': 47.3, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.8, 'H': 46.3, 'W': 47.3, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 411.2, "safety_factor": 0.608, "max_disp_mm": 3.4279, "max_strain": 0.0029396739485413152, "peak": {"node": 1585, "coords_mm": [2.18, -23.62, 49.7], "vm_mpa": 411.2}, "volume_mm3": 23238.5, "bbox_mm": [98.2, 47.3, 49.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.1, "safety_factor": 2.117, "max_disp_mm": 0.364, "max_strain": 0.0008440729949203753, "volume_mm3": 74525.9, "bbox_mm": [105.2, 47.3, 56.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.509, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 118, "family": "u_channel", "params": {"L": 90.7, "H": 38.8, "W": 39.7, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.7, 'H': 38.8, 'W': 39.7, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.7, 'H': 38.8, 'W': 39.7, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1992.2, "safety_factor": 0.125, "max_disp_mm": 4.9365, "max_strain": 0.014240836435418743, "peak": {"node": 304, "coords_mm": [45.77, 1.6, 3.6], "vm_mpa": 1992.2}, "volume_mm3": 1117.2, "bbox_mm": [51.0, 38.8, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.9, "safety_factor": 2.121, "max_disp_mm": 0.1151, "max_strain": 0.0008426061628874286, "volume_mm3": 7391.2, "bbox_mm": [51.0, 38.8, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.995, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 116, "family": "plate_holes", "params": {"L": 107.0, "H": null, "W": 58.4, "T": 4.3, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.0, 'H': None, 'W': 58.4, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.0, 'H': None, 'W': 58.4, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 361.3, "safety_factor": 0.692, "max_disp_mm": 2.8492, "max_strain": 0.002582377866151763, "peak": {"node": 1521, "coords_mm": [-51.83, 22.99, 0.0], "vm_mpa": 361.3}, "volume_mm3": 26437.6, "bbox_mm": [107.0, 58.4, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.7, "safety_factor": 1.942, "max_disp_mm": 0.5616, "max_strain": 0.0009202747705541939, "volume_mm3": 51030.6, "bbox_mm": [107.0, 58.4, 8.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.25, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 117, "family": "l_bracket", "params": {"L": 64.1, "H": 55.8, "W": 55.2, "T": 4.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.1, 'H': 55.8, 'W': 55.2, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.1, 'H': 55.8, 'W': 55.2, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 314.9, "safety_factor": 0.794, "max_disp_mm": 1.0627, "max_strain": 0.002250922825241651, "peak": {"node": 1574, "coords_mm": [8.02, -38.39, 55.8], "vm_mpa": 314.9}, "volume_mm3": 30190.0, "bbox_mm": [68.5, 55.2, 60.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.2, "safety_factor": 2.268, "max_disp_mm": 0.1777, "max_strain": 0.0007877785351853593, "volume_mm3": 67091.2, "bbox_mm": [73.5, 55.2, 65.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.475, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 119, "family": "rib_bracket", "params": {"L": 63.8, "H": 50.4, "W": 51.3, "T": 4.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.8, 'H': 50.4, 'W': 51.3, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.8, 'H': 50.4, 'W': 51.3, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 356.9, "safety_factor": 0.701, "max_disp_mm": 1.1717, "max_strain": 0.0025510743542351637, "peak": {"node": 1668, "coords_mm": [7.41, -38.16, 55.2], "vm_mpa": 356.9}, "volume_mm3": 29302.6, "bbox_mm": [68.6, 51.3, 55.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.8, "safety_factor": 2.104, "max_disp_mm": 0.1674, "max_strain": 0.000849195648499761, "volume_mm3": 69255.0, "bbox_mm": [74.6, 51.3, 61.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.404, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 120, "family": "plate_holes", "params": {"L": 116.5, "H": null, "W": 67.9, "T": 5.6, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.5, 'H': None, 'W': 67.9, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.5, 'H': None, 'W': 67.9, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 278.1, "safety_factor": 0.899, "max_disp_mm": 1.9251, "max_strain": 0.0019879830675909142, "peak": {"node": 1688, "coords_mm": [-56.33, 10.82, 0.0], "vm_mpa": 278.1}, "volume_mm3": 43418.3, "bbox_mm": [116.5, 67.9, 5.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.2, "safety_factor": 2.268, "max_disp_mm": 0.5053, "max_strain": 0.0007878758248316096, "volume_mm3": 74431.4, "bbox_mm": [116.5, 67.9, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.369, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 122, "family": "u_channel", "params": {"L": 103.3, "H": 45.1, "W": 46.1, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.3, 'H': 45.1, 'W': 46.1, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.3, 'H': 45.1, 'W': 46.1, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1589.4, "safety_factor": 0.157, "max_disp_mm": 4.5171, "max_strain": 0.011360907406125893, "peak": {"node": 341, "coords_mm": [54.09, 2.21, 4.2], "vm_mpa": 1589.4}, "volume_mm3": 1730.5, "bbox_mm": [57.2, 45.1, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 148.8, "safety_factor": 1.68, "max_disp_mm": 0.1566, "max_strain": 0.001063683452042671, "volume_mm3": 9582.1, "bbox_mm": [57.2, 45.1, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.523, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 121, "family": "l_bracket", "params": {"L": 78.3, "H": 65.3, "W": 63.1, "T": 5.3, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.3, 'H': 65.3, 'W': 63.1, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.3, 'H': 65.3, 'W': 63.1, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 265.4, "safety_factor": 0.942, "max_disp_mm": 1.0457, "max_strain": 0.001897424538603219, "peak": {"node": 2148, "coords_mm": [8.72, -33.8, 65.3], "vm_mpa": 265.4}, "volume_mm3": 49796.6, "bbox_mm": [83.6, 63.1, 70.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.0, "safety_factor": 2.476, "max_disp_mm": 0.2161, "max_strain": 0.0007218264384099915, "volume_mm3": 100024.2, "bbox_mm": [88.6, 63.1, 75.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.534, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 126, "family": "u_channel", "params": {"L": 76.0, "H": 31.5, "W": 32.4, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.0, 'H': 31.5, 'W': 32.4, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.0, 'H': 31.5, 'W': 32.4, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2432.4, "safety_factor": 0.103, "max_disp_mm": 5.7624, "max_strain": 0.017387019210008407, "peak": {"node": 262, "coords_mm": [36.26, 1.44, 2.8], "vm_mpa": 2432.4}, "volume_mm3": 566.8, "bbox_mm": [43.6, 31.5, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.4, "safety_factor": 2.465, "max_disp_mm": 0.0784, "max_strain": 0.000724893131421376, "volume_mm3": 5134.3, "bbox_mm": [43.6, 31.5, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.362, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 123, "family": "rib_bracket", "params": {"L": 76.5, "H": 56.7, "W": 57.6, "T": 5.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.5, 'H': 56.7, 'W': 57.6, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.5, 'H': 56.7, 'W': 57.6, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 304.2, "safety_factor": 0.822, "max_disp_mm": 1.0415, "max_strain": 0.0021745979643193205, "peak": {"node": 2283, "coords_mm": [8.32, -21.64, 62.5], "vm_mpa": 304.2}, "volume_mm3": 46437.1, "bbox_mm": [82.3, 57.6, 62.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.5, "safety_factor": 2.242, "max_disp_mm": 0.196, "max_strain": 0.0007970535030519801, "volume_mm3": 98553.6, "bbox_mm": [88.3, 57.6, 68.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.42, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 127, "family": "rib_bracket", "params": {"L": 49.2, "H": 43.0, "W": 44.0, "T": 3.7, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.2, 'H': 43.0, 'W': 44.0, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.2, 'H': 43.0, 'W': 44.0, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 288.0, "safety_factor": 0.868, "max_disp_mm": 0.5423, "max_strain": 0.002058461219971883, "peak": {"node": 1290, "coords_mm": [1.99, -27.82, 46.7], "vm_mpa": 288.0}, "volume_mm3": 15612.5, "bbox_mm": [52.9, 44.0, 46.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.7, "safety_factor": 2.758, "max_disp_mm": 0.0944, "max_strain": 0.0006480458968403326, "volume_mm3": 43490.9, "bbox_mm": [58.9, 44.0, 52.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.889, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 125, "family": "l_bracket", "params": {"L": 92.6, "H": 74.8, "W": 46.0, "T": 3.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.6, 'H': 74.8, 'W': 46.0, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.6, 'H': 74.8, 'W': 46.0, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 480.6, "safety_factor": 0.52, "max_disp_mm": 3.1881, "max_strain": 0.0034352228014316857, "peak": {"node": 2655, "coords_mm": [1.75, -10.3, 78.1], "vm_mpa": 480.6}, "volume_mm3": 25912.3, "bbox_mm": [95.9, 46.0, 78.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.0, "safety_factor": 1.984, "max_disp_mm": 0.3606, "max_strain": 0.000900794226653248, "volume_mm3": 84194.3, "bbox_mm": [102.9, 46.0, 85.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.464, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 128, "family": "plate_holes", "params": {"L": 105.5, "H": null, "W": 56.9, "T": 4.1, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.5, 'H': None, 'W': 56.9, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.5, 'H': None, 'W': 56.9, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 392.4, "safety_factor": 0.637, "max_disp_mm": 2.6014, "max_strain": 0.002804849285843111, "peak": {"node": 430, "coords_mm": [-50.87, 17.32, 0.0], "vm_mpa": 392.4}, "volume_mm3": 24199.9, "bbox_mm": [105.5, 56.9, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 136.7, "safety_factor": 1.828, "max_disp_mm": 0.5908, "max_strain": 0.0009774675022883085, "volume_mm3": 47809.6, "bbox_mm": [105.5, 56.9, 8.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.191, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 130, "family": "u_channel", "params": {"L": 88.7, "H": 37.8, "W": 38.7, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.7, 'H': 37.8, 'W': 38.7, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.7, 'H': 37.8, 'W': 38.7, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1791.1, "safety_factor": 0.14, "max_disp_mm": 5.1164, "max_strain": 0.012802823939022708, "peak": {"node": 264, "coords_mm": [45.51, 1.79, 0.0], "vm_mpa": 1791.1}, "volume_mm3": 1032.7, "bbox_mm": [50.0, 37.8, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.0, "safety_factor": 1.953, "max_disp_mm": 0.1122, "max_strain": 0.000915055243940452, "volume_mm3": 7066.6, "bbox_mm": [50.0, 37.8, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.813, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 129, "family": "l_bracket", "params": {"L": 61.8, "H": 54.3, "W": 53.9, "T": 4.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.8, 'H': 54.3, 'W': 53.9, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.8, 'H': 54.3, 'W': 53.9, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 244.8, "safety_factor": 1.021, "max_disp_mm": 0.6619, "max_strain": 0.0017501119318348907, "peak": {"node": 1938, "coords_mm": [15.17, -48.92, 58.5], "vm_mpa": 244.8}, "volume_mm3": 27233.5, "bbox_mm": [66.0, 53.9, 58.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 81.6, "safety_factor": 3.065, "max_disp_mm": 0.1289, "max_strain": 0.0005830912862235923, "volume_mm3": 62133.8, "bbox_mm": [71.0, 53.9, 63.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.044, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 131, "family": "rib_bracket", "params": {"L": 61.8, "H": 49.4, "W": 50.3, "T": 4.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.8, 'H': 49.4, 'W': 50.3, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.8, 'H': 49.4, 'W': 50.3, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 398.0, "safety_factor": 0.628, "max_disp_mm": 1.1404, "max_strain": 0.0028453101864307135, "peak": {"node": 833, "coords_mm": [6.56, -3.63, 49.4], "vm_mpa": 398.0}, "volume_mm3": 27399.9, "bbox_mm": [66.5, 50.3, 54.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.8, "safety_factor": 2.14, "max_disp_mm": 0.1605, "max_strain": 0.0008350346748356502, "volume_mm3": 65607.8, "bbox_mm": [72.5, 50.3, 60.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.512, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 134, "family": "u_channel", "params": {"L": 101.3, "H": 44.1, "W": 45.1, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.3, 'H': 44.1, 'W': 45.1, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.3, 'H': 44.1, 'W': 45.1, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1599.9, "safety_factor": 0.156, "max_disp_mm": 4.6328, "max_strain": 0.01143656028893667, "peak": {"node": 290, "coords_mm": [55.82, 2.02, 0.0], "vm_mpa": 1599.9}, "volume_mm3": 1617.1, "bbox_mm": [56.2, 44.1, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 156.0, "safety_factor": 1.603, "max_disp_mm": 0.1552, "max_strain": 0.0011147693791148194, "volume_mm3": 9201.3, "bbox_mm": [56.2, 44.1, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.447, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 132, "family": "plate_holes", "params": {"L": 115.0, "H": null, "W": 66.4, "T": 5.4, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.0, 'H': None, 'W': 66.4, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.0, 'H': None, 'W': 66.4, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 295.8, "safety_factor": 0.845, "max_disp_mm": 2.0912, "max_strain": 0.002114098391441589, "peak": {"node": 1780, "coords_mm": [-55.59, -14.78, 0.0], "vm_mpa": 295.8}, "volume_mm3": 40386.2, "bbox_mm": [115.0, 66.4, 5.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.4, "safety_factor": 2.204, "max_disp_mm": 0.5258, "max_strain": 0.0008107560695342483, "volume_mm3": 70301.9, "bbox_mm": [115.0, 66.4, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.359, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 133, "family": "l_bracket", "params": {"L": 76.1, "H": 63.8, "W": 61.9, "T": 5.2, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.1, 'H': 63.8, 'W': 61.9, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.1, 'H': 63.8, 'W': 61.9, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 256.4, "safety_factor": 0.975, "max_disp_mm": 1.019, "max_strain": 0.0018330732258164501, "peak": {"node": 1684, "coords_mm": [9.48, -56.91, 63.8], "vm_mpa": 256.4}, "volume_mm3": 46704.8, "bbox_mm": [81.3, 61.9, 69.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.4, "safety_factor": 2.466, "max_disp_mm": 0.2078, "max_strain": 0.0007246085324821201, "volume_mm3": 94770.1, "bbox_mm": [86.3, 61.9, 74.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.491, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 135, "family": "rib_bracket", "params": {"L": 74.5, "H": 55.7, "W": 56.7, "T": 5.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.5, 'H': 55.7, 'W': 56.7, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.5, 'H': 55.7, 'W': 56.7, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 313.1, "safety_factor": 0.798, "max_disp_mm": 1.084, "max_strain": 0.002238206215612995, "peak": {"node": 2061, "coords_mm": [8.16, -19.51, 61.3], "vm_mpa": 313.1}, "volume_mm3": 43119.2, "bbox_mm": [80.1, 56.7, 61.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 106.8, "safety_factor": 2.34, "max_disp_mm": 0.1926, "max_strain": 0.0007637237032117961, "volume_mm3": 93264.7, "bbox_mm": [86.1, 56.7, 67.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.541, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 138, "family": "u_channel", "params": {"L": 114.0, "H": 30.5, "W": 31.4, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.0, 'H': 30.5, 'W': 31.4, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.0, 'H': 30.5, 'W': 31.4, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4070.2, "safety_factor": 0.061, "max_disp_mm": 42.7355, "max_strain": 0.02909426255289419, "peak": {"node": 65, "coords_mm": [36.6, 2.7, 2.7], "vm_mpa": 4070.2}, "volume_mm3": 804.8, "bbox_mm": [82.6, 30.5, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 133.3, "safety_factor": 1.876, "max_disp_mm": 0.2653, "max_strain": 0.0009525257377392242, "volume_mm3": 11723.8, "bbox_mm": [82.6, 30.5, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.815, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 137, "family": "l_bracket", "params": {"L": 90.3, "H": 73.3, "W": 69.8, "T": 3.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.3, 'H': 73.3, 'W': 69.8, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.3, 'H': 73.3, 'W': 69.8, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 372.2, "safety_factor": 0.672, "max_disp_mm": 2.9573, "max_strain": 0.0026605412600755156, "peak": {"node": 2599, "coords_mm": [2.16, -61.08, 76.4], "vm_mpa": 372.2}, "volume_mm3": 36070.5, "bbox_mm": [93.4, 69.8, 76.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.0, "safety_factor": 2.212, "max_disp_mm": 0.399, "max_strain": 0.0008077435986459672, "volume_mm3": 97075.7, "bbox_mm": [98.4, 69.8, 81.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.541, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 139, "family": "rib_bracket", "params": {"L": 47.2, "H": 42.0, "W": 43.0, "T": 3.6, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.2, 'H': 42.0, 'W': 43.0, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.2, 'H': 42.0, 'W': 43.0, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 290.5, "safety_factor": 0.861, "max_disp_mm": 0.6259, "max_strain": 0.002076593723765439, "peak": {"node": 1403, "coords_mm": [3.32, -9.77, 45.6], "vm_mpa": 290.5}, "volume_mm3": 14365.4, "bbox_mm": [50.8, 43.0, 45.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.6, "safety_factor": 2.73, "max_disp_mm": 0.0881, "max_strain": 0.0006545362508851464, "volume_mm3": 40784.6, "bbox_mm": [56.8, 43.0, 51.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.87, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 140, "family": "plate_holes", "params": {"L": 104.0, "H": null, "W": 55.4, "T": 3.9, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.0, 'H': None, 'W': 55.4, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.0, 'H': None, 'W': 55.4, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 437.0, "safety_factor": 0.572, "max_disp_mm": 2.1536, "max_strain": 0.003123684433971795, "peak": {"node": 2547, "coords_mm": [-50.53, -14.45, 3.9], "vm_mpa": 437.0}, "volume_mm3": 22249.7, "bbox_mm": [104.0, 55.4, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.2, "safety_factor": 1.711, "max_disp_mm": 0.6184, "max_strain": 0.001044732268763552, "volume_mm3": 45069.9, "bbox_mm": [104.0, 55.4, 7.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.138, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 142, "family": "u_channel", "params": {"L": 86.7, "H": 36.8, "W": 37.7, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.7, 'H': 36.8, 'W': 37.7, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.7, 'H': 36.8, 'W': 37.7, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1784.7, "safety_factor": 0.14, "max_disp_mm": 5.3288, "max_strain": 0.012757572897084513, "peak": {"node": 260, "coords_mm": [46.77, 1.74, 0.0], "vm_mpa": 1784.7}, "volume_mm3": 952.5, "bbox_mm": [49.0, 36.8, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.6, "safety_factor": 2.022, "max_disp_mm": 0.1084, "max_strain": 0.0008837495360920482, "volume_mm3": 6750.7, "bbox_mm": [49.0, 36.8, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.882, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 141, "family": "l_bracket", "params": {"L": 59.6, "H": 52.8, "W": 52.7, "T": 4.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 59.6, 'H': 52.8, 'W': 52.7, 'T': 4.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 59.6, 'H': 52.8, 'W': 52.7, 'T': 4.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 242.1, "safety_factor": 1.033, "max_disp_mm": 0.6194, "max_strain": 0.0017303200779015422, "peak": {"node": 1233, "coords_mm": [8.86, -20.54, 52.8], "vm_mpa": 242.1}, "volume_mm3": 25172.2, "bbox_mm": [63.7, 52.7, 56.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 81.1, "safety_factor": 3.084, "max_disp_mm": 0.1233, "max_strain": 0.0005794656154562812, "volume_mm3": 58267.8, "bbox_mm": [68.7, 52.7, 61.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.051, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 143, "family": "rib_bracket", "params": {"L": 59.9, "H": 48.4, "W": 49.3, "T": 4.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.9, 'H': 48.4, 'W': 49.3, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.9, 'H': 48.4, 'W': 49.3, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 428.9, "safety_factor": 0.583, "max_disp_mm": 1.1832, "max_strain": 0.003065492155047016, "peak": {"node": 1869, "coords_mm": [8.04, -4.56, 52.9], "vm_mpa": 428.9}, "volume_mm3": 25024.7, "bbox_mm": [64.4, 49.3, 52.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.2, "safety_factor": 2.063, "max_disp_mm": 0.1573, "max_strain": 0.0008663549545877736, "volume_mm3": 61496.8, "bbox_mm": [70.4, 49.3, 58.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.48, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 144, "family": "plate_holes", "params": {"L": 113.5, "H": null, "W": 64.9, "T": 5.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.5, 'H': None, 'W': 64.9, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.5, 'H': None, 'W': 64.9, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 332.1, "safety_factor": 0.753, "max_disp_mm": 2.2835, "max_strain": 0.0023739184890793313, "peak": {"node": 1884, "coords_mm": [-55.16, -11.03, 0.0], "vm_mpa": 332.1}, "volume_mm3": 37781.2, "bbox_mm": [113.5, 64.9, 5.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.8, "safety_factor": 2.086, "max_disp_mm": 0.5448, "max_strain": 0.0008566046924020121, "volume_mm3": 66843.7, "bbox_mm": [113.5, 64.9, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.333, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 146, "family": "u_channel", "params": {"L": 99.4, "H": 43.1, "W": 44.1, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.4, 'H': 43.1, 'W': 44.1, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.4, 'H': 43.1, 'W': 44.1, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1694.9, "safety_factor": 0.148, "max_disp_mm": 4.8437, "max_strain": 0.012115321926335996, "peak": {"node": 329, "coords_mm": [57.06, 1.97, 4.0], "vm_mpa": 1694.9}, "volume_mm3": 1510.4, "bbox_mm": [55.3, 43.1, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 144.0, "safety_factor": 1.736, "max_disp_mm": 0.1507, "max_strain": 0.0010291414336763307, "volume_mm3": 8840.0, "bbox_mm": [55.3, 43.1, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.589, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 145, "family": "l_bracket", "params": {"L": 73.8, "H": 62.3, "W": 60.6, "T": 5.0, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.8, 'H': 62.3, 'W': 60.6, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.8, 'H': 62.3, 'W': 60.6, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 276.3, "safety_factor": 0.905, "max_disp_mm": 1.0758, "max_strain": 0.0019751810627197447, "peak": {"node": 1879, "coords_mm": [8.99, -48.55, 62.3], "vm_mpa": 276.3}, "volume_mm3": 42753.3, "bbox_mm": [78.8, 60.6, 67.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.4, "safety_factor": 2.441, "max_disp_mm": 0.2047, "max_strain": 0.0007319942253989345, "volume_mm3": 88536.6, "bbox_mm": [83.8, 60.6, 72.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.537, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 147, "family": "rib_bracket", "params": {"L": 72.5, "H": 54.7, "W": 55.7, "T": 5.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.5, 'H': 54.7, 'W': 55.7, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.5, 'H': 54.7, 'W': 55.7, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 308.6, "safety_factor": 0.81, "max_disp_mm": 1.0674, "max_strain": 0.002206037843061728, "peak": {"node": 994, "coords_mm": [7.66, -32.43, 54.7], "vm_mpa": 308.6}, "volume_mm3": 40652.6, "bbox_mm": [78.0, 55.7, 60.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.0, "safety_factor": 2.337, "max_disp_mm": 0.1861, "max_strain": 0.0007645805600714034, "volume_mm3": 88844.3, "bbox_mm": [84.0, 55.7, 66.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.527, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 150, "family": "u_channel", "params": {"L": 112.0, "H": 49.5, "W": 30.4, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.0, 'H': 49.5, 'W': 30.4, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.0, 'H': 49.5, 'W': 30.4, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4834.9, "safety_factor": 0.052, "max_disp_mm": 45.5788, "max_strain": 0.03456060280113372, "peak": {"node": 383, "coords_mm": [36.65, 1.31, 0.0], "vm_mpa": 4834.9}, "volume_mm3": 868.7, "bbox_mm": [81.6, 49.5, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 135.4, "safety_factor": 1.846, "max_disp_mm": 0.264, "max_strain": 0.0009678301909649407, "volume_mm3": 13539.4, "bbox_mm": [81.6, 49.5, 10.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.795, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 151, "family": "rib_bracket", "params": {"L": 45.2, "H": 41.0, "W": 42.0, "T": 3.4, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.2, 'H': 41.0, 'W': 42.0, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.2, 'H': 41.0, 'W': 42.0, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 343.5, "safety_factor": 0.728, "max_disp_mm": 0.6388, "max_strain": 0.002455590937826401, "peak": {"node": 978, "coords_mm": [2.04, -33.64, 44.4], "vm_mpa": 343.5}, "volume_mm3": 12794.9, "bbox_mm": [48.6, 42.0, 44.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 87.0, "safety_factor": 2.875, "max_disp_mm": 0.0851, "max_strain": 0.0006215697725824853, "volume_mm3": 37742.9, "bbox_mm": [54.6, 42.0, 50.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.147, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 152, "family": "plate_holes", "params": {"L": 102.5, "H": null, "W": 53.9, "T": 3.7, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.5, 'H': None, 'W': 53.9, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.5, 'H': None, 'W': 53.9, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 394.4, "safety_factor": 0.634, "max_disp_mm": 1.8957, "max_strain": 0.002819576848358032, "peak": {"node": 2394, "coords_mm": [-49.71, -3.67, 3.7], "vm_mpa": 394.4}, "volume_mm3": 20232.3, "bbox_mm": [102.5, 53.9, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.2, "safety_factor": 2.029, "max_disp_mm": 0.5188, "max_strain": 0.0008807671868414624, "volume_mm3": 42105.2, "bbox_mm": [102.5, 53.9, 7.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.395, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 154, "family": "u_channel", "params": {"L": 84.7, "H": 35.8, "W": 36.7, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.7, 'H': 35.8, 'W': 36.7, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.7, 'H': 35.8, 'W': 36.7, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1998.7, "safety_factor": 0.125, "max_disp_mm": 5.6403, "max_strain": 0.014287071847141754, "peak": {"node": 287, "coords_mm": [45.54, 1.61, 3.3], "vm_mpa": 1998.7}, "volume_mm3": 876.6, "bbox_mm": [48.0, 35.8, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 122.2, "safety_factor": 2.046, "max_disp_mm": 0.1075, "max_strain": 0.0008735784118115174, "volume_mm3": 6443.5, "bbox_mm": [48.0, 35.8, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.921, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 153, "family": "l_bracket", "params": {"L": 57.4, "H": 51.3, "W": 51.4, "T": 3.9, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 57.4, 'H': 51.3, 'W': 51.4, 'T': 3.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 57.4, 'H': 51.3, 'W': 51.4, 'T': 3.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 227.2, "safety_factor": 1.1, "max_disp_mm": 0.6462, "max_strain": 0.0016243334725851214, "peak": {"node": 1909, "coords_mm": [3.26, -29.35, 55.2], "vm_mpa": 227.2}, "volume_mm3": 22571.8, "bbox_mm": [61.3, 51.4, 55.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.5, "safety_factor": 2.994, "max_disp_mm": 0.1203, "max_strain": 0.0005968750428946525, "volume_mm3": 53797.3, "bbox_mm": [66.3, 51.4, 60.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.894, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 155, "family": "rib_bracket", "params": {"L": 57.9, "H": 47.4, "W": 48.3, "T": 4.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.9, 'H': 47.4, 'W': 48.3, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.9, 'H': 47.4, 'W': 48.3, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 493.0, "safety_factor": 0.507, "max_disp_mm": 1.1381, "max_strain": 0.0035242146949746936, "peak": {"node": 1815, "coords_mm": [7.74, -44.7, 51.8], "vm_mpa": 493.0}, "volume_mm3": 23313.4, "bbox_mm": [62.3, 48.3, 51.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.5, "safety_factor": 1.992, "max_disp_mm": 0.1511, "max_strain": 0.0008970534253623831, "volume_mm3": 58118.4, "bbox_mm": [68.3, 48.3, 57.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.485, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 156, "family": "plate_holes", "params": {"L": 112.0, "H": null, "W": 63.4, "T": 5.0, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.0, 'H': None, 'W': 63.4, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.0, 'H': None, 'W': 63.4, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 306.5, "safety_factor": 0.816, "max_disp_mm": 2.0795, "max_strain": 0.0021912122585183214, "peak": {"node": 3111, "coords_mm": [-54.57, -8.52, 5.0], "vm_mpa": 306.5}, "volume_mm3": 35001.3, "bbox_mm": [112.0, 63.4, 5.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.7, "safety_factor": 2.365, "max_disp_mm": 0.4761, "max_strain": 0.0007557141283613338, "volume_mm3": 63002.4, "bbox_mm": [112.0, 63.4, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.549, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 158, "family": "u_channel", "params": {"L": 97.4, "H": 42.1, "W": 43.1, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.4, 'H': 42.1, 'W': 43.1, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.4, 'H': 42.1, 'W': 43.1, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1602.3, "safety_factor": 0.156, "max_disp_mm": 5.2638, "max_strain": 0.011453241877690876, "peak": {"node": 102, "coords_mm": [49.4, 3.9, 0.0], "vm_mpa": 1602.3}, "volume_mm3": 1406.9, "bbox_mm": [54.3, 42.1, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 158.9, "safety_factor": 1.573, "max_disp_mm": 0.1493, "max_strain": 0.0011361513491538586, "volume_mm3": 8477.9, "bbox_mm": [54.3, 42.1, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.417, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 157, "family": "l_bracket", "params": {"L": 71.6, "H": 60.8, "W": 59.4, "T": 4.9, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.6, 'H': 60.8, 'W': 59.4, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.6, 'H': 60.8, 'W': 59.4, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 278.7, "safety_factor": 0.897, "max_disp_mm": 1.0538, "max_strain": 0.0019924088705488676, "peak": {"node": 1831, "coords_mm": [6.69, -1.8, 60.8], "vm_mpa": 278.7}, "volume_mm3": 39962.5, "bbox_mm": [76.5, 59.4, 65.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.6, "safety_factor": 2.323, "max_disp_mm": 0.1964, "max_strain": 0.0007693714450062984, "volume_mm3": 83680.9, "bbox_mm": [81.5, 59.4, 70.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.426, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 159, "family": "rib_bracket", "params": {"L": 70.5, "H": 53.7, "W": 54.7, "T": 5.3, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.5, 'H': 53.7, 'W': 54.7, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.5, 'H': 53.7, 'W': 54.7, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 303.5, "safety_factor": 0.824, "max_disp_mm": 1.0874, "max_strain": 0.00216956767114581, "peak": {"node": 2402, "coords_mm": [10.89, -53.05, 59.0], "vm_mpa": 303.5}, "volume_mm3": 37543.3, "bbox_mm": [75.8, 54.7, 59.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.4, "safety_factor": 2.443, "max_disp_mm": 0.1833, "max_strain": 0.0007316409030217239, "volume_mm3": 83753.9, "bbox_mm": [81.8, 54.7, 65.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.619, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 160, "family": "plate_holes", "params": {"L": 121.5, "H": null, "W": 72.9, "T": 6.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.5, 'H': None, 'W': 72.9, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.5, 'H': None, 'W': 72.9, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 224.7, "safety_factor": 1.112, "max_disp_mm": 1.5397, "max_strain": 0.0016064090275808999, "peak": {"node": 612, "coords_mm": [-58.63, -1.4, 0.0], "vm_mpa": 224.7}, "volume_mm3": 53941.7, "bbox_mm": [121.5, 72.9, 6.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.3, "safety_factor": 2.544, "max_disp_mm": 0.4514, "max_strain": 0.0007023303419843163, "volume_mm3": 88742.8, "bbox_mm": [121.5, 72.9, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.432, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 162, "family": "u_channel", "params": {"L": 110.0, "H": 48.5, "W": 49.4, "T": 2.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.0, 'H': 48.5, 'W': 49.4, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.0, 'H': 48.5, 'W': 49.4, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3734.9, "safety_factor": 0.067, "max_disp_mm": 20.5754, "max_strain": 0.0266980306486678, "peak": {"node": 314, "coords_mm": [53.08, 1.26, 0.0], "vm_mpa": 3734.9}, "volume_mm3": 666.2, "bbox_mm": [60.6, 48.5, 2.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.2, "safety_factor": 2.598, "max_disp_mm": 0.1113, "max_strain": 0.0006879647338646146, "volume_mm3": 10870.6, "bbox_mm": [60.6, 48.5, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.531, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 161, "family": "l_bracket", "params": {"L": 85.9, "H": 70.3, "W": 67.3, "T": 5.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.9, 'H': 70.3, 'W': 67.3, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.9, 'H': 70.3, 'W': 67.3, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 226.1, "safety_factor": 1.106, "max_disp_mm": 1.0055, "max_strain": 0.0016162548109115613, "peak": {"node": 2080, "coords_mm": [7.95, -26.17, 70.3], "vm_mpa": 226.1}, "volume_mm3": 63235.1, "bbox_mm": [91.7, 67.3, 76.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.1, "safety_factor": 2.776, "max_disp_mm": 0.2308, "max_strain": 0.0006437852639550655, "volume_mm3": 121382.3, "bbox_mm": [96.7, 67.3, 81.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.67, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 164, "family": "plate_holes", "params": {"L": 101.0, "H": null, "W": 52.5, "T": 3.5, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.0, 'H': None, 'W': 52.5, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.0, 'H': None, 'W': 52.5, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 394.8, "safety_factor": 0.633, "max_disp_mm": 2.2456, "max_strain": 0.002821908973411977, "peak": {"node": 394, "coords_mm": [-48.79, 17.55, 0.0], "vm_mpa": 394.8}, "volume_mm3": 18360.8, "bbox_mm": [101.0, 52.5, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.5, "safety_factor": 1.976, "max_disp_mm": 0.5448, "max_strain": 0.0009043623875011314, "volume_mm3": 39344.6, "bbox_mm": [101.0, 52.5, 7.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.343, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 165, "family": "l_bracket", "params": {"L": 55.1, "H": 49.8, "W": 50.2, "T": 3.8, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.1, 'H': 49.8, 'W': 50.2, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.1, 'H': 49.8, 'W': 50.2, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 223.1, "safety_factor": 1.12, "max_disp_mm": 0.6391, "max_strain": 0.0015950074892412734, "peak": {"node": 1350, "coords_mm": [1.82, -20.32, 53.6], "vm_mpa": 223.1}, "volume_mm3": 20735.6, "bbox_mm": [58.9, 50.2, 53.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 84.7, "safety_factor": 2.952, "max_disp_mm": 0.1136, "max_strain": 0.0006054371395800606, "volume_mm3": 50228.1, "bbox_mm": [63.9, 50.2, 58.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.831, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 163, "family": "rib_bracket", "params": {"L": 83.2, "H": 40.1, "W": 41.0, "T": 3.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.2, 'H': 40.1, 'W': 41.0, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.2, 'H': 40.1, 'W': 41.0, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 620.7, "safety_factor": 0.403, "max_disp_mm": 3.2744, "max_strain": 0.004437196385103321, "peak": {"node": 1947, "coords_mm": [3.38, -29.08, 43.4], "vm_mpa": 620.7}, "volume_mm3": 17129.0, "bbox_mm": [86.5, 41.0, 43.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 136.0, "safety_factor": 1.839, "max_disp_mm": 0.2944, "max_strain": 0.0009719517843452799, "volume_mm3": 62360.2, "bbox_mm": [94.5, 41.0, 51.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.436, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 166, "family": "u_channel", "params": {"L": 82.7, "H": 34.8, "W": 35.7, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.7, 'H': 34.8, 'W': 35.7, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.7, 'H': 34.8, 'W': 35.7, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2121.3, "safety_factor": 0.118, "max_disp_mm": 5.843, "max_strain": 0.015163082974129542, "peak": {"node": 240, "coords_mm": [47.19, 1.63, 0.0], "vm_mpa": 2121.3}, "volume_mm3": 804.9, "bbox_mm": [47.0, 34.8, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.2, "safety_factor": 1.997, "max_disp_mm": 0.1041, "max_strain": 0.000894780519167643, "volume_mm3": 6144.9, "bbox_mm": [47.0, 34.8, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.879, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 167, "family": "rib_bracket", "params": {"L": 55.9, "H": 46.4, "W": 47.3, "T": 4.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.9, 'H': 46.4, 'W': 47.3, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.9, 'H': 46.4, 'W': 47.3, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 259.2, "safety_factor": 0.965, "max_disp_mm": 0.6294, "max_strain": 0.0018527383259607313, "peak": {"node": 1680, "coords_mm": [1.97, -18.45, 50.6], "vm_mpa": 259.2}, "volume_mm3": 21157.3, "bbox_mm": [60.1, 47.3, 50.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 88.0, "safety_factor": 2.84, "max_disp_mm": 0.1088, "max_strain": 0.0006293404253280096, "volume_mm3": 54276.7, "bbox_mm": [66.1, 47.3, 56.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.875, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 168, "family": "plate_holes", "params": {"L": 110.5, "H": null, "W": 62.0, "T": 4.8, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.5, 'H': None, 'W': 62.0, 'T': 4.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.5, 'H': None, 'W': 62.0, 'T': 4.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 325.0, "safety_factor": 0.769, "max_disp_mm": 2.3042, "max_strain": 0.002323412898821394, "peak": {"node": 434, "coords_mm": [-53.1, 0.01, 0.0], "vm_mpa": 325.0}, "volume_mm3": 32402.3, "bbox_mm": [110.5, 62.0, 4.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.7, "safety_factor": 2.198, "max_disp_mm": 0.4975, "max_strain": 0.0008130564438466914, "volume_mm3": 59404.1, "bbox_mm": [110.5, 62.0, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.429, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 170, "family": "u_channel", "params": {"L": 95.4, "H": 41.1, "W": 42.1, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.4, 'H': 41.1, 'W': 42.1, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.4, 'H': 41.1, 'W': 42.1, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1655.5, "safety_factor": 0.151, "max_disp_mm": 5.2465, "max_strain": 0.011833412932109034, "peak": {"node": 277, "coords_mm": [47.75, 1.86, 0.0], "vm_mpa": 1655.5}, "volume_mm3": 1308.3, "bbox_mm": [53.3, 41.1, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 151.5, "safety_factor": 1.651, "max_disp_mm": 0.1464, "max_strain": 0.0010825900200517522, "volume_mm3": 8125.0, "bbox_mm": [53.3, 41.1, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.5, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 169, "family": "l_bracket", "params": {"L": 69.4, "H": 59.3, "W": 58.1, "T": 4.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.4, 'H': 59.3, 'W': 58.1, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.4, 'H': 59.3, 'W': 58.1, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 302.5, "safety_factor": 0.826, "max_disp_mm": 1.0789, "max_strain": 0.0021625118365670264, "peak": {"node": 1403, "coords_mm": [10.33, -24.01, 59.3], "vm_mpa": 302.5}, "volume_mm3": 36427.5, "bbox_mm": [74.1, 58.1, 64.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.6, "safety_factor": 2.22, "max_disp_mm": 0.1941, "max_strain": 0.000804841228096519, "volume_mm3": 77998.1, "bbox_mm": [79.1, 58.1, 69.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.394, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 171, "family": "rib_bracket", "params": {"L": 68.6, "H": 52.7, "W": 53.7, "T": 5.2, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.6, 'H': 52.7, 'W': 53.7, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.6, 'H': 52.7, 'W': 53.7, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 341.4, "safety_factor": 0.732, "max_disp_mm": 1.1221, "max_strain": 0.0024400490805194476, "peak": {"node": 2238, "coords_mm": [8.79, -36.15, 57.9], "vm_mpa": 341.4}, "volume_mm3": 35323.9, "bbox_mm": [73.8, 53.7, 57.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.7, "safety_factor": 2.089, "max_disp_mm": 0.1779, "max_strain": 0.0008553373131350358, "volume_mm3": 79690.8, "bbox_mm": [79.8, 53.7, 63.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.357, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 172, "family": "plate_holes", "params": {"L": 120.0, "H": null, "W": 71.5, "T": 6.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.0, 'H': None, 'W': 71.5, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.0, 'H': None, 'W': 71.5, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 244.3, "safety_factor": 1.023, "max_disp_mm": 1.5592, "max_strain": 0.001746588901092141, "peak": {"node": 3648, "coords_mm": [-58.37, -7.37, 6.1], "vm_mpa": 244.3}, "volume_mm3": 51379.8, "bbox_mm": [120.0, 71.5, 6.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.9, "safety_factor": 2.502, "max_disp_mm": 0.4565, "max_strain": 0.0007143715793728758, "volume_mm3": 85071.5, "bbox_mm": [120.0, 71.5, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.478, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 174, "family": "u_channel", "params": {"L": 108.1, "H": 47.5, "W": 48.4, "T": 4.4, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.1, 'H': 47.5, 'W': 48.4, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.1, 'H': 47.5, 'W': 48.4, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 962.9, "safety_factor": 0.26, "max_disp_mm": 2.838, "max_strain": 0.006882725836130849, "peak": {"node": 89, "coords_mm": [55.2, 4.4, 4.4], "vm_mpa": 962.9}, "volume_mm3": 1990.2, "bbox_mm": [59.7, 47.5, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.5, "safety_factor": 2.565, "max_disp_mm": 0.1096, "max_strain": 0.0006967197841047527, "volume_mm3": 10469.9, "bbox_mm": [59.7, 47.5, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.305, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 173, "family": "l_bracket", "params": {"L": 83.6, "H": 68.8, "W": 66.0, "T": 5.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.6, 'H': 68.8, 'W': 66.0, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.6, 'H': 68.8, 'W': 66.0, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 223.3, "safety_factor": 1.12, "max_disp_mm": 0.9736, "max_strain": 0.0015959773198456497, "peak": {"node": 2295, "coords_mm": [9.8, -27.34, 68.8], "vm_mpa": 223.3}, "volume_mm3": 59477.2, "bbox_mm": [89.3, 66.0, 74.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.5, "safety_factor": 2.514, "max_disp_mm": 0.2239, "max_strain": 0.000710958927389801, "volume_mm3": 115181.2, "bbox_mm": [94.3, 66.0, 79.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.394, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 177, "family": "l_bracket", "params": {"L": 52.9, "H": 48.3, "W": 49.0, "T": 3.6, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 52.9, 'H': 48.3, 'W': 49.0, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 52.9, 'H': 48.3, 'W': 49.0, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 222.1, "safety_factor": 1.126, "max_disp_mm": 0.5063, "max_strain": 0.001587628669738228, "peak": {"node": 1742, "coords_mm": [3.3, -19.57, 51.9], "vm_mpa": 222.1}, "volume_mm3": 18486.7, "bbox_mm": [56.5, 49.0, 51.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 84.8, "safety_factor": 2.948, "max_disp_mm": 0.1086, "max_strain": 0.000606223329288773, "volume_mm3": 46269.7, "bbox_mm": [61.5, 49.0, 56.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.822, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 175, "family": "rib_bracket", "params": {"L": 81.2, "H": 59.1, "W": 40.0, "T": 3.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.2, 'H': 59.1, 'W': 40.0, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.2, 'H': 59.1, 'W': 40.0, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 645.3, "safety_factor": 0.387, "max_disp_mm": 4.1637, "max_strain": 0.004612593531161129, "peak": {"node": 1945, "coords_mm": [1.65, -1.66, 62.2], "vm_mpa": 645.3}, "volume_mm3": 17781.6, "bbox_mm": [84.3, 40.0, 62.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 135.2, "safety_factor": 1.85, "max_disp_mm": 0.2943, "max_strain": 0.0009660957686467994, "volume_mm3": 67221.6, "bbox_mm": [92.3, 40.0, 70.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.462, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 176, "family": "plate_holes", "params": {"L": 129.5, "H": null, "W": 51.0, "T": 3.3, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.5, 'H': None, 'W': 51.0, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.5, 'H': None, 'W': 51.0, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 642.2, "safety_factor": 0.389, "max_disp_mm": 5.7038, "max_strain": 0.004590396024178167, "peak": {"node": 1590, "coords_mm": [-63.18, -12.14, 0.0], "vm_mpa": 642.2}, "volume_mm3": 21608.2, "bbox_mm": [129.5, 51.0, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.2, "safety_factor": 2.152, "max_disp_mm": 0.6691, "max_strain": 0.0008303829052327642, "volume_mm3": 60895.9, "bbox_mm": [129.5, 51.0, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.763, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 178, "family": "u_channel", "params": {"L": 80.7, "H": 33.8, "W": 34.8, "T": 3.1, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.7, 'H': 33.8, 'W': 34.8, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.7, 'H': 33.8, 'W': 34.8, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1737.1, "safety_factor": 0.144, "max_disp_mm": 4.8083, "max_strain": 0.01241725839783055, "peak": {"node": 246, "coords_mm": [38.81, 1.6, 0.0], "vm_mpa": 1737.1}, "volume_mm3": 736.1, "bbox_mm": [45.9, 33.8, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.6, "safety_factor": 2.615, "max_disp_mm": 0.0807, "max_strain": 0.0006832998743553399, "volume_mm3": 5846.4, "bbox_mm": [45.9, 33.8, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.471, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 179, "family": "rib_bracket", "params": {"L": 53.9, "H": 45.4, "W": 46.3, "T": 4.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.9, 'H': 45.4, 'W': 46.3, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.9, 'H': 45.4, 'W': 46.3, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 248.3, "safety_factor": 1.007, "max_disp_mm": 0.5978, "max_strain": 0.0017745860157384016, "peak": {"node": 1174, "coords_mm": [2.02, -23.18, 49.5], "vm_mpa": 248.3}, "volume_mm3": 19628.4, "bbox_mm": [58.0, 46.3, 49.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.0, "safety_factor": 2.747, "max_disp_mm": 0.1043, "max_strain": 0.0006505818584155441, "volume_mm3": 51158.7, "bbox_mm": [64.0, 46.3, 55.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.74, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 180, "family": "plate_holes", "params": {"L": 109.0, "H": null, "W": 60.5, "T": 4.6, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.0, 'H': None, 'W': 60.5, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.0, 'H': None, 'W': 60.5, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 347.5, "safety_factor": 0.719, "max_disp_mm": 2.5253, "max_strain": 0.0024839107358404595, "peak": {"node": 438, "coords_mm": [-52.95, 9.73, 0.0], "vm_mpa": 347.5}, "volume_mm3": 29872.3, "bbox_mm": [109.0, 60.5, 4.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 122.2, "safety_factor": 2.046, "max_disp_mm": 0.5201, "max_strain": 0.0008736224518280091, "volume_mm3": 55848.1, "bbox_mm": [109.0, 60.5, 8.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.326, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 181, "family": "l_bracket", "params": {"L": 67.1, "H": 57.8, "W": 56.9, "T": 4.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.1, 'H': 57.8, 'W': 56.9, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.1, 'H': 57.8, 'W': 56.9, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 318.7, "safety_factor": 0.784, "max_disp_mm": 1.0643, "max_strain": 0.0022783954156435386, "peak": {"node": 1652, "coords_mm": [8.0, -34.44, 57.8], "vm_mpa": 318.7}, "volume_mm3": 33895.3, "bbox_mm": [71.7, 56.9, 62.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.6, "safety_factor": 2.302, "max_disp_mm": 0.185, "max_strain": 0.000776439924034704, "volume_mm3": 73469.3, "bbox_mm": [76.7, 56.9, 67.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.517, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 182, "family": "u_channel", "params": {"L": 93.4, "H": 40.1, "W": 41.1, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.4, 'H': 40.1, 'W': 41.1, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.4, 'H': 40.1, 'W': 41.1, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1645.4, "safety_factor": 0.152, "max_disp_mm": 4.8301, "max_strain": 0.01176149239775101, "peak": {"node": 277, "coords_mm": [44.26, 1.72, 0.0], "vm_mpa": 1645.4}, "volume_mm3": 1214.3, "bbox_mm": [52.3, 40.1, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 130.9, "safety_factor": 1.91, "max_disp_mm": 0.1194, "max_strain": 0.0009353907172547671, "volume_mm3": 7781.2, "bbox_mm": [52.3, 40.1, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.759, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 183, "family": "rib_bracket", "params": {"L": 66.6, "H": 51.7, "W": 52.7, "T": 5.0, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.6, 'H': 51.7, 'W': 52.7, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.6, 'H': 51.7, 'W': 52.7, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 367.9, "safety_factor": 0.679, "max_disp_mm": 1.1253, "max_strain": 0.002630145889593681, "peak": {"node": 1391, "coords_mm": [7.01, -39.5, 51.7], "vm_mpa": 367.9}, "volume_mm3": 32489.6, "bbox_mm": [71.6, 52.7, 56.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.7, "safety_factor": 2.179, "max_disp_mm": 0.1756, "max_strain": 0.000820057420976256, "volume_mm3": 74955.2, "bbox_mm": [77.6, 52.7, 62.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.5, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 184, "family": "plate_holes", "params": {"L": 118.5, "H": null, "W": 70.0, "T": 5.9, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.5, 'H': None, 'W': 70.0, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.5, 'H': None, 'W': 70.0, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 256.4, "safety_factor": 0.975, "max_disp_mm": 1.6857, "max_strain": 0.0018330787218808137, "peak": {"node": 2160, "coords_mm": [-57.09, 6.25, 5.9], "vm_mpa": 256.4}, "volume_mm3": 48013.7, "bbox_mm": [118.5, 70.0, 5.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.2, "safety_factor": 2.423, "max_disp_mm": 0.4738, "max_strain": 0.0007374731796167474, "volume_mm3": 80565.4, "bbox_mm": [118.5, 70.0, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.448, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 185, "family": "l_bracket", "params": {"L": 81.4, "H": 67.3, "W": 64.8, "T": 5.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.4, 'H': 67.3, 'W': 64.8, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.4, 'H': 67.3, 'W': 64.8, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 243.8, "safety_factor": 1.026, "max_disp_mm": 1.0191, "max_strain": 0.0017424686460053341, "peak": {"node": 3177, "coords_mm": [6.49, -33.69, 72.8], "vm_mpa": 243.8}, "volume_mm3": 54956.9, "bbox_mm": [86.9, 64.8, 72.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.5, "safety_factor": 2.592, "max_disp_mm": 0.222, "max_strain": 0.0006895606713472446, "volume_mm3": 108319.7, "bbox_mm": [91.9, 64.8, 77.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.566, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 186, "family": "u_channel", "params": {"L": 106.1, "H": 46.5, "W": 47.4, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.1, 'H': 46.5, 'W': 47.4, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.1, 'H': 46.5, 'W': 47.4, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1597.8, "safety_factor": 0.156, "max_disp_mm": 4.3593, "max_strain": 0.011421077975932371, "peak": {"node": 354, "coords_mm": [53.41, 2.07, 4.3], "vm_mpa": 1597.8}, "volume_mm3": 1865.6, "bbox_mm": [58.7, 46.5, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 152.8, "safety_factor": 1.636, "max_disp_mm": 0.1639, "max_strain": 0.0010921727854958177, "volume_mm3": 10067.9, "bbox_mm": [58.7, 46.5, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.48, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 190, "family": "u_channel", "params": {"L": 78.7, "H": 32.8, "W": 33.8, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.7, 'H': 32.8, 'W': 33.8, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.7, 'H': 32.8, 'W': 33.8, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2037.3, "safety_factor": 0.123, "max_disp_mm": 4.9067, "max_strain": 0.014563168671894496, "peak": {"node": 227, "coords_mm": [37.83, 1.53, 0.0], "vm_mpa": 2037.3}, "volume_mm3": 672.3, "bbox_mm": [44.9, 32.8, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.7, "safety_factor": 2.483, "max_disp_mm": 0.0801, "max_strain": 0.0007198389921309299, "volume_mm3": 5564.7, "bbox_mm": [44.9, 32.8, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.36, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 187, "family": "rib_bracket", "params": {"L": 79.2, "H": 58.1, "W": 59.0, "T": 6.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.2, 'H': 58.1, 'W': 59.0, 'T': 6.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.2, 'H': 58.1, 'W': 59.0, 'T': 6.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 216.5, "safety_factor": 1.155, "max_disp_mm": 0.7804, "max_strain": 0.0015477899390173762, "peak": {"node": 1898, "coords_mm": [7.65, -40.56, 58.1], "vm_mpa": 216.5}, "volume_mm3": 50728.2, "bbox_mm": [85.2, 59.0, 64.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 81.3, "safety_factor": 3.075, "max_disp_mm": 0.1514, "max_strain": 0.0005811586778957448, "volume_mm3": 105704.4, "bbox_mm": [91.2, 59.0, 70.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.92, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 188, "family": "plate_holes", "params": {"L": 128.1, "H": null, "W": 79.5, "T": 3.1, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.1, 'H': None, 'W': 79.5, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.1, 'H': None, 'W': 79.5, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 426.8, "safety_factor": 0.586, "max_disp_mm": 4.127, "max_strain": 0.003050658036783319, "peak": {"node": 2361, "coords_mm": [-62.49, 16.15, 0.0], "vm_mpa": 426.8}, "volume_mm3": 31394.9, "bbox_mm": [128.1, 79.5, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.9, "safety_factor": 2.103, "max_disp_mm": 0.8137, "max_strain": 0.0008495649510120299, "volume_mm3": 71904.5, "bbox_mm": [128.1, 79.5, 7.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.518, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 191, "family": "rib_bracket", "params": {"L": 51.9, "H": 44.4, "W": 45.3, "T": 3.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.9, 'H': 44.4, 'W': 45.3, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.9, 'H': 44.4, 'W': 45.3, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 271.4, "safety_factor": 0.921, "max_disp_mm": 0.4795, "max_strain": 0.0019403096027944748, "peak": {"node": 1604, "coords_mm": [3.18, -28.54, 48.3], "vm_mpa": 271.4}, "volume_mm3": 17702.3, "bbox_mm": [55.8, 45.3, 48.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.7, "safety_factor": 2.727, "max_disp_mm": 0.1006, "max_strain": 0.0006552708721484676, "volume_mm3": 47627.5, "bbox_mm": [61.8, 45.3, 54.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.806, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 194, "family": "u_channel", "params": {"L": 91.4, "H": 39.1, "W": 40.1, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.4, 'H': 39.1, 'W': 40.1, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.4, 'H': 39.1, 'W': 40.1, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1712.8, "safety_factor": 0.146, "max_disp_mm": 5.0517, "max_strain": 0.01224323653504835, "peak": {"node": 97, "coords_mm": [46.09, 3.6, 0.0], "vm_mpa": 1712.8}, "volume_mm3": 1124.9, "bbox_mm": [51.3, 39.1, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.3, "safety_factor": 1.948, "max_disp_mm": 0.117, "max_strain": 0.0009174105061146787, "volume_mm3": 7446.5, "bbox_mm": [51.3, 39.1, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.802, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 192, "family": "plate_holes", "params": {"L": 107.6, "H": null, "W": 59.0, "T": 4.4, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.6, 'H': None, 'W': 59.0, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.6, 'H': None, 'W': 59.0, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 369.9, "safety_factor": 0.676, "max_disp_mm": 2.7238, "max_strain": 0.0026439403192467107, "peak": {"node": 1250, "coords_mm": [-51.67, -1.23, 0.0], "vm_mpa": 369.9}, "volume_mm3": 27490.6, "bbox_mm": [107.6, 59.0, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.6, "safety_factor": 2.006, "max_disp_mm": 0.5487, "max_strain": 0.0008907713637625694, "volume_mm3": 52482.1, "bbox_mm": [107.6, 59.0, 8.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.33, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 193, "family": "l_bracket", "params": {"L": 64.9, "H": 56.3, "W": 55.6, "T": 4.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.9, 'H': 56.3, 'W': 55.6, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.9, 'H': 56.3, 'W': 55.6, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 336.7, "safety_factor": 0.743, "max_disp_mm": 1.0776, "max_strain": 0.0024064635558783344, "peak": {"node": 1292, "coords_mm": [10.11, -13.2, 56.3], "vm_mpa": 336.7}, "volume_mm3": 30726.8, "bbox_mm": [69.3, 55.6, 60.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.7, "safety_factor": 2.3, "max_disp_mm": 0.1824, "max_strain": 0.000776846022582605, "volume_mm3": 68256.8, "bbox_mm": [74.3, 55.6, 65.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.558, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 195, "family": "rib_bracket", "params": {"L": 64.6, "H": 50.7, "W": 51.7, "T": 4.9, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.6, 'H': 50.7, 'W': 51.7, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.6, 'H': 50.7, 'W': 51.7, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 337.2, "safety_factor": 0.741, "max_disp_mm": 1.1236, "max_strain": 0.0024104158919836132, "peak": {"node": 1811, "coords_mm": [6.44, -36.5, 55.6], "vm_mpa": 337.2}, "volume_mm3": 30450.3, "bbox_mm": [69.5, 51.7, 55.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.1, "safety_factor": 2.031, "max_disp_mm": 0.1681, "max_strain": 0.0008799951815787226, "volume_mm3": 71117.5, "bbox_mm": [75.5, 51.7, 61.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.289, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 196, "family": "plate_holes", "params": {"L": 117.1, "H": null, "W": 68.5, "T": 5.7, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.1, 'H': None, 'W': 68.5, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.1, 'H': None, 'W': 68.5, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 282.9, "safety_factor": 0.884, "max_disp_mm": 1.8513, "max_strain": 0.0020224679103243146, "peak": {"node": 3460, "coords_mm": [-56.72, 16.4, 5.7], "vm_mpa": 282.9}, "volume_mm3": 44826.3, "bbox_mm": [117.1, 68.5, 5.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.4, "safety_factor": 2.224, "max_disp_mm": 0.4949, "max_strain": 0.0008036554957416534, "volume_mm3": 76283.4, "bbox_mm": [117.1, 68.5, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.34, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 198, "family": "u_channel", "params": {"L": 104.1, "H": 45.5, "W": 46.4, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.1, 'H': 45.5, 'W': 46.4, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.1, 'H': 45.5, 'W': 46.4, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1374.3, "safety_factor": 0.182, "max_disp_mm": 4.7384, "max_strain": 0.00982390383398947, "peak": {"node": 352, "coords_mm": [57.07, 2.05, 4.2], "vm_mpa": 1374.3}, "volume_mm3": 1746.4, "bbox_mm": [57.7, 45.5, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 148.7, "safety_factor": 1.682, "max_disp_mm": 0.1601, "max_strain": 0.0010626441023436723, "volume_mm3": 9675.7, "bbox_mm": [57.7, 45.5, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.5, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 197, "family": "l_bracket", "params": {"L": 79.1, "H": 65.9, "W": 63.6, "T": 5.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.1, 'H': 65.9, 'W': 63.6, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.1, 'H': 65.9, 'W': 63.6, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 257.2, "safety_factor": 0.972, "max_disp_mm": 1.0131, "max_strain": 0.0018383169572888565, "peak": {"node": 1273, "coords_mm": [7.41, -28.27, 65.9], "vm_mpa": 257.2}, "volume_mm3": 51653.4, "bbox_mm": [84.5, 63.6, 71.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.1, "safety_factor": 2.523, "max_disp_mm": 0.2149, "max_strain": 0.0007081970314101107, "volume_mm3": 102787.8, "bbox_mm": [89.5, 63.6, 76.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.551, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 199, "family": "rib_bracket", "params": {"L": 77.2, "H": 57.1, "W": 58.0, "T": 5.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.2, 'H': 57.1, 'W': 58.0, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.2, 'H': 57.1, 'W': 58.0, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 276.5, "safety_factor": 0.904, "max_disp_mm": 1.0655, "max_strain": 0.0019763608684158335, "peak": {"node": 1832, "coords_mm": [7.24, -13.27, 57.1], "vm_mpa": 276.5}, "volume_mm3": 47129.6, "bbox_mm": [83.0, 58.0, 62.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.2, "safety_factor": 2.289, "max_disp_mm": 0.1994, "max_strain": 0.0007808551143777709, "volume_mm3": 99990.8, "bbox_mm": [89.0, 58.0, 68.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.384, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 202, "family": "u_channel", "params": {"L": 76.7, "H": 31.8, "W": 32.8, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.7, 'H': 31.8, 'W': 32.8, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.7, 'H': 31.8, 'W': 32.8, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1998.5, "safety_factor": 0.125, "max_disp_mm": 4.9944, "max_strain": 0.01428525259650127, "peak": {"node": 229, "coords_mm": [39.15, 1.48, 0.0], "vm_mpa": 1998.5}, "volume_mm3": 612.2, "bbox_mm": [43.9, 31.8, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.8, "safety_factor": 2.431, "max_disp_mm": 0.0776, "max_strain": 0.0007349718196882678, "volume_mm3": 5291.2, "bbox_mm": [43.9, 31.8, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.306, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 201, "family": "l_bracket", "params": {"L": 93.4, "H": 45.4, "W": 46.5, "T": 3.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 93.4, 'H': 45.4, 'W': 46.5, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 93.4, 'H': 45.4, 'W': 46.5, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 550.3, "safety_factor": 0.454, "max_disp_mm": 3.282, "max_strain": 0.003933460661879989, "peak": {"node": 1587, "coords_mm": [2.12, -30.59, 48.7], "vm_mpa": 550.3}, "volume_mm3": 21805.2, "bbox_mm": [96.7, 46.5, 48.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.7, "safety_factor": 2.071, "max_disp_mm": 0.3638, "max_strain": 0.0008630651870726276, "volume_mm3": 71411.4, "bbox_mm": [103.7, 46.5, 55.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.616, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 203, "family": "rib_bracket", "params": {"L": 49.9, "H": 43.4, "W": 44.3, "T": 3.8, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.9, 'H': 43.4, 'W': 44.3, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.9, 'H': 43.4, 'W': 44.3, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 238.5, "safety_factor": 1.048, "max_disp_mm": 0.5181, "max_strain": 0.001704587604398229, "peak": {"node": 1077, "coords_mm": [2.13, -18.46, 47.2], "vm_mpa": 238.5}, "volume_mm3": 16345.8, "bbox_mm": [53.7, 44.3, 47.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 88.0, "safety_factor": 2.841, "max_disp_mm": 0.0946, "max_strain": 0.0006289693433166357, "volume_mm3": 44759.8, "bbox_mm": [59.7, 44.3, 53.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.793, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 204, "family": "plate_holes", "params": {"L": 106.1, "H": null, "W": 57.5, "T": 4.2, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.1, 'H': None, 'W': 57.5, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.1, 'H': None, 'W': 57.5, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 350.1, "safety_factor": 0.714, "max_disp_mm": 2.7211, "max_strain": 0.0025025082387862803, "peak": {"node": 1493, "coords_mm": [-51.52, -12.44, 0.0], "vm_mpa": 350.1}, "volume_mm3": 25200.9, "bbox_mm": [106.1, 57.5, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 131.1, "safety_factor": 1.908, "max_disp_mm": 0.574, "max_strain": 0.0009368157976203002, "volume_mm3": 49201.8, "bbox_mm": [106.1, 57.5, 8.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.193, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 206, "family": "u_channel", "params": {"L": 89.4, "H": 38.2, "W": 39.1, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.4, 'H': 38.2, 'W': 39.1, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.4, 'H': 38.2, 'W': 39.1, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1863.9, "safety_factor": 0.134, "max_disp_mm": 5.2656, "max_strain": 0.013323148524787953, "peak": {"node": 301, "coords_mm": [43.16, 1.71, 3.5], "vm_mpa": 1863.9}, "volume_mm3": 1041.3, "bbox_mm": [50.3, 38.2, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.7, "safety_factor": 1.989, "max_disp_mm": 0.1139, "max_strain": 0.0008984082492830157, "volume_mm3": 7129.8, "bbox_mm": [50.3, 38.2, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.855, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 205, "family": "l_bracket", "params": {"L": 62.7, "H": 54.9, "W": 54.4, "T": 4.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 62.7, 'H': 54.9, 'W': 54.4, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 62.7, 'H': 54.9, 'W': 54.4, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 239.9, "safety_factor": 1.042, "max_disp_mm": 0.7477, "max_strain": 0.0017148499693196767, "peak": {"node": 1188, "coords_mm": [10.75, -23.78, 54.9], "vm_mpa": 239.9}, "volume_mm3": 28514.8, "bbox_mm": [67.0, 54.4, 59.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 79.6, "safety_factor": 3.14, "max_disp_mm": 0.1304, "max_strain": 0.0005691974321031647, "volume_mm3": 64201.2, "bbox_mm": [72.0, 54.4, 64.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.097, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 207, "family": "rib_bracket", "params": {"L": 62.6, "H": 49.7, "W": 50.7, "T": 4.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.6, 'H': 49.7, 'W': 50.7, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.6, 'H': 49.7, 'W': 50.7, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 369.4, "safety_factor": 0.677, "max_disp_mm": 1.1791, "max_strain": 0.002640662081253187, "peak": {"node": 1303, "coords_mm": [10.99, -15.73, 49.7], "vm_mpa": 369.4}, "volume_mm3": 27879.9, "bbox_mm": [67.3, 50.7, 54.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.7, "safety_factor": 2.279, "max_disp_mm": 0.1654, "max_strain": 0.0007843044890638414, "volume_mm3": 66726.3, "bbox_mm": [73.3, 50.7, 60.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.602, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 208, "family": "plate_holes", "params": {"L": 115.6, "H": null, "W": 67.0, "T": 5.5, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.6, 'H': None, 'W': 67.0, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.6, 'H': None, 'W': 67.0, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 293.7, "safety_factor": 0.851, "max_disp_mm": 2.0192, "max_strain": 0.0020991524881302658, "peak": {"node": 1835, "coords_mm": [-55.49, -7.31, 0.0], "vm_mpa": 293.7}, "volume_mm3": 41734.7, "bbox_mm": [115.6, 67.0, 5.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.1, "safety_factor": 2.271, "max_disp_mm": 0.5145, "max_strain": 0.0007868030621369958, "volume_mm3": 72087.1, "bbox_mm": [115.6, 67.0, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.42, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 210, "family": "u_channel", "params": {"L": 102.1, "H": 44.5, "W": 45.4, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.1, 'H': 44.5, 'W': 45.4, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.1, 'H': 44.5, 'W': 45.4, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1451.8, "safety_factor": 0.172, "max_disp_mm": 4.8309, "max_strain": 0.010377972727957293, "peak": {"node": 85, "coords_mm": [51.89, 4.1, 4.1], "vm_mpa": 1451.8}, "volume_mm3": 1632.3, "bbox_mm": [56.7, 44.5, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 155.9, "safety_factor": 1.604, "max_disp_mm": 0.1567, "max_strain": 0.0011143909351175232, "volume_mm3": 9293.1, "bbox_mm": [56.7, 44.5, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.431, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 209, "family": "l_bracket", "params": {"L": 76.9, "H": 64.4, "W": 62.3, "T": 5.2, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.9, 'H': 64.4, 'W': 62.3, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.9, 'H': 64.4, 'W': 62.3, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 247.5, "safety_factor": 1.01, "max_disp_mm": 1.0722, "max_strain": 0.0017691432156978259, "peak": {"node": 2419, "coords_mm": [6.61, -33.69, 69.6], "vm_mpa": 247.5}, "volume_mm3": 47460.1, "bbox_mm": [82.1, 62.3, 69.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.0, "safety_factor": 2.5, "max_disp_mm": 0.2114, "max_strain": 0.0007147435180245311, "volume_mm3": 96272.2, "bbox_mm": [87.1, 62.3, 74.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.49, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 214, "family": "u_channel", "params": {"L": 114.8, "H": 30.8, "W": 31.8, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.8, 'H': 30.8, 'W': 31.8, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.8, 'H': 30.8, 'W': 31.8, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4540.0, "safety_factor": 0.055, "max_disp_mm": 39.6198, "max_strain": 0.03245282944266524, "peak": {"node": 381, "coords_mm": [35.82, 1.53, 2.8], "vm_mpa": 4540.0}, "volume_mm3": 870.2, "bbox_mm": [83.0, 30.8, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 130.2, "safety_factor": 1.919, "max_disp_mm": 0.2577, "max_strain": 0.000931006565112496, "volume_mm3": 12013.9, "bbox_mm": [83.0, 30.8, 10.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.864, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 211, "family": "rib_bracket", "params": {"L": 75.3, "H": 56.1, "W": 57.0, "T": 5.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.3, 'H': 56.1, 'W': 57.0, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.3, 'H': 56.1, 'W': 57.0, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 320.7, "safety_factor": 0.78, "max_disp_mm": 1.0685, "max_strain": 0.0022920667216851463, "peak": {"node": 1774, "coords_mm": [9.37, -27.45, 56.1], "vm_mpa": 320.7}, "volume_mm3": 44543.8, "bbox_mm": [81.0, 57.0, 61.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.5, "safety_factor": 2.393, "max_disp_mm": 0.1933, "max_strain": 0.0007467282421596412, "volume_mm3": 95433.4, "bbox_mm": [87.0, 57.0, 67.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.613, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 215, "family": "rib_bracket", "params": {"L": 47.9, "H": 42.4, "W": 43.4, "T": 3.6, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.9, 'H': 42.4, 'W': 43.4, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.9, 'H': 42.4, 'W': 43.4, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 289.8, "safety_factor": 0.863, "max_disp_mm": 0.5538, "max_strain": 0.0020717950814446297, "peak": {"node": 1421, "coords_mm": [3.46, -21.7, 46.0], "vm_mpa": 289.8}, "volume_mm3": 14670.9, "bbox_mm": [51.5, 43.4, 46.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 88.8, "safety_factor": 2.815, "max_disp_mm": 0.0916, "max_strain": 0.0006348875803304497, "volume_mm3": 41622.3, "bbox_mm": [57.5, 43.4, 52.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.952, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 213, "family": "l_bracket", "params": {"L": 91.2, "H": 73.9, "W": 45.2, "T": 3.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.2, 'H': 73.9, 'W': 45.2, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.2, 'H': 73.9, 'W': 45.2, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 463.3, "safety_factor": 0.54, "max_disp_mm": 3.3383, "max_strain": 0.0033116518046832537, "peak": {"node": 2214, "coords_mm": [2.26, -32.41, 77.1], "vm_mpa": 463.3}, "volume_mm3": 24342.9, "bbox_mm": [94.4, 45.2, 77.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.6, "safety_factor": 1.975, "max_disp_mm": 0.3576, "max_strain": 0.000904814045020488, "volume_mm3": 80820.3, "bbox_mm": [101.4, 45.2, 84.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.435, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 216, "family": "plate_holes", "params": {"L": 104.6, "H": null, "W": 56.0, "T": 4.0, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.6, 'H': None, 'W': 56.0, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.6, 'H': None, 'W': 56.0, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 378.3, "safety_factor": 0.661, "max_disp_mm": 2.1148, "max_strain": 0.0027040374222122884, "peak": {"node": 1488, "coords_mm": [-50.95, -14.66, 0.0], "vm_mpa": 378.3}, "volume_mm3": 23028.3, "bbox_mm": [104.6, 56.0, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 141.9, "safety_factor": 1.762, "max_disp_mm": 0.6038, "max_strain": 0.0010139658587287699, "volume_mm3": 46056.6, "bbox_mm": [104.6, 56.0, 8.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.102, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 218, "family": "u_channel", "params": {"L": 87.4, "H": 37.2, "W": 38.1, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.4, 'H': 37.2, 'W': 38.1, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.4, 'H': 37.2, 'W': 38.1, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1937.8, "safety_factor": 0.129, "max_disp_mm": 5.3554, "max_strain": 0.013851429912236642, "peak": {"node": 265, "coords_mm": [44.78, 1.74, 0.0], "vm_mpa": 1937.8}, "volume_mm3": 960.6, "bbox_mm": [49.3, 37.2, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 122.9, "safety_factor": 2.034, "max_disp_mm": 0.1102, "max_strain": 0.0008787685281862567, "volume_mm3": 6812.6, "bbox_mm": [49.3, 37.2, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.905, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 217, "family": "l_bracket", "params": {"L": 60.4, "H": 53.4, "W": 53.2, "T": 4.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 60.4, 'H': 53.4, 'W': 53.2, 'T': 4.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 60.4, 'H': 53.4, 'W': 53.2, 'T': 4.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 222.0, "safety_factor": 1.126, "max_disp_mm": 0.6125, "max_strain": 0.0015867859165133817, "peak": {"node": 1713, "coords_mm": [12.77, -8.76, 57.5], "vm_mpa": 222.0}, "volume_mm3": 25716.3, "bbox_mm": [64.5, 53.2, 57.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 79.3, "safety_factor": 3.154, "max_disp_mm": 0.127, "max_strain": 0.0005665981470643494, "volume_mm3": 59498.3, "bbox_mm": [69.5, 53.2, 62.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.028, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 219, "family": "rib_bracket", "params": {"L": 60.6, "H": 48.7, "W": 49.7, "T": 4.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.6, 'H': 48.7, 'W': 49.7, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.6, 'H': 48.7, 'W': 49.7, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 414.3, "safety_factor": 0.603, "max_disp_mm": 1.1429, "max_strain": 0.002961655244338958, "peak": {"node": 1612, "coords_mm": [5.89, -18.2, 53.3], "vm_mpa": 414.3}, "volume_mm3": 26039.8, "bbox_mm": [65.2, 49.7, 53.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.3, "safety_factor": 2.061, "max_disp_mm": 0.1574, "max_strain": 0.0008669686519980139, "volume_mm3": 63165.7, "bbox_mm": [71.2, 49.7, 59.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.458, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 222, "family": "u_channel", "params": {"L": 100.1, "H": 43.5, "W": 44.4, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.1, 'H': 43.5, 'W': 44.4, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.1, 'H': 43.5, 'W': 44.4, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1462.9, "safety_factor": 0.171, "max_disp_mm": 4.8519, "max_strain": 0.01045678969181313, "peak": {"node": 329, "coords_mm": [55.0, 1.97, 4.0], "vm_mpa": 1462.9}, "volume_mm3": 1523.2, "bbox_mm": [55.7, 43.5, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 148.2, "safety_factor": 1.687, "max_disp_mm": 0.1555, "max_strain": 0.0010592622435149019, "volume_mm3": 8920.0, "bbox_mm": [55.7, 43.5, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.516, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 220, "family": "plate_holes", "params": {"L": 114.1, "H": null, "W": 65.5, "T": 5.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.1, 'H': None, 'W': 65.5, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.1, 'H': None, 'W': 65.5, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 317.7, "safety_factor": 0.787, "max_disp_mm": 2.1899, "max_strain": 0.0022712964187848817, "peak": {"node": 1895, "coords_mm": [-55.54, 2.43, 0.0], "vm_mpa": 317.7}, "volume_mm3": 39077.0, "bbox_mm": [114.1, 65.5, 5.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 122.2, "safety_factor": 2.045, "max_disp_mm": 0.5353, "max_strain": 0.0008737296925617273, "volume_mm3": 68569.1, "bbox_mm": [114.1, 65.5, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.259, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 221, "family": "l_bracket", "params": {"L": 74.7, "H": 62.9, "W": 61.1, "T": 5.1, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.7, 'H': 62.9, 'W': 61.1, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.7, 'H': 62.9, 'W': 61.1, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 275.2, "safety_factor": 0.908, "max_disp_mm": 1.036, "max_strain": 0.0019673245170582646, "peak": {"node": 1982, "coords_mm": [8.91, -30.09, 62.9], "vm_mpa": 275.2}, "volume_mm3": 44466.7, "bbox_mm": [79.8, 61.1, 68.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.2, "safety_factor": 2.4, "max_disp_mm": 0.2048, "max_strain": 0.000744504770618918, "volume_mm3": 91147.1, "bbox_mm": [84.8, 61.1, 73.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.492, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 223, "family": "rib_bracket", "params": {"L": 73.3, "H": 55.1, "W": 56.0, "T": 5.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.3, 'H': 55.1, 'W': 56.0, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.3, 'H': 55.1, 'W': 56.0, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 299.9, "safety_factor": 0.834, "max_disp_mm": 1.0977, "max_strain": 0.0021436597169867144, "peak": {"node": 1971, "coords_mm": [12.24, -33.99, 60.6], "vm_mpa": 299.9}, "volume_mm3": 41241.2, "bbox_mm": [78.8, 56.0, 60.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.7, "safety_factor": 2.389, "max_disp_mm": 0.1906, "max_strain": 0.0007480533497850894, "volume_mm3": 90095.6, "bbox_mm": [84.8, 56.0, 66.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.555, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 226, "family": "u_channel", "params": {"L": 112.8, "H": 49.8, "W": 30.8, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.8, 'H': 49.8, 'W': 30.8, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.8, 'H': 49.8, 'W': 30.8, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4107.3, "safety_factor": 0.061, "max_disp_mm": 43.0498, "max_strain": 0.029359426296986752, "peak": {"node": 596, "coords_mm": [33.73, 2.3, 0.45], "vm_mpa": 4107.3}, "volume_mm3": 941.1, "bbox_mm": [82.0, 49.8, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 134.4, "safety_factor": 1.86, "max_disp_mm": 0.2584, "max_strain": 0.0009606999539306305, "volume_mm3": 13864.7, "bbox_mm": [82.0, 49.8, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.799, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 225, "family": "l_bracket", "params": {"L": 88.9, "H": 72.4, "W": 69.0, "T": 3.0, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 88.9, 'H': 72.4, 'W': 69.0, 'T': 3.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 88.9, 'H': 72.4, 'W': 69.0, 'T': 3.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 366.3, "safety_factor": 0.682, "max_disp_mm": 2.2717, "max_strain": 0.0026184549040962992, "peak": {"node": 2502, "coords_mm": [2.13, -16.02, 75.4], "vm_mpa": 366.3}, "volume_mm3": 34010.1, "bbox_mm": [91.9, 69.0, 75.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.2, "safety_factor": 2.152, "max_disp_mm": 0.3988, "max_strain": 0.0008303720117838751, "volume_mm3": 93453.6, "bbox_mm": [96.9, 69.0, 80.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.47, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 227, "family": "rib_bracket", "params": {"L": 45.9, "H": 41.4, "W": 42.4, "T": 3.5, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.9, 'H': 41.4, 'W': 42.4, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.9, 'H': 41.4, 'W': 42.4, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 319.1, "safety_factor": 0.783, "max_disp_mm": 0.5341, "max_strain": 0.0022810010528539373, "peak": {"node": 1262, "coords_mm": [2.18, -16.27, 44.9], "vm_mpa": 319.1}, "volume_mm3": 13474.7, "bbox_mm": [49.4, 42.4, 44.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.4, "safety_factor": 2.677, "max_disp_mm": 0.0854, "max_strain": 0.0006674780499459886, "volume_mm3": 38991.0, "bbox_mm": [55.4, 42.4, 50.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.894, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 228, "family": "plate_holes", "params": {"L": 103.1, "H": null, "W": 54.5, "T": 3.8, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.1, 'H': None, 'W': 54.5, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.1, 'H': None, 'W': 54.5, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 413.1, "safety_factor": 0.605, "max_disp_mm": 2.2655, "max_strain": 0.002952957840852085, "peak": {"node": 104, "coords_mm": [-51.55, 9.91, 3.8], "vm_mpa": 413.1}, "volume_mm3": 21137.1, "bbox_mm": [103.1, 54.5, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 148.7, "safety_factor": 1.682, "max_disp_mm": 0.632, "max_strain": 0.001062668366071192, "volume_mm3": 43386.7, "bbox_mm": [103.1, 54.5, 7.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.076, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 230, "family": "u_channel", "params": {"L": 85.4, "H": 36.2, "W": 37.1, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 85.4, 'H': 36.2, 'W': 37.1, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 85.4, 'H': 36.2, 'W': 37.1, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1896.2, "safety_factor": 0.132, "max_disp_mm": 5.7181, "max_strain": 0.013553977130064567, "peak": {"node": 285, "coords_mm": [41.14, 1.69, 3.3], "vm_mpa": 1896.2}, "volume_mm3": 884.3, "bbox_mm": [48.3, 36.2, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.4, "safety_factor": 1.977, "max_disp_mm": 0.1091, "max_strain": 0.0009038064030082081, "volume_mm3": 6504.0, "bbox_mm": [48.3, 36.2, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.845, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 231, "family": "rib_bracket", "params": {"L": 58.6, "H": 47.7, "W": 48.7, "T": 4.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.6, 'H': 47.7, 'W': 48.7, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.6, 'H': 47.7, 'W': 48.7, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 413.2, "safety_factor": 0.605, "max_disp_mm": 1.1715, "max_strain": 0.002953755833959352, "peak": {"node": 1317, "coords_mm": [15.9, -1.77, 52.1], "vm_mpa": 413.2}, "volume_mm3": 23720.8, "bbox_mm": [63.0, 48.7, 52.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.1, "safety_factor": 2.065, "max_disp_mm": 0.1538, "max_strain": 0.00086537532923118, "volume_mm3": 59106.2, "bbox_mm": [69.0, 48.7, 58.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.46, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 232, "family": "plate_holes", "params": {"L": 112.6, "H": null, "W": 64.0, "T": 5.1, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.6, 'H': None, 'W': 64.0, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.6, 'H': None, 'W': 64.0, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 282.2, "safety_factor": 0.886, "max_disp_mm": 1.9888, "max_strain": 0.002016945892007253, "peak": {"node": 1905, "coords_mm": [-54.17, 8.62, 5.1], "vm_mpa": 282.2}, "volume_mm3": 36239.9, "bbox_mm": [112.6, 64.0, 5.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.6, "safety_factor": 2.39, "max_disp_mm": 0.466, "max_strain": 0.0007476823031513901, "volume_mm3": 64663.4, "bbox_mm": [112.6, 64.0, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.504, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 234, "family": "u_channel", "params": {"L": 98.1, "H": 42.5, "W": 43.4, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.1, 'H': 42.5, 'W': 43.4, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.1, 'H': 42.5, 'W': 43.4, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1766.1, "safety_factor": 0.142, "max_disp_mm": 5.277, "max_strain": 0.012624533407834175, "peak": {"node": 283, "coords_mm": [53.35, 2.36, 0.0], "vm_mpa": 1766.1}, "volume_mm3": 1419.1, "bbox_mm": [54.7, 42.5, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 153.3, "safety_factor": 1.631, "max_disp_mm": 0.1524, "max_strain": 0.0010957839837266892, "volume_mm3": 8556.3, "bbox_mm": [54.7, 42.5, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.489, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 233, "family": "l_bracket", "params": {"L": 72.4, "H": 61.4, "W": 59.8, "T": 4.9, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 72.4, 'H': 61.4, 'W': 59.8, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 72.4, 'H': 61.4, 'W': 59.8, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 273.6, "safety_factor": 0.914, "max_disp_mm": 1.0848, "max_strain": 0.0019553841672844785, "peak": {"node": 2293, "coords_mm": [6.25, -19.44, 66.3], "vm_mpa": 273.6}, "volume_mm3": 40641.9, "bbox_mm": [77.3, 59.8, 66.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.1, "safety_factor": 2.23, "max_disp_mm": 0.2011, "max_strain": 0.000801273058250524, "volume_mm3": 85073.3, "bbox_mm": [82.3, 59.8, 71.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.316, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 235, "family": "rib_bracket", "params": {"L": 71.3, "H": 54.1, "W": 55.0, "T": 5.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.3, 'H': 54.1, 'W': 55.0, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.3, 'H': 54.1, 'W': 55.0, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 309.2, "safety_factor": 0.809, "max_disp_mm": 1.1003, "max_strain": 0.0022100014605606123, "peak": {"node": 969, "coords_mm": [7.54, -6.25, 54.1], "vm_mpa": 309.2}, "volume_mm3": 38847.6, "bbox_mm": [76.7, 55.0, 59.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.4, "safety_factor": 2.265, "max_disp_mm": 0.1839, "max_strain": 0.0007888949020528654, "volume_mm3": 85773.6, "bbox_mm": [82.7, 55.0, 65.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.457, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 238, "family": "u_channel", "params": {"L": 110.8, "H": 48.8, "W": 49.8, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.8, 'H': 48.8, 'W': 49.8, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.8, 'H': 48.8, 'W': 49.8, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3434.8, "safety_factor": 0.073, "max_disp_mm": 19.9929, "max_strain": 0.024552491952606385, "peak": {"node": 330, "coords_mm": [53.55, 1.31, 0.0], "vm_mpa": 3434.8}, "volume_mm3": 724.7, "bbox_mm": [61.0, 48.8, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 159.9, "safety_factor": 1.564, "max_disp_mm": 0.2394, "max_strain": 0.0011427881821181487, "volume_mm3": 7484.8, "bbox_mm": [61.0, 48.8, 8.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.491, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 236, "family": "plate_holes", "params": {"L": 122.1, "H": null, "W": 73.5, "T": 6.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.1, 'H': None, 'W': 73.5, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.1, 'H': None, 'W': 73.5, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 238.5, "safety_factor": 1.048, "max_disp_mm": 1.4774, "max_strain": 0.001704983195186944, "peak": {"node": 3868, "coords_mm": [-59.63, 8.57, 6.3], "vm_mpa": 238.5}, "volume_mm3": 55548.8, "bbox_mm": [122.1, 73.5, 6.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.2, "safety_factor": 2.547, "max_disp_mm": 0.4436, "max_strain": 0.0007016240307085381, "volume_mm3": 90817.9, "bbox_mm": [122.1, 73.5, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.499, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 240, "family": "plate_holes", "params": {"L": 101.6, "H": null, "W": 53.0, "T": 3.6, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.6, 'H': None, 'W': 53.0, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.6, 'H': None, 'W': 53.0, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 341.0, "safety_factor": 0.733, "max_disp_mm": 2.0551, "max_strain": 0.0024374245439503584, "peak": {"node": 2350, "coords_mm": [-49.02, 10.5, 3.6], "vm_mpa": 341.0}, "volume_mm3": 19181.7, "bbox_mm": [101.6, 53.0, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.3, "safety_factor": 1.934, "max_disp_mm": 0.5347, "max_strain": 0.0009239313712765903, "volume_mm3": 40494.7, "bbox_mm": [101.6, 53.0, 7.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.201, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 241, "family": "l_bracket", "params": {"L": 55.9, "H": 50.4, "W": 50.7, "T": 3.8, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.9, 'H': 50.4, 'W': 50.7, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.9, 'H': 50.4, 'W': 50.7, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 225.4, "safety_factor": 1.109, "max_disp_mm": 0.5028, "max_strain": 0.0016111595201646627, "peak": {"node": 1812, "coords_mm": [2.01, -17.98, 54.2], "vm_mpa": 225.4}, "volume_mm3": 21211.9, "bbox_mm": [59.7, 50.7, 54.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.6, "safety_factor": 2.992, "max_disp_mm": 0.1163, "max_strain": 0.0005972812723447861, "volume_mm3": 51353.0, "bbox_mm": [64.7, 50.7, 59.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.883, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 239, "family": "rib_bracket", "params": {"L": 83.9, "H": 40.4, "W": 41.4, "T": 3.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.9, 'H': 40.4, 'W': 41.4, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.9, 'H': 40.4, 'W': 41.4, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 585.2, "safety_factor": 0.427, "max_disp_mm": 3.325, "max_strain": 0.004183298652053106, "peak": {"node": 1908, "coords_mm": [1.7, -23.14, 43.7], "vm_mpa": 585.2}, "volume_mm3": 17432.7, "bbox_mm": [87.2, 41.4, 43.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.7, "safety_factor": 1.943, "max_disp_mm": 0.2983, "max_strain": 0.0009198329730044388, "volume_mm3": 63436.4, "bbox_mm": [95.2, 41.4, 51.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.516, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 242, "family": "u_channel", "params": {"L": 83.5, "H": 35.2, "W": 36.1, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.5, 'H': 35.2, 'W': 36.1, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.5, 'H': 35.2, 'W': 36.1, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2103.8, "safety_factor": 0.119, "max_disp_mm": 5.9819, "max_strain": 0.0150383166369759, "peak": {"node": 285, "coords_mm": [42.73, 1.64, 3.2], "vm_mpa": 2103.8}, "volume_mm3": 813.1, "bbox_mm": [47.4, 35.2, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.4, "safety_factor": 1.963, "max_disp_mm": 0.1064, "max_strain": 0.0009104336767738674, "volume_mm3": 6212.6, "bbox_mm": [47.4, 35.2, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.844, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 243, "family": "rib_bracket", "params": {"L": 56.6, "H": 46.8, "W": 47.7, "T": 4.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.6, 'H': 46.8, 'W': 47.7, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.6, 'H': 46.8, 'W': 47.7, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 301.1, "safety_factor": 0.83, "max_disp_mm": 0.7921, "max_strain": 0.0021520908306547036, "peak": {"node": 897, "coords_mm": [12.65, -7.75, 46.8], "vm_mpa": 301.1}, "volume_mm3": 22090.3, "bbox_mm": [60.9, 47.7, 51.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 86.4, "safety_factor": 2.892, "max_disp_mm": 0.1098, "max_strain": 0.0006178985185729127, "volume_mm3": 55861.9, "bbox_mm": [66.9, 47.7, 57.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.062, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 244, "family": "plate_holes", "params": {"L": 111.1, "H": null, "W": 62.5, "T": 4.9, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.1, 'H': None, 'W': 62.5, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.1, 'H': None, 'W': 62.5, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 326.5, "safety_factor": 0.766, "max_disp_mm": 2.1684, "max_strain": 0.0023337878515467024, "peak": {"node": 1680, "coords_mm": [-54.09, -14.95, 0.0], "vm_mpa": 326.5}, "volume_mm3": 33531.8, "bbox_mm": [111.1, 62.5, 4.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.2, "safety_factor": 2.229, "max_disp_mm": 0.4866, "max_strain": 0.0008018959848825977, "volume_mm3": 60904.6, "bbox_mm": [111.1, 62.5, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.463, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 246, "family": "u_channel", "params": {"L": 96.1, "H": 41.5, "W": 42.5, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.1, 'H': 41.5, 'W': 42.5, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.1, 'H': 41.5, 'W': 42.5, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1812.2, "safety_factor": 0.138, "max_disp_mm": 5.5173, "max_strain": 0.01295400838007155, "peak": {"node": 321, "coords_mm": [48.14, 1.85, 3.8], "vm_mpa": 1812.2}, "volume_mm3": 1318.4, "bbox_mm": [53.6, 41.5, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 160.1, "safety_factor": 1.561, "max_disp_mm": 0.1487, "max_strain": 0.0011444798266857538, "volume_mm3": 8192.2, "bbox_mm": [53.6, 41.5, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.423, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 245, "family": "l_bracket", "params": {"L": 70.2, "H": 59.9, "W": 58.6, "T": 4.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 70.2, 'H': 59.9, 'W': 58.6, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 70.2, 'H': 59.9, 'W': 58.6, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 286.1, "safety_factor": 0.874, "max_disp_mm": 1.0723, "max_strain": 0.002045391836263251, "peak": {"node": 2143, "coords_mm": [9.93, -25.89, 64.7], "vm_mpa": 286.1}, "volume_mm3": 37944.7, "bbox_mm": [75.0, 58.6, 64.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.7, "safety_factor": 2.387, "max_disp_mm": 0.1932, "max_strain": 0.0007485915651030313, "volume_mm3": 80341.8, "bbox_mm": [80.0, 58.6, 69.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.514, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 247, "family": "rib_bracket", "params": {"L": 69.3, "H": 53.1, "W": 54.0, "T": 5.2, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.3, 'H': 53.1, 'W': 54.0, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.3, 'H': 53.1, 'W': 54.0, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 327.4, "safety_factor": 0.764, "max_disp_mm": 1.1251, "max_strain": 0.0023403203506652953, "peak": {"node": 2093, "coords_mm": [6.2, -21.88, 58.3], "vm_mpa": 327.4}, "volume_mm3": 35830.1, "bbox_mm": [74.5, 54.0, 58.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.0, "safety_factor": 2.233, "max_disp_mm": 0.1822, "max_strain": 0.0008002875953146427, "volume_mm3": 80801.3, "bbox_mm": [80.5, 54.0, 64.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.469, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 248, "family": "plate_holes", "params": {"L": 120.6, "H": null, "W": 72.0, "T": 6.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.6, 'H': None, 'W': 72.0, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.6, 'H': None, 'W': 72.0, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 239.2, "safety_factor": 1.045, "max_disp_mm": 1.5735, "max_strain": 0.0017095165883411693, "peak": {"node": 3312, "coords_mm": [-58.15, 12.41, 6.1], "vm_mpa": 239.2}, "volume_mm3": 52009.3, "bbox_mm": [120.6, 72.0, 6.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.0, "safety_factor": 2.501, "max_disp_mm": 0.4589, "max_strain": 0.0007145071595023082, "volume_mm3": 86113.8, "bbox_mm": [120.6, 72.0, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.456, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 250, "family": "u_channel", "params": {"L": 108.8, "H": 47.8, "W": 48.8, "T": 4.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.8, 'H': 47.8, 'W': 48.8, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.8, 'H': 47.8, 'W': 48.8, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 955.4, "safety_factor": 0.262, "max_disp_mm": 2.5771, "max_strain": 0.006829301243408263, "peak": {"node": 341, "coords_mm": [54.76, 2.18, 4.5], "vm_mpa": 955.4}, "volume_mm3": 2091.8, "bbox_mm": [60.0, 47.8, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.8, "safety_factor": 2.666, "max_disp_mm": 0.1077, "max_strain": 0.0006703352758682785, "volume_mm3": 10727.3, "bbox_mm": [60.0, 47.8, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.404, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 249, "family": "l_bracket", "params": {"L": 84.5, "H": 69.4, "W": 66.5, "T": 5.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 84.5, 'H': 69.4, 'W': 66.5, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 84.5, 'H': 69.4, 'W': 66.5, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 235.0, "safety_factor": 1.064, "max_disp_mm": 1.0164, "max_strain": 0.0016796448901106823, "peak": {"node": 1322, "coords_mm": [7.68, -33.22, 69.4], "vm_mpa": 235.0}, "volume_mm3": 60496.4, "bbox_mm": [90.2, 66.5, 75.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 94.1, "safety_factor": 2.656, "max_disp_mm": 0.2293, "max_strain": 0.0006727286729703171, "volume_mm3": 117121.1, "bbox_mm": [95.2, 66.5, 80.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.592, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 252, "family": "plate_holes", "params": {"L": 100.1, "H": null, "W": 51.5, "T": 3.4, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.1, 'H': None, 'W': 51.5, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.1, 'H': None, 'W': 51.5, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 361.6, "safety_factor": 0.691, "max_disp_mm": 2.3973, "max_strain": 0.0025851088624327394, "peak": {"node": 1352, "coords_mm": [-48.75, -19.62, 0.0], "vm_mpa": 361.6}, "volume_mm3": 17335.2, "bbox_mm": [100.1, 51.5, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 135.5, "safety_factor": 1.845, "max_disp_mm": 0.5631, "max_strain": 0.000968603554580598, "volume_mm3": 37729.6, "bbox_mm": [100.1, 51.5, 7.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.154, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 253, "family": "l_bracket", "params": {"L": 53.7, "H": 48.9, "W": 49.4, "T": 3.7, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 53.7, 'H': 48.9, 'W': 49.4, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 53.7, 'H': 48.9, 'W': 49.4, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 209.6, "safety_factor": 1.193, "max_disp_mm": 0.4946, "max_strain": 0.0014984382657510366, "peak": {"node": 1736, "coords_mm": [1.6, -38.28, 52.6], "vm_mpa": 209.6}, "volume_mm3": 19429.5, "bbox_mm": [57.4, 49.4, 52.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.2, "safety_factor": 2.712, "max_disp_mm": 0.1092, "max_strain": 0.000658835008608227, "volume_mm3": 47834.5, "bbox_mm": [62.4, 49.4, 57.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.52, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 251, "family": "rib_bracket", "params": {"L": 82.0, "H": 59.4, "W": 40.4, "T": 3.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.0, 'H': 59.4, 'W': 40.4, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.0, 'H': 59.4, 'W': 40.4, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 632.1, "safety_factor": 0.395, "max_disp_mm": 4.8773, "max_strain": 0.0045184454677446246, "peak": {"node": 1406, "coords_mm": [2.3, -20.54, 62.6], "vm_mpa": 632.1}, "volume_mm3": 18693.9, "bbox_mm": [85.2, 40.4, 62.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 133.5, "safety_factor": 1.873, "max_disp_mm": 0.2939, "max_strain": 0.0009541794270364561, "volume_mm3": 69048.4, "bbox_mm": [93.2, 40.4, 70.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.477, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 254, "family": "u_channel", "params": {"L": 81.5, "H": 34.2, "W": 35.1, "T": 3.1, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.5, 'H': 34.2, 'W': 35.1, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.5, 'H': 34.2, 'W': 35.1, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2190.8, "safety_factor": 0.114, "max_disp_mm": 6.193, "max_strain": 0.015660516132319106, "peak": {"node": 274, "coords_mm": [43.99, 1.58, 3.1], "vm_mpa": 2190.8}, "volume_mm3": 744.8, "bbox_mm": [46.4, 34.2, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.7, "safety_factor": 1.957, "max_disp_mm": 0.1041, "max_strain": 0.0009131231182171128, "volume_mm3": 5920.9, "bbox_mm": [46.4, 34.2, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.843, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 255, "family": "rib_bracket", "params": {"L": 54.6, "H": 45.8, "W": 46.7, "T": 4.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.6, 'H': 45.8, 'W': 46.7, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.6, 'H': 45.8, 'W': 46.7, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 275.6, "safety_factor": 0.907, "max_disp_mm": 0.559, "max_strain": 0.001969964714389735, "peak": {"node": 1555, "coords_mm": [2.13, -20.89, 49.9], "vm_mpa": 275.6}, "volume_mm3": 20008.6, "bbox_mm": [58.7, 46.7, 49.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.0, "safety_factor": 2.716, "max_disp_mm": 0.1067, "max_strain": 0.0006578538885541783, "volume_mm3": 52119.5, "bbox_mm": [64.7, 46.7, 55.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.809, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 256, "family": "plate_holes", "params": {"L": 109.6, "H": null, "W": 61.0, "T": 4.7, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.6, 'H': None, 'W': 61.0, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.6, 'H': None, 'W': 61.0, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 322.1, "safety_factor": 0.776, "max_disp_mm": 2.3921, "max_strain": 0.0023022101468290527, "peak": {"node": 438, "coords_mm": [-52.87, 10.25, 0.0], "vm_mpa": 322.1}, "volume_mm3": 30949.8, "bbox_mm": [109.6, 61.0, 4.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.2, "safety_factor": 2.098, "max_disp_mm": 0.5066, "max_strain": 0.0008518156146702382, "volume_mm3": 57290.1, "bbox_mm": [109.6, 61.0, 8.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.322, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 258, "family": "u_channel", "params": {"L": 94.1, "H": 40.5, "W": 41.5, "T": 3.7, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.1, 'H': 40.5, 'W': 41.5, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.1, 'H': 40.5, 'W': 41.5, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1986.8, "safety_factor": 0.126, "max_disp_mm": 5.7462, "max_strain": 0.014201811604218292, "peak": {"node": 278, "coords_mm": [47.06, 1.81, 0.0], "vm_mpa": 1986.8}, "volume_mm3": 1223.9, "bbox_mm": [52.6, 40.5, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 145.7, "safety_factor": 1.716, "max_disp_mm": 0.1459, "max_strain": 0.0010415480094665582, "volume_mm3": 7847.1, "bbox_mm": [52.6, 40.5, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.59, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 257, "family": "l_bracket", "params": {"L": 68.0, "H": 58.4, "W": 57.3, "T": 4.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.0, 'H': 58.4, 'W': 57.3, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.0, 'H': 58.4, 'W': 57.3, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 304.8, "safety_factor": 0.82, "max_disp_mm": 1.1275, "max_strain": 0.0021790035750281767, "peak": {"node": 2474, "coords_mm": [17.03, -3.68, 63.0], "vm_mpa": 304.8}, "volume_mm3": 34529.0, "bbox_mm": [72.6, 57.3, 63.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.1, "safety_factor": 2.522, "max_disp_mm": 0.1907, "max_strain": 0.0007086238337962767, "volume_mm3": 74810.9, "bbox_mm": [77.6, 57.3, 68.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.702, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 259, "family": "rib_bracket", "params": {"L": 67.3, "H": 52.1, "W": 53.0, "T": 5.1, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.3, 'H': 52.1, 'W': 53.0, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.3, 'H': 52.1, 'W': 53.0, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 339.0, "safety_factor": 0.738, "max_disp_mm": 1.1116, "max_strain": 0.0024229121685660406, "peak": {"node": 1991, "coords_mm": [5.23, -31.62, 57.2], "vm_mpa": 339.0}, "volume_mm3": 33652.3, "bbox_mm": [72.4, 53.0, 57.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.3, "safety_factor": 2.288, "max_disp_mm": 0.175, "max_strain": 0.0007810901343067393, "volume_mm3": 76773.1, "bbox_mm": [78.4, 53.0, 63.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.55, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 260, "family": "plate_holes", "params": {"L": 119.1, "H": null, "W": 70.5, "T": 5.9, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.1, 'H': None, 'W': 70.5, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.1, 'H': None, 'W': 70.5, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 274.5, "safety_factor": 0.911, "max_disp_mm": 1.7106, "max_strain": 0.0019618507327294164, "peak": {"node": 2055, "coords_mm": [-57.97, 7.29, 0.0], "vm_mpa": 274.5}, "volume_mm3": 48612.9, "bbox_mm": [119.1, 70.5, 5.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.6, "safety_factor": 2.414, "max_disp_mm": 0.4783, "max_strain": 0.000740192204640665, "volume_mm3": 81570.8, "bbox_mm": [119.1, 70.5, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.503, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 262, "family": "u_channel", "params": {"L": 106.8, "H": 46.8, "W": 47.8, "T": 4.4, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.8, 'H': 46.8, 'W': 47.8, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.8, 'H': 46.8, 'W': 47.8, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1486.9, "safety_factor": 0.168, "max_disp_mm": 4.1959, "max_strain": 0.010628734964289873, "peak": {"node": 109, "coords_mm": [54.68, 4.4, 0.0], "vm_mpa": 1486.9}, "volume_mm3": 1963.1, "bbox_mm": [59.0, 46.8, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 143.3, "safety_factor": 1.745, "max_disp_mm": 0.1592, "max_strain": 0.0010242470875636354, "volume_mm3": 10318.5, "bbox_mm": [59.0, 46.8, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.577, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 261, "family": "l_bracket", "params": {"L": 82.2, "H": 67.9, "W": 65.3, "T": 5.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.2, 'H': 67.9, 'W': 65.3, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.2, 'H': 67.9, 'W': 65.3, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 230.8, "safety_factor": 1.083, "max_disp_mm": 1.0027, "max_strain": 0.0016494805819565867, "peak": {"node": 2752, "coords_mm": [7.24, -37.86, 73.5], "vm_mpa": 230.8}, "volume_mm3": 56936.4, "bbox_mm": [87.8, 65.3, 73.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.6, "safety_factor": 2.484, "max_disp_mm": 0.2214, "max_strain": 0.000719351259296196, "volume_mm3": 111233.3, "bbox_mm": [92.8, 65.3, 78.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.401, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 263, "family": "rib_bracket", "params": {"L": 80.0, "H": 58.4, "W": 59.4, "T": 3.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.0, 'H': 58.4, 'W': 59.4, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.0, 'H': 58.4, 'W': 59.4, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 453.1, "safety_factor": 0.552, "max_disp_mm": 2.9098, "max_strain": 0.003238521113717721, "peak": {"node": 1948, "coords_mm": [2.13, -23.51, 61.4], "vm_mpa": 453.1}, "volume_mm3": 25197.5, "bbox_mm": [83.0, 59.4, 61.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.0, "safety_factor": 1.983, "max_disp_mm": 0.3173, "max_strain": 0.0009009998520202885, "volume_mm3": 78800.0, "bbox_mm": [89.0, 59.4, 67.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.432, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 265, "family": "l_bracket", "params": {"L": 51.5, "H": 47.4, "W": 48.2, "T": 3.5, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 51.5, 'H': 47.4, 'W': 48.2, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 51.5, 'H': 47.4, 'W': 48.2, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 247.8, "safety_factor": 1.009, "max_disp_mm": 0.6102, "max_strain": 0.0017711747444699938, "peak": {"node": 1641, "coords_mm": [2.06, -20.48, 50.9], "vm_mpa": 247.8}, "volume_mm3": 17274.9, "bbox_mm": [55.0, 48.2, 50.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 79.9, "safety_factor": 3.128, "max_disp_mm": 0.106, "max_strain": 0.0005713464643646037, "volume_mm3": 44001.8, "bbox_mm": [60.0, 48.2, 55.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.119, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 266, "family": "u_channel", "params": {"L": 79.5, "H": 33.2, "W": 34.1, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.5, 'H': 33.2, 'W': 34.1, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.5, 'H': 33.2, 'W': 34.1, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2253.8, "safety_factor": 0.111, "max_disp_mm": 5.5063, "max_strain": 0.016110236843278843, "peak": {"node": 230, "coords_mm": [37.99, 1.5, 0.0], "vm_mpa": 2253.8}, "volume_mm3": 680.4, "bbox_mm": [45.4, 33.2, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.3, "safety_factor": 2.491, "max_disp_mm": 0.0821, "max_strain": 0.0007173079098258923, "volume_mm3": 5637.6, "bbox_mm": [45.4, 33.2, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.38, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 264, "family": "plate_holes", "params": {"L": 128.6, "H": null, "W": 50.0, "T": 3.2, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.6, 'H': None, 'W': 50.0, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.6, 'H': None, 'W': 50.0, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 707.7, "safety_factor": 0.353, "max_disp_mm": 6.3238, "max_strain": 0.005058563576024075, "peak": {"node": 1594, "coords_mm": [-62.93, -11.25, 0.0], "vm_mpa": 707.7}, "volume_mm3": 20395.0, "bbox_mm": [128.6, 50.0, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.1, "safety_factor": 2.099, "max_disp_mm": 0.6865, "max_strain": 0.0008514248601614162, "volume_mm3": 58635.8, "bbox_mm": [128.6, 50.0, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.746, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 267, "family": "rib_bracket", "params": {"L": 52.6, "H": 44.8, "W": 45.7, "T": 4.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.6, 'H': 44.8, 'W': 45.7, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.6, 'H': 44.8, 'W': 45.7, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 276.1, "safety_factor": 0.905, "max_disp_mm": 0.5358, "max_strain": 0.0019738366202402668, "peak": {"node": 1163, "coords_mm": [2.0, -22.55, 48.8], "vm_mpa": 276.1}, "volume_mm3": 18535.9, "bbox_mm": [56.6, 45.7, 48.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.5, "safety_factor": 2.762, "max_disp_mm": 0.1015, "max_strain": 0.0006470880195241183, "volume_mm3": 49081.8, "bbox_mm": [62.6, 45.7, 54.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.856, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 270, "family": "u_channel", "params": {"L": 92.1, "H": 39.5, "W": 40.5, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.1, 'H': 39.5, 'W': 40.5, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.1, 'H': 39.5, 'W': 40.5, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1684.9, "safety_factor": 0.148, "max_disp_mm": 4.9827, "max_strain": 0.012043767239369741, "peak": {"node": 97, "coords_mm": [46.5, 3.6, 0.0], "vm_mpa": 1684.9}, "volume_mm3": 1134.0, "bbox_mm": [51.6, 39.5, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.6, "safety_factor": 2.073, "max_disp_mm": 0.1177, "max_strain": 0.000862094222338935, "volume_mm3": 7511.0, "bbox_mm": [51.6, 39.5, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.925, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 268, "family": "plate_holes", "params": {"L": 108.1, "H": null, "W": 59.5, "T": 4.5, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.1, 'H': None, 'W': 59.5, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.1, 'H': None, 'W': 59.5, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 378.5, "safety_factor": 0.66, "max_disp_mm": 2.6082, "max_strain": 0.002705842687322417, "peak": {"node": 1649, "coords_mm": [-51.9, 1.24, 4.5], "vm_mpa": 378.5}, "volume_mm3": 28491.4, "bbox_mm": [108.1, 59.5, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.6, "safety_factor": 2.006, "max_disp_mm": 0.5325, "max_strain": 0.0008906233078161065, "volume_mm3": 53817.1, "bbox_mm": [108.1, 59.5, 8.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.346, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 269, "family": "l_bracket", "params": {"L": 65.7, "H": 56.9, "W": 56.1, "T": 4.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.7, 'H': 56.9, 'W': 56.1, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.7, 'H': 56.9, 'W': 56.1, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 321.4, "safety_factor": 0.778, "max_disp_mm": 1.1053, "max_strain": 0.0022975101180893573, "peak": {"node": 2390, "coords_mm": [12.38, -52.69, 61.4], "vm_mpa": 321.4}, "volume_mm3": 32086.4, "bbox_mm": [70.2, 56.1, 61.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.3, "safety_factor": 2.57, "max_disp_mm": 0.1826, "max_strain": 0.000695428753798086, "volume_mm3": 70402.7, "bbox_mm": [75.2, 56.1, 66.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.792, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 271, "family": "rib_bracket", "params": {"L": 65.3, "H": 51.1, "W": 52.0, "T": 4.9, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.3, 'H': 51.1, 'W': 52.0, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.3, 'H': 51.1, 'W': 52.0, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 360.7, "safety_factor": 0.693, "max_disp_mm": 1.1861, "max_strain": 0.002578315047568434, "peak": {"node": 2053, "coords_mm": [8.75, -23.05, 56.0], "vm_mpa": 360.7}, "volume_mm3": 30907.2, "bbox_mm": [70.2, 52.0, 56.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.6, "safety_factor": 2.389, "max_disp_mm": 0.1718, "max_strain": 0.0007479623331688485, "volume_mm3": 72153.6, "bbox_mm": [76.2, 52.0, 62.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.696, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 272, "family": "plate_holes", "params": {"L": 117.6, "H": null, "W": 69.0, "T": 5.7, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.6, 'H': None, 'W': 69.0, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.6, 'H': None, 'W': 69.0, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 295.2, "safety_factor": 0.847, "max_disp_mm": 1.8544, "max_strain": 0.0021102468848836218, "peak": {"node": 590, "coords_mm": [-56.85, -1.26, 0.0], "vm_mpa": 295.2}, "volume_mm3": 45356.7, "bbox_mm": [117.6, 69.0, 5.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.0, "safety_factor": 2.294, "max_disp_mm": 0.499, "max_strain": 0.0007789660186643252, "volume_mm3": 77186.0, "bbox_mm": [117.6, 69.0, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.447, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 274, "family": "u_channel", "params": {"L": 104.8, "H": 45.9, "W": 46.8, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.8, 'H': 45.9, 'W': 46.8, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.8, 'H': 45.9, 'W': 46.8, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1555.4, "safety_factor": 0.161, "max_disp_mm": 4.3551, "max_strain": 0.011118324943571362, "peak": {"node": 349, "coords_mm": [55.19, 2.07, 4.3], "vm_mpa": 1555.4}, "volume_mm3": 1841.6, "bbox_mm": [58.0, 45.9, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 148.2, "safety_factor": 1.687, "max_disp_mm": 0.158, "max_strain": 0.001059318701839234, "volume_mm3": 9930.0, "bbox_mm": [58.0, 45.9, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.526, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 273, "family": "l_bracket", "params": {"L": 80.0, "H": 66.4, "W": 64.0, "T": 5.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.0, 'H': 66.4, 'W': 64.0, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.0, 'H': 66.4, 'W': 64.0, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 254.2, "safety_factor": 0.984, "max_disp_mm": 1.0418, "max_strain": 0.0018169826200983257, "peak": {"node": 2901, "coords_mm": [6.38, -35.63, 71.8], "vm_mpa": 254.2}, "volume_mm3": 52462.1, "bbox_mm": [85.4, 64.0, 71.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.4, "safety_factor": 2.489, "max_disp_mm": 0.2199, "max_strain": 0.0007179206532051915, "volume_mm3": 104366.1, "bbox_mm": [90.4, 64.0, 76.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.506, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 278, "family": "u_channel", "params": {"L": 77.5, "H": 32.2, "W": 33.1, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.5, 'H': 32.2, 'W': 33.1, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.5, 'H': 32.2, 'W': 33.1, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1913.4, "safety_factor": 0.131, "max_disp_mm": 5.2639, "max_strain": 0.01367736384657877, "peak": {"node": 232, "coords_mm": [37.05, 1.49, 0.0], "vm_mpa": 1913.4}, "volume_mm3": 619.8, "bbox_mm": [44.4, 32.2, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.7, "safety_factor": 2.412, "max_disp_mm": 0.0801, "max_strain": 0.0007409550464538612, "volume_mm3": 5362.5, "bbox_mm": [44.4, 32.2, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.281, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 277, "family": "l_bracket", "params": {"L": 94.2, "H": 45.9, "W": 46.9, "T": 3.4, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.2, 'H': 45.9, 'W': 46.9, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.2, 'H': 45.9, 'W': 46.9, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 410.1, "safety_factor": 0.61, "max_disp_mm": 3.3818, "max_strain": 0.0029317232400324555, "peak": {"node": 1599, "coords_mm": [2.13, -18.51, 49.3], "vm_mpa": 410.1}, "volume_mm3": 22882.5, "bbox_mm": [97.6, 46.9, 49.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 157.8, "safety_factor": 1.584, "max_disp_mm": 0.6191, "max_strain": 0.0011279648569677044, "volume_mm3": 58503.1, "bbox_mm": [102.6, 46.9, 54.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 0.975, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 275, "family": "rib_bracket", "params": {"L": 78.0, "H": 57.4, "W": 58.4, "T": 5.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 78.0, 'H': 57.4, 'W': 58.4, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 78.0, 'H': 57.4, 'W': 58.4, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 216.9, "safety_factor": 1.153, "max_disp_mm": 0.7734, "max_strain": 0.0015504113572404532, "peak": {"node": 1692, "coords_mm": [8.01, -18.25, 57.4], "vm_mpa": 216.9}, "volume_mm3": 48686.3, "bbox_mm": [83.9, 58.4, 63.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.0, "safety_factor": 3.012, "max_disp_mm": 0.1495, "max_strain": 0.000593382014044747, "volume_mm3": 102367.6, "bbox_mm": [89.9, 58.4, 69.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.859, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 279, "family": "rib_bracket", "params": {"L": 50.7, "H": 43.8, "W": 44.7, "T": 3.8, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.7, 'H': 43.8, 'W': 44.7, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.7, 'H': 43.8, 'W': 44.7, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 295.7, "safety_factor": 0.845, "max_disp_mm": 0.6055, "max_strain": 0.002113910868256332, "peak": {"node": 1330, "coords_mm": [2.06, -38.44, 47.6], "vm_mpa": 295.7}, "volume_mm3": 16697.2, "bbox_mm": [54.5, 44.7, 47.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.3, "safety_factor": 2.681, "max_disp_mm": 0.0981, "max_strain": 0.0006666266549461427, "volume_mm3": 45689.7, "bbox_mm": [60.5, 44.7, 53.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.835, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 280, "family": "plate_holes", "params": {"L": 106.6, "H": null, "W": 58.0, "T": 4.3, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.6, 'H': None, 'W': 58.0, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.6, 'H': None, 'W': 58.0, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 386.3, "safety_factor": 0.647, "max_disp_mm": 2.7041, "max_strain": 0.0027615330362871513, "peak": {"node": 2755, "coords_mm": [-43.88, -25.12, 4.3], "vm_mpa": 386.3}, "volume_mm3": 26153.8, "bbox_mm": [106.6, 58.0, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.8, "safety_factor": 1.941, "max_disp_mm": 0.5597, "max_strain": 0.0009207314755753949, "volume_mm3": 50482.8, "bbox_mm": [106.6, 58.0, 8.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.294, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 281, "family": "l_bracket", "params": {"L": 63.5, "H": 55.4, "W": 54.9, "T": 4.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 63.5, 'H': 55.4, 'W': 54.9, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 63.5, 'H': 55.4, 'W': 54.9, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 240.5, "safety_factor": 1.039, "max_disp_mm": 0.7563, "max_strain": 0.0017191640234790464, "peak": {"node": 923, "coords_mm": [20.11, -2.03, 55.4], "vm_mpa": 240.5}, "volume_mm3": 29083.8, "bbox_mm": [67.8, 54.9, 59.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 77.0, "safety_factor": 3.248, "max_disp_mm": 0.1336, "max_strain": 0.0005501834134794139, "volume_mm3": 65455.1, "bbox_mm": [72.8, 54.9, 64.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.209, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 282, "family": "u_channel", "params": {"L": 90.2, "H": 38.5, "W": 39.5, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.2, 'H': 38.5, 'W': 39.5, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.2, 'H': 38.5, 'W': 39.5, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1880.5, "safety_factor": 0.133, "max_disp_mm": 5.4934, "max_strain": 0.013441998393830704, "peak": {"node": 305, "coords_mm": [47.96, 1.38, 3.5], "vm_mpa": 1880.5}, "volume_mm3": 1049.8, "bbox_mm": [50.7, 38.5, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.8, "safety_factor": 1.926, "max_disp_mm": 0.1186, "max_strain": 0.0009276940069006878, "volume_mm3": 7192.9, "bbox_mm": [50.7, 38.5, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.793, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 283, "family": "rib_bracket", "params": {"L": 63.3, "H": 50.1, "W": 51.1, "T": 4.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.3, 'H': 50.1, 'W': 51.1, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.3, 'H': 50.1, 'W': 51.1, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 361.5, "safety_factor": 0.692, "max_disp_mm": 1.148, "max_strain": 0.0025842829379408693, "peak": {"node": 1387, "coords_mm": [8.82, -24.0, 50.1], "vm_mpa": 361.5}, "volume_mm3": 28992.1, "bbox_mm": [68.1, 51.1, 54.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.1, "safety_factor": 2.172, "max_disp_mm": 0.1652, "max_strain": 0.0008228295326424787, "volume_mm3": 68543.5, "bbox_mm": [74.1, 51.1, 60.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.48, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 284, "family": "plate_holes", "params": {"L": 116.1, "H": null, "W": 67.5, "T": 5.5, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.1, 'H': None, 'W': 67.5, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.1, 'H': None, 'W': 67.5, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 296.3, "safety_factor": 0.844, "max_disp_mm": 2.0242, "max_strain": 0.002117885993466337, "peak": {"node": 1998, "coords_mm": [-56.04, 0.07, 5.5], "vm_mpa": 296.3}, "volume_mm3": 42238.2, "bbox_mm": [116.1, 67.5, 5.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.2, "safety_factor": 2.209, "max_disp_mm": 0.5175, "max_strain": 0.0008091015679047759, "volume_mm3": 72956.9, "bbox_mm": [116.1, 67.5, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.365, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 286, "family": "u_channel", "params": {"L": 102.8, "H": 44.9, "W": 45.8, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.8, 'H': 44.9, 'W': 45.8, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.8, 'H': 44.9, 'W': 45.8, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1434.5, "safety_factor": 0.174, "max_disp_mm": 4.4749, "max_strain": 0.010253748959584556, "peak": {"node": 107, "coords_mm": [52.4, 4.2, 0.0], "vm_mpa": 1434.5}, "volume_mm3": 1723.4, "bbox_mm": [57.0, 44.9, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.9, "safety_factor": 1.69, "max_disp_mm": 0.1541, "max_strain": 0.0010574264985758837, "volume_mm3": 9540.5, "bbox_mm": [57.0, 44.9, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.516, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 285, "family": "l_bracket", "params": {"L": 77.7, "H": 64.9, "W": 62.8, "T": 5.3, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 77.7, 'H': 64.9, 'W': 62.8, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 77.7, 'H': 64.9, 'W': 62.8, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 260.3, "safety_factor": 0.96, "max_disp_mm": 1.0297, "max_strain": 0.0018608772466371338, "peak": {"node": 2108, "coords_mm": [6.91, -39.85, 64.9], "vm_mpa": 260.3}, "volume_mm3": 49227.0, "bbox_mm": [83.0, 62.8, 70.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.3, "safety_factor": 2.468, "max_disp_mm": 0.2125, "max_strain": 0.0007242010958926795, "volume_mm3": 98901.8, "bbox_mm": [88.0, 62.8, 75.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.507, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 289, "family": "l_bracket", "params": {"L": 92.0, "H": 74.4, "W": 45.7, "T": 3.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.0, 'H': 74.4, 'W': 45.7, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.0, 'H': 74.4, 'W': 45.7, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 490.4, "safety_factor": 0.51, "max_disp_mm": 5.0434, "max_strain": 0.0035051480860100125, "peak": {"node": 2571, "coords_mm": [1.89, -18.03, 77.6], "vm_mpa": 490.4}, "volume_mm3": 24802.3, "bbox_mm": [95.2, 45.7, 77.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 161.1, "safety_factor": 1.552, "max_disp_mm": 0.6299, "max_strain": 0.0011517597163561847, "volume_mm3": 65429.6, "bbox_mm": [100.2, 45.7, 82.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.042, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 287, "family": "rib_bracket", "params": {"L": 76.0, "H": 56.4, "W": 57.4, "T": 5.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.0, 'H': 56.4, 'W': 57.4, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.0, 'H': 56.4, 'W': 57.4, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 278.6, "safety_factor": 0.897, "max_disp_mm": 1.0265, "max_strain": 0.001991746666685654, "peak": {"node": 2188, "coords_mm": [6.44, -41.02, 62.2], "vm_mpa": 278.6}, "volume_mm3": 46009.5, "bbox_mm": [81.8, 57.4, 62.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.5, "safety_factor": 2.439, "max_disp_mm": 0.1926, "max_strain": 0.0007326617061478278, "volume_mm3": 97669.5, "bbox_mm": [87.8, 57.4, 68.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.542, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 290, "family": "u_channel", "params": {"L": 75.5, "H": 31.2, "W": 32.1, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.5, 'H': 31.2, 'W': 32.1, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.5, 'H': 31.2, 'W': 32.1, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2063.9, "safety_factor": 0.121, "max_disp_mm": 5.7347, "max_strain": 0.014753111511124139, "peak": {"node": 262, "coords_mm": [38.34, 1.43, 2.8], "vm_mpa": 2063.9}, "volume_mm3": 562.9, "bbox_mm": [43.4, 31.2, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.3, "safety_factor": 2.469, "max_disp_mm": 0.078, "max_strain": 0.000723766511334669, "volume_mm3": 5095.6, "bbox_mm": [43.4, 31.2, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.348, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 291, "family": "rib_bracket", "params": {"L": 48.7, "H": 42.8, "W": 43.7, "T": 3.7, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.7, 'H': 42.8, 'W': 43.7, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.7, 'H': 42.8, 'W': 43.7, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 297.9, "safety_factor": 0.839, "max_disp_mm": 0.4932, "max_strain": 0.0021295401352811392, "peak": {"node": 1422, "coords_mm": [2.07, -25.56, 46.5], "vm_mpa": 297.9}, "volume_mm3": 15392.9, "bbox_mm": [52.4, 43.7, 46.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.4, "safety_factor": 2.491, "max_disp_mm": 0.0924, "max_strain": 0.0007173760319578857, "volume_mm3": 42897.7, "bbox_mm": [58.4, 43.7, 52.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.652, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 292, "family": "plate_holes", "params": {"L": 105.1, "H": null, "W": 56.5, "T": 4.1, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.1, 'H': None, 'W': 56.5, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.1, 'H': None, 'W': 56.5, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 385.9, "safety_factor": 0.648, "max_disp_mm": 2.7862, "max_strain": 0.002758343966661376, "peak": {"node": 2718, "coords_mm": [-51.16, -12.32, 4.1], "vm_mpa": 385.9}, "volume_mm3": 23934.2, "bbox_mm": [105.1, 56.5, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 137.3, "safety_factor": 1.821, "max_disp_mm": 0.5912, "max_strain": 0.0009816069986738165, "volume_mm3": 47284.7, "bbox_mm": [105.1, 56.5, 8.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.173, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 293, "family": "l_bracket", "params": {"L": 61.2, "H": 53.9, "W": 53.6, "T": 4.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.2, 'H': 53.9, 'W': 53.6, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.2, 'H': 53.9, 'W': 53.6, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 235.1, "safety_factor": 1.063, "max_disp_mm": 0.7277, "max_strain": 0.0016806905048849339, "peak": {"node": 1443, "coords_mm": [8.16, -21.93, 53.9], "vm_mpa": 235.1}, "volume_mm3": 26856.8, "bbox_mm": [65.4, 53.6, 58.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 78.3, "safety_factor": 3.193, "max_disp_mm": 0.1271, "max_strain": 0.0005596199416001909, "volume_mm3": 61294.8, "bbox_mm": [70.4, 53.6, 63.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.13, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 294, "family": "u_channel", "params": {"L": 88.2, "H": 37.5, "W": 38.5, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.2, 'H': 37.5, 'W': 38.5, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.2, 'H': 37.5, 'W': 38.5, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1779.7, "safety_factor": 0.14, "max_disp_mm": 5.4482, "max_strain": 0.012721838096701958, "peak": {"node": 300, "coords_mm": [43.26, 2.05, 3.4], "vm_mpa": 1779.7}, "volume_mm3": 968.7, "bbox_mm": [49.7, 37.5, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 136.8, "safety_factor": 1.827, "max_disp_mm": 0.1151, "max_strain": 0.000977912155619573, "volume_mm3": 6874.4, "bbox_mm": [49.7, 37.5, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.687, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 295, "family": "rib_bracket", "params": {"L": 61.3, "H": 49.1, "W": 50.1, "T": 4.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.3, 'H': 49.1, 'W': 50.1, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.3, 'H': 49.1, 'W': 50.1, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 395.6, "safety_factor": 0.632, "max_disp_mm": 1.1379, "max_strain": 0.002827868145207474, "peak": {"node": 1183, "coords_mm": [9.77, -28.92, 49.1], "vm_mpa": 395.6}, "volume_mm3": 27102.6, "bbox_mm": [66.0, 50.1, 53.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.9, "safety_factor": 2.051, "max_disp_mm": 0.1571, "max_strain": 0.000871253608851511, "volume_mm3": 64918.1, "bbox_mm": [72.0, 50.1, 59.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.419, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 296, "family": "plate_holes", "params": {"L": 114.6, "H": null, "W": 66.0, "T": 5.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.6, 'H': None, 'W': 66.0, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.6, 'H': None, 'W': 66.0, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 317.4, "safety_factor": 0.788, "max_disp_mm": 2.2053, "max_strain": 0.0022690777279919198, "peak": {"node": 3196, "coords_mm": [-55.48, -12.16, 5.3], "vm_mpa": 317.4}, "volume_mm3": 39254.6, "bbox_mm": [114.6, 66.0, 5.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.1, "safety_factor": 2.064, "max_disp_mm": 0.5393, "max_strain": 0.0008656072335881105, "volume_mm3": 68880.6, "bbox_mm": [114.6, 66.0, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.277, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 298, "family": "u_channel", "params": {"L": 100.8, "H": 43.9, "W": 44.8, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.8, 'H': 43.9, 'W': 44.8, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.8, 'H': 43.9, 'W': 44.8, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1400.1, "safety_factor": 0.179, "max_disp_mm": 4.5907, "max_strain": 0.010007765199557915, "peak": {"node": 291, "coords_mm": [53.04, 2.02, 0.0], "vm_mpa": 1400.1}, "volume_mm3": 1610.4, "bbox_mm": [56.0, 43.9, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 157.7, "safety_factor": 1.586, "max_disp_mm": 0.1533, "max_strain": 0.001127054618096964, "volume_mm3": 9160.5, "bbox_mm": [56.0, 43.9, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.407, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 297, "family": "l_bracket", "params": {"L": 75.5, "H": 63.4, "W": 61.5, "T": 5.1, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 75.5, 'H': 63.4, 'W': 61.5, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 75.5, 'H': 63.4, 'W': 61.5, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 251.2, "safety_factor": 0.995, "max_disp_mm": 1.0557, "max_strain": 0.00179547445055763, "peak": {"node": 1203, "coords_mm": [9.36, -9.83, 63.4], "vm_mpa": 251.2}, "volume_mm3": 45165.6, "bbox_mm": [80.6, 61.5, 68.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.9, "safety_factor": 2.431, "max_disp_mm": 0.2097, "max_strain": 0.0007352406941974551, "volume_mm3": 92551.4, "bbox_mm": [85.6, 61.5, 73.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.435, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 299, "family": "rib_bracket", "params": {"L": 74.0, "H": 55.4, "W": 56.4, "T": 5.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.0, 'H': 55.4, 'W': 56.4, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.0, 'H': 55.4, 'W': 56.4, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 298.2, "safety_factor": 0.838, "max_disp_mm": 1.0667, "max_strain": 0.0021313027893547914, "peak": {"node": 1698, "coords_mm": [9.55, -31.88, 55.4], "vm_mpa": 298.2}, "volume_mm3": 42638.4, "bbox_mm": [79.6, 56.4, 61.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.4, "safety_factor": 2.394, "max_disp_mm": 0.1905, "max_strain": 0.0007465078417649208, "volume_mm3": 92247.8, "bbox_mm": [85.6, 56.4, 67.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.555, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 302, "family": "u_channel", "params": {"L": 113.5, "H": 30.2, "W": 31.1, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.5, 'H': 30.2, 'W': 31.1, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.5, 'H': 30.2, 'W': 31.1, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4602.7, "safety_factor": 0.054, "max_disp_mm": 43.9479, "max_strain": 0.03290110903604428, "peak": {"node": 323, "coords_mm": [37.46, 1.37, 0.0], "vm_mpa": 4602.7}, "volume_mm3": 801.2, "bbox_mm": [82.4, 30.2, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.6, "safety_factor": 1.929, "max_disp_mm": 0.2617, "max_strain": 0.0009265941299155519, "volume_mm3": 11666.5, "bbox_mm": [82.4, 30.2, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.874, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 301, "family": "l_bracket", "params": {"L": 89.8, "H": 72.9, "W": 69.5, "T": 3.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 89.8, 'H': 72.9, 'W': 69.5, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 89.8, 'H': 72.9, 'W': 69.5, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 316.6, "safety_factor": 0.79, "max_disp_mm": 2.492, "max_strain": 0.0022627568452902925, "peak": {"node": 2525, "coords_mm": [2.18, -33.47, 76.0], "vm_mpa": 316.6}, "volume_mm3": 35721.6, "bbox_mm": [92.9, 69.5, 76.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.3, "safety_factor": 2.227, "max_disp_mm": 0.3956, "max_strain": 0.0008025811570521361, "volume_mm3": 96151.9, "bbox_mm": [97.9, 69.5, 81.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.437, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 303, "family": "rib_bracket", "params": {"L": 46.7, "H": 41.8, "W": 42.7, "T": 3.6, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.7, 'H': 41.8, 'W': 42.7, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.7, 'H': 41.8, 'W': 42.7, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 298.2, "safety_factor": 0.838, "max_disp_mm": 0.4756, "max_strain": 0.0021319089406694677, "peak": {"node": 1370, "coords_mm": [1.63, -15.42, 45.4], "vm_mpa": 298.2}, "volume_mm3": 14157.6, "bbox_mm": [50.3, 42.7, 45.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.1, "safety_factor": 2.629, "max_disp_mm": 0.0873, "max_strain": 0.0006797908852230175, "volume_mm3": 40213.2, "bbox_mm": [56.3, 42.7, 51.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.791, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 304, "family": "plate_holes", "params": {"L": 103.6, "H": null, "W": 55.1, "T": 3.9, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.6, 'H': None, 'W': 55.1, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.6, 'H': None, 'W': 55.1, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 390.0, "safety_factor": 0.641, "max_disp_mm": 2.1212, "max_strain": 0.0027874674775969998, "peak": {"node": 1486, "coords_mm": [-50.45, -14.35, 0.0], "vm_mpa": 390.0}, "volume_mm3": 22042.1, "bbox_mm": [103.6, 55.1, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 149.9, "safety_factor": 1.668, "max_disp_mm": 0.6133, "max_strain": 0.0010714095624310116, "volume_mm3": 44649.3, "bbox_mm": [103.6, 55.1, 7.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.027, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 305, "family": "l_bracket", "params": {"L": 59.0, "H": 52.4, "W": 52.4, "T": 4.0, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 59.0, 'H': 52.4, 'W': 52.4, 'T': 4.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 59.0, 'H': 52.4, 'W': 52.4, 'T': 4.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 223.3, "safety_factor": 1.12, "max_disp_mm": 0.5506, "max_strain": 0.001596113308492794, "peak": {"node": 1988, "coords_mm": [1.43, -38.68, 56.4], "vm_mpa": 223.3}, "volume_mm3": 24187.8, "bbox_mm": [63.0, 52.4, 56.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 80.0, "safety_factor": 3.126, "max_disp_mm": 0.1231, "max_strain": 0.0005716339446750283, "volume_mm3": 56780.6, "bbox_mm": [68.0, 52.4, 61.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.007, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 306, "family": "u_channel", "params": {"L": 86.2, "H": 36.5, "W": 37.5, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.2, 'H': 36.5, 'W': 37.5, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.2, 'H': 36.5, 'W': 37.5, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1930.3, "safety_factor": 0.13, "max_disp_mm": 5.8097, "max_strain": 0.013797754951968694, "peak": {"node": 265, "coords_mm": [44.01, 1.69, 0.0], "vm_mpa": 1930.3}, "volume_mm3": 891.9, "bbox_mm": [48.7, 36.5, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 133.8, "safety_factor": 1.869, "max_disp_mm": 0.1124, "max_strain": 0.0009561218436399063, "volume_mm3": 6564.6, "bbox_mm": [48.7, 36.5, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.74, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 307, "family": "rib_bracket", "params": {"L": 59.3, "H": 48.1, "W": 49.1, "T": 4.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.3, 'H': 48.1, 'W': 49.1, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.3, 'H': 48.1, 'W': 49.1, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 432.9, "safety_factor": 0.577, "max_disp_mm": 1.161, "max_strain": 0.0030944517005105504, "peak": {"node": 1287, "coords_mm": [6.12, -17.78, 48.1], "vm_mpa": 432.9}, "volume_mm3": 24724.3, "bbox_mm": [63.8, 49.1, 52.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 122.9, "safety_factor": 2.034, "max_disp_mm": 0.1539, "max_strain": 0.0008785193916797298, "volume_mm3": 60783.3, "bbox_mm": [69.8, 49.1, 58.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.457, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 308, "family": "plate_holes", "params": {"L": 113.1, "H": null, "W": 64.6, "T": 5.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.1, 'H': None, 'W': 64.6, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.1, 'H': None, 'W': 64.6, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 338.6, "safety_factor": 0.738, "max_disp_mm": 2.3787, "max_strain": 0.0024204902004721714, "peak": {"node": 1499, "coords_mm": [-54.43, 1.24, 0.0], "vm_mpa": 338.6}, "volume_mm3": 36749.2, "bbox_mm": [113.1, 64.6, 5.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.9, "safety_factor": 2.017, "max_disp_mm": 0.559, "max_strain": 0.0008859945463197183, "volume_mm3": 65572.1, "bbox_mm": [113.1, 64.6, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.279, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 310, "family": "u_channel", "params": {"L": 98.8, "H": 42.9, "W": 43.8, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.8, 'H': 42.9, 'W': 43.8, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.8, 'H': 42.9, 'W': 43.8, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1564.2, "safety_factor": 0.16, "max_disp_mm": 4.8572, "max_strain": 0.011181091213491865, "peak": {"node": 285, "coords_mm": [49.42, 2.02, 0.0], "vm_mpa": 1564.2}, "volume_mm3": 1502.4, "bbox_mm": [55.0, 42.9, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 141.5, "safety_factor": 1.767, "max_disp_mm": 0.1495, "max_strain": 0.0010116164238379544, "volume_mm3": 8790.0, "bbox_mm": [55.0, 42.9, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.607, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 309, "family": "l_bracket", "params": {"L": 73.3, "H": 61.9, "W": 60.3, "T": 5.0, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.3, 'H': 61.9, 'W': 60.3, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.3, 'H': 61.9, 'W': 60.3, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 274.0, "safety_factor": 0.912, "max_disp_mm": 1.0397, "max_strain": 0.001958452899141885, "peak": {"node": 2298, "coords_mm": [8.55, -37.06, 66.9], "vm_mpa": 274.0}, "volume_mm3": 42270.3, "bbox_mm": [78.3, 60.3, 66.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.9, "safety_factor": 2.317, "max_disp_mm": 0.2028, "max_strain": 0.0007713781054233217, "volume_mm3": 87555.6, "bbox_mm": [83.3, 60.3, 71.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.404, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 311, "family": "rib_bracket", "params": {"L": 72.0, "H": 54.5, "W": 55.4, "T": 5.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.0, 'H': 54.5, 'W': 55.4, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.0, 'H': 54.5, 'W': 55.4, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 320.2, "safety_factor": 0.781, "max_disp_mm": 1.0443, "max_strain": 0.0022885950140759145, "peak": {"node": 1677, "coords_mm": [8.85, -43.11, 54.5], "vm_mpa": 320.2}, "volume_mm3": 40220.4, "bbox_mm": [77.5, 55.4, 60.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.8, "safety_factor": 2.297, "max_disp_mm": 0.1844, "max_strain": 0.0007779589042170155, "volume_mm3": 87919.8, "bbox_mm": [83.5, 55.4, 66.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.516, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 314, "family": "u_channel", "params": {"L": 111.5, "H": 49.2, "W": 30.2, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.5, 'H': 49.2, 'W': 30.2, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.5, 'H': 49.2, 'W': 30.2, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4847.2, "safety_factor": 0.052, "max_disp_mm": 46.2577, "max_strain": 0.034648857722950135, "peak": {"node": 381, "coords_mm": [41.36, 1.31, 0.0], "vm_mpa": 4847.2}, "volume_mm3": 864.6, "bbox_mm": [81.3, 49.2, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 139.8, "safety_factor": 1.788, "max_disp_mm": 0.2601, "max_strain": 0.0009991958476442066, "volume_mm3": 13472.0, "bbox_mm": [81.3, 49.2, 10.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.737, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 312, "family": "plate_holes", "params": {"L": 122.6, "H": null, "W": 74.1, "T": 6.4, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.6, 'H': None, 'W': 74.1, 'T': 6.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.6, 'H': None, 'W': 74.1, 'T': 6.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 209.0, "safety_factor": 1.196, "max_disp_mm": 1.4217, "max_strain": 0.0014938760250055342, "peak": {"node": 3567, "coords_mm": [-59.19, -3.71, 6.4], "vm_mpa": 209.0}, "volume_mm3": 57136.5, "bbox_mm": [122.6, 74.1, 6.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 94.9, "safety_factor": 2.635, "max_disp_mm": 0.434, "max_strain": 0.0006781241401235999, "volume_mm3": 92846.8, "bbox_mm": [122.6, 74.1, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.439, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 315, "family": "rib_bracket", "params": {"L": 84.7, "H": 40.8, "W": 41.7, "T": 3.4, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.7, 'H': 40.8, 'W': 41.7, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.7, 'H': 40.8, 'W': 41.7, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 619.8, "safety_factor": 0.403, "max_disp_mm": 3.5563, "max_strain": 0.004430287670074, "peak": {"node": 1319, "coords_mm": [2.13, -20.86, 44.2], "vm_mpa": 619.8}, "volume_mm3": 18275.4, "bbox_mm": [88.1, 41.7, 44.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 160.4, "safety_factor": 1.558, "max_disp_mm": 0.4833, "max_strain": 0.0011468335276260718, "volume_mm3": 52878.1, "bbox_mm": [94.1, 41.7, 50.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.155, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 316, "family": "plate_holes", "params": {"L": 102.1, "H": null, "W": 53.6, "T": 3.7, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.1, 'H': None, 'W': 53.6, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.1, 'H': None, 'W': 53.6, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 382.0, "safety_factor": 0.654, "max_disp_mm": 2.1148, "max_strain": 0.002730462503756199, "peak": {"node": 2339, "coords_mm": [-49.41, 3.57, 3.7], "vm_mpa": 382.0}, "volume_mm3": 20039.2, "bbox_mm": [102.1, 53.6, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.7, "safety_factor": 2.022, "max_disp_mm": 0.5167, "max_strain": 0.0008839467578009965, "volume_mm3": 41703.3, "bbox_mm": [102.1, 53.6, 7.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.367, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 318, "family": "u_channel", "params": {"L": 84.2, "H": 35.5, "W": 36.5, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.2, 'H': 35.5, 'W': 36.5, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.2, 'H': 35.5, 'W': 36.5, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1847.5, "safety_factor": 0.135, "max_disp_mm": 6.2481, "max_strain": 0.013205985560500661, "peak": {"node": 89, "coords_mm": [42.17, 3.2, 0.0], "vm_mpa": 1847.5}, "volume_mm3": 819.2, "bbox_mm": [47.7, 35.5, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.7, "safety_factor": 1.973, "max_disp_mm": 0.1107, "max_strain": 0.0009058270414616026, "volume_mm3": 6263.4, "bbox_mm": [47.7, 35.5, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.837, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 319, "family": "rib_bracket", "params": {"L": 57.4, "H": 47.1, "W": 48.1, "T": 4.4, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.4, 'H': 47.1, 'W': 48.1, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.4, 'H': 47.1, 'W': 48.1, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 302.2, "safety_factor": 0.827, "max_disp_mm": 0.8012, "max_strain": 0.002160157693442961, "peak": {"node": 929, "coords_mm": [11.42, -15.87, 47.1], "vm_mpa": 302.2}, "volume_mm3": 23047.6, "bbox_mm": [61.8, 48.1, 51.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.9, "safety_factor": 2.663, "max_disp_mm": 0.1107, "max_strain": 0.0006710516511678144, "volume_mm3": 57477.6, "bbox_mm": [67.8, 48.1, 57.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.836, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 322, "family": "u_channel", "params": {"L": 96.9, "H": 41.9, "W": 42.8, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.9, 'H': 41.9, 'W': 42.8, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.9, 'H': 41.9, 'W': 42.8, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1652.6, "safety_factor": 0.151, "max_disp_mm": 5.181, "max_strain": 0.011813321998889426, "peak": {"node": 322, "coords_mm": [50.73, 1.99, 3.9], "vm_mpa": 1652.6}, "volume_mm3": 1400.8, "bbox_mm": [54.1, 41.9, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 143.8, "safety_factor": 1.739, "max_disp_mm": 0.1469, "max_strain": 0.0010276136119157044, "volume_mm3": 8438.7, "bbox_mm": [54.1, 41.9, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.588, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 320, "family": "plate_holes", "params": {"L": 111.6, "H": null, "W": 63.1, "T": 4.9, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.6, 'H': None, 'W': 63.1, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.6, 'H': None, 'W': 63.1, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 287.1, "safety_factor": 0.871, "max_disp_mm": 2.171, "max_strain": 0.0020523416477924656, "peak": {"node": 2816, "coords_mm": [-53.29, -10.61, 4.9], "vm_mpa": 287.1}, "volume_mm3": 34013.0, "bbox_mm": [111.6, 63.1, 4.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.7, "safety_factor": 2.3, "max_disp_mm": 0.4895, "max_strain": 0.0007768482699705044, "volume_mm3": 61778.7, "bbox_mm": [111.6, 63.1, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.43, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 321, "family": "l_bracket", "params": {"L": 71.0, "H": 60.4, "W": 59.0, "T": 4.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.0, 'H': 60.4, 'W': 59.0, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.0, 'H': 60.4, 'W': 59.0, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 312.9, "safety_factor": 0.799, "max_disp_mm": 1.0906, "max_strain": 0.002236744415905017, "peak": {"node": 2612, "coords_mm": [6.39, -20.86, 65.2], "vm_mpa": 312.9}, "volume_mm3": 38571.8, "bbox_mm": [75.8, 59.0, 65.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.0, "safety_factor": 2.452, "max_disp_mm": 0.199, "max_strain": 0.0007289523840115851, "volume_mm3": 81641.8, "bbox_mm": [80.8, 59.0, 70.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.653, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 323, "family": "rib_bracket", "params": {"L": 70.0, "H": 53.5, "W": 54.4, "T": 5.3, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.0, 'H': 53.5, 'W': 54.4, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.0, 'H': 53.5, 'W': 54.4, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 329.4, "safety_factor": 0.759, "max_disp_mm": 1.0949, "max_strain": 0.0023546493791319527, "peak": {"node": 2366, "coords_mm": [5.63, -30.59, 58.8], "vm_mpa": 329.4}, "volume_mm3": 37135.6, "bbox_mm": [75.3, 54.4, 58.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.7, "safety_factor": 2.219, "max_disp_mm": 0.1812, "max_strain": 0.0008055100811053901, "volume_mm3": 82864.3, "bbox_mm": [81.3, 54.4, 64.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.46, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 324, "family": "plate_holes", "params": {"L": 121.1, "H": null, "W": 72.6, "T": 6.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.1, 'H': None, 'W': 72.6, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.1, 'H': None, 'W': 72.6, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 238.2, "safety_factor": 1.049, "max_disp_mm": 1.522, "max_strain": 0.0017030136843582465, "peak": {"node": 3808, "coords_mm": [-58.96, 13.34, 6.2], "vm_mpa": 238.2}, "volume_mm3": 53535.6, "bbox_mm": [121.1, 72.6, 6.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.8, "safety_factor": 2.583, "max_disp_mm": 0.4499, "max_strain": 0.0006917560869095251, "volume_mm3": 88074.8, "bbox_mm": [121.1, 72.6, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.534, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 326, "family": "u_channel", "params": {"L": 109.5, "H": 48.2, "W": 49.2, "T": 2.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.5, 'H': 48.2, 'W': 49.2, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.5, 'H': 48.2, 'W': 49.2, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3806.0, "safety_factor": 0.066, "max_disp_mm": 20.8349, "max_strain": 0.027205598613842284, "peak": {"node": 355, "coords_mm": [55.28, 1.26, 2.5], "vm_mpa": 3806.0}, "volume_mm3": 662.5, "bbox_mm": [60.3, 48.2, 2.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.4, "safety_factor": 2.542, "max_disp_mm": 0.1097, "max_strain": 0.0007030627673603261, "volume_mm3": 10804.5, "bbox_mm": [60.3, 48.2, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.476, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 325, "family": "l_bracket", "params": {"L": 85.3, "H": 69.9, "W": 67.0, "T": 5.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.3, 'H': 69.9, 'W': 67.0, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.3, 'H': 69.9, 'W': 67.0, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 220.2, "safety_factor": 1.135, "max_disp_mm": 0.9948, "max_strain": 0.0015742804276818918, "peak": {"node": 2280, "coords_mm": [10.22, -49.21, 69.9], "vm_mpa": 220.2}, "volume_mm3": 62564.6, "bbox_mm": [91.1, 67.0, 75.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.0, "safety_factor": 2.689, "max_disp_mm": 0.2277, "max_strain": 0.0006644557431133494, "volume_mm3": 120117.6, "bbox_mm": [96.1, 67.0, 80.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.554, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 328, "family": "plate_holes", "params": {"L": 100.6, "H": null, "W": 52.1, "T": 3.5, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.6, 'H': None, 'W': 52.1, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.6, 'H': None, 'W': 52.1, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 407.3, "safety_factor": 0.614, "max_disp_mm": 2.2539, "max_strain": 0.0029115822349302886, "peak": {"node": 1332, "coords_mm": [-48.79, -12.45, 0.0], "vm_mpa": 407.3}, "volume_mm3": 18146.5, "bbox_mm": [100.6, 52.1, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.9, "safety_factor": 1.925, "max_disp_mm": 0.5452, "max_strain": 0.0009285060916005983, "volume_mm3": 38885.3, "bbox_mm": [100.6, 52.1, 7.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.311, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 329, "family": "l_bracket", "params": {"L": 54.5, "H": 49.4, "W": 49.9, "T": 3.7, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 54.5, 'H': 49.4, 'W': 49.9, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 54.5, 'H': 49.4, 'W': 49.9, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 217.8, "safety_factor": 1.148, "max_disp_mm": 0.5406, "max_strain": 0.0015568021958337972, "peak": {"node": 1287, "coords_mm": [2.16, -41.18, 53.1], "vm_mpa": 217.8}, "volume_mm3": 19866.2, "bbox_mm": [58.2, 49.9, 53.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 78.8, "safety_factor": 3.171, "max_disp_mm": 0.1135, "max_strain": 0.0005634910129562878, "volume_mm3": 48883.0, "bbox_mm": [63.2, 49.9, 58.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.023, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 327, "family": "rib_bracket", "params": {"L": 82.7, "H": 59.8, "W": 40.7, "T": 3.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.7, 'H': 59.8, 'W': 40.7, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.7, 'H': 59.8, 'W': 40.7, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 693.6, "safety_factor": 0.36, "max_disp_mm": 4.3694, "max_strain": 0.004957765754229803, "peak": {"node": 2037, "coords_mm": [1.96, -17.96, 63.1], "vm_mpa": 693.6}, "volume_mm3": 19582.4, "bbox_mm": [86.0, 40.7, 63.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 135.8, "safety_factor": 1.842, "max_disp_mm": 0.2908, "max_strain": 0.0009703662166135698, "volume_mm3": 70734.2, "bbox_mm": [94.0, 40.7, 71.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.481, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 330, "family": "u_channel", "params": {"L": 82.2, "H": 34.5, "W": 35.5, "T": 3.1, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.2, 'H': 34.5, 'W': 35.5, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.2, 'H': 34.5, 'W': 35.5, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2114.0, "safety_factor": 0.118, "max_disp_mm": 6.4231, "max_strain": 0.015111375223292022, "peak": {"node": 87, "coords_mm": [41.02, 3.1, 0.0], "vm_mpa": 2114.0}, "volume_mm3": 750.5, "bbox_mm": [46.7, 34.5, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 137.1, "safety_factor": 1.824, "max_disp_mm": 0.1076, "max_strain": 0.0009797653764675926, "volume_mm3": 5970.6, "bbox_mm": [46.7, 34.5, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.706, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 331, "family": "rib_bracket", "params": {"L": 55.4, "H": 46.1, "W": 47.1, "T": 4.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.4, 'H': 46.1, 'W': 47.1, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.4, 'H': 46.1, 'W': 47.1, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 286.5, "safety_factor": 0.873, "max_disp_mm": 0.6975, "max_strain": 0.0020476194537758455, "peak": {"node": 1696, "coords_mm": [3.3, -29.76, 50.3], "vm_mpa": 286.5}, "volume_mm3": 20909.6, "bbox_mm": [59.6, 47.1, 50.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 87.2, "safety_factor": 2.868, "max_disp_mm": 0.1072, "max_strain": 0.000623123159158903, "volume_mm3": 53662.9, "bbox_mm": [65.6, 47.1, 56.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.995, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 332, "family": "plate_holes", "params": {"L": 110.2, "H": null, "W": 61.6, "T": 4.7, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.2, 'H': None, 'W': 61.6, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.2, 'H': None, 'W': 61.6, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 344.5, "safety_factor": 0.726, "max_disp_mm": 2.4185, "max_strain": 0.0024623243391850825, "peak": {"node": 2971, "coords_mm": [-53.58, 14.77, 4.7], "vm_mpa": 344.5}, "volume_mm3": 31432.6, "bbox_mm": [110.2, 61.6, 4.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.8, "safety_factor": 2.141, "max_disp_mm": 0.5095, "max_strain": 0.0008347439532839469, "volume_mm3": 58183.8, "bbox_mm": [110.2, 61.6, 8.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.415, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 334, "family": "u_channel", "params": {"L": 94.9, "H": 40.9, "W": 41.8, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.9, 'H': 40.9, 'W': 41.8, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.9, 'H': 40.9, 'W': 41.8, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1607.8, "safety_factor": 0.155, "max_disp_mm": 5.3282, "max_strain": 0.011492983119850664, "peak": {"node": 275, "coords_mm": [49.87, 1.86, 0.0], "vm_mpa": 1607.8}, "volume_mm3": 1302.5, "bbox_mm": [53.1, 40.9, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 157.0, "safety_factor": 1.592, "max_disp_mm": 0.145, "max_strain": 0.0011223951560202375, "volume_mm3": 8086.6, "bbox_mm": [53.1, 40.9, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.437, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 333, "family": "l_bracket", "params": {"L": 68.8, "H": 58.9, "W": 57.8, "T": 4.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.8, 'H': 58.9, 'W': 57.8, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.8, 'H': 58.9, 'W': 57.8, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 308.8, "safety_factor": 0.809, "max_disp_mm": 1.0856, "max_strain": 0.0022076836849671765, "peak": {"node": 1757, "coords_mm": [8.42, -28.4, 58.9], "vm_mpa": 308.8}, "volume_mm3": 35967.8, "bbox_mm": [73.5, 57.8, 63.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.9, "safety_factor": 2.383, "max_disp_mm": 0.1913, "max_strain": 0.0007500647327863435, "volume_mm3": 77034.7, "bbox_mm": [78.5, 57.8, 68.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.573, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 335, "family": "rib_bracket", "params": {"L": 68.0, "H": 52.5, "W": 53.4, "T": 5.2, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.0, 'H': 52.5, 'W': 53.4, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.0, 'H': 52.5, 'W': 53.4, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 329.0, "safety_factor": 0.76, "max_disp_mm": 1.0932, "max_strain": 0.0023514753108100027, "peak": {"node": 906, "coords_mm": [7.3, -37.62, 52.5], "vm_mpa": 329.0}, "volume_mm3": 34904.4, "bbox_mm": [73.2, 53.4, 57.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.0, "safety_factor": 2.194, "max_disp_mm": 0.1752, "max_strain": 0.0008145806818818822, "volume_mm3": 78767.1, "bbox_mm": [79.2, 53.4, 63.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.434, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 336, "family": "plate_holes", "params": {"L": 119.7, "H": null, "W": 71.1, "T": 6.0, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.7, 'H': None, 'W': 71.1, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.7, 'H': None, 'W': 71.1, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 238.9, "safety_factor": 1.046, "max_disp_mm": 1.6403, "max_strain": 0.0017078092196016455, "peak": {"node": 3302, "coords_mm": [-57.85, 2.46, 6.0], "vm_mpa": 238.9}, "volume_mm3": 50121.5, "bbox_mm": [119.7, 71.1, 6.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 106.1, "safety_factor": 2.356, "max_disp_mm": 0.4673, "max_strain": 0.000758370231788517, "volume_mm3": 83535.9, "bbox_mm": [119.7, 71.1, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.31, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 338, "family": "u_channel", "params": {"L": 107.5, "H": 47.2, "W": 48.2, "T": 4.4, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.5, 'H': 47.2, 'W': 48.2, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.5, 'H': 47.2, 'W': 48.2, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 930.3, "safety_factor": 0.269, "max_disp_mm": 2.7095, "max_strain": 0.00664981086904866, "peak": {"node": 308, "coords_mm": [56.77, 2.12, 0.0], "vm_mpa": 930.3}, "volume_mm3": 1976.7, "bbox_mm": [59.3, 47.2, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 164.5, "safety_factor": 1.519, "max_disp_mm": 0.2395, "max_strain": 0.0011761590006261569, "volume_mm3": 6921.9, "bbox_mm": [59.3, 47.2, 8.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.251, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 337, "family": "l_bracket", "params": {"L": 83.0, "H": 68.4, "W": 65.7, "T": 5.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.0, 'H': 68.4, 'W': 65.7, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.0, 'H': 68.4, 'W': 65.7, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 228.4, "safety_factor": 1.095, "max_disp_mm": 1.013, "max_strain": 0.001632745135480305, "peak": {"node": 1933, "coords_mm": [10.74, -48.68, 68.4], "vm_mpa": 228.4}, "volume_mm3": 57763.4, "bbox_mm": [88.6, 65.7, 74.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.0, "safety_factor": 2.633, "max_disp_mm": 0.2265, "max_strain": 0.0006787956881144741, "volume_mm3": 112820.0, "bbox_mm": [93.6, 65.7, 79.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.538, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 339, "family": "rib_bracket", "params": {"L": 80.7, "H": 58.8, "W": 59.7, "T": 3.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.7, 'H': 58.8, 'W': 59.7, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.7, 'H': 58.8, 'W': 59.7, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 435.4, "safety_factor": 0.574, "max_disp_mm": 2.9461, "max_strain": 0.003112428120840499, "peak": {"node": 1974, "coords_mm": [2.55, -23.86, 61.9], "vm_mpa": 435.4}, "volume_mm3": 26391.0, "bbox_mm": [83.8, 59.7, 61.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.8, "safety_factor": 2.087, "max_disp_mm": 0.3168, "max_strain": 0.0008561856392927723, "volume_mm3": 80729.9, "bbox_mm": [89.8, 59.7, 67.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.513, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 342, "family": "u_channel", "params": {"L": 80.2, "H": 33.6, "W": 34.5, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.2, 'H': 33.6, 'W': 34.5, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.2, 'H': 33.6, 'W': 34.5, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1927.0, "safety_factor": 0.13, "max_disp_mm": 5.2856, "max_strain": 0.01377445763044953, "peak": {"node": 246, "coords_mm": [38.45, 1.55, 0.0], "vm_mpa": 1927.0}, "volume_mm3": 686.7, "bbox_mm": [45.7, 33.6, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.3, "safety_factor": 2.397, "max_disp_mm": 0.0835, "max_strain": 0.0007454539008021145, "volume_mm3": 5694.3, "bbox_mm": [45.7, 33.6, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.268, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 340, "family": "plate_holes", "params": {"L": 129.2, "H": null, "W": 50.6, "T": 3.3, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.2, 'H': None, 'W': 50.6, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.2, 'H': None, 'W': 50.6, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 634.4, "safety_factor": 0.394, "max_disp_mm": 4.9048, "max_strain": 0.004534658949469126, "peak": {"node": 2857, "coords_mm": [-63.22, 2.39, 3.3], "vm_mpa": 634.4}, "volume_mm3": 21387.2, "bbox_mm": [129.2, 50.6, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.9, "safety_factor": 2.102, "max_disp_mm": 0.6714, "max_strain": 0.0008500254700990326, "volume_mm3": 60273.0, "bbox_mm": [129.2, 50.6, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.708, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 343, "family": "rib_bracket", "params": {"L": 53.4, "H": 45.1, "W": 46.1, "T": 4.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.4, 'H': 45.1, 'W': 46.1, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.4, 'H': 45.1, 'W': 46.1, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 280.1, "safety_factor": 0.893, "max_disp_mm": 0.5071, "max_strain": 0.002001982670291892, "peak": {"node": 1407, "coords_mm": [5.73, -30.16, 49.2], "vm_mpa": 280.1}, "volume_mm3": 19392.4, "bbox_mm": [57.5, 46.1, 49.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 89.3, "safety_factor": 2.8, "max_disp_mm": 0.1022, "max_strain": 0.0006382454016340281, "volume_mm3": 50565.2, "bbox_mm": [63.5, 46.1, 55.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.907, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 344, "family": "plate_holes", "params": {"L": 108.7, "H": null, "W": 60.1, "T": 4.5, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.7, 'H': None, 'W': 60.1, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.7, 'H': None, 'W': 60.1, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 354.4, "safety_factor": 0.705, "max_disp_mm": 2.6386, "max_strain": 0.002533539592677291, "peak": {"node": 1708, "coords_mm": [-52.81, 9.67, 4.5], "vm_mpa": 354.4}, "volume_mm3": 28945.5, "bbox_mm": [108.7, 60.1, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.2, "safety_factor": 1.996, "max_disp_mm": 0.5353, "max_strain": 0.0008950905249691636, "volume_mm3": 54674.9, "bbox_mm": [108.7, 60.1, 8.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.291, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 346, "family": "u_channel", "params": {"L": 92.9, "H": 39.9, "W": 40.8, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.9, 'H': 39.9, 'W': 40.8, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.9, 'H': 39.9, 'W': 40.8, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1516.7, "safety_factor": 0.165, "max_disp_mm": 4.7492, "max_strain": 0.010841836242974818, "peak": {"node": 137, "coords_mm": [45.76, 0.0, 3.7], "vm_mpa": 1516.7}, "volume_mm3": 1208.8, "bbox_mm": [52.1, 39.9, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.1, "safety_factor": 1.999, "max_disp_mm": 0.1169, "max_strain": 0.000894138425248604, "volume_mm3": 7743.6, "bbox_mm": [52.1, 39.9, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.834, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 345, "family": "l_bracket", "params": {"L": 66.6, "H": 57.5, "W": 56.6, "T": 4.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.6, 'H': 57.5, 'W': 56.6, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.6, 'H': 57.5, 'W': 56.6, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 321.4, "safety_factor": 0.778, "max_disp_mm": 1.0998, "max_strain": 0.0022971595899783917, "peak": {"node": 1575, "coords_mm": [6.55, -52.93, 57.5], "vm_mpa": 321.4}, "volume_mm3": 32754.4, "bbox_mm": [71.1, 56.6, 62.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.1, "safety_factor": 2.576, "max_disp_mm": 0.1868, "max_strain": 0.000693805694590073, "volume_mm3": 71836.7, "bbox_mm": [76.1, 56.6, 67.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.798, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 347, "family": "rib_bracket", "params": {"L": 66.0, "H": 51.5, "W": 52.4, "T": 5.0, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.0, 'H': 51.5, 'W': 52.4, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.0, 'H': 51.5, 'W': 52.4, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 338.8, "safety_factor": 0.738, "max_disp_mm": 1.1255, "max_strain": 0.0024215817992225552, "peak": {"node": 1403, "coords_mm": [7.07, -23.45, 51.5], "vm_mpa": 338.8}, "volume_mm3": 32095.0, "bbox_mm": [71.0, 52.4, 56.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.9, "safety_factor": 2.214, "max_disp_mm": 0.1714, "max_strain": 0.0008071606231834887, "volume_mm3": 74067.4, "bbox_mm": [77.0, 52.4, 62.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.476, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 348, "family": "plate_holes", "params": {"L": 118.2, "H": null, "W": 69.6, "T": 5.8, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.2, 'H': None, 'W': 69.6, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.2, 'H': None, 'W': 69.6, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 253.6, "safety_factor": 0.986, "max_disp_mm": 1.7732, "max_strain": 0.0018128270441866705, "peak": {"node": 3163, "coords_mm": [-56.64, 1.11, 5.8], "vm_mpa": 253.6}, "volume_mm3": 46803.9, "bbox_mm": [118.2, 69.6, 5.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.0, "safety_factor": 2.315, "max_disp_mm": 0.4878, "max_strain": 0.0007719801014040062, "volume_mm3": 79082.5, "bbox_mm": [118.2, 69.6, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.329, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 350, "family": "u_channel", "params": {"L": 105.6, "H": 46.2, "W": 47.2, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.6, 'H': 46.2, 'W': 47.2, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.6, 'H': 46.2, 'W': 47.2, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1519.0, "safety_factor": 0.165, "max_disp_mm": 4.3819, "max_strain": 0.010857687137179694, "peak": {"node": 310, "coords_mm": [55.62, 2.08, 0.0], "vm_mpa": 1519.0}, "volume_mm3": 1854.5, "bbox_mm": [58.4, 46.2, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 154.3, "safety_factor": 1.621, "max_disp_mm": 0.1613, "max_strain": 0.0011026085429986054, "volume_mm3": 10004.3, "bbox_mm": [58.4, 46.2, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.456, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 349, "family": "l_bracket", "params": {"L": 80.8, "H": 67.0, "W": 64.5, "T": 5.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.8, 'H': 67.0, 'W': 64.5, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.8, 'H': 67.0, 'W': 64.5, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 234.3, "safety_factor": 1.067, "max_disp_mm": 1.0068, "max_strain": 0.0016745666712562187, "peak": {"node": 2182, "coords_mm": [14.03, -58.92, 67.0], "vm_mpa": 234.3}, "volume_mm3": 54383.2, "bbox_mm": [86.3, 64.5, 72.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.6, "safety_factor": 2.672, "max_disp_mm": 0.2187, "max_strain": 0.0006688073821776537, "volume_mm3": 107208.7, "bbox_mm": [91.3, 64.5, 77.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.605, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 353, "family": "l_bracket", "params": {"L": 50.1, "H": 46.5, "W": 47.4, "T": 3.4, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 50.1, 'H': 46.5, 'W': 47.4, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 50.1, 'H': 46.5, 'W': 47.4, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 236.5, "safety_factor": 1.057, "max_disp_mm": 0.5445, "max_strain": 0.0016903435086411205, "peak": {"node": 242, "coords_mm": [2.43, 0.0, 49.9], "vm_mpa": 236.5}, "volume_mm3": 16116.0, "bbox_mm": [53.5, 47.4, 49.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 86.6, "safety_factor": 2.885, "max_disp_mm": 0.1037, "max_strain": 0.0006193347124528154, "volume_mm3": 41806.8, "bbox_mm": [58.5, 47.4, 54.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.828, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 351, "family": "rib_bracket", "params": {"L": 78.7, "H": 57.8, "W": 58.8, "T": 6.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 78.7, 'H': 57.8, 'W': 58.8, 'T': 6.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 78.7, 'H': 57.8, 'W': 58.8, 'T': 6.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 209.1, "safety_factor": 1.196, "max_disp_mm": 0.757, "max_strain": 0.0014947372384248943, "peak": {"node": 1873, "coords_mm": [7.81, -45.35, 57.8], "vm_mpa": 209.1}, "volume_mm3": 50274.0, "bbox_mm": [84.7, 58.8, 63.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 79.2, "safety_factor": 3.156, "max_disp_mm": 0.1493, "max_strain": 0.0005662885743321959, "volume_mm3": 104781.6, "bbox_mm": [90.7, 58.8, 69.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.96, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 352, "family": "plate_holes", "params": {"L": 127.7, "H": null, "W": 79.1, "T": 3.1, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.7, 'H': None, 'W': 79.1, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.7, 'H': None, 'W': 79.1, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 327.3, "safety_factor": 0.764, "max_disp_mm": 4.06, "max_strain": 0.0023397245841965363, "peak": {"node": 161, "coords_mm": [-63.85, 7.42, 0.0], "vm_mpa": 327.3}, "volume_mm3": 31138.0, "bbox_mm": [127.7, 79.1, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.6, "safety_factor": 2.144, "max_disp_mm": 0.8186, "max_strain": 0.0008334011300153846, "volume_mm3": 71316.1, "bbox_mm": [127.7, 79.1, 7.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.38, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 354, "family": "u_channel", "params": {"L": 78.2, "H": 32.6, "W": 33.5, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.2, 'H': 32.6, 'W': 33.5, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.2, 'H': 32.6, 'W': 33.5, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1950.7, "safety_factor": 0.128, "max_disp_mm": 5.3433, "max_strain": 0.01394360310138012, "peak": {"node": 226, "coords_mm": [37.47, 1.48, 0.0], "vm_mpa": 1950.7}, "volume_mm3": 625.7, "bbox_mm": [44.7, 32.6, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 106.2, "safety_factor": 2.353, "max_disp_mm": 0.0819, "max_strain": 0.0007593287374704745, "volume_mm3": 5418.0, "bbox_mm": [44.7, 32.6, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.225, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 355, "family": "rib_bracket", "params": {"L": 51.4, "H": 44.1, "W": 45.1, "T": 3.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.4, 'H': 44.1, 'W': 45.1, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.4, 'H': 44.1, 'W': 45.1, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 277.9, "safety_factor": 0.9, "max_disp_mm": 0.4842, "max_strain": 0.0019863552327286185, "peak": {"node": 1599, "coords_mm": [3.26, -28.37, 48.0], "vm_mpa": 277.9}, "volume_mm3": 17483.5, "bbox_mm": [55.3, 45.1, 48.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.4, "safety_factor": 2.678, "max_disp_mm": 0.0987, "max_strain": 0.0006673307755489265, "volume_mm3": 47060.0, "bbox_mm": [61.3, 45.1, 54.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.778, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 356, "family": "plate_holes", "params": {"L": 107.2, "H": null, "W": 58.6, "T": 4.3, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.2, 'H': None, 'W': 58.6, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.2, 'H': None, 'W': 58.6, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 411.5, "safety_factor": 0.608, "max_disp_mm": 2.6573, "max_strain": 0.0029412132430134607, "peak": {"node": 2757, "coords_mm": [-31.24, 25.6, 4.3], "vm_mpa": 411.5}, "volume_mm3": 26580.0, "bbox_mm": [107.2, 58.6, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 137.5, "safety_factor": 1.818, "max_disp_mm": 0.5635, "max_strain": 0.0009828968081301555, "volume_mm3": 51305.5, "bbox_mm": [107.2, 58.6, 8.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.211, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 358, "family": "u_channel", "params": {"L": 90.9, "H": 38.9, "W": 39.8, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.9, 'H': 38.9, 'W': 39.8, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.9, 'H': 38.9, 'W': 39.8, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1699.3, "safety_factor": 0.147, "max_disp_mm": 4.9097, "max_strain": 0.01214691351853533, "peak": {"node": 77, "coords_mm": [45.9, 3.6, 3.6], "vm_mpa": 1699.3}, "volume_mm3": 1119.7, "bbox_mm": [51.1, 38.9, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.1, "safety_factor": 1.967, "max_disp_mm": 0.1155, "max_strain": 0.0009086426915394485, "volume_mm3": 7409.7, "bbox_mm": [51.1, 38.9, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.82, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 357, "family": "l_bracket", "params": {"L": 64.3, "H": 56.0, "W": 55.3, "T": 4.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.3, 'H': 56.0, 'W': 55.3, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.3, 'H': 56.0, 'W': 55.3, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 321.8, "safety_factor": 0.777, "max_disp_mm": 1.0664, "max_strain": 0.002299988796885579, "peak": {"node": 1792, "coords_mm": [8.48, -19.11, 60.4], "vm_mpa": 321.8}, "volume_mm3": 30342.0, "bbox_mm": [68.7, 55.3, 60.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.3, "safety_factor": 2.329, "max_disp_mm": 0.1785, "max_strain": 0.0007671472659104335, "volume_mm3": 67420.7, "bbox_mm": [73.7, 55.3, 65.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.552, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 359, "family": "rib_bracket", "params": {"L": 64.1, "H": 50.5, "W": 51.4, "T": 4.9, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.1, 'H': 50.5, 'W': 51.4, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.1, 'H': 50.5, 'W': 51.4, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 357.4, "safety_factor": 0.699, "max_disp_mm": 1.1246, "max_strain": 0.002554739263325221, "peak": {"node": 1392, "coords_mm": [6.55, -23.29, 50.5], "vm_mpa": 357.4}, "volume_mm3": 30097.3, "bbox_mm": [69.0, 51.4, 55.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.5, "safety_factor": 2.146, "max_disp_mm": 0.1649, "max_strain": 0.0008327491855571701, "volume_mm3": 70312.6, "bbox_mm": [75.0, 51.4, 61.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.446, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 360, "family": "plate_holes", "params": {"L": 116.7, "H": null, "W": 68.1, "T": 5.6, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.7, 'H': None, 'W': 68.1, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.7, 'H': None, 'W': 68.1, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 267.3, "safety_factor": 0.935, "max_disp_mm": 1.9337, "max_strain": 0.001910659605757659, "peak": {"node": 582, "coords_mm": [-56.01, -1.29, 0.0], "vm_mpa": 267.3}, "volume_mm3": 43625.1, "bbox_mm": [116.7, 68.1, 5.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.0, "safety_factor": 2.253, "max_disp_mm": 0.5075, "max_strain": 0.0007932061657209133, "volume_mm3": 74785.8, "bbox_mm": [116.7, 68.1, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.318, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 362, "family": "u_channel", "params": {"L": 103.6, "H": 45.2, "W": 46.2, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.6, 'H': 45.2, 'W': 46.2, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.6, 'H': 45.2, 'W': 46.2, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1518.2, "safety_factor": 0.165, "max_disp_mm": 4.5392, "max_strain": 0.010852671877136863, "peak": {"node": 306, "coords_mm": [51.99, 2.15, 0.0], "vm_mpa": 1518.2}, "volume_mm3": 1735.8, "bbox_mm": [57.4, 45.2, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 149.0, "safety_factor": 1.677, "max_disp_mm": 0.1569, "max_strain": 0.0010653130069248067, "volume_mm3": 9613.3, "bbox_mm": [57.4, 45.2, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.513, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 361, "family": "l_bracket", "params": {"L": 78.6, "H": 65.5, "W": 63.2, "T": 5.3, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.6, 'H': 65.5, 'W': 63.2, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.6, 'H': 65.5, 'W': 63.2, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 261.5, "safety_factor": 0.956, "max_disp_mm": 1.0597, "max_strain": 0.001869285914136408, "peak": {"node": 1267, "coords_mm": [7.28, -35.13, 65.5], "vm_mpa": 261.5}, "volume_mm3": 50043.0, "bbox_mm": [83.9, 63.2, 70.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.0, "safety_factor": 2.5, "max_disp_mm": 0.2176, "max_strain": 0.0007147454604344215, "volume_mm3": 100508.2, "bbox_mm": [88.9, 63.2, 75.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.544, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 366, "family": "u_channel", "params": {"L": 76.2, "H": 31.6, "W": 32.5, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.2, 'H': 31.6, 'W': 32.5, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.2, 'H': 31.6, 'W': 32.5, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2143.2, "safety_factor": 0.117, "max_disp_mm": 5.6257, "max_strain": 0.015320081674598827, "peak": {"node": 229, "coords_mm": [38.77, 1.43, 0.0], "vm_mpa": 2143.2}, "volume_mm3": 568.4, "bbox_mm": [43.7, 31.6, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.9, "safety_factor": 2.454, "max_disp_mm": 0.0797, "max_strain": 0.000728220355622756, "volume_mm3": 5149.8, "bbox_mm": [43.7, 31.6, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.337, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 363, "family": "rib_bracket", "params": {"L": 76.7, "H": 56.8, "W": 57.8, "T": 5.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.7, 'H': 56.8, 'W': 57.8, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.7, 'H': 56.8, 'W': 57.8, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 295.1, "safety_factor": 0.847, "max_disp_mm": 1.048, "max_strain": 0.0021090632115080992, "peak": {"node": 1502, "coords_mm": [11.55, -34.21, 56.8], "vm_mpa": 295.1}, "volume_mm3": 46698.9, "bbox_mm": [82.5, 57.8, 62.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.9, "safety_factor": 2.157, "max_disp_mm": 0.1967, "max_strain": 0.000828388305420183, "volume_mm3": 99100.4, "bbox_mm": [88.5, 57.8, 68.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.31, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 367, "family": "rib_bracket", "params": {"L": 49.4, "H": 43.1, "W": 44.1, "T": 3.8, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.4, 'H': 43.1, 'W': 44.1, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.4, 'H': 43.1, 'W': 44.1, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 278.7, "safety_factor": 0.897, "max_disp_mm": 0.5117, "max_strain": 0.0019922900081237567, "peak": {"node": 1065, "coords_mm": [1.9, -13.07, 46.9], "vm_mpa": 278.7}, "volume_mm3": 16138.0, "bbox_mm": [53.2, 44.1, 46.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.5, "safety_factor": 2.761, "max_disp_mm": 0.0927, "max_strain": 0.0006471627983111926, "volume_mm3": 44212.0, "bbox_mm": [59.2, 44.1, 52.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.864, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 365, "family": "l_bracket", "params": {"L": 92.8, "H": 75.0, "W": 46.2, "T": 3.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.8, 'H': 75.0, 'W': 46.2, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.8, 'H': 75.0, 'W': 46.2, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 483.0, "safety_factor": 0.518, "max_disp_mm": 3.2559, "max_strain": 0.0034523886993875607, "peak": {"node": 2595, "coords_mm": [1.88, -18.24, 78.3], "vm_mpa": 483.0}, "volume_mm3": 26085.9, "bbox_mm": [96.1, 46.2, 78.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.9, "safety_factor": 2.084, "max_disp_mm": 0.3601, "max_strain": 0.0008574138028789621, "volume_mm3": 84750.7, "bbox_mm": [103.1, 46.2, 85.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.567, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 368, "family": "plate_holes", "params": {"L": 105.7, "H": null, "W": 57.1, "T": 4.1, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.7, 'H': None, 'W': 57.1, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.7, 'H': None, 'W': 57.1, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 352.4, "safety_factor": 0.71, "max_disp_mm": 2.7583, "max_strain": 0.002518666326900632, "peak": {"node": 422, "coords_mm": [-36.82, 26.59, 0.0], "vm_mpa": 352.4}, "volume_mm3": 24333.3, "bbox_mm": [105.7, 57.1, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 132.5, "safety_factor": 1.887, "max_disp_mm": 0.5895, "max_strain": 0.0009472282214317351, "volume_mm3": 48073.0, "bbox_mm": [105.7, 57.1, 8.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.177, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 370, "family": "u_channel", "params": {"L": 88.9, "H": 37.9, "W": 38.8, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.9, 'H': 37.9, 'W': 38.8, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.9, 'H': 37.9, 'W': 38.8, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2177.8, "safety_factor": 0.115, "max_disp_mm": 5.1901, "max_strain": 0.015567547559647408, "peak": {"node": 267, "coords_mm": [44.76, 1.38, 0.0], "vm_mpa": 2177.8}, "volume_mm3": 1035.1, "bbox_mm": [50.1, 37.9, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.9, "safety_factor": 2.051, "max_disp_mm": 0.1136, "max_strain": 0.0008714073370543971, "volume_mm3": 7084.6, "bbox_mm": [50.1, 37.9, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.936, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 369, "family": "l_bracket", "params": {"L": 62.1, "H": 54.5, "W": 54.1, "T": 4.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 62.1, 'H': 54.5, 'W': 54.1, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 62.1, 'H': 54.5, 'W': 54.1, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 248.2, "safety_factor": 1.007, "max_disp_mm": 0.6779, "max_strain": 0.0017743022166013657, "peak": {"node": 1809, "coords_mm": [10.96, -7.42, 58.7], "vm_mpa": 248.2}, "volume_mm3": 27448.2, "bbox_mm": [66.3, 54.1, 58.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 82.5, "safety_factor": 3.032, "max_disp_mm": 0.1301, "max_strain": 0.00058939052229144, "volume_mm3": 62613.2, "bbox_mm": [71.3, 54.1, 63.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.025, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 371, "family": "rib_bracket", "params": {"L": 62.1, "H": 49.5, "W": 50.4, "T": 4.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.1, 'H': 49.5, 'W': 50.4, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.1, 'H': 49.5, 'W': 50.4, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 392.6, "safety_factor": 0.637, "max_disp_mm": 1.1436, "max_strain": 0.0028063559536250886, "peak": {"node": 1327, "coords_mm": [6.61, -13.49, 49.5], "vm_mpa": 392.6}, "volume_mm3": 27549.1, "bbox_mm": [66.8, 50.4, 54.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.6, "safety_factor": 2.162, "max_disp_mm": 0.1624, "max_strain": 0.0008264739587757032, "volume_mm3": 65953.9, "bbox_mm": [72.8, 50.4, 60.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.525, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 372, "family": "plate_holes", "params": {"L": 115.2, "H": null, "W": 66.6, "T": 5.4, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.2, 'H': None, 'W': 66.6, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.2, 'H': None, 'W': 66.6, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 302.7, "safety_factor": 0.826, "max_disp_mm": 2.1138, "max_strain": 0.002163680355936165, "peak": {"node": 622, "coords_mm": [-55.48, 14.84, 0.0], "vm_mpa": 302.7}, "volume_mm3": 40582.3, "bbox_mm": [115.2, 66.6, 5.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.5, "safety_factor": 2.128, "max_disp_mm": 0.5294, "max_strain": 0.0008397232799190076, "volume_mm3": 70643.3, "bbox_mm": [115.2, 66.6, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.302, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 374, "family": "u_channel", "params": {"L": 101.6, "H": 44.2, "W": 45.2, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.6, 'H': 44.2, 'W': 45.2, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.6, 'H': 44.2, 'W': 45.2, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1512.1, "safety_factor": 0.165, "max_disp_mm": 4.7561, "max_strain": 0.010808895505718865, "peak": {"node": 341, "coords_mm": [58.42, 2.02, 4.1], "vm_mpa": 1512.1}, "volume_mm3": 1622.2, "bbox_mm": [56.4, 44.2, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 154.9, "safety_factor": 1.614, "max_disp_mm": 0.1562, "max_strain": 0.0011070882381924397, "volume_mm3": 9231.9, "bbox_mm": [56.4, 44.2, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.449, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 373, "family": "l_bracket", "params": {"L": 76.3, "H": 64.0, "W": 62.0, "T": 5.2, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.3, 'H': 64.0, 'W': 62.0, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.3, 'H': 64.0, 'W': 62.0, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 246.1, "safety_factor": 1.016, "max_disp_mm": 1.0367, "max_strain": 0.0017593537945488887, "peak": {"node": 1722, "coords_mm": [7.21, -38.36, 64.0], "vm_mpa": 246.1}, "volume_mm3": 46909.2, "bbox_mm": [81.5, 62.0, 69.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.5, "safety_factor": 2.513, "max_disp_mm": 0.2084, "max_strain": 0.0007110055252016838, "volume_mm3": 95176.2, "bbox_mm": [86.5, 62.0, 74.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.498, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 375, "family": "rib_bracket", "params": {"L": 74.7, "H": 55.8, "W": 56.8, "T": 5.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.7, 'H': 55.8, 'W': 56.8, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.7, 'H': 55.8, 'W': 56.8, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 290.0, "safety_factor": 0.862, "max_disp_mm": 1.0369, "max_strain": 0.0020729185370074337, "peak": {"node": 2065, "coords_mm": [8.25, -37.23, 61.5], "vm_mpa": 290.0}, "volume_mm3": 44096.1, "bbox_mm": [80.4, 56.8, 61.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.9, "safety_factor": 2.254, "max_disp_mm": 0.1894, "max_strain": 0.000792874847961521, "volume_mm3": 94500.4, "bbox_mm": [86.4, 56.8, 67.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.392, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 378, "family": "u_channel", "params": {"L": 114.2, "H": 30.6, "W": 31.5, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.2, 'H': 30.6, 'W': 31.5, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.2, 'H': 30.6, 'W': 31.5, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4373.8, "safety_factor": 0.057, "max_disp_mm": 42.2852, "max_strain": 0.03126473697563914, "peak": {"node": 311, "coords_mm": [35.08, 1.28, 0.0], "vm_mpa": 4373.8}, "volume_mm3": 806.3, "bbox_mm": [82.7, 30.6, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 136.5, "safety_factor": 1.832, "max_disp_mm": 0.2662, "max_strain": 0.0009754569487144389, "volume_mm3": 11746.7, "bbox_mm": [82.7, 30.6, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.775, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 379, "family": "rib_bracket", "params": {"L": 47.4, "H": 42.2, "W": 43.1, "T": 3.6, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.4, 'H': 42.2, 'W': 43.1, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.4, 'H': 42.2, 'W': 43.1, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 286.4, "safety_factor": 0.873, "max_disp_mm": 0.6285, "max_strain": 0.002047199439099542, "peak": {"node": 1001, "coords_mm": [1.78, -15.6, 45.8], "vm_mpa": 286.4}, "volume_mm3": 14460.9, "bbox_mm": [51.0, 43.1, 45.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.5, "safety_factor": 2.704, "max_disp_mm": 0.0894, "max_strain": 0.0006609807906301192, "volume_mm3": 41045.0, "bbox_mm": [57.0, 43.1, 51.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.831, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 377, "family": "l_bracket", "params": {"L": 90.6, "H": 73.5, "W": 69.9, "T": 3.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.6, 'H': 73.5, 'W': 69.9, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.6, 'H': 73.5, 'W': 69.9, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 326.9, "safety_factor": 0.765, "max_disp_mm": 2.4349, "max_strain": 0.002336761686964595, "peak": {"node": 3724, "coords_mm": [1.95, -51.21, 76.6], "vm_mpa": 326.9}, "volume_mm3": 36230.6, "bbox_mm": [93.7, 69.9, 76.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.7, "safety_factor": 2.279, "max_disp_mm": 0.4002, "max_strain": 0.0007841974333359153, "volume_mm3": 97497.9, "bbox_mm": [98.7, 69.9, 81.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.514, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 380, "family": "plate_holes", "params": {"L": 104.2, "H": null, "W": 55.6, "T": 3.9, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.2, 'H': None, 'W': 55.6, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.2, 'H': None, 'W': 55.6, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 393.0, "safety_factor": 0.636, "max_disp_mm": 2.0855, "max_strain": 0.002809292961254648, "peak": {"node": 129, "coords_mm": [-52.1, 3.63, 0.0], "vm_mpa": 393.0}, "volume_mm3": 22374.2, "bbox_mm": [104.2, 55.6, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 143.6, "safety_factor": 1.741, "max_disp_mm": 0.6197, "max_strain": 0.001026461086034918, "volume_mm3": 45322.1, "bbox_mm": [104.2, 55.6, 7.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.105, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 382, "family": "u_channel", "params": {"L": 86.9, "H": 36.9, "W": 37.8, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.9, 'H': 36.9, 'W': 37.8, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.9, 'H': 36.9, 'W': 37.8, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2189.9, "safety_factor": 0.114, "max_disp_mm": 5.4533, "max_strain": 0.01565351552923202, "peak": {"node": 264, "coords_mm": [44.46, 1.74, 0.0], "vm_mpa": 2189.9}, "volume_mm3": 954.9, "bbox_mm": [49.1, 36.9, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 122.8, "safety_factor": 2.037, "max_disp_mm": 0.1088, "max_strain": 0.0008774597311006889, "volume_mm3": 6768.4, "bbox_mm": [49.1, 36.9, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.922, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 383, "family": "rib_bracket", "params": {"L": 60.1, "H": 48.5, "W": 49.4, "T": 4.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.1, 'H': 48.5, 'W': 49.4, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.1, 'H': 48.5, 'W': 49.4, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 397.3, "safety_factor": 0.629, "max_disp_mm": 1.1338, "max_strain": 0.0028399807861850426, "peak": {"node": 1299, "coords_mm": [6.37, -10.43, 48.5], "vm_mpa": 397.3}, "volume_mm3": 25723.6, "bbox_mm": [64.7, 49.4, 53.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.2, "safety_factor": 2.097, "max_disp_mm": 0.1555, "max_strain": 0.0008523320836845695, "volume_mm3": 62417.9, "bbox_mm": [70.7, 49.4, 59.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.467, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 384, "family": "plate_holes", "params": {"L": 113.7, "H": null, "W": 65.1, "T": 5.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.7, 'H': None, 'W': 65.1, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.7, 'H': None, 'W': 65.1, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 350.7, "safety_factor": 0.713, "max_disp_mm": 2.3002, "max_strain": 0.002507163414417205, "peak": {"node": 1926, "coords_mm": [-55.39, 7.21, 0.0], "vm_mpa": 350.7}, "volume_mm3": 37967.0, "bbox_mm": [113.7, 65.1, 5.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.4, "safety_factor": 2.059, "max_disp_mm": 0.5483, "max_strain": 0.0008679933159737946, "volume_mm3": 67172.3, "bbox_mm": [113.7, 65.1, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.346, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 386, "family": "u_channel", "params": {"L": 99.6, "H": 43.2, "W": 44.2, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.6, 'H': 43.2, 'W': 44.2, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.6, 'H': 43.2, 'W': 44.2, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1620.6, "safety_factor": 0.154, "max_disp_mm": 4.7796, "max_strain": 0.011584130654043191, "peak": {"node": 328, "coords_mm": [57.18, 1.97, 4.0], "vm_mpa": 1620.6}, "volume_mm3": 1513.6, "bbox_mm": [55.4, 43.2, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 145.9, "safety_factor": 1.714, "max_disp_mm": 0.1524, "max_strain": 0.0010425547914754217, "volume_mm3": 8860.0, "bbox_mm": [55.4, 43.2, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.56, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 385, "family": "l_bracket", "params": {"L": 74.1, "H": 62.5, "W": 60.8, "T": 5.0, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.1, 'H': 62.5, 'W': 60.8, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.1, 'H': 62.5, 'W': 60.8, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 289.6, "safety_factor": 0.863, "max_disp_mm": 1.0731, "max_strain": 0.0020698359059516274, "peak": {"node": 1865, "coords_mm": [7.0, -32.61, 62.5], "vm_mpa": 289.6}, "volume_mm3": 43046.4, "bbox_mm": [79.1, 60.8, 67.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.1, "safety_factor": 2.449, "max_disp_mm": 0.2056, "max_strain": 0.0007296868107943389, "volume_mm3": 89132.8, "bbox_mm": [84.1, 60.8, 72.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.586, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 387, "family": "rib_bracket", "params": {"L": 72.8, "H": 54.8, "W": 55.8, "T": 5.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.8, 'H': 54.8, 'W': 55.8, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.8, 'H': 54.8, 'W': 55.8, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 305.8, "safety_factor": 0.818, "max_disp_mm": 1.0847, "max_strain": 0.002185841202211499, "peak": {"node": 1680, "coords_mm": [9.54, -10.2, 54.8], "vm_mpa": 305.8}, "volume_mm3": 40848.4, "bbox_mm": [78.3, 55.8, 60.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.3, "safety_factor": 2.207, "max_disp_mm": 0.1887, "max_strain": 0.0008097600585842703, "volume_mm3": 89260.5, "bbox_mm": [84.3, 55.8, 66.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.389, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 390, "family": "u_channel", "params": {"L": 112.3, "H": 49.6, "W": 30.5, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.3, 'H': 49.6, 'W': 30.5, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.3, 'H': 49.6, 'W': 30.5, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4917.8, "safety_factor": 0.051, "max_disp_mm": 46.7418, "max_strain": 0.035152938083339684, "peak": {"node": 438, "coords_mm": [34.29, 1.31, 2.6], "vm_mpa": 4917.8}, "volume_mm3": 870.7, "bbox_mm": [81.8, 49.6, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 134.3, "safety_factor": 1.862, "max_disp_mm": 0.2655, "max_strain": 0.0009596450189249283, "volume_mm3": 13573.1, "bbox_mm": [81.8, 49.6, 10.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.811, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 391, "family": "rib_bracket", "params": {"L": 45.4, "H": 41.2, "W": 42.1, "T": 3.5, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.4, 'H': 41.2, 'W': 42.1, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.4, 'H': 41.2, 'W': 42.1, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 254.9, "safety_factor": 0.981, "max_disp_mm": 0.5202, "max_strain": 0.0018219265866875134, "peak": {"node": 1293, "coords_mm": [1.67, -23.48, 44.7], "vm_mpa": 254.9}, "volume_mm3": 13276.2, "bbox_mm": [48.9, 42.1, 44.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 81.0, "safety_factor": 3.085, "max_disp_mm": 0.0833, "max_strain": 0.0005793106822408056, "volume_mm3": 38435.2, "bbox_mm": [54.9, 42.1, 50.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.104, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 392, "family": "plate_holes", "params": {"L": 102.7, "H": null, "W": 54.1, "T": 3.7, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.7, 'H': None, 'W': 54.1, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.7, 'H': None, 'W': 54.1, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 382.7, "safety_factor": 0.653, "max_disp_mm": 1.9039, "max_strain": 0.0027353787058558465, "peak": {"node": 1412, "coords_mm": [-49.85, -11.06, 0.0], "vm_mpa": 382.7}, "volume_mm3": 20348.2, "bbox_mm": [102.7, 54.1, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.9, "safety_factor": 2.017, "max_disp_mm": 0.5225, "max_strain": 0.0008859934839409279, "volume_mm3": 42346.3, "bbox_mm": [102.7, 54.1, 7.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.364, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 394, "family": "u_channel", "params": {"L": 84.9, "H": 35.9, "W": 36.9, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.9, 'H': 35.9, 'W': 36.9, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.9, 'H': 35.9, 'W': 36.9, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2212.7, "safety_factor": 0.113, "max_disp_mm": 5.6754, "max_strain": 0.015816857682655314, "peak": {"node": 292, "coords_mm": [45.74, 1.61, 3.3], "vm_mpa": 2212.7}, "volume_mm3": 877.7, "bbox_mm": [48.0, 35.9, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.9, "safety_factor": 1.985, "max_disp_mm": 0.1082, "max_strain": 0.0009002309516597263, "volume_mm3": 6452.2, "bbox_mm": [48.0, 35.9, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.872, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 395, "family": "rib_bracket", "params": {"L": 58.1, "H": 47.5, "W": 48.4, "T": 4.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.1, 'H': 47.5, 'W': 48.4, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.1, 'H': 47.5, 'W': 48.4, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 422.6, "safety_factor": 0.592, "max_disp_mm": 1.0909, "max_strain": 0.0030206590785085098, "peak": {"node": 1642, "coords_mm": [7.48, -44.24, 51.9], "vm_mpa": 422.6}, "volume_mm3": 23425.6, "bbox_mm": [62.5, 48.4, 51.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.5, "safety_factor": 2.11, "max_disp_mm": 0.152, "max_strain": 0.0008469483112322555, "volume_mm3": 58389.8, "bbox_mm": [68.5, 48.4, 57.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.518, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 396, "family": "plate_holes", "params": {"L": 112.2, "H": null, "W": 63.6, "T": 5.0, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.2, 'H': None, 'W': 63.6, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.2, 'H': None, 'W': 63.6, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 305.6, "safety_factor": 0.818, "max_disp_mm": 2.0885, "max_strain": 0.0021843355889446503, "peak": {"node": 1759, "coords_mm": [-54.67, -8.55, 0.0], "vm_mpa": 305.6}, "volume_mm3": 35176.9, "bbox_mm": [112.2, 63.6, 5.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.8, "safety_factor": 2.276, "max_disp_mm": 0.4765, "max_strain": 0.0007851847046939533, "volume_mm3": 63318.5, "bbox_mm": [112.2, 63.6, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.458, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 398, "family": "u_channel", "params": {"L": 97.6, "H": 42.2, "W": 43.2, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.6, 'H': 42.2, 'W': 43.2, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.6, 'H': 42.2, 'W': 43.2, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1770.6, "safety_factor": 0.141, "max_disp_mm": 5.2955, "max_strain": 0.012656759438774931, "peak": {"node": 323, "coords_mm": [51.16, 1.99, 3.9], "vm_mpa": 1770.6}, "volume_mm3": 1410.0, "bbox_mm": [54.4, 42.2, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 153.7, "safety_factor": 1.626, "max_disp_mm": 0.1479, "max_strain": 0.0010988449054189465, "volume_mm3": 8497.5, "bbox_mm": [54.4, 42.2, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.485, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 397, "family": "l_bracket", "params": {"L": 71.9, "H": 61.0, "W": 59.5, "T": 4.9, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.9, 'H': 61.0, 'W': 59.5, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.9, 'H': 61.0, 'W': 59.5, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 263.0, "safety_factor": 0.951, "max_disp_mm": 1.0647, "max_strain": 0.0018799809755677202, "peak": {"node": 2237, "coords_mm": [6.44, -21.09, 65.9], "vm_mpa": 263.0}, "volume_mm3": 40175.6, "bbox_mm": [76.8, 59.5, 65.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.7, "safety_factor": 2.533, "max_disp_mm": 0.1988, "max_strain": 0.0007055165978664124, "volume_mm3": 84116.3, "bbox_mm": [81.8, 59.5, 70.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.582, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 399, "family": "rib_bracket", "params": {"L": 70.8, "H": 53.8, "W": 54.8, "T": 5.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.8, 'H': 53.8, 'W': 54.8, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.8, 'H': 53.8, 'W': 54.8, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 325.6, "safety_factor": 0.768, "max_disp_mm": 1.0797, "max_strain": 0.00232773849636168, "peak": {"node": 2374, "coords_mm": [6.19, -36.23, 59.2], "vm_mpa": 325.6}, "volume_mm3": 38469.6, "bbox_mm": [76.2, 54.8, 59.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.4, "safety_factor": 2.442, "max_disp_mm": 0.1807, "max_strain": 0.0007317570997299848, "volume_mm3": 84961.9, "bbox_mm": [82.2, 54.8, 65.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.674, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 400, "family": "plate_holes", "params": {"L": 121.7, "H": null, "W": 73.1, "T": 6.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.7, 'H': None, 'W': 73.1, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.7, 'H': None, 'W': 73.1, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 233.6, "safety_factor": 1.07, "max_disp_mm": 1.473, "max_strain": 0.0016698083081288738, "peak": {"node": 2226, "coords_mm": [-59.51, 8.53, 0.0], "vm_mpa": 233.6}, "volume_mm3": 55056.9, "bbox_mm": [121.7, 73.1, 6.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.5, "safety_factor": 2.618, "max_disp_mm": 0.4424, "max_strain": 0.0006826056769877255, "volume_mm3": 90013.7, "bbox_mm": [121.7, 73.1, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.548, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 402, "family": "u_channel", "params": {"L": 110.3, "H": 48.6, "W": 49.5, "T": 2.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.3, 'H': 48.6, 'W': 49.5, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.3, 'H': 48.6, 'W': 49.5, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3410.4, "safety_factor": 0.073, "max_disp_mm": 20.6404, "max_strain": 0.024377758440906033, "peak": {"node": 306, "coords_mm": [62.91, 1.26, 0.0], "vm_mpa": 3410.4}, "volume_mm3": 668.1, "bbox_mm": [60.8, 48.6, 2.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.9, "safety_factor": 2.529, "max_disp_mm": 0.1117, "max_strain": 0.0007066920555900864, "volume_mm3": 10903.7, "bbox_mm": [60.8, 48.6, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.455, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 401, "family": "l_bracket", "params": {"L": 86.1, "H": 70.5, "W": 67.4, "T": 5.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 86.1, 'H': 70.5, 'W': 67.4, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 86.1, 'H': 70.5, 'W': 67.4, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 229.5, "safety_factor": 1.09, "max_disp_mm": 1.017, "max_strain": 0.0016402372347302304, "peak": {"node": 2401, "coords_mm": [13.21, -31.16, 70.5], "vm_mpa": 229.5}, "volume_mm3": 63485.4, "bbox_mm": [91.9, 67.4, 76.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 87.3, "safety_factor": 2.863, "max_disp_mm": 0.2323, "max_strain": 0.0006241809951429839, "volume_mm3": 121853.8, "bbox_mm": [96.9, 67.4, 81.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.774, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 404, "family": "plate_holes", "params": {"L": 101.2, "H": null, "W": 52.6, "T": 3.5, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.2, 'H': None, 'W': 52.6, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.2, 'H': None, 'W': 52.6, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 408.2, "safety_factor": 0.612, "max_disp_mm": 2.2963, "max_strain": 0.0029177897270021473, "peak": {"node": 2330, "coords_mm": [-48.91, -13.13, 3.5], "vm_mpa": 408.2}, "volume_mm3": 18433.0, "bbox_mm": [101.2, 52.6, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 132.9, "safety_factor": 1.881, "max_disp_mm": 0.5538, "max_strain": 0.0009500608220600941, "volume_mm3": 39499.3, "bbox_mm": [101.2, 52.6, 7.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.269, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 405, "family": "l_bracket", "params": {"L": 55.4, "H": 50.0, "W": 50.3, "T": 3.8, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.4, 'H': 50.0, 'W': 50.3, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.4, 'H': 50.0, 'W': 50.3, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 241.9, "safety_factor": 1.034, "max_disp_mm": 0.5978, "max_strain": 0.001728845356800192, "peak": {"node": 1861, "coords_mm": [1.82, -13.7, 53.8], "vm_mpa": 241.9}, "volume_mm3": 20872.5, "bbox_mm": [59.2, 50.3, 53.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 86.8, "safety_factor": 2.88, "max_disp_mm": 0.1152, "max_strain": 0.000620519904913026, "volume_mm3": 50549.5, "bbox_mm": [64.2, 50.3, 58.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.846, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 403, "family": "rib_bracket", "params": {"L": 83.4, "H": 40.2, "W": 41.1, "T": 3.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.4, 'H': 40.2, 'W': 41.1, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.4, 'H': 40.2, 'W': 41.1, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 669.2, "safety_factor": 0.374, "max_disp_mm": 3.3064, "max_strain": 0.004783602305272143, "peak": {"node": 1319, "coords_mm": [1.94, -13.16, 43.5], "vm_mpa": 669.2}, "volume_mm3": 17211.4, "bbox_mm": [86.7, 41.1, 43.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 137.5, "safety_factor": 1.819, "max_disp_mm": 0.296, "max_strain": 0.0009826635343183623, "volume_mm3": 62651.6, "bbox_mm": [94.7, 41.1, 51.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.445, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 406, "family": "u_channel", "params": {"L": 82.9, "H": 34.9, "W": 35.9, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.9, 'H': 34.9, 'W': 35.9, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.9, 'H': 34.9, 'W': 35.9, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1943.4, "safety_factor": 0.129, "max_disp_mm": 5.874, "max_strain": 0.01389198478630367, "peak": {"node": 241, "coords_mm": [44.94, 1.64, 0.0], "vm_mpa": 1943.4}, "volume_mm3": 805.9, "bbox_mm": [47.0, 34.9, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.0, "safety_factor": 1.937, "max_disp_mm": 0.104, "max_strain": 0.0009223860830721196, "volume_mm3": 6153.3, "bbox_mm": [47.0, 34.9, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.809, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 407, "family": "rib_bracket", "params": {"L": 56.1, "H": 46.5, "W": 47.4, "T": 4.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.1, 'H': 46.5, 'W': 47.4, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.1, 'H': 46.5, 'W': 47.4, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 330.6, "safety_factor": 0.756, "max_disp_mm": 0.7868, "max_strain": 0.0023629253255369707, "peak": {"node": 1425, "coords_mm": [11.06, -42.94, 50.8], "vm_mpa": 330.6}, "volume_mm3": 21788.4, "bbox_mm": [60.4, 47.4, 50.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 86.9, "safety_factor": 2.877, "max_disp_mm": 0.1073, "max_strain": 0.0006211532988781038, "volume_mm3": 55120.0, "bbox_mm": [66.4, 47.4, 56.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.121, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 408, "family": "plate_holes", "params": {"L": 110.7, "H": null, "W": 62.1, "T": 4.8, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.7, 'H': None, 'W': 62.1, 'T': 4.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.7, 'H': None, 'W': 62.1, 'T': 4.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 307.8, "safety_factor": 0.812, "max_disp_mm": 2.2766, "max_strain": 0.00219998079381484, "peak": {"node": 1333, "coords_mm": [-53.21, -2.48, 0.0], "vm_mpa": 307.8}, "volume_mm3": 32514.9, "bbox_mm": [110.7, 62.1, 4.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.8, "safety_factor": 2.177, "max_disp_mm": 0.4976, "max_strain": 0.0008209259064751877, "volume_mm3": 59610.7, "bbox_mm": [110.7, 62.1, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.365, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 410, "family": "u_channel", "params": {"L": 95.6, "H": 41.2, "W": 42.2, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.6, 'H': 41.2, 'W': 42.2, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.6, 'H': 41.2, 'W': 42.2, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1636.1, "safety_factor": 0.153, "max_disp_mm": 5.364, "max_strain": 0.011694982897726757, "peak": {"node": 276, "coords_mm": [47.86, 1.86, 0.0], "vm_mpa": 1636.1}, "volume_mm3": 1311.2, "bbox_mm": [53.4, 41.2, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 152.3, "safety_factor": 1.642, "max_disp_mm": 0.1459, "max_strain": 0.001088324198318998, "volume_mm3": 8144.2, "bbox_mm": [53.4, 41.2, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.489, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 409, "family": "l_bracket", "params": {"L": 69.6, "H": 59.5, "W": 58.3, "T": 4.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.6, 'H': 59.5, 'W': 58.3, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.6, 'H': 59.5, 'W': 58.3, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 301.8, "safety_factor": 0.828, "max_disp_mm": 1.1031, "max_strain": 0.00215738133748743, "peak": {"node": 1039, "coords_mm": [7.01, -20.32, 59.5], "vm_mpa": 301.8}, "volume_mm3": 36662.5, "bbox_mm": [74.3, 58.3, 64.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.1, "safety_factor": 2.403, "max_disp_mm": 0.1946, "max_strain": 0.0007438121611124729, "volume_mm3": 78492.8, "bbox_mm": [79.3, 58.3, 69.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.574, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 411, "family": "rib_bracket", "params": {"L": 68.8, "H": 52.8, "W": 53.8, "T": 5.2, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.8, 'H': 52.8, 'W': 53.8, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.8, 'H': 52.8, 'W': 53.8, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 345.6, "safety_factor": 0.723, "max_disp_mm": 1.1214, "max_strain": 0.0024702098811253976, "peak": {"node": 1409, "coords_mm": [8.9, -30.43, 52.8], "vm_mpa": 345.6}, "volume_mm3": 35473.6, "bbox_mm": [74.0, 53.8, 58.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.2, "safety_factor": 2.19, "max_disp_mm": 0.179, "max_strain": 0.0008160291554288638, "volume_mm3": 80020.0, "bbox_mm": [80.0, 53.8, 64.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.466, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 412, "family": "plate_holes", "params": {"L": 120.2, "H": null, "W": 71.6, "T": 6.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.2, 'H': None, 'W': 71.6, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.2, 'H': None, 'W': 71.6, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 232.1, "safety_factor": 1.077, "max_disp_mm": 1.5665, "max_strain": 0.0016590779388696633, "peak": {"node": 1696, "coords_mm": [-57.97, 17.28, 0.0], "vm_mpa": 232.1}, "volume_mm3": 51540.4, "bbox_mm": [120.2, 71.6, 6.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.1, "safety_factor": 2.573, "max_disp_mm": 0.458, "max_strain": 0.0006944202970049828, "volume_mm3": 85337.3, "bbox_mm": [120.2, 71.6, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.496, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 414, "family": "u_channel", "params": {"L": 108.3, "H": 47.6, "W": 48.5, "T": 4.4, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.3, 'H': 47.6, 'W': 48.5, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.3, 'H': 47.6, 'W': 48.5, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 897.4, "safety_factor": 0.279, "max_disp_mm": 2.7838, "max_strain": 0.006415073755621436, "peak": {"node": 356, "coords_mm": [56.59, 2.3, 4.4], "vm_mpa": 897.4}, "volume_mm3": 1994.1, "bbox_mm": [59.8, 47.6, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.3, "safety_factor": 2.679, "max_disp_mm": 0.1109, "max_strain": 0.0006670131157681276, "volume_mm3": 10491.5, "bbox_mm": [59.8, 47.6, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.401, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 413, "family": "l_bracket", "params": {"L": 83.9, "H": 69.0, "W": 66.2, "T": 5.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.9, 'H': 69.0, 'W': 66.2, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.9, 'H': 69.0, 'W': 66.2, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 226.1, "safety_factor": 1.106, "max_disp_mm": 0.9864, "max_strain": 0.0016160343473230671, "peak": {"node": 2854, "coords_mm": [6.15, -40.77, 74.7], "vm_mpa": 226.1}, "volume_mm3": 59846.1, "bbox_mm": [89.6, 66.2, 74.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.8, "safety_factor": 2.583, "max_disp_mm": 0.2257, "max_strain": 0.0006919773278822223, "volume_mm3": 115884.4, "bbox_mm": [94.6, 66.2, 79.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.477, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 417, "family": "l_bracket", "params": {"L": 53.1, "H": 48.5, "W": 49.1, "T": 3.6, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 53.1, 'H': 48.5, 'W': 49.1, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 53.1, 'H': 48.5, 'W': 49.1, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 227.7, "safety_factor": 1.098, "max_disp_mm": 0.5192, "max_strain": 0.0016272757742941439, "peak": {"node": 1633, "coords_mm": [2.14, -18.38, 52.1], "vm_mpa": 227.7}, "volume_mm3": 18595.2, "bbox_mm": [56.7, 49.1, 52.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 78.1, "safety_factor": 3.201, "max_disp_mm": 0.1095, "max_strain": 0.0005582226169419397, "volume_mm3": 46533.1, "bbox_mm": [61.7, 49.1, 57.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.103, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 415, "family": "rib_bracket", "params": {"L": 81.4, "H": 59.2, "W": 40.1, "T": 3.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.4, 'H': 59.2, 'W': 40.1, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.4, 'H': 59.2, 'W': 40.1, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 734.3, "safety_factor": 0.34, "max_disp_mm": 3.5477, "max_strain": 0.005248763809595817, "peak": {"node": 2018, "coords_mm": [1.6, -21.82, 62.4], "vm_mpa": 734.3}, "volume_mm3": 18452.4, "bbox_mm": [84.6, 40.1, 62.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 133.1, "safety_factor": 1.879, "max_disp_mm": 0.2895, "max_strain": 0.0009511839822199278, "volume_mm3": 68176.4, "bbox_mm": [92.6, 40.1, 70.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.538, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 416, "family": "plate_holes", "params": {"L": 129.7, "H": null, "W": 51.1, "T": 3.3, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.7, 'H': None, 'W': 51.1, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.7, 'H': None, 'W': 51.1, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 661.3, "safety_factor": 0.378, "max_disp_mm": 5.7138, "max_strain": 0.004727194597024333, "peak": {"node": 2876, "coords_mm": [-63.46, -2.41, 3.3], "vm_mpa": 661.3}, "volume_mm3": 21684.7, "bbox_mm": [129.7, 51.1, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.2, "safety_factor": 2.114, "max_disp_mm": 0.6681, "max_strain": 0.000845226930974516, "volume_mm3": 61111.4, "bbox_mm": [129.7, 51.1, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.736, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 418, "family": "u_channel", "params": {"L": 80.9, "H": 33.9, "W": 34.9, "T": 3.1, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.9, 'H': 33.9, 'W': 34.9, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.9, 'H': 33.9, 'W': 34.9, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2154.4, "safety_factor": 0.116, "max_disp_mm": 6.0003, "max_strain": 0.015400129641078005, "peak": {"node": 87, "coords_mm": [40.38, 3.1, 0.0], "vm_mpa": 2154.4}, "volume_mm3": 738.0, "bbox_mm": [46.0, 33.9, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.6, "safety_factor": 2.022, "max_disp_mm": 0.1011, "max_strain": 0.0008837961880745884, "volume_mm3": 5862.9, "bbox_mm": [46.0, 33.9, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.906, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 419, "family": "rib_bracket", "params": {"L": 54.1, "H": 45.5, "W": 46.4, "T": 4.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.1, 'H': 45.5, 'W': 46.4, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.1, 'H': 45.5, 'W': 46.4, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 262.8, "safety_factor": 0.951, "max_disp_mm": 0.5841, "max_strain": 0.0018787905670705326, "peak": {"node": 1197, "coords_mm": [2.11, -28.08, 49.6], "vm_mpa": 262.8}, "volume_mm3": 19727.9, "bbox_mm": [58.2, 46.4, 49.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 94.1, "safety_factor": 2.656, "max_disp_mm": 0.1042, "max_strain": 0.0006727638867784234, "volume_mm3": 51409.8, "bbox_mm": [64.2, 46.4, 55.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.705, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 420, "family": "plate_holes", "params": {"L": 109.2, "H": null, "W": 60.6, "T": 4.6, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.2, 'H': None, 'W': 60.6, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.2, 'H': None, 'W': 60.6, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 344.7, "safety_factor": 0.725, "max_disp_mm": 2.5217, "max_strain": 0.0024641378129014488, "peak": {"node": 2863, "coords_mm": [-53.03, -12.13, 4.6], "vm_mpa": 344.7}, "volume_mm3": 29978.1, "bbox_mm": [109.2, 60.6, 4.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.9, "safety_factor": 2.12, "max_disp_mm": 0.5221, "max_strain": 0.0008428551267854936, "volume_mm3": 56046.1, "bbox_mm": [109.2, 60.6, 8.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.395, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 422, "family": "u_channel", "params": {"L": 93.6, "H": 40.3, "W": 41.2, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.6, 'H': 40.3, 'W': 41.2, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.6, 'H': 40.3, 'W': 41.2, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1503.7, "safety_factor": 0.166, "max_disp_mm": 4.7268, "max_strain": 0.010748389819705462, "peak": {"node": 79, "coords_mm": [47.34, 3.7, 3.7], "vm_mpa": 1503.7}, "volume_mm3": 1218.4, "bbox_mm": [52.4, 40.3, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.3, "safety_factor": 2.114, "max_disp_mm": 0.1196, "max_strain": 0.0008454332090990176, "volume_mm3": 7809.5, "bbox_mm": [52.4, 40.3, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.947, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 421, "family": "l_bracket", "params": {"L": 67.4, "H": 58.0, "W": 57.0, "T": 4.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.4, 'H': 58.0, 'W': 57.0, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.4, 'H': 58.0, 'W': 57.0, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 308.2, "safety_factor": 0.811, "max_disp_mm": 1.0632, "max_strain": 0.0022032965558885014, "peak": {"node": 2422, "coords_mm": [20.85, -3.91, 62.6], "vm_mpa": 308.2}, "volume_mm3": 34086.0, "bbox_mm": [72.0, 57.0, 62.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 106.1, "safety_factor": 2.357, "max_disp_mm": 0.1867, "max_strain": 0.0007582066265989757, "volume_mm3": 73872.0, "bbox_mm": [77.0, 57.0, 67.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.546, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 423, "family": "rib_bracket", "params": {"L": 66.8, "H": 51.8, "W": 52.8, "T": 5.1, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.8, 'H': 51.8, 'W': 52.8, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.8, 'H': 51.8, 'W': 52.8, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 350.5, "safety_factor": 0.713, "max_disp_mm": 1.0632, "max_strain": 0.002505583107020384, "peak": {"node": 1528, "coords_mm": [6.74, -1.69, 51.8], "vm_mpa": 350.5}, "volume_mm3": 33309.9, "bbox_mm": [71.9, 52.8, 56.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.4, "safety_factor": 2.077, "max_disp_mm": 0.1725, "max_strain": 0.0008604015766139799, "volume_mm3": 76014.6, "bbox_mm": [77.9, 52.8, 62.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.364, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 424, "family": "plate_holes", "params": {"L": 118.7, "H": null, "W": 70.1, "T": 5.9, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.7, 'H': None, 'W': 70.1, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.7, 'H': None, 'W': 70.1, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 274.7, "safety_factor": 0.91, "max_disp_mm": 1.7016, "max_strain": 0.001963918639305531, "peak": {"node": 3597, "coords_mm": [-57.79, 7.25, 5.9], "vm_mpa": 274.7}, "volume_mm3": 48166.4, "bbox_mm": [118.7, 70.1, 5.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.2, "safety_factor": 2.333, "max_disp_mm": 0.4765, "max_strain": 0.0007660938133983395, "volume_mm3": 80821.5, "bbox_mm": [118.7, 70.1, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.423, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 426, "family": "u_channel", "params": {"L": 106.3, "H": 46.6, "W": 47.5, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.3, 'H': 46.6, 'W': 47.5, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.3, 'H': 46.6, 'W': 47.5, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1519.9, "safety_factor": 0.164, "max_disp_mm": 4.3726, "max_strain": 0.010864602279319019, "peak": {"node": 348, "coords_mm": [53.47, 2.09, 4.3], "vm_mpa": 1519.9}, "volume_mm3": 1869.3, "bbox_mm": [58.8, 46.6, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 143.2, "safety_factor": 1.746, "max_disp_mm": 0.163, "max_strain": 0.001023589164900176, "volume_mm3": 10089.2, "bbox_mm": [58.8, 46.6, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.581, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 425, "family": "l_bracket", "params": {"L": 81.6, "H": 67.5, "W": 64.9, "T": 5.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.6, 'H': 67.5, 'W': 64.9, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.6, 'H': 67.5, 'W': 64.9, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 233.0, "safety_factor": 1.073, "max_disp_mm": 1.0296, "max_strain": 0.0016655004510266874, "peak": {"node": 1256, "coords_mm": [7.69, -13.81, 67.5], "vm_mpa": 233.0}, "volume_mm3": 55184.5, "bbox_mm": [87.1, 64.9, 73.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.0, "safety_factor": 2.501, "max_disp_mm": 0.223, "max_strain": 0.000714650032675172, "volume_mm3": 108759.4, "bbox_mm": [92.1, 64.9, 78.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.428, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 427, "family": "rib_bracket", "params": {"L": 79.5, "H": 58.2, "W": 59.1, "T": 3.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.5, 'H': 58.2, 'W': 59.1, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.5, 'H': 58.2, 'W': 59.1, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 447.2, "safety_factor": 0.559, "max_disp_mm": 3.6673, "max_strain": 0.0031963684558800978, "peak": {"node": 2729, "coords_mm": [1.88, -23.39, 61.2], "vm_mpa": 447.2}, "volume_mm3": 24946.1, "bbox_mm": [82.5, 59.1, 61.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.6, "safety_factor": 1.959, "max_disp_mm": 0.3141, "max_strain": 0.000912011584911813, "volume_mm3": 78029.7, "bbox_mm": [88.5, 59.1, 67.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.4, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 429, "family": "l_bracket", "params": {"L": 50.9, "H": 47.0, "W": 47.9, "T": 3.5, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 50.9, 'H': 47.0, 'W': 47.9, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 50.9, 'H': 47.0, 'W': 47.9, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 234.7, "safety_factor": 1.065, "max_disp_mm": 0.6418, "max_strain": 0.0016777496958564947, "peak": {"node": 1563, "coords_mm": [1.9, -25.05, 50.5], "vm_mpa": 234.7}, "volume_mm3": 16999.7, "bbox_mm": [54.4, 47.9, 50.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 79.9, "safety_factor": 3.128, "max_disp_mm": 0.1026, "max_strain": 0.0005713338741069124, "volume_mm3": 43320.8, "bbox_mm": [59.4, 47.9, 55.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.063, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 428, "family": "plate_holes", "params": {"L": 128.2, "H": null, "W": 79.6, "T": 3.1, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.2, 'H': None, 'W': 79.6, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.2, 'H': None, 'W': 79.6, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 496.1, "safety_factor": 0.504, "max_disp_mm": 3.4758, "max_strain": 0.003546167105873266, "peak": {"node": 2446, "coords_mm": [-62.83, -8.71, 0.0], "vm_mpa": 496.1}, "volume_mm3": 31459.3, "bbox_mm": [128.2, 79.6, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.7, "safety_factor": 1.942, "max_disp_mm": 0.8251, "max_strain": 0.0009200875185594421, "volume_mm3": 72052.0, "bbox_mm": [128.2, 79.6, 7.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.438, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 430, "family": "u_channel", "params": {"L": 79.0, "H": 32.9, "W": 33.9, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.0, 'H': 32.9, 'W': 33.9, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.0, 'H': 32.9, 'W': 33.9, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1788.6, "safety_factor": 0.14, "max_disp_mm": 5.2935, "max_strain": 0.012785481664530541, "peak": {"node": 264, "coords_mm": [44.97, 1.45, 3.0], "vm_mpa": 1788.6}, "volume_mm3": 675.0, "bbox_mm": [45.1, 32.9, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.1, "safety_factor": 2.448, "max_disp_mm": 0.0801, "max_strain": 0.000730000034710958, "volume_mm3": 5589.0, "bbox_mm": [45.1, 32.9, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.308, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 431, "family": "rib_bracket", "params": {"L": 52.1, "H": 44.5, "W": 45.5, "T": 4.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.1, 'H': 44.5, 'W': 45.5, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.1, 'H': 44.5, 'W': 45.5, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 254.5, "safety_factor": 0.982, "max_disp_mm": 0.4457, "max_strain": 0.0018194710131713514, "peak": {"node": 1604, "coords_mm": [3.22, -28.67, 48.5], "vm_mpa": 254.5}, "volume_mm3": 18309.2, "bbox_mm": [56.1, 45.5, 48.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 87.1, "safety_factor": 2.871, "max_disp_mm": 0.0989, "max_strain": 0.0006225406869923014, "volume_mm3": 48503.0, "bbox_mm": [62.1, 45.5, 54.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.888, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 432, "family": "plate_holes", "params": {"L": 107.7, "H": null, "W": 59.1, "T": 4.4, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.7, 'H': None, 'W': 59.1, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.7, 'H': None, 'W': 59.1, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 392.3, "safety_factor": 0.637, "max_disp_mm": 2.7433, "max_strain": 0.002803883973367154, "peak": {"node": 1680, "coords_mm": [-51.72, -6.16, 4.4], "vm_mpa": 392.3}, "volume_mm3": 27564.0, "bbox_mm": [107.7, 59.1, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.8, "safety_factor": 1.971, "max_disp_mm": 0.547, "max_strain": 0.0009066567707318759, "volume_mm3": 52622.1, "bbox_mm": [107.7, 59.1, 8.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.334, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 434, "family": "u_channel", "params": {"L": 91.6, "H": 39.3, "W": 40.2, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.6, 'H': 39.3, 'W': 40.2, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.6, 'H': 39.3, 'W': 40.2, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1710.7, "safety_factor": 0.146, "max_disp_mm": 5.0699, "max_strain": 0.012228290488825382, "peak": {"node": 77, "coords_mm": [46.19, 3.6, 3.6], "vm_mpa": 1710.7}, "volume_mm3": 1128.8, "bbox_mm": [51.4, 39.3, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 130.1, "safety_factor": 1.922, "max_disp_mm": 0.1183, "max_strain": 0.0009297858203256776, "volume_mm3": 7474.2, "bbox_mm": [51.4, 39.3, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.776, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 433, "family": "l_bracket", "params": {"L": 65.1, "H": 56.5, "W": 55.8, "T": 4.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.1, 'H': 56.5, 'W': 55.8, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.1, 'H': 56.5, 'W': 55.8, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 309.6, "safety_factor": 0.808, "max_disp_mm": 1.0553, "max_strain": 0.0022127988976522643, "peak": {"node": 2001, "coords_mm": [9.76, -51.25, 60.9], "vm_mpa": 309.6}, "volume_mm3": 30935.5, "bbox_mm": [69.5, 55.8, 60.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.9, "safety_factor": 2.407, "max_disp_mm": 0.1829, "max_strain": 0.0007423544884978155, "volume_mm3": 68712.1, "bbox_mm": [74.5, 55.8, 65.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.6, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 435, "family": "rib_bracket", "params": {"L": 64.8, "H": 50.8, "W": 51.8, "T": 4.9, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.8, 'H': 50.8, 'W': 51.8, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.8, 'H': 50.8, 'W': 51.8, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 358.8, "safety_factor": 0.697, "max_disp_mm": 1.1243, "max_strain": 0.00256477026116075, "peak": {"node": 1839, "coords_mm": [7.68, -17.24, 55.7], "vm_mpa": 358.8}, "volume_mm3": 30585.3, "bbox_mm": [69.7, 51.8, 55.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.3, "safety_factor": 2.028, "max_disp_mm": 0.1685, "max_strain": 0.0008812085902923402, "volume_mm3": 71424.4, "bbox_mm": [75.7, 51.8, 61.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.331, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 436, "family": "plate_holes", "params": {"L": 117.2, "H": null, "W": 68.6, "T": 5.7, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.2, 'H': None, 'W': 68.6, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.2, 'H': None, 'W': 68.6, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 269.0, "safety_factor": 0.929, "max_disp_mm": 1.8456, "max_strain": 0.0019226051475983341, "peak": {"node": 637, "coords_mm": [-56.66, 13.76, 0.0], "vm_mpa": 269.0}, "volume_mm3": 44932.2, "bbox_mm": [117.2, 68.6, 5.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.3, "safety_factor": 2.227, "max_disp_mm": 0.496, "max_strain": 0.0008025516671158976, "volume_mm3": 76463.6, "bbox_mm": [117.2, 68.6, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.297, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 438, "family": "u_channel", "params": {"L": 104.3, "H": 45.6, "W": 46.5, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.3, 'H': 45.6, 'W': 46.5, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.3, 'H': 45.6, 'W': 46.5, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1583.5, "safety_factor": 0.158, "max_disp_mm": 4.579, "max_strain": 0.011319091366362097, "peak": {"node": 352, "coords_mm": [52.36, 2.04, 4.2], "vm_mpa": 1583.5}, "volume_mm3": 1749.9, "bbox_mm": [57.8, 45.6, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 149.9, "safety_factor": 1.667, "max_disp_mm": 0.1619, "max_strain": 0.001071727484187941, "volume_mm3": 9696.5, "bbox_mm": [57.8, 45.6, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.51, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 437, "family": "l_bracket", "params": {"L": 79.4, "H": 66.0, "W": 63.7, "T": 5.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.4, 'H': 66.0, 'W': 63.7, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.4, 'H': 66.0, 'W': 63.7, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 245.6, "safety_factor": 1.018, "max_disp_mm": 1.0164, "max_strain": 0.001755936852754305, "peak": {"node": 2729, "coords_mm": [5.99, -23.06, 71.4], "vm_mpa": 245.6}, "volume_mm3": 51872.2, "bbox_mm": [84.8, 63.7, 71.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.9, "safety_factor": 2.721, "max_disp_mm": 0.2157, "max_strain": 0.0006567778641651495, "volume_mm3": 103214.4, "bbox_mm": [89.8, 63.7, 76.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.703, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 439, "family": "rib_bracket", "params": {"L": 77.5, "H": 57.2, "W": 58.1, "T": 5.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.5, 'H': 57.2, 'W': 58.1, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.5, 'H': 57.2, 'W': 58.1, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 222.0, "safety_factor": 1.126, "max_disp_mm": 0.7781, "max_strain": 0.0015868874440879894, "peak": {"node": 1839, "coords_mm": [9.1, -38.92, 57.2], "vm_mpa": 222.0}, "volume_mm3": 48196.3, "bbox_mm": [83.4, 58.1, 63.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 81.5, "safety_factor": 3.069, "max_disp_mm": 0.1472, "max_strain": 0.0005823138300461324, "volume_mm3": 101357.8, "bbox_mm": [89.4, 58.1, 69.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.943, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 442, "family": "u_channel", "params": {"L": 77.0, "H": 31.9, "W": 32.9, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.0, 'H': 31.9, 'W': 32.9, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.0, 'H': 31.9, 'W': 32.9, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2116.6, "safety_factor": 0.118, "max_disp_mm": 5.2443, "max_strain": 0.015130095993917025, "peak": {"node": 232, "coords_mm": [36.84, 1.49, 0.0], "vm_mpa": 2116.6}, "volume_mm3": 614.8, "bbox_mm": [44.1, 31.9, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.6, "safety_factor": 2.536, "max_disp_mm": 0.0777, "max_strain": 0.0007045342121217772, "volume_mm3": 5315.0, "bbox_mm": [44.1, 31.9, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.418, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 441, "family": "l_bracket", "params": {"L": 93.7, "H": 45.5, "W": 46.6, "T": 3.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 93.7, 'H': 45.5, 'W': 46.6, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 93.7, 'H': 45.5, 'W': 46.6, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 552.1, "safety_factor": 0.453, "max_disp_mm": 4.7364, "max_strain": 0.0039462457923083215, "peak": {"node": 2378, "coords_mm": [3.25, -17.21, 48.8], "vm_mpa": 552.1}, "volume_mm3": 21913.7, "bbox_mm": [97.0, 46.6, 48.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.1, "safety_factor": 2.099, "max_disp_mm": 0.3662, "max_strain": 0.0008514005177788863, "volume_mm3": 71757.0, "bbox_mm": [104.0, 46.6, 55.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.646, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 443, "family": "rib_bracket", "params": {"L": 50.1, "H": 43.5, "W": 44.5, "T": 3.8, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.1, 'H': 43.5, 'W': 44.5, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.1, 'H': 43.5, 'W': 44.5, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 255.8, "safety_factor": 0.977, "max_disp_mm": 0.5692, "max_strain": 0.0018283778983895532, "peak": {"node": 1097, "coords_mm": [2.14, -8.65, 47.3], "vm_mpa": 255.8}, "volume_mm3": 16470.3, "bbox_mm": [53.9, 44.5, 47.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.2, "safety_factor": 2.711, "max_disp_mm": 0.0959, "max_strain": 0.0006592997505736623, "volume_mm3": 45092.7, "bbox_mm": [59.9, 44.5, 53.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.733, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 444, "family": "plate_holes", "params": {"L": 106.2, "H": null, "W": 57.6, "T": 4.2, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.2, 'H': None, 'W': 57.6, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.2, 'H': None, 'W': 57.6, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 364.9, "safety_factor": 0.685, "max_disp_mm": 2.7257, "max_strain": 0.0026081792747331255, "peak": {"node": 1508, "coords_mm": [-51.45, 22.67, 0.0], "vm_mpa": 364.9}, "volume_mm3": 25269.7, "bbox_mm": [106.2, 57.6, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 134.7, "safety_factor": 1.856, "max_disp_mm": 0.5787, "max_strain": 0.0009627776329681803, "volume_mm3": 49336.0, "bbox_mm": [106.2, 57.6, 8.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.171, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 446, "family": "u_channel", "params": {"L": 89.6, "H": 38.3, "W": 39.2, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.6, 'H': 38.3, 'W': 39.2, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.6, 'H': 38.3, 'W': 39.2, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1756.1, "safety_factor": 0.142, "max_disp_mm": 5.2433, "max_strain": 0.012552845096863115, "peak": {"node": 265, "coords_mm": [43.27, 1.71, 0.0], "vm_mpa": 1756.1}, "volume_mm3": 1043.7, "bbox_mm": [50.4, 38.3, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 131.5, "safety_factor": 1.901, "max_disp_mm": 0.1159, "max_strain": 0.000939906159232087, "volume_mm3": 7147.8, "bbox_mm": [50.4, 38.3, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.759, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 445, "family": "l_bracket", "params": {"L": 62.9, "H": 55.0, "W": 54.5, "T": 4.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 62.9, 'H': 55.0, 'W': 54.5, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 62.9, 'H': 55.0, 'W': 54.5, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 235.3, "safety_factor": 1.062, "max_disp_mm": 0.7465, "max_strain": 0.0016821946973934574, "peak": {"node": 1175, "coords_mm": [15.15, -6.8, 55.0], "vm_mpa": 235.3}, "volume_mm3": 28637.6, "bbox_mm": [67.2, 54.5, 59.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 84.5, "safety_factor": 2.958, "max_disp_mm": 0.1308, "max_strain": 0.0006041477061479204, "volume_mm3": 64471.3, "bbox_mm": [72.2, 54.5, 64.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.896, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 447, "family": "rib_bracket", "params": {"L": 62.8, "H": 49.9, "W": 50.8, "T": 4.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.8, 'H': 49.9, 'W': 50.8, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.8, 'H': 49.9, 'W': 50.8, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 359.1, "safety_factor": 0.696, "max_disp_mm": 1.1115, "max_strain": 0.0025670955314572074, "peak": {"node": 2042, "coords_mm": [10.72, -49.17, 54.7], "vm_mpa": 359.1}, "volume_mm3": 28651.2, "bbox_mm": [67.6, 50.8, 54.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.6, "safety_factor": 2.201, "max_disp_mm": 0.1626, "max_strain": 0.0008118681431787142, "volume_mm3": 67757.0, "bbox_mm": [73.6, 50.8, 60.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.505, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 448, "family": "plate_holes", "params": {"L": 115.7, "H": null, "W": 67.2, "T": 5.5, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.7, 'H': None, 'W': 67.2, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.7, 'H': None, 'W': 67.2, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 302.8, "safety_factor": 0.826, "max_disp_mm": 2.0206, "max_strain": 0.002164111806967172, "peak": {"node": 2001, "coords_mm": [-55.83, -0.0, 5.5], "vm_mpa": 302.8}, "volume_mm3": 41898.8, "bbox_mm": [115.7, 67.2, 5.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.1, "safety_factor": 2.21, "max_disp_mm": 0.5139, "max_strain": 0.0008085336212660497, "volume_mm3": 72370.6, "bbox_mm": [115.7, 67.2, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.384, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 450, "family": "u_channel", "params": {"L": 102.3, "H": 44.6, "W": 45.5, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.3, 'H': 44.6, 'W': 45.5, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.3, 'H': 44.6, 'W': 45.5, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1662.0, "safety_factor": 0.15, "max_disp_mm": 4.8957, "max_strain": 0.011879972893293513, "peak": {"node": 338, "coords_mm": [55.86, 2.13, 4.1], "vm_mpa": 1662.0}, "volume_mm3": 1635.6, "bbox_mm": [56.8, 44.6, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 158.2, "safety_factor": 1.581, "max_disp_mm": 0.1594, "max_strain": 0.0011306040165283394, "volume_mm3": 9313.5, "bbox_mm": [56.8, 44.6, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.43, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 449, "family": "l_bracket", "params": {"L": 77.2, "H": 64.5, "W": 62.5, "T": 5.2, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 77.2, 'H': 64.5, 'W': 62.5, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 77.2, 'H': 64.5, 'W': 62.5, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 269.4, "safety_factor": 0.928, "max_disp_mm": 1.0584, "max_strain": 0.0019255044894732455, "peak": {"node": 1971, "coords_mm": [9.25, -40.06, 64.5], "vm_mpa": 269.4}, "volume_mm3": 47742.5, "bbox_mm": [82.4, 62.5, 69.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.5, "safety_factor": 2.488, "max_disp_mm": 0.2133, "max_strain": 0.0007182185050962499, "volume_mm3": 96836.3, "bbox_mm": [87.4, 62.5, 74.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.56, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 451, "family": "rib_bracket", "params": {"L": 75.5, "H": 56.2, "W": 57.1, "T": 5.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.5, 'H': 56.2, 'W': 57.1, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.5, 'H': 56.2, 'W': 57.1, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 292.5, "safety_factor": 0.855, "max_disp_mm": 1.0712, "max_strain": 0.00209089908589625, "peak": {"node": 2108, "coords_mm": [8.47, -37.37, 61.9], "vm_mpa": 292.5}, "volume_mm3": 44719.6, "bbox_mm": [81.2, 57.1, 61.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.6, "safety_factor": 2.414, "max_disp_mm": 0.1943, "max_strain": 0.0007402746682076683, "volume_mm3": 95801.2, "bbox_mm": [87.2, 57.1, 67.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.559, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 454, "family": "u_channel", "params": {"L": 115.0, "H": 30.9, "W": 31.9, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 115.0, 'H': 30.9, 'W': 31.9, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 115.0, 'H': 30.9, 'W': 31.9, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4304.0, "safety_factor": 0.058, "max_disp_mm": 39.7163, "max_strain": 0.030765860992597316, "peak": {"node": 98, "coords_mm": [37.13, 2.8, 0.0], "vm_mpa": 4304.0}, "volume_mm3": 871.8, "bbox_mm": [83.1, 30.9, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.4, "safety_factor": 1.962, "max_disp_mm": 0.2608, "max_strain": 0.0009110044172000682, "volume_mm3": 12037.2, "bbox_mm": [83.1, 30.9, 10.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.904, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 455, "family": "rib_bracket", "params": {"L": 48.1, "H": 42.5, "W": 43.5, "T": 3.7, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.1, 'H': 42.5, 'W': 43.5, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.1, 'H': 42.5, 'W': 43.5, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 286.0, "safety_factor": 0.874, "max_disp_mm": 0.5235, "max_strain": 0.0020445224945046443, "peak": {"node": 1343, "coords_mm": [1.94, -30.32, 46.2], "vm_mpa": 286.0}, "volume_mm3": 15177.6, "bbox_mm": [51.8, 43.5, 46.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 78.2, "safety_factor": 3.196, "max_disp_mm": 0.0903, "max_strain": 0.0005592315230054265, "volume_mm3": 42321.6, "bbox_mm": [57.8, 43.5, 52.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.321, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 453, "family": "l_bracket", "params": {"L": 91.4, "H": 74.0, "W": 45.4, "T": 3.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.4, 'H': 74.0, 'W': 45.4, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.4, 'H': 74.0, 'W': 45.4, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 555.9, "safety_factor": 0.45, "max_disp_mm": 4.7298, "max_strain": 0.0039738871875013146, "peak": {"node": 2562, "coords_mm": [1.43, -27.48, 77.2], "vm_mpa": 555.9}, "volume_mm3": 24494.2, "bbox_mm": [94.6, 45.4, 77.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.5, "safety_factor": 2.008, "max_disp_mm": 0.3584, "max_strain": 0.0008900934249353534, "volume_mm3": 81316.8, "bbox_mm": [101.6, 45.4, 84.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.558, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 456, "family": "plate_holes", "params": {"L": 104.7, "H": null, "W": 56.2, "T": 4.0, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.7, 'H': None, 'W': 56.2, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.7, 'H': None, 'W': 56.2, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 367.9, "safety_factor": 0.68, "max_disp_mm": 2.2135, "max_strain": 0.002629691801589408, "peak": {"node": 1500, "coords_mm": [-51.0, -14.69, 0.0], "vm_mpa": 367.9}, "volume_mm3": 23134.4, "bbox_mm": [104.7, 56.2, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 138.6, "safety_factor": 1.803, "max_disp_mm": 0.605, "max_strain": 0.0009910033797896696, "volume_mm3": 46268.9, "bbox_mm": [104.7, 56.2, 8.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.124, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 458, "family": "u_channel", "params": {"L": 87.7, "H": 37.3, "W": 38.2, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.7, 'H': 37.3, 'W': 38.2, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.7, 'H': 37.3, 'W': 38.2, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1810.9, "safety_factor": 0.138, "max_disp_mm": 5.4487, "max_strain": 0.012944195222584536, "peak": {"node": 263, "coords_mm": [44.9, 1.74, 0.0], "vm_mpa": 1810.9}, "volume_mm3": 964.1, "bbox_mm": [49.5, 37.3, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.2, "safety_factor": 2.116, "max_disp_mm": 0.1126, "max_strain": 0.0008446759502422688, "volume_mm3": 6839.1, "bbox_mm": [49.5, 37.3, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.978, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 459, "family": "rib_bracket", "params": {"L": 60.8, "H": 48.9, "W": 49.8, "T": 4.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.8, 'H': 48.9, 'W': 49.8, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.8, 'H': 48.9, 'W': 49.8, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 416.0, "safety_factor": 0.601, "max_disp_mm": 1.1872, "max_strain": 0.0029739708261837406, "peak": {"node": 1317, "coords_mm": [8.65, -45.93, 48.9], "vm_mpa": 416.0}, "volume_mm3": 26183.8, "bbox_mm": [65.4, 49.8, 53.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.5, "safety_factor": 2.127, "max_disp_mm": 0.1582, "max_strain": 0.0008400134307227052, "volume_mm3": 63504.0, "bbox_mm": [71.4, 49.8, 59.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.526, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 460, "family": "plate_holes", "params": {"L": 114.2, "H": null, "W": 65.7, "T": 5.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.2, 'H': None, 'W': 65.7, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.2, 'H': None, 'W': 65.7, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 327.2, "safety_factor": 0.764, "max_disp_mm": 2.1785, "max_strain": 0.0023389486273626193, "peak": {"node": 3186, "coords_mm": [-54.99, 2.31, 5.3], "vm_mpa": 327.2}, "volume_mm3": 39232.8, "bbox_mm": [114.2, 65.7, 5.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.5, "safety_factor": 2.111, "max_disp_mm": 0.5338, "max_strain": 0.0008467119791679534, "volume_mm3": 68842.4, "bbox_mm": [114.2, 65.7, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.347, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 462, "family": "u_channel", "params": {"L": 100.3, "H": 43.6, "W": 44.6, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.3, 'H': 43.6, 'W': 44.6, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.3, 'H': 43.6, 'W': 44.6, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1432.1, "safety_factor": 0.175, "max_disp_mm": 5.0454, "max_strain": 0.010236700179953089, "peak": {"node": 326, "coords_mm": [55.2, 1.97, 4.0], "vm_mpa": 1432.1}, "volume_mm3": 1524.8, "bbox_mm": [55.7, 43.6, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.0, "safety_factor": 1.701, "max_disp_mm": 0.1558, "max_strain": 0.001050540534857353, "volume_mm3": 8930.0, "bbox_mm": [55.7, 43.6, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.526, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 461, "family": "l_bracket", "params": {"L": 74.9, "H": 63.0, "W": 61.2, "T": 5.1, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.9, 'H': 63.0, 'W': 61.2, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.9, 'H': 63.0, 'W': 61.2, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 273.0, "safety_factor": 0.916, "max_disp_mm": 1.0529, "max_strain": 0.001951382674911421, "peak": {"node": 2459, "coords_mm": [5.94, -26.12, 68.1], "vm_mpa": 273.0}, "volume_mm3": 44633.2, "bbox_mm": [80.0, 61.2, 68.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.0, "safety_factor": 2.476, "max_disp_mm": 0.2051, "max_strain": 0.0007218112689358537, "volume_mm3": 91481.8, "bbox_mm": [85.0, 61.2, 73.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.56, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 463, "family": "rib_bracket", "params": {"L": 73.5, "H": 55.2, "W": 56.1, "T": 5.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.5, 'H': 55.2, 'W': 56.1, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.5, 'H': 55.2, 'W': 56.1, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 299.7, "safety_factor": 0.834, "max_disp_mm": 1.0581, "max_strain": 0.0021425256639930803, "peak": {"node": 2243, "coords_mm": [6.56, -31.95, 60.8], "vm_mpa": 299.7}, "volume_mm3": 42191.7, "bbox_mm": [79.1, 56.1, 60.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.7, "safety_factor": 2.258, "max_disp_mm": 0.1886, "max_strain": 0.0007914570846325234, "volume_mm3": 91301.6, "bbox_mm": [85.1, 56.1, 66.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.424, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 466, "family": "u_channel", "params": {"L": 113.0, "H": 49.9, "W": 30.9, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.0, 'H': 49.9, 'W': 30.9, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.0, 'H': 49.9, 'W': 30.9, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3999.1, "safety_factor": 0.063, "max_disp_mm": 42.1083, "max_strain": 0.028586173433551895, "peak": {"node": 383, "coords_mm": [37.24, 1.37, 0.0], "vm_mpa": 3999.1}, "volume_mm3": 942.6, "bbox_mm": [82.1, 49.9, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.3, "safety_factor": 1.98, "max_disp_mm": 0.2594, "max_strain": 0.0009025936044774082, "volume_mm3": 13887.6, "bbox_mm": [82.1, 49.9, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.917, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 465, "family": "l_bracket", "params": {"L": 89.2, "H": 72.5, "W": 69.1, "T": 3.0, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 89.2, 'H': 72.5, 'W': 69.1, 'T': 3.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 89.2, 'H': 72.5, 'W': 69.1, 'T': 3.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 394.7, "safety_factor": 0.633, "max_disp_mm": 2.6648, "max_strain": 0.0028212627356000225, "peak": {"node": 3530, "coords_mm": [1.94, -48.15, 75.5], "vm_mpa": 394.7}, "volume_mm3": 34142.3, "bbox_mm": [92.2, 69.1, 75.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.4, "safety_factor": 2.112, "max_disp_mm": 0.4025, "max_strain": 0.0008461279724026646, "volume_mm3": 93810.2, "bbox_mm": [97.2, 69.1, 80.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.479, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 467, "family": "rib_bracket", "params": {"L": 46.2, "H": 41.5, "W": 42.5, "T": 3.5, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.2, 'H': 41.5, 'W': 42.5, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.2, 'H': 41.5, 'W': 42.5, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 258.6, "safety_factor": 0.967, "max_disp_mm": 0.5321, "max_strain": 0.001848395997561338, "peak": {"node": 1258, "coords_mm": [2.17, -26.26, 45.0], "vm_mpa": 258.6}, "volume_mm3": 13566.0, "bbox_mm": [49.7, 42.5, 45.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 84.6, "safety_factor": 2.956, "max_disp_mm": 0.0866, "max_strain": 0.0006045833798198363, "volume_mm3": 39244.5, "bbox_mm": [55.7, 42.5, 51.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.989, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 468, "family": "plate_holes", "params": {"L": 103.2, "H": null, "W": 54.7, "T": 3.8, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.2, 'H': None, 'W': 54.7, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.2, 'H': None, 'W': 54.7, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 372.2, "safety_factor": 0.672, "max_disp_mm": 2.2709, "max_strain": 0.0026605361509739523, "peak": {"node": 1120, "coords_mm": [-49.59, 13.68, 0.0], "vm_mpa": 372.2}, "volume_mm3": 21236.3, "bbox_mm": [103.2, 54.7, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.0, "safety_factor": 1.713, "max_disp_mm": 0.634, "max_strain": 0.0010433194987823856, "volume_mm3": 43590.2, "bbox_mm": [103.2, 54.7, 7.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.041, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 470, "family": "u_channel", "params": {"L": 85.7, "H": 36.3, "W": 37.2, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 85.7, 'H': 36.3, 'W': 37.2, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 85.7, 'H': 36.3, 'W': 37.2, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1961.9, "safety_factor": 0.127, "max_disp_mm": 5.7739, "max_strain": 0.014024100677103447, "peak": {"node": 73, "coords_mm": [42.88, 3.3, 3.3], "vm_mpa": 1961.9}, "volume_mm3": 887.5, "bbox_mm": [48.5, 36.3, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.9, "safety_factor": 1.97, "max_disp_mm": 0.11, "max_strain": 0.000906899251862903, "volume_mm3": 6530.0, "bbox_mm": [48.5, 36.3, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.843, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 471, "family": "rib_bracket", "params": {"L": 58.8, "H": 47.9, "W": 48.8, "T": 4.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.8, 'H': 47.9, 'W': 48.8, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.8, 'H': 47.9, 'W': 48.8, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 413.8, "safety_factor": 0.604, "max_disp_mm": 1.1298, "max_strain": 0.002958238529694476, "peak": {"node": 1230, "coords_mm": [6.5, -45.11, 47.9], "vm_mpa": 413.8}, "volume_mm3": 24419.5, "bbox_mm": [63.3, 48.8, 52.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.0, "safety_factor": 2.084, "max_disp_mm": 0.1516, "max_strain": 0.0008576957702627883, "volume_mm3": 60053.3, "bbox_mm": [69.3, 48.8, 58.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.479, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 474, "family": "u_channel", "params": {"L": 98.3, "H": 42.6, "W": 43.6, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.3, 'H': 42.6, 'W': 43.6, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.3, 'H': 42.6, 'W': 43.6, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1546.6, "safety_factor": 0.162, "max_disp_mm": 4.787, "max_strain": 0.011055230080869557, "peak": {"node": 329, "coords_mm": [51.51, 2.08, 4.0], "vm_mpa": 1546.6}, "volume_mm3": 1492.8, "bbox_mm": [54.7, 42.6, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.6, "safety_factor": 1.705, "max_disp_mm": 0.1468, "max_strain": 0.0010479968647137833, "volume_mm3": 8730.0, "bbox_mm": [54.7, 42.6, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.544, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 472, "family": "plate_holes", "params": {"L": 112.7, "H": null, "W": 64.2, "T": 5.1, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.7, 'H': None, 'W': 64.2, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.7, 'H': None, 'W': 64.2, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 271.2, "safety_factor": 0.922, "max_disp_mm": 1.9796, "max_strain": 0.0019385714515819262, "peak": {"node": 548, "coords_mm": [-54.26, -6.25, 0.0], "vm_mpa": 271.2}, "volume_mm3": 36387.5, "bbox_mm": [112.7, 64.2, 5.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.9, "safety_factor": 2.406, "max_disp_mm": 0.466, "max_strain": 0.000742653149805295, "volume_mm3": 64926.8, "bbox_mm": [112.7, 64.2, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.484, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 473, "family": "l_bracket", "params": {"L": 72.7, "H": 61.5, "W": 60.0, "T": 4.9, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 72.7, 'H': 61.5, 'W': 60.0, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 72.7, 'H': 61.5, 'W': 60.0, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 280.4, "safety_factor": 0.892, "max_disp_mm": 1.109, "max_strain": 0.0020039880627177025, "peak": {"node": 2543, "coords_mm": [9.46, -33.0, 66.4], "vm_mpa": 280.4}, "volume_mm3": 40895.4, "bbox_mm": [77.6, 60.0, 66.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.7, "safety_factor": 2.558, "max_disp_mm": 0.2027, "max_strain": 0.0006985377115746686, "volume_mm3": 85595.4, "bbox_mm": [82.6, 60.0, 71.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.667, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 475, "family": "rib_bracket", "params": {"L": 71.5, "H": 54.2, "W": 55.1, "T": 5.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.5, 'H': 54.2, 'W': 55.1, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.5, 'H': 54.2, 'W': 55.1, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 328.7, "safety_factor": 0.761, "max_disp_mm": 1.0912, "max_strain": 0.0023492908448378333, "peak": {"node": 1412, "coords_mm": [10.59, -29.4, 54.2], "vm_mpa": 328.7}, "volume_mm3": 39007.5, "bbox_mm": [76.9, 55.1, 59.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.5, "safety_factor": 2.128, "max_disp_mm": 0.1859, "max_strain": 0.0008398767703163919, "volume_mm3": 86118.0, "bbox_mm": [82.9, 55.1, 65.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.367, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 478, "family": "u_channel", "params": {"L": 111.0, "H": 48.9, "W": 49.9, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.0, 'H': 48.9, 'W': 49.9, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.0, 'H': 48.9, 'W': 49.9, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3651.4, "safety_factor": 0.068, "max_disp_mm": 19.2373, "max_strain": 0.026101036894576688, "peak": {"node": 330, "coords_mm": [53.66, 1.31, 0.0], "vm_mpa": 3651.4}, "volume_mm3": 726.0, "bbox_mm": [61.1, 48.9, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 160.7, "safety_factor": 1.556, "max_disp_mm": 0.2404, "max_strain": 0.0011488301872375453, "volume_mm3": 7499.5, "bbox_mm": [61.1, 48.9, 8.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.487, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 476, "family": "plate_holes", "params": {"L": 122.3, "H": null, "W": 73.7, "T": 6.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.3, 'H': None, 'W': 73.7, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.3, 'H': None, 'W': 73.7, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 232.4, "safety_factor": 1.076, "max_disp_mm": 1.4775, "max_strain": 0.0016611838289759145, "peak": {"node": 2239, "coords_mm": [-59.76, -13.5, 0.0], "vm_mpa": 232.4}, "volume_mm3": 55795.5, "bbox_mm": [122.3, 73.7, 6.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.2, "safety_factor": 2.471, "max_disp_mm": 0.4434, "max_strain": 0.0007230560144066032, "volume_mm3": 91221.2, "bbox_mm": [122.3, 73.7, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.396, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 480, "family": "plate_holes", "params": {"L": 101.8, "H": null, "W": 53.2, "T": 3.6, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.8, 'H': None, 'W': 53.2, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.8, 'H': None, 'W': 53.2, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 391.5, "safety_factor": 0.639, "max_disp_mm": 1.8302, "max_strain": 0.0027986827920668984, "peak": {"node": 2368, "coords_mm": [-49.47, 6.05, 3.6], "vm_mpa": 391.5}, "volume_mm3": 19293.2, "bbox_mm": [101.8, 53.2, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.5, "safety_factor": 1.946, "max_disp_mm": 0.5361, "max_strain": 0.0009184089450424422, "volume_mm3": 40730.0, "bbox_mm": [101.8, 53.2, 7.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.307, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 481, "family": "l_bracket", "params": {"L": 56.2, "H": 50.5, "W": 50.8, "T": 3.8, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 56.2, 'H': 50.5, 'W': 50.8, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 56.2, 'H': 50.5, 'W': 50.8, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 217.7, "safety_factor": 1.148, "max_disp_mm": 0.644, "max_strain": 0.0015563527786048054, "peak": {"node": 1367, "coords_mm": [1.84, -30.22, 54.3], "vm_mpa": 217.7}, "volume_mm3": 21330.9, "bbox_mm": [60.0, 50.8, 54.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.4, "safety_factor": 2.765, "max_disp_mm": 0.1176, "max_strain": 0.0006462872576693103, "volume_mm3": 51633.1, "bbox_mm": [65.0, 50.8, 59.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.617, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 482, "family": "u_channel", "params": {"L": 83.7, "H": 35.3, "W": 36.2, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.7, 'H': 35.3, 'W': 36.2, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.7, 'H': 35.3, 'W': 36.2, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1885.3, "safety_factor": 0.133, "max_disp_mm": 6.0579, "max_strain": 0.013476537066202282, "peak": {"node": 282, "coords_mm": [42.84, 1.64, 3.2], "vm_mpa": 1885.3}, "volume_mm3": 815.1, "bbox_mm": [47.5, 35.3, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 133.1, "safety_factor": 1.879, "max_disp_mm": 0.1075, "max_strain": 0.0009511748402824371, "volume_mm3": 6229.5, "bbox_mm": [47.5, 35.3, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.746, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 479, "family": "rib_bracket", "params": {"L": 84.2, "H": 40.5, "W": 41.5, "T": 3.4, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.2, 'H': 40.5, 'W': 41.5, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.2, 'H': 40.5, 'W': 41.5, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 540.4, "safety_factor": 0.463, "max_disp_mm": 3.5093, "max_strain": 0.0038632140015163125, "peak": {"node": 1934, "coords_mm": [3.58, -14.72, 43.9], "vm_mpa": 540.4}, "volume_mm3": 18074.9, "bbox_mm": [87.6, 41.5, 43.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 122.3, "safety_factor": 2.044, "max_disp_mm": 0.293, "max_strain": 0.0008744530999206432, "volume_mm3": 64388.9, "bbox_mm": [95.6, 41.5, 51.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.581, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 483, "family": "rib_bracket", "params": {"L": 56.8, "H": 46.9, "W": 47.8, "T": 4.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.8, 'H': 46.9, 'W': 47.8, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.8, 'H': 46.9, 'W': 47.8, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 325.4, "safety_factor": 0.768, "max_disp_mm": 0.7591, "max_strain": 0.0023259352024813072, "peak": {"node": 1236, "coords_mm": [16.1, -3.74, 46.9], "vm_mpa": 325.4}, "volume_mm3": 22198.3, "bbox_mm": [61.1, 47.8, 51.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 88.8, "safety_factor": 2.816, "max_disp_mm": 0.1112, "max_strain": 0.0006346349287112353, "volume_mm3": 56126.8, "bbox_mm": [67.1, 47.8, 57.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.048, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 486, "family": "u_channel", "params": {"L": 96.3, "H": 41.6, "W": 42.6, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.3, 'H': 41.6, 'W': 42.6, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.3, 'H': 41.6, 'W': 42.6, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1649.3, "safety_factor": 0.152, "max_disp_mm": 4.909, "max_strain": 0.011789413014367346, "peak": {"node": 323, "coords_mm": [48.29, 1.9, 3.9], "vm_mpa": 1649.3}, "volume_mm3": 1390.2, "bbox_mm": [53.7, 41.6, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.0, "safety_factor": 1.7, "max_disp_mm": 0.1442, "max_strain": 0.0010510075789681506, "volume_mm3": 8370.1, "bbox_mm": [53.7, 41.6, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.549, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 484, "family": "plate_holes", "params": {"L": 111.3, "H": null, "W": 62.7, "T": 4.9, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.3, 'H': None, 'W': 62.7, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.3, 'H': None, 'W': 62.7, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 322.0, "safety_factor": 0.776, "max_disp_mm": 2.1939, "max_strain": 0.0023017569762110333, "peak": {"node": 3043, "coords_mm": [-54.16, -6.01, 4.9], "vm_mpa": 322.0}, "volume_mm3": 33702.1, "bbox_mm": [111.3, 62.7, 4.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.3, "safety_factor": 2.168, "max_disp_mm": 0.4876, "max_strain": 0.0008242047384281556, "volume_mm3": 61214.0, "bbox_mm": [111.3, 62.7, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.392, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 485, "family": "l_bracket", "params": {"L": 70.4, "H": 60.1, "W": 58.7, "T": 4.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 70.4, 'H': 60.1, 'W': 58.7, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 70.4, 'H': 60.1, 'W': 58.7, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 298.6, "safety_factor": 0.837, "max_disp_mm": 1.0635, "max_strain": 0.0021341318162538536, "peak": {"node": 1827, "coords_mm": [10.37, -10.83, 60.1], "vm_mpa": 298.6}, "volume_mm3": 38122.1, "bbox_mm": [75.2, 58.7, 64.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.2, "safety_factor": 2.445, "max_disp_mm": 0.1954, "max_strain": 0.000730889441804364, "volume_mm3": 80709.0, "bbox_mm": [80.2, 58.7, 69.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.608, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 487, "family": "rib_bracket", "params": {"L": 69.5, "H": 53.2, "W": 54.1, "T": 5.3, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.5, 'H': 53.2, 'W': 54.1, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.5, 'H': 53.2, 'W': 54.1, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 321.0, "safety_factor": 0.779, "max_disp_mm": 1.0672, "max_strain": 0.0022946975166586473, "peak": {"node": 2337, "coords_mm": [10.77, -1.9, 58.5], "vm_mpa": 321.0}, "volume_mm3": 36701.4, "bbox_mm": [74.8, 54.1, 58.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.2, "safety_factor": 2.29, "max_disp_mm": 0.1788, "max_strain": 0.0007805075617181254, "volume_mm3": 81918.2, "bbox_mm": [80.8, 54.1, 64.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.511, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 488, "family": "plate_holes", "params": {"L": 120.8, "H": null, "W": 72.2, "T": 6.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.8, 'H': None, 'W': 72.2, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.8, 'H': None, 'W': 72.2, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 229.3, "safety_factor": 1.09, "max_disp_mm": 1.5804, "max_strain": 0.0016389178243913854, "peak": {"node": 608, "coords_mm": [-58.29, 9.88, 0.0], "vm_mpa": 229.3}, "volume_mm3": 52244.6, "bbox_mm": [120.8, 72.2, 6.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.3, "safety_factor": 2.493, "max_disp_mm": 0.4598, "max_strain": 0.0007168256571524652, "volume_mm3": 86503.3, "bbox_mm": [120.8, 72.2, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.403, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 490, "family": "u_channel", "params": {"L": 109.0, "H": 48.0, "W": 48.9, "T": 4.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.0, 'H': 48.0, 'W': 48.9, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.0, 'H': 48.0, 'W': 48.9, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 815.3, "safety_factor": 0.307, "max_disp_mm": 2.6747, "max_strain": 0.005827576269257913, "peak": {"node": 308, "coords_mm": [54.79, 2.18, 0.0], "vm_mpa": 815.3}, "volume_mm3": 2097.9, "bbox_mm": [60.1, 48.0, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.8, "safety_factor": 2.582, "max_disp_mm": 0.1089, "max_strain": 0.0006921316248490889, "volume_mm3": 10760.4, "bbox_mm": [60.1, 48.0, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.275, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 489, "family": "l_bracket", "params": {"L": 84.7, "H": 69.6, "W": 66.6, "T": 5.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 84.7, 'H': 69.6, 'W': 66.6, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 84.7, 'H': 69.6, 'W': 66.6, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 226.5, "safety_factor": 1.104, "max_disp_mm": 1.0154, "max_strain": 0.0016188734759312307, "peak": {"node": 2300, "coords_mm": [9.6, -4.58, 69.6], "vm_mpa": 226.5}, "volume_mm3": 60739.2, "bbox_mm": [90.4, 66.6, 75.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.0, "safety_factor": 2.747, "max_disp_mm": 0.2304, "max_strain": 0.0006506187205233213, "volume_mm3": 117582.3, "bbox_mm": [95.4, 66.6, 80.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.643, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 492, "family": "plate_holes", "params": {"L": 100.3, "H": null, "W": 51.7, "T": 3.4, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.3, 'H': None, 'W': 51.7, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.3, 'H': None, 'W': 51.7, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 410.5, "safety_factor": 0.609, "max_disp_mm": 2.488, "max_strain": 0.0029341213050640314, "peak": {"node": 104, "coords_mm": [-50.15, 3.69, 3.4], "vm_mpa": 410.5}, "volume_mm3": 17438.5, "bbox_mm": [100.3, 51.7, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 135.9, "safety_factor": 1.839, "max_disp_mm": 0.562, "max_strain": 0.0009717679317687181, "volume_mm3": 37954.3, "bbox_mm": [100.3, 51.7, 7.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.23, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 493, "family": "l_bracket", "params": {"L": 54.0, "H": 49.1, "W": 49.6, "T": 3.7, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 54.0, 'H': 49.1, 'W': 49.6, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 54.0, 'H': 49.1, 'W': 49.6, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 230.4, "safety_factor": 1.085, "max_disp_mm": 0.566, "max_strain": 0.0016468263660379134, "peak": {"node": 1743, "coords_mm": [3.71, -2.02, 52.8], "vm_mpa": 230.4}, "volume_mm3": 19599.9, "bbox_mm": [57.7, 49.6, 52.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 82.2, "safety_factor": 3.043, "max_disp_mm": 0.1114, "max_strain": 0.000587316050347419, "volume_mm3": 48243.9, "bbox_mm": [62.7, 49.6, 57.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.958, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 491, "family": "rib_bracket", "params": {"L": 82.2, "H": 59.5, "W": 40.5, "T": 3.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.2, 'H': 59.5, 'W': 40.5, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.2, 'H': 59.5, 'W': 40.5, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 670.3, "safety_factor": 0.373, "max_disp_mm": 5.0201, "max_strain": 0.00479158350095993, "peak": {"node": 2043, "coords_mm": [3.34, -28.73, 62.7], "vm_mpa": 670.3}, "volume_mm3": 18779.0, "bbox_mm": [85.4, 40.5, 62.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 133.1, "safety_factor": 1.879, "max_disp_mm": 0.2962, "max_strain": 0.0009512923242241953, "volume_mm3": 69355.4, "bbox_mm": [93.4, 40.5, 70.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.506, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 494, "family": "u_channel", "params": {"L": 81.7, "H": 34.3, "W": 35.2, "T": 3.1, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.7, 'H': 34.3, 'W': 35.2, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.7, 'H': 34.3, 'W': 35.2, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2045.6, "safety_factor": 0.122, "max_disp_mm": 6.4152, "max_strain": 0.014621942134076906, "peak": {"node": 240, "coords_mm": [46.53, 1.58, 0.0], "vm_mpa": 2045.6}, "volume_mm3": 746.7, "bbox_mm": [46.5, 34.3, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.6, "safety_factor": 1.959, "max_disp_mm": 0.1048, "max_strain": 0.0009123035521959574, "volume_mm3": 5937.5, "bbox_mm": [46.5, 34.3, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.837, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 495, "family": "rib_bracket", "params": {"L": 54.9, "H": 45.9, "W": 46.8, "T": 4.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.9, 'H': 45.9, 'W': 46.8, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.9, 'H': 45.9, 'W': 46.8, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 286.5, "safety_factor": 0.873, "max_disp_mm": 0.7037, "max_strain": 0.002047729264082353, "peak": {"node": 1554, "coords_mm": [6.4, -23.4, 50.1], "vm_mpa": 286.5}, "volume_mm3": 20638.8, "bbox_mm": [59.1, 46.8, 50.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 87.2, "safety_factor": 2.867, "max_disp_mm": 0.106, "max_strain": 0.0006232535837865354, "volume_mm3": 52987.0, "bbox_mm": [65.1, 46.8, 56.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.995, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 496, "family": "plate_holes", "params": {"L": 109.8, "H": null, "W": 61.2, "T": 4.7, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.8, 'H': None, 'W': 61.2, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.8, 'H': None, 'W': 61.2, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 336.4, "safety_factor": 0.743, "max_disp_mm": 2.4187, "max_strain": 0.002404649663858354, "peak": {"node": 1357, "coords_mm": [-52.37, -7.54, 0.0], "vm_mpa": 336.4}, "volume_mm3": 31110.4, "bbox_mm": [109.8, 61.2, 4.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.7, "safety_factor": 2.218, "max_disp_mm": 0.5075, "max_strain": 0.0008058344141140501, "volume_mm3": 57587.3, "bbox_mm": [109.8, 61.2, 8.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.474, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 498, "family": "u_channel", "params": {"L": 94.4, "H": 40.6, "W": 41.6, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.4, 'H': 40.6, 'W': 41.6, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.4, 'H': 40.6, 'W': 41.6, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1594.6, "safety_factor": 0.157, "max_disp_mm": 5.2156, "max_strain": 0.0113983941167065, "peak": {"node": 80, "coords_mm": [50.3, 3.8, 3.8], "vm_mpa": 1594.6}, "volume_mm3": 1293.8, "bbox_mm": [52.8, 40.6, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 161.1, "safety_factor": 1.552, "max_disp_mm": 0.1426, "max_strain": 0.0011514495120500303, "volume_mm3": 8028.9, "bbox_mm": [52.8, 40.6, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.395, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 497, "family": "l_bracket", "params": {"L": 68.2, "H": 58.6, "W": 57.5, "T": 4.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.2, 'H': 58.6, 'W': 57.5, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.2, 'H': 58.6, 'W': 57.5, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 320.7, "safety_factor": 0.78, "max_disp_mm": 1.1201, "max_strain": 0.002292434517787222, "peak": {"node": 2460, "coords_mm": [7.03, -3.94, 63.2], "vm_mpa": 320.7}, "volume_mm3": 34755.3, "bbox_mm": [72.8, 57.5, 63.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.2, "safety_factor": 2.471, "max_disp_mm": 0.1914, "max_strain": 0.0007232264903959174, "volume_mm3": 75292.8, "bbox_mm": [77.8, 57.5, 68.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.691, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 499, "family": "rib_bracket", "params": {"L": 67.5, "H": 52.2, "W": 53.2, "T": 5.1, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.5, 'H': 52.2, 'W': 53.2, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.5, 'H': 52.2, 'W': 53.2, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 316.0, "safety_factor": 0.791, "max_disp_mm": 1.127, "max_strain": 0.0022584685660923154, "peak": {"node": 1204, "coords_mm": [11.08, -47.46, 52.2], "vm_mpa": 316.0}, "volume_mm3": 33860.7, "bbox_mm": [72.6, 53.2, 57.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.6, "safety_factor": 2.219, "max_disp_mm": 0.1756, "max_strain": 0.0008052289416393281, "volume_mm3": 77240.0, "bbox_mm": [78.6, 53.2, 63.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.428, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 500, "family": "plate_holes", "params": {"L": 119.3, "H": null, "W": 70.7, "T": 5.9, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.3, 'H': None, 'W': 70.7, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.3, 'H': None, 'W': 70.7, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 270.7, "safety_factor": 0.924, "max_disp_mm": 1.7034, "max_strain": 0.0019348828417478235, "peak": {"node": 652, "coords_mm": [-57.96, -14.64, 0.0], "vm_mpa": 270.7}, "volume_mm3": 48836.8, "bbox_mm": [119.3, 70.7, 5.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.4, "safety_factor": 2.394, "max_disp_mm": 0.4777, "max_strain": 0.0007463450435535709, "volume_mm3": 81946.6, "bbox_mm": [119.3, 70.7, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.471, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 502, "family": "u_channel", "params": {"L": 107.0, "H": 47.0, "W": 47.9, "T": 4.4, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.0, 'H': 47.0, 'W': 47.9, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.0, 'H': 47.0, 'W': 47.9, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1329.2, "safety_factor": 0.188, "max_disp_mm": 4.0295, "max_strain": 0.00950150282646171, "peak": {"node": 354, "coords_mm": [56.45, 2.12, 4.4], "vm_mpa": 1329.2}, "volume_mm3": 1968.9, "bbox_mm": [59.1, 47.0, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 141.8, "safety_factor": 1.764, "max_disp_mm": 0.1592, "max_strain": 0.0010132521929513303, "volume_mm3": 10350.9, "bbox_mm": [59.1, 47.0, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.576, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 501, "family": "l_bracket", "params": {"L": 82.5, "H": 68.1, "W": 65.4, "T": 5.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.5, 'H': 68.1, 'W': 65.4, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.5, 'H': 68.1, 'W': 65.4, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 241.1, "safety_factor": 1.037, "max_disp_mm": 1.005, "max_strain": 0.0017234799877274274, "peak": {"node": 2299, "coords_mm": [8.96, -21.77, 68.1], "vm_mpa": 241.1}, "volume_mm3": 57206.7, "bbox_mm": [88.1, 65.4, 73.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.4, "safety_factor": 2.706, "max_disp_mm": 0.2232, "max_strain": 0.0006605176591946569, "volume_mm3": 111750.3, "bbox_mm": [93.1, 65.4, 78.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.669, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 505, "family": "l_bracket", "params": {"L": 51.7, "H": 47.6, "W": 48.3, "T": 3.5, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 51.7, 'H': 47.6, 'W': 48.3, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 51.7, 'H': 47.6, 'W': 48.3, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 251.3, "safety_factor": 0.995, "max_disp_mm": 0.527, "max_strain": 0.0017964014199215014, "peak": {"node": 1559, "coords_mm": [2.1, -30.2, 51.1], "vm_mpa": 251.3}, "volume_mm3": 17378.3, "bbox_mm": [55.2, 48.3, 51.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 86.1, "safety_factor": 2.904, "max_disp_mm": 0.1073, "max_strain": 0.000615276482944985, "volume_mm3": 44257.3, "bbox_mm": [60.2, 48.3, 56.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.91, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 503, "family": "rib_bracket", "params": {"L": 80.2, "H": 58.5, "W": 59.5, "T": 3.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.2, 'H': 58.5, 'W': 59.5, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.2, 'H': 58.5, 'W': 59.5, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 435.1, "safety_factor": 0.575, "max_disp_mm": 2.5437, "max_strain": 0.00311007550917824, "peak": {"node": 2489, "coords_mm": [2.15, -11.15, 61.6], "vm_mpa": 435.1}, "volume_mm3": 26155.0, "bbox_mm": [83.3, 59.5, 61.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.9, "safety_factor": 2.05, "max_disp_mm": 0.3126, "max_strain": 0.0008717063421468664, "volume_mm3": 80026.3, "bbox_mm": [89.3, 59.5, 67.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.475, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 506, "family": "u_channel", "params": {"L": 79.7, "H": 33.3, "W": 34.2, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.7, 'H': 33.3, 'W': 34.2, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.7, 'H': 33.3, 'W': 34.2, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2229.8, "safety_factor": 0.112, "max_disp_mm": 5.4217, "max_strain": 0.015938857001988986, "peak": {"node": 230, "coords_mm": [38.1, 1.5, 0.0], "vm_mpa": 2229.8}, "volume_mm3": 682.2, "bbox_mm": [45.5, 33.3, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.9, "safety_factor": 2.454, "max_disp_mm": 0.0824, "max_strain": 0.0007281153122323783, "volume_mm3": 5653.8, "bbox_mm": [45.5, 33.3, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.342, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 504, "family": "plate_holes", "params": {"L": 128.8, "H": null, "W": 50.2, "T": 3.2, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.8, 'H': None, 'W': 50.2, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.8, 'H': None, 'W': 50.2, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 601.2, "safety_factor": 0.416, "max_disp_mm": 6.0697, "max_strain": 0.0042973654091233585, "peak": {"node": 1555, "coords_mm": [-62.73, 14.67, 0.0], "vm_mpa": 601.2}, "volume_mm3": 20509.5, "bbox_mm": [128.8, 50.2, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.4, "safety_factor": 1.978, "max_disp_mm": 0.6897, "max_strain": 0.0009033825223236104, "volume_mm3": 58964.7, "bbox_mm": [128.8, 50.2, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.562, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 507, "family": "rib_bracket", "params": {"L": 52.9, "H": 44.9, "W": 45.8, "T": 4.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.9, 'H': 44.9, 'W': 45.8, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.9, 'H': 44.9, 'W': 45.8, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 230.7, "safety_factor": 1.084, "max_disp_mm": 0.52, "max_strain": 0.0016492726019281027, "peak": {"node": 1635, "coords_mm": [3.18, -38.58, 48.9], "vm_mpa": 230.7}, "volume_mm3": 18649.8, "bbox_mm": [56.9, 45.8, 48.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 89.1, "safety_factor": 2.805, "max_disp_mm": 0.1028, "max_strain": 0.0006371379163394793, "volume_mm3": 49372.4, "bbox_mm": [62.9, 45.8, 54.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.721, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 510, "family": "u_channel", "params": {"L": 92.4, "H": 39.6, "W": 40.6, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.4, 'H': 39.6, 'W': 40.6, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.4, 'H': 39.6, 'W': 40.6, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1546.9, "safety_factor": 0.162, "max_disp_mm": 4.691, "max_strain": 0.011057421624402196, "peak": {"node": 309, "coords_mm": [47.6, 1.96, 3.7], "vm_mpa": 1546.9}, "volume_mm3": 1200.6, "bbox_mm": [51.8, 39.6, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.4, "safety_factor": 2.06, "max_disp_mm": 0.1161, "max_strain": 0.0008676262290417846, "volume_mm3": 7687.2, "bbox_mm": [51.8, 39.6, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.898, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 508, "family": "plate_holes", "params": {"L": 108.3, "H": null, "W": 59.7, "T": 4.5, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.3, 'H': None, 'W': 59.7, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.3, 'H': None, 'W': 59.7, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 362.3, "safety_factor": 0.69, "max_disp_mm": 2.6144, "max_strain": 0.0025898441231484094, "peak": {"node": 1271, "coords_mm": [-52.01, 1.23, 0.0], "vm_mpa": 362.3}, "volume_mm3": 28642.4, "bbox_mm": [108.3, 59.7, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.8, "safety_factor": 2.019, "max_disp_mm": 0.532, "max_strain": 0.0008852262809968892, "volume_mm3": 54102.3, "bbox_mm": [108.3, 59.7, 8.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.329, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 509, "family": "l_bracket", "params": {"L": 66.0, "H": 57.1, "W": 56.2, "T": 4.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.0, 'H': 57.1, 'W': 56.2, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.0, 'H': 57.1, 'W': 56.2, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 343.7, "safety_factor": 0.727, "max_disp_mm": 1.0865, "max_strain": 0.002457054546742066, "peak": {"node": 2329, "coords_mm": [7.34, -36.58, 61.6], "vm_mpa": 343.7}, "volume_mm3": 32270.0, "bbox_mm": [70.5, 56.2, 61.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.3, "safety_factor": 2.444, "max_disp_mm": 0.1838, "max_strain": 0.0007311479850197868, "volume_mm3": 70795.1, "bbox_mm": [75.5, 56.2, 66.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.717, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 511, "family": "rib_bracket", "params": {"L": 65.5, "H": 51.2, "W": 52.2, "T": 5.0, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.5, 'H': 51.2, 'W': 52.2, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.5, 'H': 51.2, 'W': 52.2, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 343.7, "safety_factor": 0.727, "max_disp_mm": 1.1214, "max_strain": 0.0024564867689962425, "peak": {"node": 1375, "coords_mm": [9.43, -20.28, 51.2], "vm_mpa": 343.7}, "volume_mm3": 31763.7, "bbox_mm": [70.5, 52.2, 56.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.6, "safety_factor": 2.219, "max_disp_mm": 0.1686, "max_strain": 0.0008051959815927206, "volume_mm3": 73325.3, "bbox_mm": [76.5, 52.2, 62.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.492, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 512, "family": "plate_holes", "params": {"L": 117.8, "H": null, "W": 69.2, "T": 5.7, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.8, 'H': None, 'W': 69.2, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.8, 'H': None, 'W': 69.2, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 269.0, "safety_factor": 0.929, "max_disp_mm": 1.8559, "max_strain": 0.0019230479239568522, "peak": {"node": 2012, "coords_mm": [-57.31, -13.59, 0.0], "vm_mpa": 269.0}, "volume_mm3": 45569.7, "bbox_mm": [117.8, 69.2, 5.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.1, "safety_factor": 2.292, "max_disp_mm": 0.5, "max_strain": 0.0007796965883760892, "volume_mm3": 77548.4, "bbox_mm": [117.8, 69.2, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.363, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 514, "family": "u_channel", "params": {"L": 105.0, "H": 46.0, "W": 46.9, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.0, 'H': 46.0, 'W': 46.9, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.0, 'H': 46.0, 'W': 46.9, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1381.9, "safety_factor": 0.181, "max_disp_mm": 4.2996, "max_strain": 0.009877956233269557, "peak": {"node": 109, "coords_mm": [53.65, 4.3, 0.0], "vm_mpa": 1381.9}, "volume_mm3": 1845.3, "bbox_mm": [58.1, 46.0, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 150.4, "safety_factor": 1.662, "max_disp_mm": 0.1582, "max_strain": 0.001075401455652527, "volume_mm3": 9951.2, "bbox_mm": [58.1, 46.0, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.481, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 513, "family": "l_bracket", "params": {"L": 80.2, "H": 66.6, "W": 64.2, "T": 5.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.2, 'H': 66.6, 'W': 64.2, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.2, 'H': 66.6, 'W': 64.2, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 250.4, "safety_factor": 0.998, "max_disp_mm": 1.0281, "max_strain": 0.0017899317927892084, "peak": {"node": 2722, "coords_mm": [6.44, -40.61, 72.0], "vm_mpa": 250.4}, "volume_mm3": 52764.7, "bbox_mm": [85.6, 64.2, 72.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.3, "safety_factor": 2.769, "max_disp_mm": 0.2206, "max_strain": 0.0006452843858259254, "volume_mm3": 104959.3, "bbox_mm": [90.6, 64.2, 77.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.771, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 518, "family": "u_channel", "params": {"L": 77.7, "H": 32.3, "W": 33.2, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.7, 'H': 32.3, 'W': 33.2, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.7, 'H': 32.3, 'W': 33.2, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2008.0, "safety_factor": 0.125, "max_disp_mm": 5.1885, "max_strain": 0.014353579876435985, "peak": {"node": 259, "coords_mm": [39.62, 1.48, 2.9], "vm_mpa": 2008.0}, "volume_mm3": 621.5, "bbox_mm": [44.5, 32.3, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.4, "safety_factor": 2.372, "max_disp_mm": 0.0806, "max_strain": 0.0007533220094702885, "volume_mm3": 5378.4, "bbox_mm": [44.5, 32.3, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.248, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 516, "family": "plate_holes", "params": {"L": 127.3, "H": null, "W": 78.7, "T": 3.0, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.3, 'H': None, 'W': 78.7, 'T': 3.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.3, 'H': None, 'W': 78.7, 'T': 3.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 418.9, "safety_factor": 0.597, "max_disp_mm": 4.3922, "max_strain": 0.0029940718939872324, "peak": {"node": 2284, "coords_mm": [-62.0, -28.41, 0.0], "vm_mpa": 418.9}, "volume_mm3": 29885.9, "bbox_mm": [127.3, 78.7, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 130.7, "safety_factor": 1.913, "max_disp_mm": 0.8399, "max_strain": 0.0009342161922926692, "volume_mm3": 69733.7, "bbox_mm": [127.3, 78.7, 7.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.316, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 517, "family": "l_bracket", "params": {"L": 94.5, "H": 46.1, "W": 47.1, "T": 3.4, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.5, 'H': 46.1, 'W': 47.1, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.5, 'H': 46.1, 'W': 47.1, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 371.5, "safety_factor": 0.673, "max_disp_mm": 3.3886, "max_strain": 0.0026553622674866193, "peak": {"node": 2072, "coords_mm": [2.13, -30.99, 49.5], "vm_mpa": 371.5}, "volume_mm3": 23060.2, "bbox_mm": [97.9, 47.1, 49.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 165.6, "safety_factor": 1.51, "max_disp_mm": 0.6187, "max_strain": 0.0011835178342177474, "volume_mm3": 58950.4, "bbox_mm": [102.9, 47.1, 54.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 0.837, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 519, "family": "rib_bracket", "params": {"L": 50.9, "H": 43.9, "W": 44.8, "T": 3.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.9, 'H': 43.9, 'W': 44.8, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.9, 'H': 43.9, 'W': 44.8, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 229.9, "safety_factor": 1.087, "max_disp_mm": 0.5118, "max_strain": 0.0016432521975717096, "peak": {"node": 1508, "coords_mm": [3.31, -29.86, 47.8], "vm_mpa": 229.9}, "volume_mm3": 17244.9, "bbox_mm": [54.8, 44.8, 47.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 94.0, "safety_factor": 2.658, "max_disp_mm": 0.0965, "max_strain": 0.0006722769087403378, "volume_mm3": 46436.5, "bbox_mm": [60.8, 44.8, 53.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.571, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 522, "family": "u_channel", "params": {"L": 90.4, "H": 38.6, "W": 39.6, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.4, 'H': 38.6, 'W': 39.6, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.4, 'H': 38.6, 'W': 39.6, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1582.3, "safety_factor": 0.158, "max_disp_mm": 4.7972, "max_strain": 0.01131045341234382, "peak": {"node": 300, "coords_mm": [43.24, 1.42, 3.6], "vm_mpa": 1582.3}, "volume_mm3": 1112.0, "bbox_mm": [50.8, 38.6, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.9, "safety_factor": 2.102, "max_disp_mm": 0.1121, "max_strain": 0.0008501855672635366, "volume_mm3": 7354.4, "bbox_mm": [50.8, 38.6, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.944, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 520, "family": "plate_holes", "params": {"L": 106.8, "H": null, "W": 58.2, "T": 4.3, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.8, 'H': None, 'W': 58.2, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.8, 'H': None, 'W': 58.2, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 383.1, "safety_factor": 0.653, "max_disp_mm": 2.7604, "max_strain": 0.0027386074733515156, "peak": {"node": 1614, "coords_mm": [-51.3, 8.49, 4.3], "vm_mpa": 383.1}, "volume_mm3": 26295.5, "bbox_mm": [106.8, 58.2, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.5, "safety_factor": 1.93, "max_disp_mm": 0.5599, "max_strain": 0.0009259515984074057, "volume_mm3": 50756.4, "bbox_mm": [106.8, 58.2, 8.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.277, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 521, "family": "l_bracket", "params": {"L": 63.7, "H": 55.6, "W": 55.0, "T": 4.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 63.7, 'H': 55.6, 'W': 55.0, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 63.7, 'H': 55.6, 'W': 55.0, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 228.2, "safety_factor": 1.095, "max_disp_mm": 0.7054, "max_strain": 0.0016315357999941208, "peak": {"node": 2033, "coords_mm": [12.46, -36.74, 59.9], "vm_mpa": 228.2}, "volume_mm3": 29231.4, "bbox_mm": [68.0, 55.0, 59.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 80.1, "safety_factor": 3.122, "max_disp_mm": 0.1346, "max_strain": 0.0005723464143881123, "volume_mm3": 65778.9, "bbox_mm": [73.0, 55.0, 64.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.027, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 523, "family": "rib_bracket", "params": {"L": 63.5, "H": 50.2, "W": 51.2, "T": 4.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.5, 'H': 50.2, 'W': 51.2, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.5, 'H': 50.2, 'W': 51.2, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 385.4, "safety_factor": 0.649, "max_disp_mm": 1.1574, "max_strain": 0.0027551718979515766, "peak": {"node": 1132, "coords_mm": [9.34, -34.22, 50.2], "vm_mpa": 385.4}, "volume_mm3": 29122.6, "bbox_mm": [68.3, 51.2, 55.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.6, "safety_factor": 2.241, "max_disp_mm": 0.1657, "max_strain": 0.0007973889491894988, "volume_mm3": 68843.5, "bbox_mm": [74.3, 51.2, 61.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.592, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 524, "family": "plate_holes", "params": {"L": 116.3, "H": null, "W": 67.7, "T": 5.5, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.3, 'H': None, 'W': 67.7, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.3, 'H': None, 'W': 67.7, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 290.8, "safety_factor": 0.86, "max_disp_mm": 2.0187, "max_strain": 0.0020787405343412903, "peak": {"node": 3317, "coords_mm": [-56.17, 6.23, 5.5], "vm_mpa": 290.8}, "volume_mm3": 42440.4, "bbox_mm": [116.3, 67.7, 5.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.8, "safety_factor": 2.159, "max_disp_mm": 0.5191, "max_strain": 0.0008276180236855842, "volume_mm3": 73306.1, "bbox_mm": [116.3, 67.7, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.3, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 526, "family": "u_channel", "params": {"L": 103.0, "H": 45.0, "W": 45.9, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.0, 'H': 45.0, 'W': 45.9, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.0, 'H': 45.0, 'W': 45.9, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1618.9, "safety_factor": 0.154, "max_disp_mm": 4.5515, "max_strain": 0.011572134457543013, "peak": {"node": 285, "coords_mm": [53.87, 2.2, 0.0], "vm_mpa": 1618.9}, "volume_mm3": 1727.0, "bbox_mm": [57.1, 45.0, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 151.5, "safety_factor": 1.651, "max_disp_mm": 0.1544, "max_strain": 0.001082687059059899, "volume_mm3": 9561.3, "bbox_mm": [57.1, 45.0, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.496, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 525, "family": "l_bracket", "params": {"L": 78.0, "H": 65.1, "W": 62.9, "T": 5.3, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.0, 'H': 65.1, 'W': 62.9, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.0, 'H': 65.1, 'W': 62.9, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 257.1, "safety_factor": 0.972, "max_disp_mm": 1.0397, "max_strain": 0.001837647162549757, "peak": {"node": 1239, "coords_mm": [7.23, -30.22, 65.1], "vm_mpa": 257.1}, "volume_mm3": 49472.1, "bbox_mm": [83.3, 62.9, 70.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.6, "safety_factor": 2.51, "max_disp_mm": 0.2138, "max_strain": 0.0007120735439242908, "volume_mm3": 99383.3, "bbox_mm": [88.3, 62.9, 75.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.537, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 527, "family": "rib_bracket", "params": {"L": 76.2, "H": 56.6, "W": 57.5, "T": 5.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.2, 'H': 56.6, 'W': 57.5, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.2, 'H': 56.6, 'W': 57.5, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 286.7, "safety_factor": 0.872, "max_disp_mm": 1.0446, "max_strain": 0.002049297445418951, "peak": {"node": 1758, "coords_mm": [9.62, -32.52, 56.6], "vm_mpa": 286.7}, "volume_mm3": 46223.1, "bbox_mm": [82.0, 57.5, 62.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.5, "safety_factor": 2.414, "max_disp_mm": 0.194, "max_strain": 0.0007401852099296161, "volume_mm3": 98111.1, "bbox_mm": [88.0, 57.5, 68.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.542, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 530, "family": "u_channel", "params": {"L": 75.7, "H": 31.3, "W": 32.3, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.7, 'H': 31.3, 'W': 32.3, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.7, 'H': 31.3, 'W': 32.3, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2122.9, "safety_factor": 0.118, "max_disp_mm": 5.5473, "max_strain": 0.0151748532282058, "peak": {"node": 232, "coords_mm": [36.15, 1.44, 0.0], "vm_mpa": 2122.9}, "volume_mm3": 563.7, "bbox_mm": [43.4, 31.3, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.1, "safety_factor": 2.523, "max_disp_mm": 0.0772, "max_strain": 0.0007083880211931901, "volume_mm3": 5103.3, "bbox_mm": [43.4, 31.3, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.405, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 529, "family": "l_bracket", "params": {"L": 92.2, "H": 74.6, "W": 45.8, "T": 3.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.2, 'H': 74.6, 'W': 45.8, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.2, 'H': 74.6, 'W': 45.8, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 513.3, "safety_factor": 0.487, "max_disp_mm": 3.4972, "max_strain": 0.003669131964834371, "peak": {"node": 2579, "coords_mm": [1.81, -34.95, 77.8], "vm_mpa": 513.3}, "volume_mm3": 24915.2, "bbox_mm": [95.4, 45.8, 77.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.7, "safety_factor": 1.989, "max_disp_mm": 0.3627, "max_strain": 0.0008984835242034826, "volume_mm3": 82687.3, "bbox_mm": [102.4, 45.8, 84.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.502, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 531, "family": "rib_bracket", "params": {"L": 48.9, "H": 42.9, "W": 43.8, "T": 3.7, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.9, 'H': 42.9, 'W': 43.8, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.9, 'H': 42.9, 'W': 43.8, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 275.7, "safety_factor": 0.907, "max_disp_mm": 0.5463, "max_strain": 0.0019705000428141177, "peak": {"node": 1057, "coords_mm": [2.11, -30.42, 46.6], "vm_mpa": 275.7}, "volume_mm3": 15476.7, "bbox_mm": [52.6, 43.8, 46.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.1, "safety_factor": 2.575, "max_disp_mm": 0.0935, "max_strain": 0.0006939940111810494, "volume_mm3": 43123.3, "bbox_mm": [58.6, 43.8, 52.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.668, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 532, "family": "plate_holes", "params": {"L": 105.3, "H": null, "W": 56.7, "T": 4.1, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.3, 'H': None, 'W': 56.7, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.3, 'H': None, 'W': 56.7, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 393.2, "safety_factor": 0.636, "max_disp_mm": 2.7701, "max_strain": 0.0028107574959285427, "peak": {"node": 1531, "coords_mm": [-35.51, 24.89, 0.0], "vm_mpa": 393.2}, "volume_mm3": 24066.9, "bbox_mm": [105.3, 56.7, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 138.6, "safety_factor": 1.804, "max_disp_mm": 0.5913, "max_strain": 0.000990502956217949, "volume_mm3": 47546.8, "bbox_mm": [105.3, 56.7, 8.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.168, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 534, "family": "u_channel", "params": {"L": 88.4, "H": 37.6, "W": 38.6, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.4, 'H': 37.6, 'W': 38.6, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.4, 'H': 37.6, 'W': 38.6, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1732.3, "safety_factor": 0.144, "max_disp_mm": 5.1554, "max_strain": 0.012382958411523853, "peak": {"node": 94, "coords_mm": [44.54, 3.5, 0.0], "vm_mpa": 1732.3}, "volume_mm3": 1027.8, "bbox_mm": [49.8, 37.6, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.3, "safety_factor": 2.061, "max_disp_mm": 0.1115, "max_strain": 0.0008670322470143713, "volume_mm3": 7030.5, "bbox_mm": [49.8, 37.6, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.917, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 533, "family": "l_bracket", "params": {"L": 61.5, "H": 54.1, "W": 53.8, "T": 4.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.5, 'H': 54.1, 'W': 53.8, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.5, 'H': 54.1, 'W': 53.8, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 258.1, "safety_factor": 0.969, "max_disp_mm": 0.7121, "max_strain": 0.0018446325021518404, "peak": {"node": 1479, "coords_mm": [5.65, -40.35, 54.1], "vm_mpa": 258.1}, "volume_mm3": 27070.0, "bbox_mm": [65.7, 53.8, 58.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 81.3, "safety_factor": 3.077, "max_disp_mm": 0.1284, "max_strain": 0.0005808624972410402, "volume_mm3": 61771.0, "bbox_mm": [70.7, 53.8, 63.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.108, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 535, "family": "rib_bracket", "params": {"L": 61.6, "H": 49.2, "W": 50.2, "T": 4.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.6, 'H': 49.2, 'W': 50.2, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.6, 'H': 49.2, 'W': 50.2, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 388.1, "safety_factor": 0.644, "max_disp_mm": 1.1462, "max_strain": 0.0027742074708847738, "peak": {"node": 1298, "coords_mm": [6.72, -5.98, 49.2], "vm_mpa": 388.1}, "volume_mm3": 27251.1, "bbox_mm": [66.3, 50.2, 53.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.4, "safety_factor": 2.186, "max_disp_mm": 0.1594, "max_strain": 0.0008174189376566104, "volume_mm3": 65262.5, "bbox_mm": [72.3, 50.2, 59.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.542, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 536, "family": "plate_holes", "params": {"L": 114.8, "H": null, "W": 66.2, "T": 5.4, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.8, 'H': None, 'W': 66.2, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.8, 'H': None, 'W': 66.2, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 310.6, "safety_factor": 0.805, "max_disp_mm": 2.0998, "max_strain": 0.002220264759614997, "peak": {"node": 569, "coords_mm": [-55.45, 9.91, 0.0], "vm_mpa": 310.6}, "volume_mm3": 40190.5, "bbox_mm": [114.8, 66.2, 5.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.5, "safety_factor": 2.165, "max_disp_mm": 0.5258, "max_strain": 0.0008255309993734839, "volume_mm3": 69961.2, "bbox_mm": [114.8, 66.2, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.36, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 538, "family": "u_channel", "params": {"L": 101.1, "H": 44.0, "W": 44.9, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.1, 'H': 44.0, 'W': 44.9, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.1, 'H': 44.0, 'W': 44.9, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1584.9, "safety_factor": 0.158, "max_disp_mm": 4.7257, "max_strain": 0.011329122710895657, "peak": {"node": 289, "coords_mm": [58.08, 2.02, 0.0], "vm_mpa": 1584.9}, "volume_mm3": 1615.4, "bbox_mm": [56.2, 44.0, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.3, "safety_factor": 1.708, "max_disp_mm": 0.1544, "max_strain": 0.0010459904347469144, "volume_mm3": 9191.1, "bbox_mm": [56.2, 44.0, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.551, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 537, "family": "l_bracket", "params": {"L": 75.8, "H": 63.6, "W": 61.7, "T": 5.1, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 75.8, 'H': 63.6, 'W': 61.7, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 75.8, 'H': 63.6, 'W': 61.7, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 272.6, "safety_factor": 0.917, "max_disp_mm": 1.0717, "max_strain": 0.0019482556877692414, "peak": {"node": 2425, "coords_mm": [8.49, -34.71, 68.7], "vm_mpa": 272.6}, "volume_mm3": 45469.8, "bbox_mm": [80.9, 61.7, 68.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 94.7, "safety_factor": 2.641, "max_disp_mm": 0.2111, "max_strain": 0.0006767478772612245, "volume_mm3": 93163.9, "bbox_mm": [85.9, 61.7, 73.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.723, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 539, "family": "rib_bracket", "params": {"L": 74.2, "H": 55.6, "W": 56.5, "T": 5.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.2, 'H': 55.6, 'W': 56.5, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.2, 'H': 55.6, 'W': 56.5, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 302.7, "safety_factor": 0.826, "max_disp_mm": 1.0778, "max_strain": 0.0021633890016429036, "peak": {"node": 1021, "coords_mm": [7.56, -23.2, 55.6], "vm_mpa": 302.7}, "volume_mm3": 42840.6, "bbox_mm": [79.8, 56.5, 61.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.4, "safety_factor": 2.305, "max_disp_mm": 0.191, "max_strain": 0.0007751229630354406, "volume_mm3": 92673.6, "bbox_mm": [85.8, 56.5, 67.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.479, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 542, "family": "u_channel", "params": {"L": 113.7, "H": 30.3, "W": 31.3, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.7, 'H': 30.3, 'W': 31.3, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.7, 'H': 30.3, 'W': 31.3, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4347.3, "safety_factor": 0.058, "max_disp_mm": 43.0618, "max_strain": 0.031075338973665982, "peak": {"node": 65, "coords_mm": [36.49, 2.7, 2.7], "vm_mpa": 4347.3}, "volume_mm3": 801.9, "bbox_mm": [82.4, 30.3, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 137.9, "safety_factor": 1.812, "max_disp_mm": 0.2621, "max_strain": 0.0009860181421829926, "volume_mm3": 11678.0, "bbox_mm": [82.4, 30.3, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.755, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 543, "family": "rib_bracket", "params": {"L": 46.9, "H": 41.9, "W": 42.8, "T": 3.6, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.9, 'H': 41.9, 'W': 42.8, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.9, 'H': 41.9, 'W': 42.8, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 309.6, "safety_factor": 0.808, "max_disp_mm": 0.4879, "max_strain": 0.0022129809449517993, "peak": {"node": 1357, "coords_mm": [1.83, -13.06, 45.5], "vm_mpa": 309.6}, "volume_mm3": 14237.0, "bbox_mm": [50.5, 42.8, 45.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.7, "safety_factor": 2.696, "max_disp_mm": 0.0878, "max_strain": 0.0006627972377273004, "volume_mm3": 40430.6, "bbox_mm": [56.5, 42.8, 51.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.889, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 541, "family": "l_bracket", "params": {"L": 90.0, "H": 73.1, "W": 69.6, "T": 3.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.0, 'H': 73.1, 'W': 69.6, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.0, 'H': 73.1, 'W': 69.6, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 329.5, "safety_factor": 0.759, "max_disp_mm": 2.5373, "max_strain": 0.002355455729969963, "peak": {"node": 3592, "coords_mm": [2.15, -33.58, 76.2], "vm_mpa": 329.5}, "volume_mm3": 35859.3, "bbox_mm": [93.1, 69.6, 76.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.7, "safety_factor": 2.125, "max_disp_mm": 0.3972, "max_strain": 0.0008411070528880455, "volume_mm3": 96515.7, "bbox_mm": [98.1, 69.6, 81.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.366, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 544, "family": "plate_holes", "params": {"L": 103.8, "H": null, "W": 55.2, "T": 3.9, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.8, 'H': None, 'W': 55.2, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.8, 'H': None, 'W': 55.2, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 396.8, "safety_factor": 0.63, "max_disp_mm": 2.1665, "max_strain": 0.0028362793025083757, "peak": {"node": 113, "coords_mm": [-51.9, -10.8, 3.9], "vm_mpa": 396.8}, "volume_mm3": 22125.5, "bbox_mm": [103.8, 55.2, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.0, "safety_factor": 1.701, "max_disp_mm": 0.6179, "max_strain": 0.0010505007863144406, "volume_mm3": 44818.4, "bbox_mm": [103.8, 55.2, 7.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.071, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 546, "family": "u_channel", "params": {"L": 86.4, "H": 36.6, "W": 37.6, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.4, 'H': 36.6, 'W': 37.6, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.4, 'H': 36.6, 'W': 37.6, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1758.5, "safety_factor": 0.142, "max_disp_mm": 5.3821, "max_strain": 0.01257023558169, "peak": {"node": 260, "coords_mm": [46.64, 1.74, 0.0], "vm_mpa": 1758.5}, "volume_mm3": 947.9, "bbox_mm": [48.8, 36.6, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.5, "safety_factor": 1.977, "max_disp_mm": 0.1094, "max_strain": 0.0009039059457625739, "volume_mm3": 6715.4, "bbox_mm": [48.8, 36.6, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.835, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 545, "family": "l_bracket", "params": {"L": 59.3, "H": 52.6, "W": 52.5, "T": 4.0, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 59.3, 'H': 52.6, 'W': 52.5, 'T': 4.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 59.3, 'H': 52.6, 'W': 52.5, 'T': 4.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 216.8, "safety_factor": 1.153, "max_disp_mm": 0.5398, "max_strain": 0.0015496757808096547, "peak": {"node": 1443, "coords_mm": [2.16, -43.75, 56.6], "vm_mpa": 216.8}, "volume_mm3": 24339.0, "bbox_mm": [63.3, 52.5, 56.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.7, "safety_factor": 2.988, "max_disp_mm": 0.125, "max_strain": 0.0005980592517276588, "volume_mm3": 57125.2, "bbox_mm": [68.3, 52.5, 61.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.835, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 547, "family": "rib_bracket", "params": {"L": 59.6, "H": 48.2, "W": 49.2, "T": 4.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.6, 'H': 48.2, 'W': 49.2, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.6, 'H': 48.2, 'W': 49.2, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 391.8, "safety_factor": 0.638, "max_disp_mm": 1.1356, "max_strain": 0.002800818786515917, "peak": {"node": 1616, "coords_mm": [7.5, -34.08, 52.7], "vm_mpa": 391.8}, "volume_mm3": 24863.2, "bbox_mm": [64.1, 49.2, 52.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.6, "safety_factor": 2.057, "max_disp_mm": 0.1559, "max_strain": 0.0008688859215996769, "volume_mm3": 61113.8, "bbox_mm": [70.1, 49.2, 58.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.419, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 548, "family": "plate_holes", "params": {"L": 113.3, "H": null, "W": 64.7, "T": 5.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.3, 'H': None, 'W': 64.7, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.3, 'H': None, 'W': 64.7, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 329.5, "safety_factor": 0.759, "max_disp_mm": 2.2816, "max_strain": 0.0023550521850477907, "peak": {"node": 3343, "coords_mm": [-55.28, -13.65, 5.2], "vm_mpa": 329.5}, "volume_mm3": 37595.9, "bbox_mm": [113.3, 64.7, 5.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.0, "safety_factor": 2.066, "max_disp_mm": 0.5457, "max_strain": 0.0008648480786382505, "volume_mm3": 66515.8, "bbox_mm": [113.3, 64.7, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.307, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 550, "family": "u_channel", "params": {"L": 99.1, "H": 43.0, "W": 43.9, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.1, 'H': 43.0, 'W': 43.9, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.1, 'H': 43.0, 'W': 43.9, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1484.7, "safety_factor": 0.168, "max_disp_mm": 4.8067, "max_strain": 0.010612948471193703, "peak": {"node": 83, "coords_mm": [50.34, 4.0, 4.0], "vm_mpa": 1484.7}, "volume_mm3": 1507.2, "bbox_mm": [55.2, 43.0, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 145.1, "safety_factor": 1.723, "max_disp_mm": 0.1512, "max_strain": 0.0010368930789597802, "volume_mm3": 8820.0, "bbox_mm": [55.2, 43.0, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.555, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 549, "family": "l_bracket", "params": {"L": 73.5, "H": 62.1, "W": 60.4, "T": 5.0, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.5, 'H': 62.1, 'W': 60.4, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.5, 'H': 62.1, 'W': 60.4, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 282.4, "safety_factor": 0.885, "max_disp_mm": 1.0743, "max_strain": 0.0020189846655966387, "peak": {"node": 1523, "coords_mm": [9.15, -32.84, 62.1], "vm_mpa": 282.4}, "volume_mm3": 42461.2, "bbox_mm": [78.5, 60.4, 67.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.1, "safety_factor": 2.472, "max_disp_mm": 0.2037, "max_strain": 0.0007229266898670656, "volume_mm3": 87942.4, "bbox_mm": [83.5, 60.4, 72.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.587, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 551, "family": "rib_bracket", "params": {"L": 72.2, "H": 54.6, "W": 55.5, "T": 5.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.2, 'H': 54.6, 'W': 55.5, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.2, 'H': 54.6, 'W': 55.5, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 324.9, "safety_factor": 0.769, "max_disp_mm": 1.0706, "max_strain": 0.0023227131320098684, "peak": {"node": 1652, "coords_mm": [7.29, -15.68, 54.6], "vm_mpa": 324.9}, "volume_mm3": 40384.6, "bbox_mm": [77.7, 55.5, 60.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.7, "safety_factor": 2.125, "max_disp_mm": 0.185, "max_strain": 0.0008411370377993467, "volume_mm3": 88270.0, "bbox_mm": [83.7, 55.5, 66.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.355, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 552, "family": "plate_holes", "params": {"L": 122.8, "H": null, "W": 74.2, "T": 6.4, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.8, 'H': None, 'W': 74.2, 'T': 6.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.8, 'H': None, 'W': 74.2, 'T': 6.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 211.1, "safety_factor": 1.184, "max_disp_mm": 1.4351, "max_strain": 0.0015088034220628029, "peak": {"node": 628, "coords_mm": [-59.43, 11.19, 0.0], "vm_mpa": 211.1}, "volume_mm3": 57310.0, "bbox_mm": [122.8, 74.2, 6.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.8, "safety_factor": 2.694, "max_disp_mm": 0.4341, "max_strain": 0.0006633050694983015, "volume_mm3": 93128.7, "bbox_mm": [122.8, 74.2, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.51, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 554, "family": "u_channel", "params": {"L": 111.7, "H": 49.3, "W": 30.3, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.7, 'H': 49.3, 'W': 30.3, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.7, 'H': 49.3, 'W': 30.3, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4864.4, "safety_factor": 0.051, "max_disp_mm": 46.2548, "max_strain": 0.034771585327404764, "peak": {"node": 438, "coords_mm": [34.08, 1.31, 2.6], "vm_mpa": 4864.4}, "volume_mm3": 866.0, "bbox_mm": [81.4, 49.3, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 135.0, "safety_factor": 1.851, "max_disp_mm": 0.2631, "max_strain": 0.0009652766770399933, "volume_mm3": 13494.4, "bbox_mm": [81.4, 49.3, 10.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.8, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 556, "family": "plate_holes", "params": {"L": 102.3, "H": null, "W": 53.7, "T": 3.7, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.3, 'H': None, 'W': 53.7, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.3, 'H': None, 'W': 53.7, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 359.3, "safety_factor": 0.696, "max_disp_mm": 1.8928, "max_strain": 0.0025681039450259294, "peak": {"node": 1325, "coords_mm": [-49.46, 13.39, 0.0], "vm_mpa": 359.3}, "volume_mm3": 20116.8, "bbox_mm": [102.3, 53.7, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.1, "safety_factor": 2.014, "max_disp_mm": 0.5197, "max_strain": 0.000887409759756172, "volume_mm3": 41864.6, "bbox_mm": [102.3, 53.7, 7.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.318, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 558, "family": "u_channel", "params": {"L": 84.4, "H": 35.7, "W": 36.6, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.4, 'H': 35.7, 'W': 36.6, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.4, 'H': 35.7, 'W': 36.6, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1746.3, "safety_factor": 0.143, "max_disp_mm": 5.597, "max_strain": 0.012482811109254224, "peak": {"node": 144, "coords_mm": [43.77, 0.0, 0.0], "vm_mpa": 1746.3}, "volume_mm3": 873.4, "bbox_mm": [47.8, 35.7, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.5, "safety_factor": 1.992, "max_disp_mm": 0.1066, "max_strain": 0.0008969156682063035, "volume_mm3": 6417.6, "bbox_mm": [47.8, 35.7, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.849, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 555, "family": "rib_bracket", "params": {"L": 84.9, "H": 40.9, "W": 41.8, "T": 3.4, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.9, 'H': 40.9, 'W': 41.8, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.9, 'H': 40.9, 'W': 41.8, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 604.7, "safety_factor": 0.413, "max_disp_mm": 3.5083, "max_strain": 0.004322722213984799, "peak": {"node": 1683, "coords_mm": [1.98, -30.73, 44.3], "vm_mpa": 604.7}, "volume_mm3": 18361.9, "bbox_mm": [88.3, 41.8, 44.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.3, "safety_factor": 1.934, "max_disp_mm": 0.2981, "max_strain": 0.0009239949926563022, "volume_mm3": 65378.5, "bbox_mm": [96.3, 41.8, 52.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.521, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 559, "family": "rib_bracket", "params": {"L": 57.6, "H": 47.2, "W": 48.2, "T": 4.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.6, 'H': 47.2, 'W': 48.2, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.6, 'H': 47.2, 'W': 48.2, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 421.6, "safety_factor": 0.593, "max_disp_mm": 1.1396, "max_strain": 0.003013544933333343, "peak": {"node": 1239, "coords_mm": [8.21, -28.94, 47.2], "vm_mpa": 421.6}, "volume_mm3": 23159.1, "bbox_mm": [62.0, 48.2, 51.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.8, "safety_factor": 2.298, "max_disp_mm": 0.149, "max_strain": 0.0007776880954117575, "volume_mm3": 57747.5, "bbox_mm": [68.0, 48.2, 57.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.705, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 560, "family": "plate_holes", "params": {"L": 111.8, "H": null, "W": 63.2, "T": 5.0, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.8, 'H': None, 'W': 63.2, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.8, 'H': None, 'W': 63.2, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 311.3, "safety_factor": 0.803, "max_disp_mm": 2.0891, "max_strain": 0.0022251424694588184, "peak": {"node": 1457, "coords_mm": [-53.95, 1.34, 0.0], "vm_mpa": 311.3}, "volume_mm3": 34826.1, "bbox_mm": [111.8, 63.2, 5.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.7, "safety_factor": 2.299, "max_disp_mm": 0.4761, "max_strain": 0.0007772440304719465, "volume_mm3": 62687.1, "bbox_mm": [111.8, 63.2, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.496, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 562, "family": "u_channel", "params": {"L": 97.1, "H": 42.0, "W": 42.9, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.1, 'H': 42.0, 'W': 42.9, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.1, 'H': 42.0, 'W': 42.9, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1747.2, "safety_factor": 0.143, "max_disp_mm": 5.2391, "max_strain": 0.012488905493376652, "peak": {"node": 285, "coords_mm": [52.79, 2.19, 0.0], "vm_mpa": 1747.2}, "volume_mm3": 1403.9, "bbox_mm": [54.2, 42.0, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.6, "safety_factor": 1.693, "max_disp_mm": 0.1491, "max_strain": 0.0010552438501858234, "volume_mm3": 8458.3, "bbox_mm": [54.2, 42.0, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.55, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 561, "family": "l_bracket", "params": {"L": 71.3, "H": 60.6, "W": 59.2, "T": 4.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.3, 'H': 60.6, 'W': 59.2, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.3, 'H': 60.6, 'W': 59.2, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 294.4, "safety_factor": 0.849, "max_disp_mm": 1.1009, "max_strain": 0.002104683428889291, "peak": {"node": 2241, "coords_mm": [6.41, -23.39, 65.4], "vm_mpa": 294.4}, "volume_mm3": 38844.7, "bbox_mm": [76.1, 59.2, 65.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.3, "safety_factor": 2.374, "max_disp_mm": 0.1999, "max_strain": 0.000752733720900776, "volume_mm3": 82208.7, "bbox_mm": [81.1, 59.2, 70.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.525, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 563, "family": "rib_bracket", "params": {"L": 70.3, "H": 53.6, "W": 54.5, "T": 5.3, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.3, 'H': 53.6, 'W': 54.5, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.3, 'H': 53.6, 'W': 54.5, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 349.6, "safety_factor": 0.715, "max_disp_mm": 1.1301, "max_strain": 0.0024987212198565828, "peak": {"node": 2402, "coords_mm": [5.77, -33.26, 58.9], "vm_mpa": 349.6}, "volume_mm3": 37319.4, "bbox_mm": [75.6, 54.5, 58.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.9, "safety_factor": 2.215, "max_disp_mm": 0.1828, "max_strain": 0.0008068606965533384, "volume_mm3": 83262.9, "bbox_mm": [81.6, 54.5, 64.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.5, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 564, "family": "plate_holes", "params": {"L": 121.3, "H": null, "W": 72.7, "T": 6.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.3, 'H': None, 'W': 72.7, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.3, 'H': None, 'W': 72.7, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 224.0, "safety_factor": 1.116, "max_disp_mm": 1.5324, "max_strain": 0.0016009320952949549, "peak": {"node": 670, "coords_mm": [-58.6, 6.16, 0.0], "vm_mpa": 224.0}, "volume_mm3": 53700.9, "bbox_mm": [121.3, 72.7, 6.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.3, "safety_factor": 2.492, "max_disp_mm": 0.4517, "max_strain": 0.0007171828147224508, "volume_mm3": 88346.6, "bbox_mm": [121.3, 72.7, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.376, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 565, "family": "l_bracket", "params": {"L": 85.5, "H": 70.1, "W": 67.1, "T": 5.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.5, 'H': 70.1, 'W': 67.1, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.5, 'H': 70.1, 'W': 67.1, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 216.8, "safety_factor": 1.153, "max_disp_mm": 1.0032, "max_strain": 0.0015500370088784214, "peak": {"node": 1391, "coords_mm": [7.95, -38.47, 70.1], "vm_mpa": 216.8}, "volume_mm3": 62813.7, "bbox_mm": [91.3, 67.1, 75.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.9, "safety_factor": 2.691, "max_disp_mm": 0.2292, "max_strain": 0.0006640687132545949, "volume_mm3": 120586.8, "bbox_mm": [96.3, 67.1, 80.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.538, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 566, "family": "u_channel", "params": {"L": 109.8, "H": 48.3, "W": 49.3, "T": 2.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.8, 'H': 48.3, 'W': 49.3, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.8, 'H': 48.3, 'W': 49.3, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3890.7, "safety_factor": 0.064, "max_disp_mm": 21.251, "max_strain": 0.027810917621895352, "peak": {"node": 311, "coords_mm": [53.01, 1.29, 0.0], "vm_mpa": 3890.7}, "volume_mm3": 664.4, "bbox_mm": [60.5, 48.3, 2.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.6, "safety_factor": 2.56, "max_disp_mm": 0.1103, "max_strain": 0.000698003100347422, "volume_mm3": 10837.6, "bbox_mm": [60.5, 48.3, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.496, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 568, "family": "plate_holes", "params": {"L": 100.8, "H": null, "W": 52.2, "T": 3.5, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.8, 'H': None, 'W': 52.2, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.8, 'H': None, 'W': 52.2, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 389.8, "safety_factor": 0.641, "max_disp_mm": 2.0552, "max_strain": 0.002786399833542065, "peak": {"node": 103, "coords_mm": [-50.4, 6.21, 3.5], "vm_mpa": 389.8}, "volume_mm3": 18218.2, "bbox_mm": [100.8, 52.2, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 133.5, "safety_factor": 1.873, "max_disp_mm": 0.5469, "max_strain": 0.0009541576103804455, "volume_mm3": 39039.1, "bbox_mm": [100.8, 52.2, 7.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.232, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 570, "family": "u_channel", "params": {"L": 82.4, "H": 34.7, "W": 35.6, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.4, 'H': 34.7, 'W': 35.6, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.4, 'H': 34.7, 'W': 35.6, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2015.0, "safety_factor": 0.124, "max_disp_mm": 5.7034, "max_strain": 0.014403873343025618, "peak": {"node": 239, "coords_mm": [47.04, 1.63, 0.0], "vm_mpa": 2015.0}, "volume_mm3": 801.8, "bbox_mm": [46.8, 34.7, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 130.8, "safety_factor": 1.911, "max_disp_mm": 0.1045, "max_strain": 0.0009349772902270474, "volume_mm3": 6119.5, "bbox_mm": [46.8, 34.7, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.787, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 567, "family": "rib_bracket", "params": {"L": 82.9, "H": 59.9, "W": 40.9, "T": 3.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.9, 'H': 59.9, 'W': 40.9, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.9, 'H': 59.9, 'W': 40.9, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 619.9, "safety_factor": 0.403, "max_disp_mm": 4.3526, "max_strain": 0.004431382545891288, "peak": {"node": 1471, "coords_mm": [2.01, -27.9, 63.2], "vm_mpa": 619.9}, "volume_mm3": 19719.1, "bbox_mm": [86.2, 40.9, 63.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.7, "safety_factor": 1.927, "max_disp_mm": 0.2923, "max_strain": 0.0009274343599294417, "volume_mm3": 71220.4, "bbox_mm": [94.2, 40.9, 71.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.524, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 571, "family": "rib_bracket", "params": {"L": 55.6, "H": 46.2, "W": 47.2, "T": 4.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.6, 'H': 46.2, 'W': 47.2, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.6, 'H': 46.2, 'W': 47.2, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 279.8, "safety_factor": 0.893, "max_disp_mm": 0.6872, "max_strain": 0.00200027753756119, "peak": {"node": 1692, "coords_mm": [3.22, -29.6, 50.4], "vm_mpa": 279.8}, "volume_mm3": 21013.4, "bbox_mm": [59.8, 47.2, 50.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 88.4, "safety_factor": 2.829, "max_disp_mm": 0.1081, "max_strain": 0.0006316701259194496, "volume_mm3": 53921.3, "bbox_mm": [65.8, 47.2, 56.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.936, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 572, "family": "plate_holes", "params": {"L": 110.3, "H": null, "W": 61.7, "T": 4.8, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.3, 'H': None, 'W': 61.7, 'T': 4.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.3, 'H': None, 'W': 61.7, 'T': 4.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 333.2, "safety_factor": 0.75, "max_disp_mm": 2.3102, "max_strain": 0.002381758903841907, "peak": {"node": 1356, "coords_mm": [-53.2, -7.38, 0.0], "vm_mpa": 333.2}, "volume_mm3": 32183.9, "bbox_mm": [110.3, 61.7, 4.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.4, "safety_factor": 2.166, "max_disp_mm": 0.4972, "max_strain": 0.0008248649584549845, "volume_mm3": 59003.8, "bbox_mm": [110.3, 61.7, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.416, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 574, "family": "u_channel", "params": {"L": 95.1, "H": 41.0, "W": 41.9, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.1, 'H': 41.0, 'W': 41.9, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.1, 'H': 41.0, 'W': 41.9, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1828.2, "safety_factor": 0.137, "max_disp_mm": 5.363, "max_strain": 0.013068056232696067, "peak": {"node": 313, "coords_mm": [49.98, 1.86, 3.8], "vm_mpa": 1828.2}, "volume_mm3": 1305.4, "bbox_mm": [53.2, 41.0, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 143.4, "safety_factor": 1.743, "max_disp_mm": 0.1449, "max_strain": 0.0010251259020936372, "volume_mm3": 8105.8, "bbox_mm": [53.2, 41.0, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.606, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 573, "family": "l_bracket", "params": {"L": 69.0, "H": 59.1, "W": 57.9, "T": 4.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.0, 'H': 59.1, 'W': 57.9, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.0, 'H': 59.1, 'W': 57.9, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 323.9, "safety_factor": 0.772, "max_disp_mm": 1.0928, "max_strain": 0.0023156330041483237, "peak": {"node": 1742, "coords_mm": [6.47, -39.26, 59.1], "vm_mpa": 323.9}, "volume_mm3": 36138.9, "bbox_mm": [73.7, 57.9, 63.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.1, "safety_factor": 2.473, "max_disp_mm": 0.1921, "max_strain": 0.0007225242514754641, "volume_mm3": 77392.6, "bbox_mm": [78.7, 57.9, 68.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.702, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 575, "family": "rib_bracket", "params": {"L": 68.3, "H": 52.6, "W": 53.5, "T": 5.2, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.3, 'H': 52.6, 'W': 53.5, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.3, 'H': 52.6, 'W': 53.5, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 330.8, "safety_factor": 0.756, "max_disp_mm": 1.1012, "max_strain": 0.0023648863215129552, "peak": {"node": 1903, "coords_mm": [8.54, -21.76, 57.8], "vm_mpa": 330.8}, "volume_mm3": 35081.0, "bbox_mm": [73.5, 53.5, 57.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.3, "safety_factor": 2.42, "max_disp_mm": 0.1765, "max_strain": 0.0007383111332477927, "volume_mm3": 79154.3, "bbox_mm": [79.5, 53.5, 63.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.665, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 576, "family": "plate_holes", "params": {"L": 119.8, "H": null, "W": 71.2, "T": 6.0, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.8, 'H': None, 'W': 71.2, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.8, 'H': None, 'W': 71.2, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 250.4, "safety_factor": 0.999, "max_disp_mm": 1.6362, "max_strain": 0.0017895646315169106, "peak": {"node": 3600, "coords_mm": [-58.13, -12.28, 6.0], "vm_mpa": 250.4}, "volume_mm3": 50236.1, "bbox_mm": [119.8, 71.2, 6.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.7, "safety_factor": 2.507, "max_disp_mm": 0.4678, "max_strain": 0.000712799231936543, "volume_mm3": 83726.8, "bbox_mm": [119.8, 71.2, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.508, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 578, "family": "u_channel", "params": {"L": 107.8, "H": 47.3, "W": 48.3, "T": 4.4, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.8, 'H': 47.3, 'W': 48.3, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.8, 'H': 47.3, 'W': 48.3, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1007.3, "safety_factor": 0.248, "max_disp_mm": 2.8043, "max_strain": 0.0072003368731078776, "peak": {"node": 296, "coords_mm": [56.29, 2.33, 0.0], "vm_mpa": 1007.3}, "volume_mm3": 1982.5, "bbox_mm": [59.5, 47.3, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.1, "safety_factor": 2.379, "max_disp_mm": 0.1092, "max_strain": 0.0007511457417091632, "volume_mm3": 10426.6, "bbox_mm": [59.5, 47.3, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.131, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 577, "family": "l_bracket", "params": {"L": 83.3, "H": 68.6, "W": 65.9, "T": 5.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.3, 'H': 68.6, 'W': 65.9, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.3, 'H': 68.6, 'W': 65.9, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 228.2, "safety_factor": 1.096, "max_disp_mm": 1.016, "max_strain": 0.0016308644243540908, "peak": {"node": 2711, "coords_mm": [8.95, -33.87, 74.2], "vm_mpa": 228.2}, "volume_mm3": 58123.8, "bbox_mm": [88.9, 65.9, 74.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.9, "safety_factor": 2.504, "max_disp_mm": 0.2276, "max_strain": 0.0007137624474536789, "volume_mm3": 113512.7, "bbox_mm": [93.9, 65.9, 79.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.408, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 579, "family": "rib_bracket", "params": {"L": 80.9, "H": 58.9, "W": 59.9, "T": 3.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.9, 'H': 58.9, 'W': 59.9, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.9, 'H': 58.9, 'W': 59.9, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 453.0, "safety_factor": 0.552, "max_disp_mm": 2.5775, "max_strain": 0.003238293818856654, "peak": {"node": 2585, "coords_mm": [2.17, -41.2, 62.0], "vm_mpa": 453.0}, "volume_mm3": 26535.1, "bbox_mm": [84.0, 59.9, 62.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.5, "safety_factor": 2.008, "max_disp_mm": 0.3179, "max_strain": 0.0008898943645132533, "volume_mm3": 81163.9, "bbox_mm": [90.0, 59.9, 68.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.456, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 581, "family": "l_bracket", "params": {"L": 52.6, "H": 48.1, "W": 48.8, "T": 3.6, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 52.6, 'H': 48.1, 'W': 48.8, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 52.6, 'H': 48.1, 'W': 48.8, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 209.5, "safety_factor": 1.193, "max_disp_mm": 0.5103, "max_strain": 0.0014978624505018654, "peak": {"node": 1745, "coords_mm": [3.25, -19.51, 51.7], "vm_mpa": 209.5}, "volume_mm3": 18323.4, "bbox_mm": [56.2, 48.8, 51.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 80.9, "safety_factor": 3.09, "max_disp_mm": 0.1086, "max_strain": 0.0005783548620414759, "volume_mm3": 45871.0, "bbox_mm": [61.2, 48.8, 56.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.897, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 580, "family": "plate_holes", "params": {"L": 129.3, "H": null, "W": 50.7, "T": 3.3, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.3, 'H': None, 'W': 50.7, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.3, 'H': None, 'W': 50.7, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 583.7, "safety_factor": 0.428, "max_disp_mm": 5.5784, "max_strain": 0.004172286008346867, "peak": {"node": 2797, "coords_mm": [-63.04, 14.53, 3.3], "vm_mpa": 583.7}, "volume_mm3": 21446.6, "bbox_mm": [129.3, 50.7, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.6, "safety_factor": 2.125, "max_disp_mm": 0.6665, "max_strain": 0.0008408590044341375, "volume_mm3": 60440.3, "bbox_mm": [129.3, 50.7, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.697, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 582, "family": "u_channel", "params": {"L": 80.4, "H": 33.7, "W": 34.6, "T": 3.1, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.4, 'H': 33.7, 'W': 34.6, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.4, 'H': 33.7, 'W': 34.6, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2081.7, "safety_factor": 0.12, "max_disp_mm": 4.8463, "max_strain": 0.014880629652387548, "peak": {"node": 246, "coords_mm": [38.61, 1.6, 0.0], "vm_mpa": 2081.7}, "volume_mm3": 734.2, "bbox_mm": [45.8, 33.7, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.8, "safety_factor": 2.61, "max_disp_mm": 0.0801, "max_strain": 0.0006846261216914862, "volume_mm3": 5829.8, "bbox_mm": [45.8, 33.7, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.49, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 583, "family": "rib_bracket", "params": {"L": 53.6, "H": 45.2, "W": 46.2, "T": 4.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.6, 'H': 45.2, 'W': 46.2, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.6, 'H': 45.2, 'W': 46.2, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 287.2, "safety_factor": 0.87, "max_disp_mm": 0.665, "max_strain": 0.002053261918944559, "peak": {"node": 1621, "coords_mm": [19.09, -42.24, 49.3], "vm_mpa": 287.2}, "volume_mm3": 19491.3, "bbox_mm": [57.7, 46.2, 49.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.6, "safety_factor": 2.672, "max_disp_mm": 0.1031, "max_strain": 0.0006687527764846266, "volume_mm3": 50814.9, "bbox_mm": [63.7, 46.2, 55.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.802, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 584, "family": "plate_holes", "params": {"L": 108.8, "H": null, "W": 60.2, "T": 4.6, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.8, 'H': None, 'W': 60.2, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.8, 'H': None, 'W': 60.2, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 369.4, "safety_factor": 0.677, "max_disp_mm": 2.5107, "max_strain": 0.0026407475462392714, "peak": {"node": 437, "coords_mm": [-52.64, 9.67, 0.0], "vm_mpa": 369.4}, "volume_mm3": 29666.5, "bbox_mm": [108.8, 60.2, 4.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.1, "safety_factor": 2.065, "max_disp_mm": 0.5183, "max_strain": 0.000865598188795234, "volume_mm3": 55463.4, "bbox_mm": [108.8, 60.2, 8.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.388, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 586, "family": "u_channel", "params": {"L": 93.1, "H": 40.0, "W": 40.9, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.1, 'H': 40.0, 'W': 40.9, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.1, 'H': 40.0, 'W': 40.9, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1603.5, "safety_factor": 0.156, "max_disp_mm": 4.6599, "max_strain": 0.011461928474936376, "peak": {"node": 97, "coords_mm": [47.02, 3.7, 0.0], "vm_mpa": 1603.5}, "volume_mm3": 1211.6, "bbox_mm": [52.2, 40.0, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.1, "safety_factor": 2.099, "max_disp_mm": 0.1168, "max_strain": 0.0008513459827456542, "volume_mm3": 7762.4, "bbox_mm": [52.2, 40.0, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.943, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 585, "family": "l_bracket", "params": {"L": 66.8, "H": 57.6, "W": 56.7, "T": 4.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.8, 'H': 57.6, 'W': 56.7, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.8, 'H': 57.6, 'W': 56.7, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 311.0, "safety_factor": 0.804, "max_disp_mm": 1.0899, "max_strain": 0.0022234113748726783, "peak": {"node": 2342, "coords_mm": [7.36, -37.08, 62.1], "vm_mpa": 311.0}, "volume_mm3": 32888.8, "bbox_mm": [71.3, 56.7, 62.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.3, "safety_factor": 2.397, "max_disp_mm": 0.1877, "max_strain": 0.0007455428778638697, "volume_mm3": 72125.2, "bbox_mm": [76.3, 56.7, 67.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.593, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 587, "family": "rib_bracket", "params": {"L": 66.3, "H": 51.6, "W": 52.5, "T": 5.0, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.3, 'H': 51.6, 'W': 52.5, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.3, 'H': 51.6, 'W': 52.5, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 360.2, "safety_factor": 0.694, "max_disp_mm": 1.1463, "max_strain": 0.0025751003913967586, "peak": {"node": 2120, "coords_mm": [11.06, -50.92, 56.6], "vm_mpa": 360.2}, "volume_mm3": 32261.3, "bbox_mm": [71.3, 52.5, 56.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.8, "safety_factor": 2.217, "max_disp_mm": 0.1728, "max_strain": 0.0008062205085844715, "volume_mm3": 74439.8, "bbox_mm": [77.3, 52.5, 62.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.523, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 588, "family": "plate_holes", "params": {"L": 118.3, "H": null, "W": 69.7, "T": 5.8, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.3, 'H': None, 'W': 69.7, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.3, 'H': None, 'W': 69.7, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 261.4, "safety_factor": 0.956, "max_disp_mm": 1.77, "max_strain": 0.0018683533148231807, "peak": {"node": 2035, "coords_mm": [-57.33, 13.08, 0.0], "vm_mpa": 261.4}, "volume_mm3": 46912.9, "bbox_mm": [118.3, 69.7, 5.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 106.7, "safety_factor": 2.343, "max_disp_mm": 0.4872, "max_strain": 0.0007628514801860024, "volume_mm3": 79266.6, "bbox_mm": [118.3, 69.7, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.386, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 589, "family": "l_bracket", "params": {"L": 81.1, "H": 67.1, "W": 64.6, "T": 5.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.1, 'H': 67.1, 'W': 64.6, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.1, 'H': 67.1, 'W': 64.6, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 245.9, "safety_factor": 1.017, "max_disp_mm": 1.0148, "max_strain": 0.0017580165597888698, "peak": {"node": 2910, "coords_mm": [8.6, -44.72, 72.6], "vm_mpa": 245.9}, "volume_mm3": 54609.6, "bbox_mm": [86.6, 64.6, 72.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.4, "safety_factor": 2.595, "max_disp_mm": 0.2209, "max_strain": 0.0006887264280989579, "volume_mm3": 107646.2, "bbox_mm": [91.6, 64.6, 77.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.578, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 590, "family": "u_channel", "params": {"L": 105.8, "H": 46.3, "W": 47.3, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.8, 'H': 46.3, 'W': 47.3, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.8, 'H': 46.3, 'W': 47.3, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1309.0, "safety_factor": 0.191, "max_disp_mm": 4.3703, "max_strain": 0.009356985869804591, "peak": {"node": 348, "coords_mm": [55.73, 2.08, 4.3], "vm_mpa": 1309.0}, "volume_mm3": 1858.2, "bbox_mm": [58.5, 46.3, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 158.0, "safety_factor": 1.583, "max_disp_mm": 0.1621, "max_strain": 0.00112909016373424, "volume_mm3": 10025.5, "bbox_mm": [58.5, 46.3, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.392, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 594, "family": "u_channel", "params": {"L": 78.4, "H": 32.7, "W": 33.6, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.4, 'H': 32.7, 'W': 33.6, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.4, 'H': 32.7, 'W': 33.6, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2130.7, "safety_factor": 0.117, "max_disp_mm": 4.9745, "max_strain": 0.015230398282512684, "peak": {"node": 227, "coords_mm": [37.62, 1.53, 0.0], "vm_mpa": 2130.7}, "volume_mm3": 670.5, "bbox_mm": [44.8, 32.7, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.6, "safety_factor": 2.484, "max_disp_mm": 0.0796, "max_strain": 0.0007193712935316597, "volume_mm3": 5548.5, "bbox_mm": [44.8, 32.7, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.367, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 593, "family": "l_bracket", "params": {"L": 50.3, "H": 46.6, "W": 47.5, "T": 3.4, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 50.3, 'H': 46.6, 'W': 47.5, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 50.3, 'H': 46.6, 'W': 47.5, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 224.3, "safety_factor": 1.114, "max_disp_mm": 0.554, "max_strain": 0.0016035398504455074, "peak": {"node": 1186, "coords_mm": [2.12, -3.83, 50.0], "vm_mpa": 224.3}, "volume_mm3": 16198.4, "bbox_mm": [53.7, 47.5, 50.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 85.4, "safety_factor": 2.927, "max_disp_mm": 0.1035, "max_strain": 0.0006105360042302265, "volume_mm3": 42014.7, "bbox_mm": [58.7, 47.5, 55.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.813, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 592, "family": "plate_holes", "params": {"L": 127.8, "H": null, "W": 79.3, "T": 3.1, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.8, 'H': None, 'W': 79.3, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.8, 'H': None, 'W': 79.3, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 356.1, "safety_factor": 0.702, "max_disp_mm": 3.4594, "max_strain": 0.0025456092807243785, "peak": {"node": 170, "coords_mm": [-63.9, -14.87, 0.0], "vm_mpa": 356.1}, "volume_mm3": 31241.8, "bbox_mm": [127.8, 79.3, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.1, "safety_factor": 2.21, "max_disp_mm": 0.8181, "max_strain": 0.0008087752644779703, "volume_mm3": 71553.7, "bbox_mm": [127.8, 79.3, 7.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.508, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 595, "family": "rib_bracket", "params": {"L": 51.6, "H": 44.3, "W": 45.2, "T": 3.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.6, 'H': 44.3, 'W': 45.2, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.6, 'H': 44.3, 'W': 45.2, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 272.8, "safety_factor": 0.916, "max_disp_mm": 0.4968, "max_strain": 0.0019500124929108628, "peak": {"node": 1537, "coords_mm": [1.87, -25.01, 48.2], "vm_mpa": 272.8}, "volume_mm3": 17592.7, "bbox_mm": [55.5, 45.2, 48.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.4, "safety_factor": 2.766, "max_disp_mm": 0.0999, "max_strain": 0.0006460239599087155, "volume_mm3": 47343.4, "bbox_mm": [61.5, 45.2, 54.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.85, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 596, "family": "plate_holes", "params": {"L": 107.3, "H": null, "W": 58.8, "T": 4.4, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.3, 'H': None, 'W': 58.8, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.3, 'H': None, 'W': 58.8, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 357.2, "safety_factor": 0.7, "max_disp_mm": 2.6685, "max_strain": 0.002553400246852728, "peak": {"node": 1547, "coords_mm": [-44.92, 23.56, 0.0], "vm_mpa": 357.2}, "volume_mm3": 27318.3, "bbox_mm": [107.3, 58.8, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.2, "safety_factor": 1.949, "max_disp_mm": 0.5435, "max_strain": 0.0009167159643702729, "volume_mm3": 52153.2, "bbox_mm": [107.3, 58.8, 8.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.25, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 598, "family": "u_channel", "params": {"L": 91.1, "H": 39.0, "W": 39.9, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.1, 'H': 39.0, 'W': 39.9, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.1, 'H': 39.0, 'W': 39.9, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1574.2, "safety_factor": 0.159, "max_disp_mm": 4.9734, "max_strain": 0.01125259241743026, "peak": {"node": 309, "coords_mm": [46.67, 1.87, 3.6], "vm_mpa": 1574.2}, "volume_mm3": 1122.3, "bbox_mm": [51.2, 39.0, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.8, "safety_factor": 1.987, "max_disp_mm": 0.1164, "max_strain": 0.0008994910142895706, "volume_mm3": 7428.1, "bbox_mm": [51.2, 39.0, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.828, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 597, "family": "l_bracket", "params": {"L": 64.6, "H": 56.1, "W": 55.5, "T": 4.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.6, 'H': 56.1, 'W': 55.5, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.6, 'H': 56.1, 'W': 55.5, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 331.2, "safety_factor": 0.755, "max_disp_mm": 1.0375, "max_strain": 0.0023673269621494984, "peak": {"node": 1590, "coords_mm": [7.57, -16.84, 56.1], "vm_mpa": 331.2}, "volume_mm3": 30549.4, "bbox_mm": [69.0, 55.5, 60.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.4, "safety_factor": 2.395, "max_disp_mm": 0.1803, "max_strain": 0.0007461274127631498, "volume_mm3": 67873.2, "bbox_mm": [74.0, 55.5, 65.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.64, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 599, "family": "rib_bracket", "params": {"L": 64.3, "H": 50.6, "W": 51.5, "T": 4.9, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.3, 'H': 50.6, 'W': 51.5, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.3, 'H': 50.6, 'W': 51.5, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 365.0, "safety_factor": 0.685, "max_disp_mm": 1.127, "max_strain": 0.0026090908980322468, "peak": {"node": 1798, "coords_mm": [6.13, -19.44, 55.5], "vm_mpa": 365.0}, "volume_mm3": 30231.5, "bbox_mm": [69.2, 51.5, 55.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.5, "safety_factor": 2.183, "max_disp_mm": 0.1668, "max_strain": 0.0008184565254696672, "volume_mm3": 70617.8, "bbox_mm": [75.2, 51.5, 61.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.499, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 602, "family": "u_channel", "params": {"L": 103.8, "H": 45.3, "W": 46.3, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.8, 'H': 45.3, 'W': 46.3, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.8, 'H': 45.3, 'W': 46.3, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1686.1, "safety_factor": 0.148, "max_disp_mm": 4.5526, "max_strain": 0.012052596546914823, "peak": {"node": 339, "coords_mm": [54.31, 2.2, 4.2], "vm_mpa": 1686.1}, "volume_mm3": 1739.3, "bbox_mm": [57.5, 45.3, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.8, "safety_factor": 1.703, "max_disp_mm": 0.1586, "max_strain": 0.0010493130515269184, "volume_mm3": 9634.1, "bbox_mm": [57.5, 45.3, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.555, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 600, "family": "plate_holes", "params": {"L": 116.8, "H": null, "W": 68.3, "T": 5.6, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.8, 'H': None, 'W': 68.3, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.8, 'H': None, 'W': 68.3, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 280.8, "safety_factor": 0.89, "max_disp_mm": 1.9386, "max_strain": 0.0020070851906471556, "peak": {"node": 1666, "coords_mm": [-56.28, 1.3, 0.0], "vm_mpa": 280.8}, "volume_mm3": 43794.0, "bbox_mm": [116.8, 68.3, 5.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.3, "safety_factor": 2.246, "max_disp_mm": 0.5072, "max_strain": 0.0007957852345291088, "volume_mm3": 75075.5, "bbox_mm": [116.8, 68.3, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.355, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 601, "family": "l_bracket", "params": {"L": 78.8, "H": 65.6, "W": 63.4, "T": 5.3, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.8, 'H': 65.6, 'W': 63.4, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.8, 'H': 65.6, 'W': 63.4, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 261.0, "safety_factor": 0.958, "max_disp_mm": 1.0489, "max_strain": 0.0018656936026176804, "peak": {"node": 2688, "coords_mm": [6.19, -35.68, 70.9], "vm_mpa": 261.0}, "volume_mm3": 50302.2, "bbox_mm": [84.1, 63.4, 70.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.1, "safety_factor": 2.574, "max_disp_mm": 0.2183, "max_strain": 0.0006942529670321049, "volume_mm3": 101022.2, "bbox_mm": [89.1, 63.4, 75.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.616, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 606, "family": "u_channel", "params": {"L": 76.5, "H": 31.7, "W": 32.6, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.5, 'H': 31.7, 'W': 32.6, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.5, 'H': 31.7, 'W': 32.6, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1942.6, "safety_factor": 0.129, "max_disp_mm": 5.2291, "max_strain": 0.013886068810642173, "peak": {"node": 232, "coords_mm": [36.53, 1.49, 0.0], "vm_mpa": 1942.6}, "volume_mm3": 611.4, "bbox_mm": [43.9, 31.7, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.0, "safety_factor": 2.336, "max_disp_mm": 0.0767, "max_strain": 0.0007649159490386783, "volume_mm3": 5283.3, "bbox_mm": [43.9, 31.7, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.208, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 603, "family": "rib_bracket", "params": {"L": 77.0, "H": 56.9, "W": 57.9, "T": 5.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.0, 'H': 56.9, 'W': 57.9, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.0, 'H': 56.9, 'W': 57.9, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 283.4, "safety_factor": 0.882, "max_disp_mm": 1.0658, "max_strain": 0.002026140113794348, "peak": {"node": 1832, "coords_mm": [9.61, -26.22, 56.9], "vm_mpa": 283.4}, "volume_mm3": 46914.1, "bbox_mm": [82.8, 57.9, 62.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.7, "safety_factor": 2.257, "max_disp_mm": 0.1982, "max_strain": 0.0007916337199502007, "volume_mm3": 99545.2, "bbox_mm": [88.8, 57.9, 68.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.375, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 607, "family": "rib_bracket", "params": {"L": 49.6, "H": 43.3, "W": 44.2, "T": 3.8, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.6, 'H': 43.3, 'W': 44.2, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.6, 'H': 43.3, 'W': 44.2, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 258.9, "safety_factor": 0.966, "max_disp_mm": 0.5104, "max_strain": 0.0018503695795620884, "peak": {"node": 1074, "coords_mm": [2.14, -25.8, 47.1], "vm_mpa": 258.9}, "volume_mm3": 16241.7, "bbox_mm": [53.4, 44.2, 47.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.8, "safety_factor": 2.754, "max_disp_mm": 0.0927, "max_strain": 0.0006487860074221797, "volume_mm3": 44485.5, "bbox_mm": [59.4, 44.2, 53.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.789, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 605, "family": "l_bracket", "params": {"L": 93.1, "H": 45.1, "W": 46.3, "T": 3.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 93.1, 'H': 45.1, 'W': 46.3, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 93.1, 'H': 45.1, 'W': 46.3, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 561.0, "safety_factor": 0.446, "max_disp_mm": 3.7117, "max_strain": 0.004010455462959534, "peak": {"node": 2332, "coords_mm": [1.77, -18.3, 48.4], "vm_mpa": 561.0}, "volume_mm3": 21619.8, "bbox_mm": [96.4, 46.3, 48.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.9, "safety_factor": 2.002, "max_disp_mm": 0.3623, "max_strain": 0.0008926945108914176, "volume_mm3": 70818.2, "bbox_mm": [103.4, 46.3, 55.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.556, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 608, "family": "plate_holes", "params": {"L": 105.8, "H": null, "W": 57.3, "T": 4.2, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.8, 'H': None, 'W': 57.3, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.8, 'H': None, 'W': 57.3, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 343.5, "safety_factor": 0.728, "max_disp_mm": 2.7461, "max_strain": 0.0024552671299711945, "peak": {"node": 1490, "coords_mm": [-51.38, -12.44, 0.0], "vm_mpa": 343.5}, "volume_mm3": 25039.6, "bbox_mm": [105.8, 57.3, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 130.4, "safety_factor": 1.918, "max_disp_mm": 0.5696, "max_strain": 0.0009319640722230165, "volume_mm3": 48886.8, "bbox_mm": [105.8, 57.3, 8.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.19, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 610, "family": "u_channel", "params": {"L": 89.1, "H": 38.0, "W": 39.0, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.1, 'H': 38.0, 'W': 39.0, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.1, 'H': 38.0, 'W': 39.0, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2001.3, "safety_factor": 0.125, "max_disp_mm": 5.1095, "max_strain": 0.014305663868295264, "peak": {"node": 303, "coords_mm": [44.96, 1.38, 3.5], "vm_mpa": 2001.3}, "volume_mm3": 1036.4, "bbox_mm": [50.1, 38.0, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.6, "safety_factor": 2.007, "max_disp_mm": 0.1135, "max_strain": 0.0008903535674219391, "volume_mm3": 7093.6, "bbox_mm": [50.1, 38.0, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.882, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 611, "family": "rib_bracket", "params": {"L": 62.3, "H": 49.6, "W": 50.5, "T": 4.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.3, 'H': 49.6, 'W': 50.5, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.3, 'H': 49.6, 'W': 50.5, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 410.3, "safety_factor": 0.609, "max_disp_mm": 1.1726, "max_strain": 0.0029329853836148044, "peak": {"node": 1773, "coords_mm": [5.77, -24.71, 54.3], "vm_mpa": 410.3}, "volume_mm3": 27675.0, "bbox_mm": [67.0, 50.5, 54.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.2, "safety_factor": 2.268, "max_disp_mm": 0.1637, "max_strain": 0.000787886498259855, "volume_mm3": 66246.9, "bbox_mm": [73.0, 50.5, 60.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.659, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 612, "family": "plate_holes", "params": {"L": 115.3, "H": null, "W": 66.8, "T": 5.4, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.3, 'H': None, 'W': 66.8, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.3, 'H': None, 'W': 66.8, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 311.7, "safety_factor": 0.802, "max_disp_mm": 2.1066, "max_strain": 0.0022284282160727003, "peak": {"node": 625, "coords_mm": [-55.99, -4.91, 0.0], "vm_mpa": 311.7}, "volume_mm3": 40742.8, "bbox_mm": [115.3, 66.8, 5.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.2, "safety_factor": 2.169, "max_disp_mm": 0.527, "max_strain": 0.0008237675566697942, "volume_mm3": 70922.6, "bbox_mm": [115.3, 66.8, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.367, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 614, "family": "u_channel", "params": {"L": 101.8, "H": 44.3, "W": 45.3, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.8, 'H': 44.3, 'W': 45.3, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.8, 'H': 44.3, 'W': 45.3, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1551.6, "safety_factor": 0.161, "max_disp_mm": 4.6728, "max_strain": 0.011090904622644717, "peak": {"node": 295, "coords_mm": [58.54, 2.02, 0.0], "vm_mpa": 1551.6}, "volume_mm3": 1625.5, "bbox_mm": [56.5, 44.3, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 153.4, "safety_factor": 1.63, "max_disp_mm": 0.1567, "max_strain": 0.0010964432650978847, "volume_mm3": 9252.3, "bbox_mm": [56.5, 44.3, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.469, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 613, "family": "l_bracket", "params": {"L": 76.6, "H": 64.1, "W": 62.1, "T": 5.2, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.6, 'H': 64.1, 'W': 62.1, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.6, 'H': 64.1, 'W': 62.1, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 266.2, "safety_factor": 0.939, "max_disp_mm": 1.0429, "max_strain": 0.0019025506878904727, "peak": {"node": 1973, "coords_mm": [9.2, -34.91, 64.1], "vm_mpa": 266.2}, "volume_mm3": 47114.0, "bbox_mm": [81.8, 62.1, 69.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.6, "safety_factor": 2.729, "max_disp_mm": 0.2098, "max_strain": 0.0006549086269920803, "volume_mm3": 95583.1, "bbox_mm": [86.8, 62.1, 74.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.789, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 615, "family": "rib_bracket", "params": {"L": 75.0, "H": 55.9, "W": 56.9, "T": 5.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.0, 'H': 55.9, 'W': 56.9, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.0, 'H': 55.9, 'W': 56.9, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 328.4, "safety_factor": 0.761, "max_disp_mm": 1.0473, "max_strain": 0.0023471482896726486, "peak": {"node": 1722, "coords_mm": [9.1, -34.77, 55.9], "vm_mpa": 328.4}, "volume_mm3": 44303.5, "bbox_mm": [80.7, 56.9, 61.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.4, "safety_factor": 2.244, "max_disp_mm": 0.1913, "max_strain": 0.0007965363491717028, "volume_mm3": 94933.1, "bbox_mm": [86.7, 56.9, 67.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.482, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 618, "family": "u_channel", "params": {"L": 114.5, "H": 30.7, "W": 31.6, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.5, 'H': 30.7, 'W': 31.6, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.5, 'H': 30.7, 'W': 31.6, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4171.7, "safety_factor": 0.06, "max_disp_mm": 41.2565, "max_strain": 0.029820186196370897, "peak": {"node": 390, "coords_mm": [37.9, 1.43, 2.8], "vm_mpa": 4171.7}, "volume_mm3": 868.7, "bbox_mm": [82.9, 30.7, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 137.5, "safety_factor": 1.818, "max_disp_mm": 0.257, "max_strain": 0.0009829218406606974, "volume_mm3": 11990.6, "bbox_mm": [82.9, 30.7, 10.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.758, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 619, "family": "rib_bracket", "params": {"L": 47.6, "H": 42.3, "W": 43.2, "T": 3.6, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.6, 'H': 42.3, 'W': 43.2, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.6, 'H': 42.3, 'W': 43.2, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 275.8, "safety_factor": 0.906, "max_disp_mm": 0.5461, "max_strain": 0.0019713888123593123, "peak": {"node": 1425, "coords_mm": [3.48, -21.66, 45.9], "vm_mpa": 275.8}, "volume_mm3": 14541.1, "bbox_mm": [51.2, 43.2, 45.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.6, "safety_factor": 2.728, "max_disp_mm": 0.0906, "max_strain": 0.0006549890201755291, "volume_mm3": 41264.6, "bbox_mm": [57.2, 43.2, 51.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.822, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 617, "family": "l_bracket", "params": {"L": 90.8, "H": 73.6, "W": 45.1, "T": 3.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.8, 'H': 73.6, 'W': 45.1, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.8, 'H': 73.6, 'W': 45.1, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 512.8, "safety_factor": 0.487, "max_disp_mm": 5.0615, "max_strain": 0.003665904424727859, "peak": {"node": 2556, "coords_mm": [1.93, -17.74, 76.7], "vm_mpa": 512.8}, "volume_mm3": 23418.2, "bbox_mm": [93.9, 45.1, 76.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 130.0, "safety_factor": 1.923, "max_disp_mm": 0.3662, "max_strain": 0.0009293919798563431, "volume_mm3": 79486.5, "bbox_mm": [100.9, 45.1, 83.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.435, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 620, "family": "plate_holes", "params": {"L": 104.4, "H": null, "W": 55.8, "T": 4.0, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.4, 'H': None, 'W': 55.8, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.4, 'H': None, 'W': 55.8, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 398.3, "safety_factor": 0.628, "max_disp_mm": 2.2851, "max_strain": 0.0028473820665463304, "peak": {"node": 1490, "coords_mm": [-50.76, -14.68, 0.0], "vm_mpa": 398.3}, "volume_mm3": 22900.0, "bbox_mm": [104.4, 55.8, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 139.0, "safety_factor": 1.799, "max_disp_mm": 0.6041, "max_strain": 0.0009935167289621726, "volume_mm3": 45799.9, "bbox_mm": [104.4, 55.8, 8.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.171, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 622, "family": "u_channel", "params": {"L": 87.1, "H": 37.0, "W": 38.0, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.1, 'H': 37.0, 'W': 38.0, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.1, 'H': 37.0, 'W': 38.0, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1898.3, "safety_factor": 0.132, "max_disp_mm": 5.3814, "max_strain": 0.013569238291099763, "peak": {"node": 298, "coords_mm": [42.72, 2.05, 3.4], "vm_mpa": 1898.3}, "volume_mm3": 956.0, "bbox_mm": [49.1, 37.0, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.3, "safety_factor": 2.027, "max_disp_mm": 0.1098, "max_strain": 0.0008814890462187939, "volume_mm3": 6777.2, "bbox_mm": [49.1, 37.0, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.896, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 621, "family": "l_bracket", "params": {"L": 60.1, "H": 53.1, "W": 53.0, "T": 4.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 60.1, 'H': 53.1, 'W': 53.0, 'T': 4.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 60.1, 'H': 53.1, 'W': 53.0, 'T': 4.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 219.6, "safety_factor": 1.138, "max_disp_mm": 0.6335, "max_strain": 0.0015698858040665924, "peak": {"node": 1807, "coords_mm": [10.99, -23.4, 57.2], "vm_mpa": 219.6}, "volume_mm3": 25489.3, "bbox_mm": [64.2, 53.0, 57.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.5, "safety_factor": 2.993, "max_disp_mm": 0.1259, "max_strain": 0.0005971374952019219, "volume_mm3": 58985.3, "bbox_mm": [69.2, 53.0, 62.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.854, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 623, "family": "rib_bracket", "params": {"L": 60.3, "H": 48.6, "W": 49.5, "T": 4.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.3, 'H': 48.6, 'W': 49.5, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.3, 'H': 48.6, 'W': 49.5, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 395.3, "safety_factor": 0.632, "max_disp_mm": 1.1408, "max_strain": 0.0028255135646141354, "peak": {"node": 1689, "coords_mm": [5.17, -32.24, 53.2], "vm_mpa": 395.3}, "volume_mm3": 25844.0, "bbox_mm": [64.9, 49.5, 53.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.4, "safety_factor": 2.245, "max_disp_mm": 0.1559, "max_strain": 0.0007959816064610077, "volume_mm3": 62701.7, "bbox_mm": [70.9, 49.5, 59.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.613, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 624, "family": "plate_holes", "params": {"L": 113.9, "H": null, "W": 65.3, "T": 5.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.9, 'H': None, 'W': 65.3, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.9, 'H': None, 'W': 65.3, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 344.3, "safety_factor": 0.726, "max_disp_mm": 2.3068, "max_strain": 0.0024608651150733584, "peak": {"node": 1886, "coords_mm": [-55.48, 2.41, 0.0], "vm_mpa": 344.3}, "volume_mm3": 38153.1, "bbox_mm": [113.9, 65.3, 5.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.8, "safety_factor": 2.053, "max_disp_mm": 0.5514, "max_strain": 0.0008704408851755005, "volume_mm3": 67501.7, "bbox_mm": [113.9, 65.3, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.327, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 626, "family": "u_channel", "params": {"L": 99.8, "H": 43.4, "W": 44.3, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.8, 'H': 43.4, 'W': 44.3, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.8, 'H': 43.4, 'W': 44.3, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1645.1, "safety_factor": 0.152, "max_disp_mm": 4.945, "max_strain": 0.011759637174317937, "peak": {"node": 331, "coords_mm": [52.44, 1.97, 4.0], "vm_mpa": 1645.1}, "volume_mm3": 1518.4, "bbox_mm": [55.5, 43.4, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 152.4, "safety_factor": 1.64, "max_disp_mm": 0.1533, "max_strain": 0.0010897023258446814, "volume_mm3": 8890.0, "bbox_mm": [55.5, 43.4, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.488, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 625, "family": "l_bracket", "params": {"L": 74.3, "H": 62.6, "W": 60.9, "T": 5.0, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.3, 'H': 62.6, 'W': 60.9, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.3, 'H': 62.6, 'W': 60.9, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 267.8, "safety_factor": 0.933, "max_disp_mm": 1.0763, "max_strain": 0.0019145276109135362, "peak": {"node": 2425, "coords_mm": [5.22, -22.36, 67.6], "vm_mpa": 267.8}, "volume_mm3": 43208.5, "bbox_mm": [79.3, 60.9, 67.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.6, "safety_factor": 2.562, "max_disp_mm": 0.2067, "max_strain": 0.0006976178731911212, "volume_mm3": 89462.1, "bbox_mm": [84.3, 60.9, 72.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.628, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 627, "family": "rib_bracket", "params": {"L": 73.0, "H": 54.9, "W": 55.9, "T": 5.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.0, 'H': 54.9, 'W': 55.9, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.0, 'H': 54.9, 'W': 55.9, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 311.4, "safety_factor": 0.803, "max_disp_mm": 1.0841, "max_strain": 0.0022257312441726672, "peak": {"node": 2290, "coords_mm": [6.36, -27.59, 60.4], "vm_mpa": 311.4}, "volume_mm3": 41013.8, "bbox_mm": [78.5, 55.9, 60.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.0, "safety_factor": 2.252, "max_disp_mm": 0.189, "max_strain": 0.0007933748915747081, "volume_mm3": 89613.3, "bbox_mm": [84.5, 55.9, 66.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.45, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 630, "family": "u_channel", "params": {"L": 112.5, "H": 49.7, "W": 30.6, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.5, 'H': 49.7, 'W': 30.6, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.5, 'H': 49.7, 'W': 30.6, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3970.8, "safety_factor": 0.063, "max_disp_mm": 40.7208, "max_strain": 0.02838353354198832, "peak": {"node": 438, "coords_mm": [34.45, 1.37, 2.7], "vm_mpa": 3970.8}, "volume_mm3": 939.7, "bbox_mm": [81.9, 49.7, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.4, "safety_factor": 1.962, "max_disp_mm": 0.2576, "max_strain": 0.0009109091133024935, "volume_mm3": 13841.8, "bbox_mm": [81.9, 49.7, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.899, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 631, "family": "rib_bracket", "params": {"L": 45.6, "H": 41.3, "W": 42.2, "T": 3.5, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.6, 'H': 41.3, 'W': 42.2, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.6, 'H': 41.3, 'W': 42.2, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 275.0, "safety_factor": 0.909, "max_disp_mm": 0.5597, "max_strain": 0.0019657236853359832, "peak": {"node": 1170, "coords_mm": [2.15, -30.97, 44.8], "vm_mpa": 275.0}, "volume_mm3": 13352.1, "bbox_mm": [49.1, 42.2, 44.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.7, "safety_factor": 2.611, "max_disp_mm": 0.0846, "max_strain": 0.000684376585107093, "volume_mm3": 38646.8, "bbox_mm": [55.1, 42.2, 50.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.702, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 632, "family": "plate_holes", "params": {"L": 102.9, "H": null, "W": 54.3, "T": 3.8, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.9, 'H': None, 'W': 54.3, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.9, 'H': None, 'W': 54.3, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 335.2, "safety_factor": 0.746, "max_disp_mm": 1.7907, "max_strain": 0.002396347550954485, "peak": {"node": 1372, "coords_mm": [-49.81, -11.14, 0.0], "vm_mpa": 335.2}, "volume_mm3": 21017.5, "bbox_mm": [102.9, 54.3, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.2, "safety_factor": 2.063, "max_disp_mm": 0.5052, "max_strain": 0.0008662832427609624, "volume_mm3": 43141.2, "bbox_mm": [102.9, 54.3, 7.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.317, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 634, "family": "u_channel", "params": {"L": 85.2, "H": 36.0, "W": 37.0, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 85.2, 'H': 36.0, 'W': 37.0, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 85.2, 'H': 36.0, 'W': 37.0, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2012.7, "safety_factor": 0.124, "max_disp_mm": 5.785, "max_strain": 0.014387190993124174, "peak": {"node": 285, "coords_mm": [41.03, 1.69, 3.3], "vm_mpa": 2012.7}, "volume_mm3": 881.0, "bbox_mm": [48.2, 36.0, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.9, "safety_factor": 1.939, "max_disp_mm": 0.1088, "max_strain": 0.0009214094747619124, "volume_mm3": 6478.1, "bbox_mm": [48.2, 36.0, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.815, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 635, "family": "rib_bracket", "params": {"L": 58.3, "H": 47.6, "W": 48.6, "T": 4.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.3, 'H': 47.6, 'W': 48.6, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.3, 'H': 47.6, 'W': 48.6, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 450.4, "safety_factor": 0.555, "max_disp_mm": 1.1919, "max_strain": 0.0032194718355984106, "peak": {"node": 766, "coords_mm": [6.47, -32.79, 47.6], "vm_mpa": 450.4}, "volume_mm3": 23586.6, "bbox_mm": [62.7, 48.6, 52.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.7, "safety_factor": 2.089, "max_disp_mm": 0.1523, "max_strain": 0.0008553473451072923, "volume_mm3": 58782.7, "bbox_mm": [68.7, 48.6, 58.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.534, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 638, "family": "u_channel", "params": {"L": 97.8, "H": 42.4, "W": 43.3, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.8, 'H': 42.4, 'W': 43.3, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.8, 'H': 42.4, 'W': 43.3, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1634.7, "safety_factor": 0.153, "max_disp_mm": 5.285, "max_strain": 0.011685184942590522, "peak": {"node": 321, "coords_mm": [53.24, 2.3, 3.9], "vm_mpa": 1634.7}, "volume_mm3": 1414.5, "bbox_mm": [54.5, 42.4, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 148.9, "safety_factor": 1.678, "max_disp_mm": 0.149, "max_strain": 0.001064662805778289, "volume_mm3": 8526.9, "bbox_mm": [54.5, 42.4, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.526, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 636, "family": "plate_holes", "params": {"L": 112.4, "H": null, "W": 63.8, "T": 5.0, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.4, 'H': None, 'W': 63.8, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.4, 'H': None, 'W': 63.8, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 283.9, "safety_factor": 0.881, "max_disp_mm": 2.0786, "max_strain": 0.0020294734649451327, "peak": {"node": 448, "coords_mm": [-54.26, 8.41, 0.0], "vm_mpa": 283.9}, "volume_mm3": 35352.9, "bbox_mm": [112.4, 63.8, 5.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.5, "safety_factor": 2.263, "max_disp_mm": 0.4751, "max_strain": 0.0007897036026373353, "volume_mm3": 63635.3, "bbox_mm": [112.4, 63.8, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.382, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 637, "family": "l_bracket", "params": {"L": 72.1, "H": 61.2, "W": 59.6, "T": 4.9, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 72.1, 'H': 61.2, 'W': 59.6, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 72.1, 'H': 61.2, 'W': 59.6, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 271.6, "safety_factor": 0.92, "max_disp_mm": 1.0922, "max_strain": 0.0019416247735645768, "peak": {"node": 1506, "coords_mm": [8.77, -44.85, 61.2], "vm_mpa": 271.6}, "volume_mm3": 40359.9, "bbox_mm": [77.0, 59.6, 66.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.9, "safety_factor": 2.384, "max_disp_mm": 0.1998, "max_strain": 0.0007497291043424621, "volume_mm3": 84493.7, "bbox_mm": [82.0, 59.6, 71.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.463, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 639, "family": "rib_bracket", "params": {"L": 71.0, "H": 53.9, "W": 54.9, "T": 5.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.0, 'H': 53.9, 'W': 54.9, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.0, 'H': 53.9, 'W': 54.9, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 304.7, "safety_factor": 0.82, "max_disp_mm": 1.0633, "max_strain": 0.002178267573602848, "peak": {"node": 951, "coords_mm": [7.56, -33.69, 53.9], "vm_mpa": 304.7}, "volume_mm3": 38628.7, "bbox_mm": [76.4, 54.9, 59.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.2, "safety_factor": 2.375, "max_disp_mm": 0.1822, "max_strain": 0.0007522852542928959, "volume_mm3": 85304.7, "bbox_mm": [82.4, 54.9, 65.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.555, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 640, "family": "plate_holes", "params": {"L": 121.9, "H": null, "W": 73.3, "T": 6.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.9, 'H': None, 'W': 73.3, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.9, 'H': None, 'W': 73.3, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 219.1, "safety_factor": 1.141, "max_disp_mm": 1.4727, "max_strain": 0.0015659754696101293, "peak": {"node": 3778, "coords_mm": [-59.06, 8.55, 6.3], "vm_mpa": 219.1}, "volume_mm3": 55302.6, "bbox_mm": [121.9, 73.3, 6.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.3, "safety_factor": 2.57, "max_disp_mm": 0.4426, "max_strain": 0.0006953090908128964, "volume_mm3": 90415.4, "bbox_mm": [121.9, 73.3, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.429, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 642, "family": "u_channel", "params": {"L": 110.5, "H": 48.7, "W": 49.6, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.5, 'H': 48.7, 'W': 49.6, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.5, 'H': 48.7, 'W': 49.6, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3248.3, "safety_factor": 0.077, "max_disp_mm": 19.617, "max_strain": 0.023219413888059794, "peak": {"node": 325, "coords_mm": [58.21, 1.31, 0.0], "vm_mpa": 3248.3}, "volume_mm3": 723.3, "bbox_mm": [60.9, 48.7, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.0, "safety_factor": 2.603, "max_disp_mm": 0.1083, "max_strain": 0.0006864045373735736, "volume_mm3": 11123.6, "bbox_mm": [60.9, 48.7, 10.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.527, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 641, "family": "l_bracket", "params": {"L": 86.4, "H": 70.7, "W": 67.6, "T": 5.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 86.4, 'H': 70.7, 'W': 67.6, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 86.4, 'H': 70.7, 'W': 67.6, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 228.6, "safety_factor": 1.094, "max_disp_mm": 1.0129, "max_strain": 0.0016338326161748392, "peak": {"node": 2466, "coords_mm": [9.06, -28.97, 70.7], "vm_mpa": 228.6}, "volume_mm3": 63869.8, "bbox_mm": [92.2, 67.6, 76.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.4, "safety_factor": 2.676, "max_disp_mm": 0.2349, "max_strain": 0.0006676977390964867, "volume_mm3": 122580.4, "bbox_mm": [97.2, 67.6, 81.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.583, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 643, "family": "rib_bracket", "params": {"L": 83.7, "H": 40.3, "W": 41.2, "T": 3.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.7, 'H': 40.3, 'W': 41.2, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.7, 'H': 40.3, 'W': 41.2, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 595.3, "safety_factor": 0.42, "max_disp_mm": 3.3865, "max_strain": 0.004255648669884262, "peak": {"node": 1905, "coords_mm": [1.7, -23.02, 43.6], "vm_mpa": 595.3}, "volume_mm3": 17307.7, "bbox_mm": [87.0, 41.2, 43.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 166.4, "safety_factor": 1.502, "max_disp_mm": 0.4878, "max_strain": 0.0011897437390974615, "volume_mm3": 51075.2, "bbox_mm": [93.0, 41.2, 49.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.082, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 644, "family": "plate_holes", "params": {"L": 101.4, "H": null, "W": 52.8, "T": 3.6, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.4, 'H': None, 'W': 52.8, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.4, 'H': None, 'W': 52.8, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 402.9, "safety_factor": 0.62, "max_disp_mm": 2.0492, "max_strain": 0.0028800889875610003, "peak": {"node": 2363, "coords_mm": [-49.19, -8.4, 3.6], "vm_mpa": 402.9}, "volume_mm3": 19070.5, "bbox_mm": [101.4, 52.8, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 131.5, "safety_factor": 1.9, "max_disp_mm": 0.5361, "max_strain": 0.0009402974605860944, "volume_mm3": 40260.0, "bbox_mm": [101.4, 52.8, 7.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.28, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 646, "family": "u_channel", "params": {"L": 83.2, "H": 35.0, "W": 36.0, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.2, 'H': 35.0, 'W': 36.0, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.2, 'H': 35.0, 'W': 36.0, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2006.9, "safety_factor": 0.125, "max_disp_mm": 5.6774, "max_strain": 0.014345291315935467, "peak": {"node": 87, "coords_mm": [41.64, 3.2, 0.0], "vm_mpa": 2006.9}, "volume_mm3": 809.0, "bbox_mm": [47.2, 35.0, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.7, "safety_factor": 1.927, "max_disp_mm": 0.1057, "max_strain": 0.0009273809757105168, "volume_mm3": 6178.7, "bbox_mm": [47.2, 35.0, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.802, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 645, "family": "l_bracket", "params": {"L": 55.6, "H": 50.2, "W": 50.5, "T": 3.8, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.6, 'H': 50.2, 'W': 50.5, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.6, 'H': 50.2, 'W': 50.5, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 221.8, "safety_factor": 1.127, "max_disp_mm": 0.4728, "max_strain": 0.0015851336326035898, "peak": {"node": 1745, "coords_mm": [1.99, -32.49, 54.0], "vm_mpa": 221.8}, "volume_mm3": 21032.2, "bbox_mm": [59.4, 50.5, 54.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 79.5, "safety_factor": 3.145, "max_disp_mm": 0.115, "max_strain": 0.0005682241159731991, "volume_mm3": 50928.2, "bbox_mm": [64.4, 50.5, 59.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.018, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 647, "family": "rib_bracket", "params": {"L": 56.3, "H": 46.6, "W": 47.6, "T": 4.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.3, 'H': 46.6, 'W': 47.6, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.3, 'H': 46.6, 'W': 47.6, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 347.9, "safety_factor": 0.719, "max_disp_mm": 0.8112, "max_strain": 0.0024866386732760623, "peak": {"node": 1214, "coords_mm": [7.86, -33.34, 46.6], "vm_mpa": 347.9}, "volume_mm3": 21941.7, "bbox_mm": [60.6, 47.6, 50.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 89.1, "safety_factor": 2.805, "max_disp_mm": 0.1089, "max_strain": 0.0006370484591401626, "volume_mm3": 55499.7, "bbox_mm": [66.6, 47.6, 56.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.087, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 648, "family": "plate_holes", "params": {"L": 110.9, "H": null, "W": 62.3, "T": 4.8, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.9, 'H': None, 'W': 62.3, 'T': 4.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.9, 'H': None, 'W': 62.3, 'T': 4.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 311.5, "safety_factor": 0.802, "max_disp_mm": 2.2717, "max_strain": 0.0022268360566145553, "peak": {"node": 1682, "coords_mm": [-54.0, -14.9, 0.0], "vm_mpa": 311.5}, "volume_mm3": 32681.0, "bbox_mm": [110.9, 62.3, 4.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.8, "safety_factor": 2.216, "max_disp_mm": 0.499, "max_strain": 0.0008064438975176586, "volume_mm3": 59915.1, "bbox_mm": [110.9, 62.3, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.413, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 649, "family": "l_bracket", "params": {"L": 69.9, "H": 59.7, "W": 58.4, "T": 4.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.9, 'H': 59.7, 'W': 58.4, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.9, 'H': 59.7, 'W': 58.4, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 282.9, "safety_factor": 0.884, "max_disp_mm": 1.0549, "max_strain": 0.0020218643087495697, "peak": {"node": 1680, "coords_mm": [7.14, -30.37, 59.7], "vm_mpa": 282.9}, "volume_mm3": 37675.0, "bbox_mm": [74.7, 58.4, 64.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.5, "safety_factor": 2.514, "max_disp_mm": 0.1915, "max_strain": 0.0007108851053251187, "volume_mm3": 79781.4, "bbox_mm": [79.7, 58.4, 69.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.63, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 650, "family": "u_channel", "params": {"L": 95.8, "H": 41.4, "W": 42.3, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.8, 'H': 41.4, 'W': 42.3, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.8, 'H': 41.4, 'W': 42.3, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1985.6, "safety_factor": 0.126, "max_disp_mm": 5.5003, "max_strain": 0.014193392880481725, "peak": {"node": 282, "coords_mm": [47.93, 1.85, 0.0], "vm_mpa": 1985.6}, "volume_mm3": 1315.5, "bbox_mm": [53.5, 41.4, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.2, "safety_factor": 1.71, "max_disp_mm": 0.147, "max_strain": 0.0010450517524915085, "volume_mm3": 8173.0, "bbox_mm": [53.5, 41.4, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.584, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 651, "family": "rib_bracket", "params": {"L": 69.0, "H": 52.9, "W": 53.9, "T": 5.2, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.0, 'H': 52.9, 'W': 53.9, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.0, 'H': 52.9, 'W': 53.9, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 341.4, "safety_factor": 0.732, "max_disp_mm": 1.1203, "max_strain": 0.0024402890610291644, "peak": {"node": 1603, "coords_mm": [9.02, -5.64, 52.9], "vm_mpa": 341.4}, "volume_mm3": 35623.6, "bbox_mm": [74.2, 53.9, 58.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.4, "safety_factor": 2.373, "max_disp_mm": 0.1801, "max_strain": 0.0007531715921010184, "volume_mm3": 80349.8, "bbox_mm": [80.2, 53.9, 64.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.64, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 652, "family": "plate_holes", "params": {"L": 120.4, "H": null, "W": 71.8, "T": 6.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.4, 'H': None, 'W': 71.8, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.4, 'H': None, 'W': 71.8, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 221.9, "safety_factor": 1.126, "max_disp_mm": 1.5698, "max_strain": 0.001586366613570083, "peak": {"node": 3303, "coords_mm": [-58.07, 22.29, 6.1], "vm_mpa": 221.9}, "volume_mm3": 51774.6, "bbox_mm": [120.4, 71.8, 6.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.0, "safety_factor": 2.525, "max_disp_mm": 0.4586, "max_strain": 0.0007077954616631204, "volume_mm3": 85725.2, "bbox_mm": [120.4, 71.8, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.398, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 654, "family": "u_channel", "params": {"L": 108.5, "H": 47.7, "W": 48.6, "T": 4.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.5, 'H': 47.7, 'W': 48.6, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.5, 'H': 47.7, 'W': 48.6, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 829.4, "safety_factor": 0.301, "max_disp_mm": 2.6269, "max_strain": 0.0059285871860766635, "peak": {"node": 310, "coords_mm": [56.78, 2.38, 0.0], "vm_mpa": 829.4}, "volume_mm3": 2087.8, "bbox_mm": [59.9, 47.7, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.7, "safety_factor": 2.507, "max_disp_mm": 0.1079, "max_strain": 0.0007128580519050339, "volume_mm3": 10705.3, "bbox_mm": [59.9, 47.7, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.205, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 653, "family": "l_bracket", "params": {"L": 84.1, "H": 69.2, "W": 66.3, "T": 5.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 84.1, 'H': 69.2, 'W': 66.3, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 84.1, 'H': 69.2, 'W': 66.3, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 220.3, "safety_factor": 1.135, "max_disp_mm": 0.987, "max_strain": 0.0015743987741623517, "peak": {"node": 3042, "coords_mm": [5.63, -30.13, 74.9], "vm_mpa": 220.3}, "volume_mm3": 60087.7, "bbox_mm": [89.8, 66.3, 74.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.1, "safety_factor": 2.498, "max_disp_mm": 0.2278, "max_strain": 0.0007154721649908441, "volume_mm3": 116343.2, "bbox_mm": [94.8, 66.3, 79.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.363, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 657, "family": "l_bracket", "params": {"L": 53.4, "H": 48.7, "W": 49.2, "T": 3.7, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 53.4, 'H': 48.7, 'W': 49.2, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 53.4, 'H': 48.7, 'W': 49.2, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 228.9, "safety_factor": 1.092, "max_disp_mm": 0.4896, "max_strain": 0.0016364016727651966, "peak": {"node": 1257, "coords_mm": [1.96, -23.26, 52.4], "vm_mpa": 228.9}, "volume_mm3": 19259.8, "bbox_mm": [57.1, 49.2, 52.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 85.8, "safety_factor": 2.914, "max_disp_mm": 0.1084, "max_strain": 0.000613271229001549, "volume_mm3": 47426.8, "bbox_mm": [62.1, 49.2, 57.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.822, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 655, "family": "rib_bracket", "params": {"L": 81.7, "H": 59.3, "W": 40.2, "T": 3.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.7, 'H': 59.3, 'W': 40.2, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.7, 'H': 59.3, 'W': 40.2, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 774.5, "safety_factor": 0.323, "max_disp_mm": 4.7378, "max_strain": 0.005535912398386376, "peak": {"node": 1973, "coords_mm": [1.71, -15.04, 62.5], "vm_mpa": 774.5}, "volume_mm3": 18549.9, "bbox_mm": [84.9, 40.2, 62.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 141.1, "safety_factor": 1.772, "max_disp_mm": 0.2926, "max_strain": 0.0010086723722764568, "volume_mm3": 68526.5, "bbox_mm": [92.9, 40.2, 70.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.449, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 658, "family": "u_channel", "params": {"L": 81.2, "H": 34.0, "W": 35.0, "T": 3.1, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.2, 'H': 34.0, 'W': 35.0, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.2, 'H': 34.0, 'W': 35.0, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2117.9, "safety_factor": 0.118, "max_disp_mm": 6.193, "max_strain": 0.01513896912126877, "peak": {"node": 69, "coords_mm": [40.49, 3.1, 3.1], "vm_mpa": 2117.9}, "volume_mm3": 740.9, "bbox_mm": [46.2, 34.0, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.8, "safety_factor": 1.972, "max_disp_mm": 0.1035, "max_strain": 0.0009063668230157344, "volume_mm3": 5887.8, "bbox_mm": [46.2, 34.0, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.854, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 656, "family": "plate_holes", "params": {"L": 129.9, "H": null, "W": 51.3, "T": 3.4, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.9, 'H': None, 'W': 51.3, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.9, 'H': None, 'W': 51.3, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 540.2, "safety_factor": 0.463, "max_disp_mm": 5.333, "max_strain": 0.003861081152970547, "peak": {"node": 133, "coords_mm": [-64.95, -13.44, 3.4], "vm_mpa": 540.2}, "volume_mm3": 22464.9, "bbox_mm": [129.9, 51.3, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.2, "safety_factor": 2.247, "max_disp_mm": 0.6497, "max_strain": 0.0007951364710415374, "volume_mm3": 62108.8, "bbox_mm": [129.9, 51.3, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.785, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 659, "family": "rib_bracket", "params": {"L": 54.3, "H": 45.6, "W": 46.6, "T": 4.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.3, 'H': 45.6, 'W': 46.6, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.3, 'H': 45.6, 'W': 46.6, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 250.3, "safety_factor": 0.999, "max_disp_mm": 0.5751, "max_strain": 0.0017890194551245376, "peak": {"node": 1195, "coords_mm": [2.12, -18.39, 49.7], "vm_mpa": 250.3}, "volume_mm3": 19870.2, "bbox_mm": [58.4, 46.6, 49.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.9, "safety_factor": 2.719, "max_disp_mm": 0.1053, "max_strain": 0.0006571933420305777, "volume_mm3": 51772.6, "bbox_mm": [64.4, 46.6, 55.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.72, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 660, "family": "plate_holes", "params": {"L": 109.4, "H": null, "W": 60.8, "T": 4.6, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.4, 'H': None, 'W': 60.8, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.4, 'H': None, 'W': 60.8, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 351.5, "safety_factor": 0.711, "max_disp_mm": 2.5325, "max_strain": 0.0025127918626054245, "peak": {"node": 438, "coords_mm": [-53.15, 9.78, 0.0], "vm_mpa": 351.5}, "volume_mm3": 30134.5, "bbox_mm": [109.4, 60.8, 4.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.3, "safety_factor": 2.078, "max_disp_mm": 0.5213, "max_strain": 0.0008600177579238156, "volume_mm3": 56338.5, "bbox_mm": [109.4, 60.8, 8.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.367, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 661, "family": "l_bracket", "params": {"L": 67.6, "H": 58.2, "W": 57.2, "T": 4.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.6, 'H': 58.2, 'W': 57.2, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.6, 'H': 58.2, 'W': 57.2, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 310.8, "safety_factor": 0.804, "max_disp_mm": 1.1023, "max_strain": 0.0022215071236446307, "peak": {"node": 2093, "coords_mm": [6.21, -32.35, 62.8], "vm_mpa": 310.8}, "volume_mm3": 34310.8, "bbox_mm": [72.2, 57.2, 62.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.3, "safety_factor": 2.544, "max_disp_mm": 0.1883, "max_strain": 0.0007025115628652264, "volume_mm3": 74350.8, "bbox_mm": [77.2, 57.2, 67.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.739, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 662, "family": "u_channel", "params": {"L": 93.8, "H": 40.4, "W": 41.3, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.8, 'H': 40.4, 'W': 41.3, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.8, 'H': 40.4, 'W': 41.3, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1576.3, "safety_factor": 0.159, "max_disp_mm": 4.7657, "max_strain": 0.011267867429661212, "peak": {"node": 275, "coords_mm": [46.22, 2.15, 0.0], "vm_mpa": 1576.3}, "volume_mm3": 1221.1, "bbox_mm": [52.5, 40.4, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.6, "safety_factor": 2.055, "max_disp_mm": 0.1195, "max_strain": 0.0008694609682508033, "volume_mm3": 7828.3, "bbox_mm": [52.5, 40.4, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.897, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 663, "family": "rib_bracket", "params": {"L": 67.0, "H": 52.0, "W": 52.9, "T": 5.1, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.0, 'H': 52.0, 'W': 52.9, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.0, 'H': 52.0, 'W': 52.9, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 339.2, "safety_factor": 0.737, "max_disp_mm": 1.0987, "max_strain": 0.0024247848309283497, "peak": {"node": 2136, "coords_mm": [8.63, -15.07, 57.1], "vm_mpa": 339.2}, "volume_mm3": 33480.9, "bbox_mm": [72.1, 52.9, 57.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.5, "safety_factor": 2.414, "max_disp_mm": 0.1731, "max_strain": 0.0007401290387931038, "volume_mm3": 76393.4, "bbox_mm": [78.1, 52.9, 63.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.678, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 664, "family": "plate_holes", "params": {"L": 118.9, "H": null, "W": 70.3, "T": 5.9, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.9, 'H': None, 'W': 70.3, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.9, 'H': None, 'W': 70.3, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 266.8, "safety_factor": 0.937, "max_disp_mm": 1.7026, "max_strain": 0.001906791566914748, "peak": {"node": 654, "coords_mm": [-57.77, -14.56, 0.0], "vm_mpa": 266.8}, "volume_mm3": 48389.4, "bbox_mm": [118.9, 70.3, 5.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.5, "safety_factor": 2.37, "max_disp_mm": 0.4764, "max_strain": 0.0007541538885442957, "volume_mm3": 81195.7, "bbox_mm": [118.9, 70.3, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.432, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 666, "family": "u_channel", "params": {"L": 106.5, "H": 46.7, "W": 47.6, "T": 4.4, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.5, 'H': 46.7, 'W': 47.6, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.5, 'H': 46.7, 'W': 47.6, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1441.4, "safety_factor": 0.173, "max_disp_mm": 4.0901, "max_strain": 0.010303102895780616, "peak": {"node": 347, "coords_mm": [56.15, 2.11, 4.4], "vm_mpa": 1441.4}, "volume_mm3": 1959.2, "bbox_mm": [58.9, 46.7, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 150.8, "safety_factor": 1.657, "max_disp_mm": 0.1589, "max_strain": 0.0010782199962367683, "volume_mm3": 10296.8, "bbox_mm": [58.9, 46.7, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.484, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 665, "family": "l_bracket", "params": {"L": 81.9, "H": 67.7, "W": 65.1, "T": 5.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.9, 'H': 67.7, 'W': 65.1, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.9, 'H': 67.7, 'W': 65.1, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 220.6, "safety_factor": 1.133, "max_disp_mm": 0.9833, "max_strain": 0.001577205118072778, "peak": {"node": 3185, "coords_mm": [9.83, -38.58, 73.3], "vm_mpa": 220.6}, "volume_mm3": 56579.7, "bbox_mm": [87.5, 65.1, 73.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.9, "safety_factor": 2.691, "max_disp_mm": 0.2202, "max_strain": 0.0006640916337406558, "volume_mm3": 110547.6, "bbox_mm": [92.5, 65.1, 78.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.558, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 669, "family": "l_bracket", "params": {"L": 51.1, "H": 47.2, "W": 48.0, "T": 3.5, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 51.1, 'H': 47.2, 'W': 48.0, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 51.1, 'H': 47.2, 'W': 48.0, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 237.8, "safety_factor": 1.051, "max_disp_mm": 0.6373, "max_strain": 0.0016998999362668919, "peak": {"node": 1561, "coords_mm": [1.9, -25.11, 50.7], "vm_mpa": 237.8}, "volume_mm3": 17102.4, "bbox_mm": [54.6, 48.0, 50.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 84.9, "safety_factor": 2.943, "max_disp_mm": 0.1039, "max_strain": 0.0006072323827040953, "volume_mm3": 43574.4, "bbox_mm": [59.6, 48.0, 55.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.892, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 667, "family": "rib_bracket", "params": {"L": 79.7, "H": 58.3, "W": 59.2, "T": 3.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.7, 'H': 58.3, 'W': 59.2, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.7, 'H': 58.3, 'W': 59.2, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 449.6, "safety_factor": 0.556, "max_disp_mm": 2.859, "max_strain": 0.0032136535518725354, "peak": {"node": 2768, "coords_mm": [2.15, -31.19, 61.3], "vm_mpa": 449.6}, "volume_mm3": 25041.6, "bbox_mm": [82.7, 59.2, 61.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.0, "safety_factor": 2.016, "max_disp_mm": 0.317, "max_strain": 0.000886446295438162, "volume_mm3": 78321.6, "bbox_mm": [88.7, 59.2, 67.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.46, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 668, "family": "plate_holes", "params": {"L": 128.4, "H": null, "W": 79.8, "T": 3.2, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.4, 'H': None, 'W': 79.8, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.4, 'H': None, 'W': 79.8, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 405.9, "safety_factor": 0.616, "max_disp_mm": 3.749, "max_strain": 0.00290175021626911, "peak": {"node": 4396, "coords_mm": [-62.82, -8.74, 3.2], "vm_mpa": 405.9}, "volume_mm3": 32607.3, "bbox_mm": [128.4, 79.8, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.0, "safety_factor": 2.118, "max_disp_mm": 0.7992, "max_strain": 0.0008437337148096255, "volume_mm3": 73366.4, "bbox_mm": [128.4, 79.8, 7.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.502, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 670, "family": "u_channel", "params": {"L": 79.2, "H": 33.0, "W": 34.0, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.2, 'H': 33.0, 'W': 34.0, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.2, 'H': 33.0, 'W': 34.0, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2002.1, "safety_factor": 0.125, "max_disp_mm": 5.3416, "max_strain": 0.014311159893155038, "peak": {"node": 254, "coords_mm": [37.98, 1.56, 3.0], "vm_mpa": 2002.1}, "volume_mm3": 676.8, "bbox_mm": [45.2, 33.0, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.1, "safety_factor": 2.402, "max_disp_mm": 0.0814, "max_strain": 0.0007439456171991993, "volume_mm3": 5605.2, "bbox_mm": [45.2, 33.0, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.277, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 671, "family": "rib_bracket", "params": {"L": 52.4, "H": 44.6, "W": 45.6, "T": 4.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.4, 'H': 44.6, 'W': 45.6, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.4, 'H': 44.6, 'W': 45.6, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 265.1, "safety_factor": 0.943, "max_disp_mm": 0.6356, "max_strain": 0.0018948195049606285, "peak": {"node": 1123, "coords_mm": [2.23, -22.65, 48.6], "vm_mpa": 265.1}, "volume_mm3": 18422.4, "bbox_mm": [56.4, 45.6, 48.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 86.2, "safety_factor": 2.899, "max_disp_mm": 0.0996, "max_strain": 0.0006164485081297267, "volume_mm3": 48792.0, "bbox_mm": [62.4, 45.6, 54.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.956, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 674, "family": "u_channel", "params": {"L": 91.9, "H": 39.4, "W": 40.3, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.9, 'H': 39.4, 'W': 40.3, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.9, 'H': 39.4, 'W': 40.3, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1696.7, "safety_factor": 0.147, "max_disp_mm": 5.0591, "max_strain": 0.012128391486426438, "peak": {"node": 270, "coords_mm": [45.23, 2.21, 0.0], "vm_mpa": 1696.7}, "volume_mm3": 1132.7, "bbox_mm": [51.6, 39.4, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 122.0, "safety_factor": 2.048, "max_disp_mm": 0.1184, "max_strain": 0.0008724167359250584, "volume_mm3": 7501.8, "bbox_mm": [51.6, 39.4, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.901, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 672, "family": "plate_holes", "params": {"L": 107.9, "H": null, "W": 59.3, "T": 4.4, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.9, 'H': None, 'W': 59.3, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.9, 'H': None, 'W': 59.3, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 361.0, "safety_factor": 0.693, "max_disp_mm": 2.7468, "max_strain": 0.002580331667620016, "peak": {"node": 458, "coords_mm": [-52.07, 3.76, 0.0], "vm_mpa": 361.0}, "volume_mm3": 27710.9, "bbox_mm": [107.9, 59.3, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.5, "safety_factor": 2.008, "max_disp_mm": 0.5484, "max_strain": 0.0008897687373635723, "volume_mm3": 52902.7, "bbox_mm": [107.9, 59.3, 8.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.316, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 673, "family": "l_bracket", "params": {"L": 65.4, "H": 56.7, "W": 55.9, "T": 4.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.4, 'H': 56.7, 'W': 55.9, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.4, 'H': 56.7, 'W': 55.9, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 325.3, "safety_factor": 0.769, "max_disp_mm": 1.0653, "max_strain": 0.0023251505619072497, "peak": {"node": 1485, "coords_mm": [12.96, -53.4, 56.7], "vm_mpa": 325.3}, "volume_mm3": 31846.2, "bbox_mm": [69.9, 55.9, 61.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.9, "safety_factor": 2.361, "max_disp_mm": 0.1807, "max_strain": 0.0007569454182498604, "volume_mm3": 69886.2, "bbox_mm": [74.9, 55.9, 66.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.592, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 675, "family": "rib_bracket", "params": {"L": 65.0, "H": 51.0, "W": 51.9, "T": 4.9, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.0, 'H': 51.0, 'W': 51.9, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.0, 'H': 51.0, 'W': 51.9, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 345.9, "safety_factor": 0.723, "max_disp_mm": 1.1443, "max_strain": 0.0024726556407164116, "peak": {"node": 1391, "coords_mm": [6.72, -11.05, 51.0], "vm_mpa": 345.9}, "volume_mm3": 30746.1, "bbox_mm": [69.9, 51.9, 55.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.0, "safety_factor": 2.118, "max_disp_mm": 0.1698, "max_strain": 0.0008438140828778901, "volume_mm3": 71788.6, "bbox_mm": [75.9, 51.9, 61.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.395, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 676, "family": "plate_holes", "params": {"L": 117.4, "H": null, "W": 68.8, "T": 5.7, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.4, 'H': None, 'W': 68.8, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.4, 'H': None, 'W': 68.8, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 282.2, "safety_factor": 0.886, "max_disp_mm": 1.848, "max_strain": 0.0020168767505702374, "peak": {"node": 3135, "coords_mm": [-56.7, -3.64, 5.7], "vm_mpa": 282.2}, "volume_mm3": 45144.2, "bbox_mm": [117.4, 68.8, 5.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.1, "safety_factor": 2.172, "max_disp_mm": 0.495, "max_strain": 0.0008226961846174168, "volume_mm3": 76824.4, "bbox_mm": [117.4, 68.8, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.286, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 678, "family": "u_channel", "params": {"L": 104.5, "H": 45.7, "W": 46.7, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.5, 'H': 45.7, 'W': 46.7, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.5, 'H': 45.7, 'W': 46.7, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1479.6, "safety_factor": 0.169, "max_disp_mm": 4.21, "max_strain": 0.010576123560693132, "peak": {"node": 304, "coords_mm": [55.07, 2.07, 0.0], "vm_mpa": 1479.6}, "volume_mm3": 1834.2, "bbox_mm": [57.8, 45.7, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 145.3, "safety_factor": 1.72, "max_disp_mm": 0.1562, "max_strain": 0.001038938580802529, "volume_mm3": 9887.6, "bbox_mm": [57.8, 45.7, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.551, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 677, "family": "l_bracket", "params": {"L": 79.7, "H": 66.2, "W": 63.8, "T": 5.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.7, 'H': 66.2, 'W': 63.8, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.7, 'H': 66.2, 'W': 63.8, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 240.6, "safety_factor": 1.039, "max_disp_mm": 1.0268, "max_strain": 0.0017201790813665691, "peak": {"node": 2151, "coords_mm": [9.04, -56.28, 66.2], "vm_mpa": 240.6}, "volume_mm3": 52125.9, "bbox_mm": [85.1, 63.8, 71.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.1, "safety_factor": 2.575, "max_disp_mm": 0.2183, "max_strain": 0.0006940698784508587, "volume_mm3": 103708.2, "bbox_mm": [90.1, 63.8, 76.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.536, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 682, "family": "u_channel", "params": {"L": 77.2, "H": 32.0, "W": 33.0, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.2, 'H': 32.0, 'W': 33.0, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.2, 'H': 32.0, 'W': 33.0, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1934.8, "safety_factor": 0.129, "max_disp_mm": 5.1517, "max_strain": 0.013830606427554553, "peak": {"node": 232, "coords_mm": [36.94, 1.49, 0.0], "vm_mpa": 1934.8}, "volume_mm3": 616.5, "bbox_mm": [44.2, 32.0, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.5, "safety_factor": 2.462, "max_disp_mm": 0.0788, "max_strain": 0.0007257976510576601, "volume_mm3": 5330.8, "bbox_mm": [44.2, 32.0, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.333, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 683, "family": "rib_bracket", "params": {"L": 50.4, "H": 43.6, "W": 44.6, "T": 3.8, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.4, 'H': 43.6, 'W': 44.6, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.4, 'H': 43.6, 'W': 44.6, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 286.4, "safety_factor": 0.873, "max_disp_mm": 0.5679, "max_strain": 0.0020474802062082115, "peak": {"node": 1084, "coords_mm": [2.15, -30.97, 47.4], "vm_mpa": 286.4}, "volume_mm3": 16575.1, "bbox_mm": [54.2, 44.6, 47.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.6, "safety_factor": 2.759, "max_disp_mm": 0.0973, "max_strain": 0.0006478031639767618, "volume_mm3": 45368.9, "bbox_mm": [60.2, 44.6, 53.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.886, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 681, "family": "l_bracket", "params": {"L": 93.9, "H": 45.7, "W": 46.8, "T": 3.4, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 93.9, 'H': 45.7, 'W': 46.8, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 93.9, 'H': 45.7, 'W': 46.8, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 524.1, "safety_factor": 0.477, "max_disp_mm": 4.2155, "max_strain": 0.0037464253691666476, "peak": {"node": 2307, "coords_mm": [1.92, -25.89, 49.1], "vm_mpa": 524.1}, "volume_mm3": 22754.2, "bbox_mm": [97.3, 46.8, 49.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.0, "safety_factor": 2.173, "max_disp_mm": 0.3581, "max_strain": 0.0008223146587009597, "volume_mm3": 73008.0, "bbox_mm": [104.3, 46.8, 56.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.696, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 684, "family": "plate_holes", "params": {"L": 106.4, "H": null, "W": 57.8, "T": 4.2, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.4, 'H': None, 'W': 57.8, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.4, 'H': None, 'W': 57.8, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 393.2, "safety_factor": 0.636, "max_disp_mm": 2.735, "max_strain": 0.0028103814049831124, "peak": {"node": 1498, "coords_mm": [-51.56, 1.32, 0.0], "vm_mpa": 393.2}, "volume_mm3": 25407.4, "bbox_mm": [106.4, 57.8, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 136.1, "safety_factor": 1.837, "max_disp_mm": 0.5792, "max_strain": 0.0009727012829179543, "volume_mm3": 49605.0, "bbox_mm": [106.4, 57.8, 8.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.201, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 686, "family": "u_channel", "params": {"L": 89.9, "H": 38.4, "W": 39.3, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.9, 'H': 38.4, 'W': 39.3, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.9, 'H': 38.4, 'W': 39.3, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2018.8, "safety_factor": 0.124, "max_disp_mm": 5.4354, "max_strain": 0.014430369380265132, "peak": {"node": 306, "coords_mm": [47.74, 1.38, 3.5], "vm_mpa": 2018.8}, "volume_mm3": 1047.4, "bbox_mm": [50.6, 38.4, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.3, "safety_factor": 1.949, "max_disp_mm": 0.1155, "max_strain": 0.0009167758852766871, "volume_mm3": 7174.9, "bbox_mm": [50.6, 38.4, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.825, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 685, "family": "l_bracket", "params": {"L": 63.2, "H": 55.2, "W": 54.7, "T": 4.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 63.2, 'H': 55.2, 'W': 54.7, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 63.2, 'H': 55.2, 'W': 54.7, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 242.1, "safety_factor": 1.032, "max_disp_mm": 0.7558, "max_strain": 0.0017308329120639782, "peak": {"node": 1200, "coords_mm": [10.78, -28.32, 55.2], "vm_mpa": 242.1}, "volume_mm3": 28860.3, "bbox_mm": [67.5, 54.7, 59.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 72.7, "safety_factor": 3.441, "max_disp_mm": 0.1324, "max_strain": 0.0005193133278584471, "volume_mm3": 64962.3, "bbox_mm": [72.5, 54.7, 64.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.409, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 687, "family": "rib_bracket", "params": {"L": 63.0, "H": 50.0, "W": 50.9, "T": 4.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.0, 'H': 50.0, 'W': 50.9, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.0, 'H': 50.0, 'W': 50.9, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 370.6, "safety_factor": 0.675, "max_disp_mm": 1.1279, "max_strain": 0.0026488525886247225, "peak": {"node": 2011, "coords_mm": [6.49, -47.39, 54.8], "vm_mpa": 370.6}, "volume_mm3": 28780.9, "bbox_mm": [67.8, 50.9, 54.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.7, "safety_factor": 2.238, "max_disp_mm": 0.1631, "max_strain": 0.000798363975901418, "volume_mm3": 68055.3, "bbox_mm": [73.8, 50.9, 60.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.564, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 690, "family": "u_channel", "params": {"L": 102.5, "H": 44.7, "W": 45.7, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.5, 'H': 44.7, 'W': 45.7, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.5, 'H': 44.7, 'W': 45.7, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1618.6, "safety_factor": 0.154, "max_disp_mm": 4.3709, "max_strain": 0.011569804642311492, "peak": {"node": 330, "coords_mm": [53.64, 2.2, 4.2], "vm_mpa": 1618.6}, "volume_mm3": 1716.4, "bbox_mm": [56.8, 44.7, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.8, "safety_factor": 1.691, "max_disp_mm": 0.1535, "max_strain": 0.0010566100488561137, "volume_mm3": 9498.9, "bbox_mm": [56.8, 44.7, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.537, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 688, "family": "plate_holes", "params": {"L": 115.9, "H": null, "W": 67.3, "T": 5.5, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.9, 'H': None, 'W': 67.3, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.9, 'H': None, 'W': 67.3, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 291.8, "safety_factor": 0.857, "max_disp_mm": 2.0188, "max_strain": 0.0020854840831844323, "peak": {"node": 2004, "coords_mm": [-55.95, 0.06, 5.5], "vm_mpa": 291.8}, "volume_mm3": 42036.4, "bbox_mm": [115.9, 67.3, 5.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.3, "safety_factor": 2.226, "max_disp_mm": 0.5171, "max_strain": 0.0008027488300411565, "volume_mm3": 72608.4, "bbox_mm": [115.9, 67.3, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.369, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 689, "family": "l_bracket", "params": {"L": 77.4, "H": 64.7, "W": 62.6, "T": 5.3, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 77.4, 'H': 64.7, 'W': 62.6, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 77.4, 'H': 64.7, 'W': 62.6, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 250.1, "safety_factor": 1.0, "max_disp_mm": 1.0224, "max_strain": 0.0017874132116006526, "peak": {"node": 2053, "coords_mm": [9.38, -47.41, 64.7], "vm_mpa": 250.1}, "volume_mm3": 48904.4, "bbox_mm": [82.7, 62.6, 70.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.9, "safety_factor": 2.502, "max_disp_mm": 0.2106, "max_strain": 0.0007141879517964353, "volume_mm3": 98264.5, "bbox_mm": [87.7, 62.6, 75.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.502, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 694, "family": "u_channel", "params": {"L": 75.2, "H": 31.0, "W": 32.0, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.2, 'H': 31.0, 'W': 32.0, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.2, 'H': 31.0, 'W': 32.0, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2043.5, "safety_factor": 0.122, "max_disp_mm": 5.7227, "max_strain": 0.014607318485563642, "peak": {"node": 231, "coords_mm": [35.99, 1.53, 0.0], "vm_mpa": 2043.5}, "volume_mm3": 559.8, "bbox_mm": [43.2, 31.0, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.0, "safety_factor": 2.499, "max_disp_mm": 0.0766, "max_strain": 0.0007151199415593082, "volume_mm3": 5064.6, "bbox_mm": [43.2, 31.0, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.377, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 691, "family": "rib_bracket", "params": {"L": 75.7, "H": 56.3, "W": 57.2, "T": 5.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.7, 'H': 56.3, 'W': 57.2, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.7, 'H': 56.3, 'W': 57.2, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 294.7, "safety_factor": 0.848, "max_disp_mm": 1.0815, "max_strain": 0.002106328647650279, "peak": {"node": 2255, "coords_mm": [8.66, -52.05, 62.0], "vm_mpa": 294.7}, "volume_mm3": 44895.7, "bbox_mm": [81.4, 57.2, 62.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.1, "safety_factor": 2.402, "max_disp_mm": 0.1945, "max_strain": 0.0007440487080602248, "volume_mm3": 96169.8, "bbox_mm": [87.4, 57.2, 68.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.553, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 695, "family": "rib_bracket", "params": {"L": 48.4, "H": 42.6, "W": 43.6, "T": 3.7, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.4, 'H': 42.6, 'W': 43.6, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.4, 'H': 42.6, 'W': 43.6, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 265.6, "safety_factor": 0.941, "max_disp_mm": 0.5118, "max_strain": 0.0018986691304047289, "peak": {"node": 1460, "coords_mm": [3.34, -21.78, 46.3], "vm_mpa": 265.6}, "volume_mm3": 15277.0, "bbox_mm": [52.1, 43.6, 46.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 88.1, "safety_factor": 2.837, "max_disp_mm": 0.0909, "max_strain": 0.0006299812637762492, "volume_mm3": 42588.0, "bbox_mm": [58.1, 43.6, 52.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.895, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 693, "family": "l_bracket", "params": {"L": 91.7, "H": 74.2, "W": 45.5, "T": 3.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.7, 'H': 74.2, 'W': 45.5, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.7, 'H': 74.2, 'W': 45.5, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 526.0, "safety_factor": 0.475, "max_disp_mm": 4.6837, "max_strain": 0.003760230798763837, "peak": {"node": 2251, "coords_mm": [2.49, -32.68, 77.4], "vm_mpa": 526.0}, "volume_mm3": 24621.0, "bbox_mm": [94.9, 45.5, 77.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.1, "safety_factor": 1.951, "max_disp_mm": 0.3612, "max_strain": 0.0009159536809876094, "volume_mm3": 81728.0, "bbox_mm": [101.9, 45.5, 84.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.476, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 696, "family": "plate_holes", "params": {"L": 104.9, "H": null, "W": 56.3, "T": 4.0, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.9, 'H': None, 'W': 56.3, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.9, 'H': None, 'W': 56.3, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 382.4, "safety_factor": 0.654, "max_disp_mm": 2.2372, "max_strain": 0.002733678965598194, "peak": {"node": 1504, "coords_mm": [-51.09, -14.72, 0.0], "vm_mpa": 382.4}, "volume_mm3": 23221.4, "bbox_mm": [104.9, 56.3, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 145.1, "safety_factor": 1.723, "max_disp_mm": 0.6073, "max_strain": 0.0010369946426225718, "volume_mm3": 46442.7, "bbox_mm": [104.9, 56.3, 8.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.07, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 698, "family": "u_channel", "params": {"L": 87.9, "H": 37.4, "W": 38.3, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.9, 'H': 37.4, 'W': 38.3, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.9, 'H': 37.4, 'W': 38.3, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2068.9, "safety_factor": 0.121, "max_disp_mm": 5.2905, "max_strain": 0.014789104149430665, "peak": {"node": 297, "coords_mm": [47.46, 1.74, 3.4], "vm_mpa": 2068.9}, "volume_mm3": 966.4, "bbox_mm": [49.6, 37.4, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.7, "safety_factor": 2.005, "max_disp_mm": 0.1144, "max_strain": 0.0008912485920683484, "volume_mm3": 6856.7, "bbox_mm": [49.6, 37.4, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.884, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 697, "family": "l_bracket", "params": {"L": 60.9, "H": 53.7, "W": 53.4, "T": 4.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 60.9, 'H': 53.7, 'W': 53.4, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 60.9, 'H': 53.7, 'W': 53.4, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 239.5, "safety_factor": 1.044, "max_disp_mm": 0.6732, "max_strain": 0.0017120842116059294, "peak": {"node": 1795, "coords_mm": [23.21, -46.15, 57.9], "vm_mpa": 239.5}, "volume_mm3": 26644.5, "bbox_mm": [65.1, 53.4, 57.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 84.1, "safety_factor": 2.971, "max_disp_mm": 0.1267, "max_strain": 0.0006014236101339176, "volume_mm3": 60820.5, "bbox_mm": [70.1, 53.4, 62.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.928, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 699, "family": "rib_bracket", "params": {"L": 61.0, "H": 49.0, "W": 49.9, "T": 4.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.0, 'H': 49.0, 'W': 49.9, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.0, 'H': 49.0, 'W': 49.9, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 401.9, "safety_factor": 0.622, "max_disp_mm": 1.1636, "max_strain": 0.00287248132652105, "peak": {"node": 1870, "coords_mm": [6.49, -26.04, 53.6], "vm_mpa": 401.9}, "volume_mm3": 26305.3, "bbox_mm": [65.6, 49.9, 53.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.8, "safety_factor": 2.178, "max_disp_mm": 0.1593, "max_strain": 0.0008206763289751816, "volume_mm3": 63790.2, "bbox_mm": [71.6, 49.9, 59.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.555, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 700, "family": "plate_holes", "params": {"L": 114.4, "H": null, "W": 65.8, "T": 5.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.4, 'H': None, 'W': 65.8, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.4, 'H': None, 'W': 65.8, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 315.8, "safety_factor": 0.792, "max_disp_mm": 2.2018, "max_strain": 0.002257140845808053, "peak": {"node": 1818, "coords_mm": [-55.38, -12.14, 0.0], "vm_mpa": 315.8}, "volume_mm3": 39063.3, "bbox_mm": [114.4, 65.8, 5.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.9, "safety_factor": 2.121, "max_disp_mm": 0.54, "max_strain": 0.0008426767398297966, "volume_mm3": 68545.1, "bbox_mm": [114.4, 65.8, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.329, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 702, "family": "u_channel", "params": {"L": 100.5, "H": 43.7, "W": 44.7, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.5, 'H': 43.7, 'W': 44.7, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.5, 'H': 43.7, 'W': 44.7, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1427.1, "safety_factor": 0.175, "max_disp_mm": 4.5616, "max_strain": 0.010200915346334367, "peak": {"node": 104, "coords_mm": [51.26, 4.1, 0.0], "vm_mpa": 1427.1}, "volume_mm3": 1603.7, "bbox_mm": [55.8, 43.7, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 142.5, "safety_factor": 1.754, "max_disp_mm": 0.151, "max_strain": 0.0010186045437808732, "volume_mm3": 9119.7, "bbox_mm": [55.8, 43.7, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.579, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 701, "family": "l_bracket", "params": {"L": 75.2, "H": 63.2, "W": 61.4, "T": 5.1, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 75.2, 'H': 63.2, 'W': 61.4, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 75.2, 'H': 63.2, 'W': 61.4, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 263.9, "safety_factor": 0.947, "max_disp_mm": 1.0667, "max_strain": 0.001886355215671421, "peak": {"node": 1993, "coords_mm": [8.83, -31.85, 63.2], "vm_mpa": 263.9}, "volume_mm3": 44935.6, "bbox_mm": [80.3, 61.4, 68.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.8, "safety_factor": 2.409, "max_disp_mm": 0.2078, "max_strain": 0.0007417735789634995, "volume_mm3": 92090.8, "bbox_mm": [85.3, 61.4, 73.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.462, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 703, "family": "rib_bracket", "params": {"L": 73.7, "H": 55.3, "W": 56.2, "T": 5.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.7, 'H': 55.3, 'W': 56.2, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.7, 'H': 55.3, 'W': 56.2, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 305.8, "safety_factor": 0.818, "max_disp_mm": 1.056, "max_strain": 0.0021856000977799593, "peak": {"node": 2274, "coords_mm": [6.17, -28.38, 60.9], "vm_mpa": 305.8}, "volume_mm3": 42361.3, "bbox_mm": [79.3, 56.2, 60.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 106.9, "safety_factor": 2.338, "max_disp_mm": 0.189, "max_strain": 0.0007641800745004236, "volume_mm3": 91660.0, "bbox_mm": [85.3, 56.2, 66.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.521, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 706, "family": "u_channel", "params": {"L": 113.2, "H": 30.1, "W": 31.0, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.2, 'H': 30.1, 'W': 31.0, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.2, 'H': 30.1, 'W': 31.0, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4799.5, "safety_factor": 0.052, "max_disp_mm": 43.4081, "max_strain": 0.03430720012315881, "peak": {"node": 359, "coords_mm": [37.35, 1.37, 2.7], "vm_mpa": 4799.5}, "volume_mm3": 799.0, "bbox_mm": [82.2, 30.1, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 140.2, "safety_factor": 1.783, "max_disp_mm": 0.261, "max_strain": 0.0010019957620924019, "volume_mm3": 11632.2, "bbox_mm": [82.2, 30.1, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.731, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 707, "family": "rib_bracket", "params": {"L": 46.4, "H": 41.6, "W": 42.6, "T": 3.5, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.4, 'H': 41.6, 'W': 42.6, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.4, 'H': 41.6, 'W': 42.6, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 305.8, "safety_factor": 0.817, "max_disp_mm": 0.552, "max_strain": 0.0021861986883904795, "peak": {"node": 1001, "coords_mm": [1.86, -15.42, 45.1], "vm_mpa": 305.8}, "volume_mm3": 13642.7, "bbox_mm": [49.9, 42.6, 45.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.0, "safety_factor": 2.717, "max_disp_mm": 0.0878, "max_strain": 0.0006576963742968745, "volume_mm3": 39458.2, "bbox_mm": [55.9, 42.6, 51.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.9, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 705, "family": "l_bracket", "params": {"L": 89.4, "H": 72.7, "W": 69.3, "T": 3.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 89.4, 'H': 72.7, 'W': 69.3, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 89.4, 'H': 72.7, 'W': 69.3, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 334.9, "safety_factor": 0.746, "max_disp_mm": 3.2151, "max_strain": 0.0023940920350719913, "peak": {"node": 3656, "coords_mm": [3.27, -17.45, 75.8], "vm_mpa": 334.9}, "volume_mm3": 35489.9, "bbox_mm": [92.5, 69.3, 75.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.0, "safety_factor": 2.173, "max_disp_mm": 0.3895, "max_strain": 0.0008222404173538443, "volume_mm3": 95538.4, "bbox_mm": [97.5, 69.3, 80.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.427, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 708, "family": "plate_holes", "params": {"L": 103.4, "H": null, "W": 54.8, "T": 3.8, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.4, 'H': None, 'W': 54.8, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.4, 'H': None, 'W': 54.8, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 433.9, "safety_factor": 0.576, "max_disp_mm": 2.0663, "max_strain": 0.003101446575019743, "peak": {"node": 124, "coords_mm": [-51.7, 12.45, 0.0], "vm_mpa": 433.9}, "volume_mm3": 21317.1, "bbox_mm": [103.4, 54.8, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.9, "safety_factor": 1.702, "max_disp_mm": 0.6323, "max_strain": 0.00104981422127453, "volume_mm3": 43756.2, "bbox_mm": [103.4, 54.8, 7.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.126, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 710, "family": "u_channel", "params": {"L": 85.9, "H": 36.4, "W": 37.3, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 85.9, 'H': 36.4, 'W': 37.3, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 85.9, 'H': 36.4, 'W': 37.3, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2059.3, "safety_factor": 0.121, "max_disp_mm": 5.8237, "max_strain": 0.014720125359125364, "peak": {"node": 73, "coords_mm": [42.98, 3.3, 3.3], "vm_mpa": 2059.3}, "volume_mm3": 889.7, "bbox_mm": [48.6, 36.4, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.5, "safety_factor": 1.96, "max_disp_mm": 0.1107, "max_strain": 0.0009116853349990497, "volume_mm3": 6547.3, "bbox_mm": [48.6, 36.4, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.839, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 711, "family": "rib_bracket", "params": {"L": 59.1, "H": 48.0, "W": 48.9, "T": 4.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.1, 'H': 48.0, 'W': 48.9, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.1, 'H': 48.0, 'W': 48.9, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 430.9, "safety_factor": 0.58, "max_disp_mm": 1.129, "max_strain": 0.003080324394076351, "peak": {"node": 1633, "coords_mm": [6.02, -42.62, 52.5], "vm_mpa": 430.9}, "volume_mm3": 24557.6, "bbox_mm": [63.6, 48.9, 52.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.6, "safety_factor": 2.182, "max_disp_mm": 0.1529, "max_strain": 0.0008191722006592101, "volume_mm3": 60381.7, "bbox_mm": [69.6, 48.9, 58.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.601, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 712, "family": "plate_holes", "params": {"L": 112.9, "H": null, "W": 64.3, "T": 5.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.9, 'H': None, 'W': 64.3, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.9, 'H': None, 'W': 64.3, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 339.8, "safety_factor": 0.736, "max_disp_mm": 2.3853, "max_strain": 0.0024290357074298243, "peak": {"node": 1762, "coords_mm": [-54.43, 13.47, 0.0], "vm_mpa": 339.8}, "volume_mm3": 36510.6, "bbox_mm": [112.9, 64.3, 5.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.7, "safety_factor": 1.973, "max_disp_mm": 0.5601, "max_strain": 0.0009058307542782712, "volume_mm3": 65146.3, "bbox_mm": [112.9, 64.3, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.237, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 714, "family": "u_channel", "params": {"L": 98.6, "H": 42.7, "W": 43.7, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.6, 'H': 42.7, 'W': 43.7, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.6, 'H': 42.7, 'W': 43.7, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1567.3, "safety_factor": 0.16, "max_disp_mm": 4.6997, "max_strain": 0.011203404344678375, "peak": {"node": 326, "coords_mm": [49.32, 2.02, 4.0], "vm_mpa": 1567.3}, "volume_mm3": 1497.6, "bbox_mm": [54.9, 42.7, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 143.9, "safety_factor": 1.737, "max_disp_mm": 0.1481, "max_strain": 0.0010288091493793393, "volume_mm3": 8760.0, "bbox_mm": [54.9, 42.7, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.577, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 713, "family": "l_bracket", "params": {"L": 72.9, "H": 61.7, "W": 60.1, "T": 5.0, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 72.9, 'H': 61.7, 'W': 60.1, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 72.9, 'H': 61.7, 'W': 60.1, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 263.7, "safety_factor": 0.948, "max_disp_mm": 1.0458, "max_strain": 0.0018851573919105994, "peak": {"node": 2250, "coords_mm": [9.68, -29.4, 66.7], "vm_mpa": 263.7}, "volume_mm3": 41949.8, "bbox_mm": [77.9, 60.1, 66.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.8, "safety_factor": 2.297, "max_disp_mm": 0.2005, "max_strain": 0.0007778736823263886, "volume_mm3": 86904.6, "bbox_mm": [82.9, 60.1, 71.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.349, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 715, "family": "rib_bracket", "params": {"L": 71.7, "H": 54.3, "W": 55.3, "T": 5.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.7, 'H': 54.3, 'W': 55.3, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.7, 'H': 54.3, 'W': 55.3, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 329.6, "safety_factor": 0.759, "max_disp_mm": 1.092, "max_strain": 0.0023556858982501953, "peak": {"node": 1528, "coords_mm": [7.41, -39.65, 54.3], "vm_mpa": 329.6}, "volume_mm3": 39238.7, "bbox_mm": [77.1, 55.3, 59.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.2, "safety_factor": 2.333, "max_disp_mm": 0.1865, "max_strain": 0.0007660770924482214, "volume_mm3": 86619.7, "bbox_mm": [83.1, 55.3, 65.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.574, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 716, "family": "plate_holes", "params": {"L": 122.4, "H": null, "W": 73.8, "T": 6.4, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.4, 'H': None, 'W': 73.8, 'T': 6.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.4, 'H': None, 'W': 73.8, 'T': 6.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 224.9, "safety_factor": 1.112, "max_disp_mm": 1.4216, "max_strain": 0.0016075111602489053, "peak": {"node": 3891, "coords_mm": [-59.81, -13.52, 6.4], "vm_mpa": 224.9}, "volume_mm3": 56806.7, "bbox_mm": [122.4, 73.8, 6.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.0, "safety_factor": 2.687, "max_disp_mm": 0.4328, "max_strain": 0.0006649713047620799, "volume_mm3": 92310.8, "bbox_mm": [122.4, 73.8, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.576, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 718, "family": "u_channel", "params": {"L": 111.2, "H": 49.1, "W": 30.0, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.2, 'H': 49.1, 'W': 30.0, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.2, 'H': 49.1, 'W': 30.0, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4902.4, "safety_factor": 0.051, "max_disp_mm": 43.6921, "max_strain": 0.03504340759478736, "peak": {"node": 435, "coords_mm": [33.83, 1.36, 2.6], "vm_mpa": 4902.4}, "volume_mm3": 863.3, "bbox_mm": [81.2, 49.1, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 137.1, "safety_factor": 1.824, "max_disp_mm": 0.26, "max_strain": 0.000979881848095167, "volume_mm3": 13449.5, "bbox_mm": [81.2, 49.1, 10.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.773, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 720, "family": "plate_holes", "params": {"L": 101.9, "H": null, "W": 53.3, "T": 3.6, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.9, 'H': None, 'W': 53.3, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.9, 'H': None, 'W': 53.3, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 368.6, "safety_factor": 0.678, "max_disp_mm": 2.0606, "max_strain": 0.002635116991437655, "peak": {"node": 2357, "coords_mm": [-49.4, 15.75, 3.6], "vm_mpa": 368.6}, "volume_mm3": 19349.0, "bbox_mm": [101.9, 53.3, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.4, "safety_factor": 1.978, "max_disp_mm": 0.5349, "max_strain": 0.0009032340986130895, "volume_mm3": 40847.9, "bbox_mm": [101.9, 53.3, 7.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.3, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 719, "family": "rib_bracket", "params": {"L": 84.4, "H": 40.6, "W": 41.6, "T": 3.4, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.4, 'H': 40.6, 'W': 41.6, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.4, 'H': 40.6, 'W': 41.6, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 586.1, "safety_factor": 0.427, "max_disp_mm": 3.4695, "max_strain": 0.0041895573929712875, "peak": {"node": 1328, "coords_mm": [1.82, -13.54, 44.0], "vm_mpa": 586.1}, "volume_mm3": 18160.9, "bbox_mm": [87.8, 41.6, 44.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 133.3, "safety_factor": 1.876, "max_disp_mm": 0.2951, "max_strain": 0.000952522133320721, "volume_mm3": 64686.3, "bbox_mm": [95.8, 41.6, 52.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.45, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 722, "family": "u_channel", "params": {"L": 83.9, "H": 35.4, "W": 36.3, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.9, 'H': 35.4, 'W': 36.3, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.9, 'H': 35.4, 'W': 36.3, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1939.4, "safety_factor": 0.129, "max_disp_mm": 6.2172, "max_strain": 0.013863452562928615, "peak": {"node": 247, "coords_mm": [42.63, 1.56, 0.0], "vm_mpa": 1939.4}, "volume_mm3": 817.2, "bbox_mm": [47.6, 35.4, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.1, "safety_factor": 1.937, "max_disp_mm": 0.1108, "max_strain": 0.0009226506927375879, "volume_mm3": 6246.4, "bbox_mm": [47.6, 35.4, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.808, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 723, "family": "rib_bracket", "params": {"L": 57.1, "H": 47.0, "W": 47.9, "T": 4.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.1, 'H': 47.0, 'W': 47.9, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.1, 'H': 47.0, 'W': 47.9, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 305.6, "safety_factor": 0.818, "max_disp_mm": 0.7723, "max_strain": 0.0021845074301773144, "peak": {"node": 1605, "coords_mm": [7.77, -9.87, 51.3], "vm_mpa": 305.6}, "volume_mm3": 22327.1, "bbox_mm": [61.4, 47.9, 51.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.2, "safety_factor": 2.742, "max_disp_mm": 0.1117, "max_strain": 0.0006516206903913332, "volume_mm3": 56441.5, "bbox_mm": [67.4, 47.9, 57.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.924, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 724, "family": "plate_holes", "params": {"L": 111.4, "H": null, "W": 62.8, "T": 4.9, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.4, 'H': None, 'W': 62.8, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.4, 'H': None, 'W': 62.8, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 301.8, "safety_factor": 0.828, "max_disp_mm": 2.1742, "max_strain": 0.002157272098521161, "peak": {"node": 3088, "coords_mm": [-54.3, -13.28, 4.9], "vm_mpa": 301.8}, "volume_mm3": 33787.4, "bbox_mm": [111.4, 62.8, 4.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.8, "safety_factor": 2.217, "max_disp_mm": 0.4872, "max_strain": 0.0008061680481231225, "volume_mm3": 61369.0, "bbox_mm": [111.4, 62.8, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.388, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 725, "family": "l_bracket", "params": {"L": 70.7, "H": 60.2, "W": 58.9, "T": 4.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 70.7, 'H': 60.2, 'W': 58.9, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 70.7, 'H': 60.2, 'W': 58.9, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 298.6, "safety_factor": 0.837, "max_disp_mm": 1.0979, "max_strain": 0.0021346010525151735, "peak": {"node": 2143, "coords_mm": [7.78, -39.36, 65.0], "vm_mpa": 298.6}, "volume_mm3": 38365.1, "bbox_mm": [75.5, 58.9, 65.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.7, "safety_factor": 2.411, "max_disp_mm": 0.1966, "max_strain": 0.0007413047738721604, "volume_mm3": 81214.9, "bbox_mm": [80.5, 58.9, 70.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.573, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 726, "family": "u_channel", "params": {"L": 96.6, "H": 41.7, "W": 42.7, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.6, 'H': 41.7, 'W': 42.7, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.6, 'H': 41.7, 'W': 42.7, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1511.3, "safety_factor": 0.165, "max_disp_mm": 5.0765, "max_strain": 0.010802759533235676, "peak": {"node": 320, "coords_mm": [50.91, 1.91, 3.9], "vm_mpa": 1511.3}, "volume_mm3": 1394.8, "bbox_mm": [53.9, 41.7, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 141.0, "safety_factor": 1.773, "max_disp_mm": 0.1448, "max_strain": 0.001008171955485075, "volume_mm3": 8399.5, "bbox_mm": [53.9, 41.7, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.607, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 727, "family": "rib_bracket", "params": {"L": 69.7, "H": 53.3, "W": 54.3, "T": 5.3, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.7, 'H': 53.3, 'W': 54.3, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.7, 'H': 53.3, 'W': 54.3, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 300.8, "safety_factor": 0.831, "max_disp_mm": 1.0736, "max_strain": 0.0021498092209418116, "peak": {"node": 1229, "coords_mm": [11.5, -45.14, 53.3], "vm_mpa": 300.8}, "volume_mm3": 36923.5, "bbox_mm": [75.0, 54.3, 58.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.8, "safety_factor": 2.256, "max_disp_mm": 0.1792, "max_strain": 0.000791980473312499, "volume_mm3": 82405.1, "bbox_mm": [81.0, 54.3, 64.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.425, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 728, "family": "plate_holes", "params": {"L": 120.9, "H": null, "W": 72.3, "T": 6.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.9, 'H': None, 'W': 72.3, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.9, 'H': None, 'W': 72.3, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 232.9, "safety_factor": 1.074, "max_disp_mm": 1.5076, "max_strain": 0.0016644895530254476, "peak": {"node": 610, "coords_mm": [-58.44, -9.98, 0.0], "vm_mpa": 232.9}, "volume_mm3": 53220.7, "bbox_mm": [120.9, 72.3, 6.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.6, "safety_factor": 2.587, "max_disp_mm": 0.449, "max_strain": 0.0006906484467795451, "volume_mm3": 87556.7, "bbox_mm": [120.9, 72.3, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.514, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 730, "family": "u_channel", "params": {"L": 109.2, "H": 48.1, "W": 49.0, "T": 4.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.2, 'H': 48.1, 'W': 49.0, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.2, 'H': 48.1, 'W': 49.0, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 914.4, "safety_factor": 0.273, "max_disp_mm": 2.655, "max_strain": 0.006536007353415286, "peak": {"node": 368, "coords_mm": [57.36, 2.25, 4.5], "vm_mpa": 914.4}, "volume_mm3": 2101.9, "bbox_mm": [60.2, 48.1, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.6, "safety_factor": 2.485, "max_disp_mm": 0.1092, "max_strain": 0.0007190032452357761, "volume_mm3": 10782.5, "bbox_mm": [60.2, 48.1, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.212, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 729, "family": "l_bracket", "params": {"L": 85.0, "H": 69.7, "W": 66.8, "T": 5.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.0, 'H': 69.7, 'W': 66.8, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.0, 'H': 69.7, 'W': 66.8, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 214.9, "safety_factor": 1.163, "max_disp_mm": 0.9793, "max_strain": 0.0015363759659361889, "peak": {"node": 1903, "coords_mm": [12.37, -38.7, 69.7], "vm_mpa": 214.9}, "volume_mm3": 62184.1, "bbox_mm": [90.8, 66.8, 75.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.6, "safety_factor": 2.73, "max_disp_mm": 0.2266, "max_strain": 0.0006546794532585357, "volume_mm3": 119398.3, "bbox_mm": [95.8, 66.8, 80.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.566, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 732, "family": "plate_holes", "params": {"L": 100.4, "H": null, "W": 51.8, "T": 3.4, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.4, 'H': None, 'W': 51.8, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.4, 'H': None, 'W': 51.8, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 325.5, "safety_factor": 0.768, "max_disp_mm": 2.4185, "max_strain": 0.0023268269329379094, "peak": {"node": 380, "coords_mm": [-48.12, -0.1, 0.0], "vm_mpa": 325.5}, "volume_mm3": 17490.2, "bbox_mm": [100.4, 51.8, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 136.6, "safety_factor": 1.83, "max_disp_mm": 0.5625, "max_strain": 0.0009765224287010313, "volume_mm3": 38066.9, "bbox_mm": [100.4, 51.8, 7.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.062, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 734, "family": "u_channel", "params": {"L": 81.9, "H": 34.4, "W": 35.3, "T": 3.1, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.9, 'H': 34.4, 'W': 35.3, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.9, 'H': 34.4, 'W': 35.3, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2176.7, "safety_factor": 0.115, "max_disp_mm": 6.373, "max_strain": 0.015559056673047031, "peak": {"node": 240, "coords_mm": [46.65, 1.58, 0.0], "vm_mpa": 2176.7}, "volume_mm3": 748.6, "bbox_mm": [46.6, 34.4, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.1, "safety_factor": 1.999, "max_disp_mm": 0.1062, "max_strain": 0.0008940810986882016, "volume_mm3": 5954.0, "bbox_mm": [46.6, 34.4, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.884, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 731, "family": "rib_bracket", "params": {"L": 82.4, "H": 59.6, "W": 40.6, "T": 3.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.4, 'H': 59.6, 'W': 40.6, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.4, 'H': 59.6, 'W': 40.6, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 698.8, "safety_factor": 0.358, "max_disp_mm": 4.1204, "max_strain": 0.004994874410699612, "peak": {"node": 1993, "coords_mm": [1.87, -17.91, 62.8], "vm_mpa": 698.8}, "volume_mm3": 18864.4, "bbox_mm": [85.6, 40.6, 62.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 138.2, "safety_factor": 1.809, "max_disp_mm": 0.2959, "max_strain": 0.000987647140440208, "volume_mm3": 69663.1, "bbox_mm": [93.6, 40.6, 70.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.452, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 735, "family": "rib_bracket", "params": {"L": 55.1, "H": 46.0, "W": 46.9, "T": 4.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.1, 'H': 46.0, 'W': 46.9, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.1, 'H': 46.0, 'W': 46.9, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 274.9, "safety_factor": 0.91, "max_disp_mm": 0.6952, "max_strain": 0.0019647580588616226, "peak": {"node": 923, "coords_mm": [13.0, -41.21, 46.0], "vm_mpa": 274.9}, "volume_mm3": 20742.0, "bbox_mm": [59.3, 46.9, 50.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.3, "safety_factor": 2.768, "max_disp_mm": 0.1065, "max_strain": 0.0006455756740213157, "volume_mm3": 53243.7, "bbox_mm": [65.3, 46.9, 56.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.859, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 736, "family": "plate_holes", "params": {"L": 109.9, "H": null, "W": 61.4, "T": 4.7, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.9, 'H': None, 'W': 61.4, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.9, 'H': None, 'W': 61.4, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 335.3, "safety_factor": 0.746, "max_disp_mm": 2.4045, "max_strain": 0.0023965224487664505, "peak": {"node": 1559, "coords_mm": [-53.28, -7.44, 0.0], "vm_mpa": 335.3}, "volume_mm3": 31242.4, "bbox_mm": [109.9, 61.4, 4.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.1, "safety_factor": 2.154, "max_disp_mm": 0.5069, "max_strain": 0.0008295959854315612, "volume_mm3": 57831.8, "bbox_mm": [109.9, 61.4, 8.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.408, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 738, "family": "u_channel", "params": {"L": 94.6, "H": 40.7, "W": 41.7, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.6, 'H': 40.7, 'W': 41.7, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.6, 'H': 40.7, 'W': 41.7, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1603.1, "safety_factor": 0.156, "max_disp_mm": 5.2467, "max_strain": 0.011459076017709338, "peak": {"node": 278, "coords_mm": [47.32, 1.86, 0.0], "vm_mpa": 1603.1}, "volume_mm3": 1296.7, "bbox_mm": [52.9, 40.7, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 159.2, "safety_factor": 1.57, "max_disp_mm": 0.1443, "max_strain": 0.0011381490156605562, "volume_mm3": 8048.2, "bbox_mm": [52.9, 40.7, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.414, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 737, "family": "l_bracket", "params": {"L": 68.5, "H": 58.7, "W": 57.6, "T": 4.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.5, 'H': 58.7, 'W': 57.6, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.5, 'H': 58.7, 'W': 57.6, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 313.8, "safety_factor": 0.797, "max_disp_mm": 1.0771, "max_strain": 0.002242987071505296, "peak": {"node": 1748, "coords_mm": [6.11, -34.8, 58.7], "vm_mpa": 313.8}, "volume_mm3": 35708.0, "bbox_mm": [73.2, 57.6, 63.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.2, "safety_factor": 2.423, "max_disp_mm": 0.1892, "max_strain": 0.0007375564731679828, "volume_mm3": 76488.8, "bbox_mm": [78.2, 57.6, 68.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.626, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 739, "family": "rib_bracket", "params": {"L": 67.7, "H": 52.3, "W": 53.3, "T": 5.1, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.7, 'H': 52.3, 'W': 53.3, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.7, 'H': 52.3, 'W': 53.3, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 354.6, "safety_factor": 0.705, "max_disp_mm": 1.1342, "max_strain": 0.0025349935583159205, "peak": {"node": 1945, "coords_mm": [8.48, -35.7, 57.4], "vm_mpa": 354.6}, "volume_mm3": 34005.9, "bbox_mm": [72.8, 53.3, 57.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.3, "safety_factor": 2.288, "max_disp_mm": 0.1764, "max_strain": 0.0007809540805025863, "volume_mm3": 77562.7, "bbox_mm": [78.8, 53.3, 63.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.583, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 740, "family": "plate_holes", "params": {"L": 119.4, "H": null, "W": 70.9, "T": 6.0, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.4, 'H': None, 'W': 70.9, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.4, 'H': None, 'W': 70.9, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 253.3, "safety_factor": 0.987, "max_disp_mm": 1.6333, "max_strain": 0.001810616300684319, "peak": {"node": 3612, "coords_mm": [-58.04, -7.25, 6.0], "vm_mpa": 253.3}, "volume_mm3": 49850.3, "bbox_mm": [119.4, 70.9, 6.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.2, "safety_factor": 2.399, "max_disp_mm": 0.4664, "max_strain": 0.0007447856191849637, "volume_mm3": 83083.8, "bbox_mm": [119.4, 70.9, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.412, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 742, "family": "u_channel", "params": {"L": 107.3, "H": 47.1, "W": 48.0, "T": 4.4, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.3, 'H': 47.1, 'W': 48.0, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.3, 'H': 47.1, 'W': 48.0, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1523.1, "safety_factor": 0.164, "max_disp_mm": 4.1852, "max_strain": 0.010887663584363588, "peak": {"node": 312, "coords_mm": [56.57, 2.12, 0.0], "vm_mpa": 1523.1}, "volume_mm3": 1974.7, "bbox_mm": [59.3, 47.1, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.2, "safety_factor": 1.698, "max_disp_mm": 0.162, "max_strain": 0.0010523757131110625, "volume_mm3": 10383.4, "bbox_mm": [59.3, 47.1, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.534, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 741, "family": "l_bracket", "params": {"L": 82.7, "H": 68.2, "W": 65.5, "T": 5.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.7, 'H': 68.2, 'W': 65.5, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.7, 'H': 68.2, 'W': 65.5, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 252.7, "safety_factor": 0.989, "max_disp_mm": 1.011, "max_strain": 0.0018063304743644035, "peak": {"node": 1924, "coords_mm": [9.28, -40.01, 68.2], "vm_mpa": 252.7}, "volume_mm3": 57404.2, "bbox_mm": [88.3, 65.5, 73.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.5, "safety_factor": 2.463, "max_disp_mm": 0.2253, "max_strain": 0.000725498202886802, "volume_mm3": 112129.4, "bbox_mm": [93.3, 65.5, 78.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.474, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 743, "family": "rib_bracket", "params": {"L": 80.4, "H": 58.7, "W": 59.6, "T": 3.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.4, 'H': 58.7, 'W': 59.6, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.4, 'H': 58.7, 'W': 59.6, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 414.7, "safety_factor": 0.603, "max_disp_mm": 2.8348, "max_strain": 0.0029641962152674867, "peak": {"node": 2533, "coords_mm": [2.14, -18.61, 61.8], "vm_mpa": 414.7}, "volume_mm3": 26272.9, "bbox_mm": [83.5, 59.6, 61.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.8, "safety_factor": 2.298, "max_disp_mm": 0.3126, "max_strain": 0.0007775544457339048, "volume_mm3": 80377.8, "bbox_mm": [89.5, 59.6, 67.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.695, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 746, "family": "u_channel", "params": {"L": 79.9, "H": 33.4, "W": 34.4, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.9, 'H': 33.4, 'W': 34.4, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.9, 'H': 33.4, 'W': 34.4, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1878.7, "safety_factor": 0.133, "max_disp_mm": 5.3982, "max_strain": 0.013429410435293327, "peak": {"node": 230, "coords_mm": [38.3, 1.5, 0.0], "vm_mpa": 1878.7}, "volume_mm3": 683.1, "bbox_mm": [45.5, 33.4, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.9, "safety_factor": 2.362, "max_disp_mm": 0.0818, "max_strain": 0.0007566893624780602, "volume_mm3": 5661.9, "bbox_mm": [45.5, 33.4, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.229, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 747, "family": "rib_bracket", "params": {"L": 53.1, "H": 45.0, "W": 45.9, "T": 4.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.1, 'H': 45.0, 'W': 45.9, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.1, 'H': 45.0, 'W': 45.9, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 284.9, "safety_factor": 0.878, "max_disp_mm": 0.524, "max_strain": 0.002036479046077404, "peak": {"node": 1633, "coords_mm": [3.36, -21.73, 49.0], "vm_mpa": 284.9}, "volume_mm3": 18745.6, "bbox_mm": [57.1, 45.9, 49.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.8, "safety_factor": 2.694, "max_disp_mm": 0.1037, "max_strain": 0.0006634340466193749, "volume_mm3": 49617.9, "bbox_mm": [63.1, 45.9, 55.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.816, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 744, "family": "plate_holes", "params": {"L": 128.9, "H": null, "W": 50.4, "T": 3.2, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.9, 'H': None, 'W': 50.4, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.9, 'H': None, 'W': 50.4, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 668.5, "safety_factor": 0.374, "max_disp_mm": 6.3266, "max_strain": 0.004778819641089378, "peak": {"node": 2811, "coords_mm": [-62.92, -2.4, 3.2], "vm_mpa": 668.5}, "volume_mm3": 20608.0, "bbox_mm": [128.9, 50.4, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.5, "safety_factor": 2.129, "max_disp_mm": 0.684, "max_strain": 0.0008395567040256613, "volume_mm3": 59248.1, "bbox_mm": [128.9, 50.4, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.755, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 750, "family": "u_channel", "params": {"L": 92.6, "H": 39.7, "W": 40.7, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.6, 'H': 39.7, 'W': 40.7, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.6, 'H': 39.7, 'W': 40.7, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1629.4, "safety_factor": 0.153, "max_disp_mm": 4.6719, "max_strain": 0.011647382858373419, "peak": {"node": 77, "coords_mm": [46.81, 3.7, 3.7], "vm_mpa": 1629.4}, "volume_mm3": 1203.4, "bbox_mm": [51.9, 39.7, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.4, "safety_factor": 2.009, "max_disp_mm": 0.1158, "max_strain": 0.0008895162241667789, "volume_mm3": 7706.0, "bbox_mm": [51.9, 39.7, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.856, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 748, "family": "plate_holes", "params": {"L": 108.4, "H": null, "W": 59.9, "T": 4.5, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.4, 'H': None, 'W': 59.9, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.4, 'H': None, 'W': 59.9, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 353.5, "safety_factor": 0.707, "max_disp_mm": 2.6293, "max_strain": 0.0025267810047992873, "peak": {"node": 454, "coords_mm": [-52.07, -3.74, 0.0], "vm_mpa": 353.5}, "volume_mm3": 28766.8, "bbox_mm": [108.4, 59.9, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.6, "safety_factor": 2.022, "max_disp_mm": 0.533, "max_strain": 0.0008837517259020323, "volume_mm3": 54337.3, "bbox_mm": [108.4, 59.9, 8.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.315, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 749, "family": "l_bracket", "params": {"L": 66.2, "H": 57.2, "W": 56.4, "T": 4.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.2, 'H': 57.2, 'W': 56.4, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.2, 'H': 57.2, 'W': 56.4, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 350.3, "safety_factor": 0.714, "max_disp_mm": 1.1082, "max_strain": 0.002504160823070675, "peak": {"node": 2315, "coords_mm": [7.21, -36.92, 61.7], "vm_mpa": 350.3}, "volume_mm3": 32461.0, "bbox_mm": [70.7, 56.4, 61.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.1, "safety_factor": 2.38, "max_disp_mm": 0.1849, "max_strain": 0.0007509361564992117, "volume_mm3": 71207.8, "bbox_mm": [75.7, 56.4, 66.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.666, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 751, "family": "rib_bracket", "params": {"L": 65.8, "H": 51.3, "W": 52.3, "T": 5.0, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.8, 'H': 51.3, 'W': 52.3, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.8, 'H': 51.3, 'W': 52.3, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 342.5, "safety_factor": 0.73, "max_disp_mm": 1.122, "max_strain": 0.002448266986248316, "peak": {"node": 1885, "coords_mm": [6.38, -43.42, 56.3], "vm_mpa": 342.5}, "volume_mm3": 31929.1, "bbox_mm": [70.8, 52.3, 56.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.7, "safety_factor": 2.3, "max_disp_mm": 0.1698, "max_strain": 0.0007768666347880447, "volume_mm3": 73695.9, "bbox_mm": [76.8, 52.3, 62.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.57, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 752, "family": "plate_holes", "params": {"L": 117.9, "H": null, "W": 69.4, "T": 5.8, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.9, 'H': None, 'W': 69.4, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.9, 'H': None, 'W': 69.4, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 274.9, "safety_factor": 0.909, "max_disp_mm": 1.77, "max_strain": 0.0019652812469130652, "peak": {"node": 3135, "coords_mm": [-56.81, 3.74, 5.8], "vm_mpa": 274.9}, "volume_mm3": 46546.0, "bbox_mm": [117.9, 69.4, 5.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.4, "safety_factor": 2.372, "max_disp_mm": 0.4841, "max_strain": 0.0007533028582232307, "volume_mm3": 78646.8, "bbox_mm": [117.9, 69.4, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.463, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 754, "family": "u_channel", "params": {"L": 105.3, "H": 46.1, "W": 47.0, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.3, 'H': 46.1, 'W': 47.0, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.3, 'H': 46.1, 'W': 47.0, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1561.0, "safety_factor": 0.16, "max_disp_mm": 4.3573, "max_strain": 0.011158183895973813, "peak": {"node": 350, "coords_mm": [55.41, 2.08, 4.3], "vm_mpa": 1561.0}, "volume_mm3": 1850.8, "bbox_mm": [58.3, 46.1, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.0, "safety_factor": 1.713, "max_disp_mm": 0.1607, "max_strain": 0.0010433057588561147, "volume_mm3": 9983.1, "bbox_mm": [58.3, 46.1, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.553, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 753, "family": "l_bracket", "params": {"L": 80.5, "H": 66.7, "W": 64.3, "T": 5.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.5, 'H': 66.7, 'W': 64.3, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.5, 'H': 66.7, 'W': 64.3, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 238.2, "safety_factor": 1.05, "max_disp_mm": 1.0056, "max_strain": 0.0017024560782570263, "peak": {"node": 2016, "coords_mm": [9.78, -12.35, 66.7], "vm_mpa": 238.2}, "volume_mm3": 54002.4, "bbox_mm": [86.0, 64.3, 72.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.1, "safety_factor": 2.601, "max_disp_mm": 0.2175, "max_strain": 0.0006869694925328458, "volume_mm3": 106471.2, "bbox_mm": [91.0, 64.3, 77.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.552, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 756, "family": "plate_holes", "params": {"L": 127.4, "H": null, "W": 78.9, "T": 3.0, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.4, 'H': None, 'W': 78.9, 'T': 3.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.4, 'H': None, 'W': 78.9, 'T': 3.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 432.8, "safety_factor": 0.578, "max_disp_mm": 4.4132, "max_strain": 0.003093890196537184, "peak": {"node": 4240, "coords_mm": [-61.87, -11.54, 3.0], "vm_mpa": 432.8}, "volume_mm3": 29985.9, "bbox_mm": [127.4, 78.9, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.6, "safety_factor": 1.959, "max_disp_mm": 0.8396, "max_strain": 0.0009120807974291282, "volume_mm3": 69967.2, "bbox_mm": [127.4, 78.9, 7.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.382, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 755, "family": "rib_bracket", "params": {"L": 78.4, "H": 57.7, "W": 58.6, "T": 5.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 78.4, 'H': 57.7, 'W': 58.6, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 78.4, 'H': 57.7, 'W': 58.6, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 212.0, "safety_factor": 1.179, "max_disp_mm": 0.7875, "max_strain": 0.0015152605491749373, "peak": {"node": 1874, "coords_mm": [10.02, -36.27, 57.7], "vm_mpa": 212.0}, "volume_mm3": 49095.1, "bbox_mm": [84.3, 58.6, 63.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 82.4, "safety_factor": 3.033, "max_disp_mm": 0.1515, "max_strain": 0.000589128566847404, "volume_mm3": 103206.3, "bbox_mm": [90.3, 58.6, 69.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.854, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 758, "family": "u_channel", "params": {"L": 77.9, "H": 32.4, "W": 33.4, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.9, 'H': 32.4, 'W': 33.4, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.9, 'H': 32.4, 'W': 33.4, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2065.7, "safety_factor": 0.121, "max_disp_mm": 5.1978, "max_strain": 0.014765928276580105, "peak": {"node": 229, "coords_mm": [39.82, 1.48, 0.0], "vm_mpa": 2065.7}, "volume_mm3": 622.3, "bbox_mm": [44.5, 32.4, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.8, "safety_factor": 2.32, "max_disp_mm": 0.0801, "max_strain": 0.0007702560998145428, "volume_mm3": 5386.3, "bbox_mm": [44.5, 32.4, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.199, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 757, "family": "l_bracket", "params": {"L": 94.7, "H": 46.2, "W": 47.2, "T": 3.4, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.7, 'H': 46.2, 'W': 47.2, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.7, 'H': 46.2, 'W': 47.2, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 435.7, "safety_factor": 0.574, "max_disp_mm": 3.4049, "max_strain": 0.003114778989896999, "peak": {"node": 2132, "coords_mm": [2.16, -26.09, 49.6], "vm_mpa": 435.7}, "volume_mm3": 23157.3, "bbox_mm": [98.1, 47.2, 49.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.0, "safety_factor": 2.083, "max_disp_mm": 0.3619, "max_strain": 0.0008577098421993147, "volume_mm3": 74270.1, "bbox_mm": [105.1, 47.2, 56.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.51, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 759, "family": "rib_bracket", "params": {"L": 51.1, "H": 44.0, "W": 44.9, "T": 3.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.1, 'H': 44.0, 'W': 44.9, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.1, 'H': 44.0, 'W': 44.9, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 271.5, "safety_factor": 0.921, "max_disp_mm": 0.5133, "max_strain": 0.001940387997247334, "peak": {"node": 1468, "coords_mm": [1.84, -19.06, 47.9], "vm_mpa": 271.5}, "volume_mm3": 17335.9, "bbox_mm": [55.0, 44.9, 47.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.8, "safety_factor": 2.984, "max_disp_mm": 0.0972, "max_strain": 0.0005989369586605693, "volume_mm3": 46673.5, "bbox_mm": [61.0, 44.9, 53.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.063, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 762, "family": "u_channel", "params": {"L": 90.6, "H": 38.7, "W": 39.7, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.6, 'H': 38.7, 'W': 39.7, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.6, 'H': 38.7, 'W': 39.7, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1995.8, "safety_factor": 0.125, "max_disp_mm": 4.8721, "max_strain": 0.014266065937652693, "peak": {"node": 304, "coords_mm": [45.76, 1.6, 3.6], "vm_mpa": 1995.8}, "volume_mm3": 1114.6, "bbox_mm": [50.9, 38.7, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.6, "safety_factor": 2.056, "max_disp_mm": 0.1136, "max_strain": 0.0008690153861217649, "volume_mm3": 7372.8, "bbox_mm": [50.9, 38.7, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.931, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 760, "family": "plate_holes", "params": {"L": 107.0, "H": null, "W": 58.4, "T": 4.3, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.0, 'H': None, 'W': 58.4, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.0, 'H': None, 'W': 58.4, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 361.3, "safety_factor": 0.692, "max_disp_mm": 2.8492, "max_strain": 0.002582377866151763, "peak": {"node": 1521, "coords_mm": [-51.83, 22.99, 0.0], "vm_mpa": 361.3}, "volume_mm3": 26437.6, "bbox_mm": [107.0, 58.4, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.7, "safety_factor": 1.942, "max_disp_mm": 0.5616, "max_strain": 0.0009202747705541939, "volume_mm3": 51030.6, "bbox_mm": [107.0, 58.4, 8.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.25, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 761, "family": "l_bracket", "params": {"L": 64.0, "H": 55.7, "W": 55.1, "T": 4.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.0, 'H': 55.7, 'W': 55.1, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.0, 'H': 55.7, 'W': 55.1, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 300.4, "safety_factor": 0.832, "max_disp_mm": 1.031, "max_strain": 0.0021469929369184334, "peak": {"node": 1568, "coords_mm": [8.42, -23.31, 55.7], "vm_mpa": 300.4}, "volume_mm3": 30086.8, "bbox_mm": [68.4, 55.1, 60.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.3, "safety_factor": 2.287, "max_disp_mm": 0.178, "max_strain": 0.0007812618490726052, "volume_mm3": 66866.1, "bbox_mm": [73.4, 55.1, 65.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.455, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 763, "family": "rib_bracket", "params": {"L": 63.8, "H": 50.3, "W": 51.3, "T": 4.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.8, 'H': 50.3, 'W': 51.3, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.8, 'H': 50.3, 'W': 51.3, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 380.5, "safety_factor": 0.657, "max_disp_mm": 1.1748, "max_strain": 0.0027199019734433245, "peak": {"node": 1669, "coords_mm": [7.41, -38.16, 55.1], "vm_mpa": 380.5}, "volume_mm3": 29277.9, "bbox_mm": [68.6, 51.3, 55.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.7, "safety_factor": 2.239, "max_disp_mm": 0.1675, "max_strain": 0.0007981890661033199, "volume_mm3": 69199.6, "bbox_mm": [74.6, 51.3, 61.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.582, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 764, "family": "plate_holes", "params": {"L": 116.5, "H": null, "W": 67.9, "T": 5.6, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.5, 'H': None, 'W': 67.9, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.5, 'H': None, 'W': 67.9, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 278.1, "safety_factor": 0.899, "max_disp_mm": 1.9251, "max_strain": 0.0019879830675909142, "peak": {"node": 1688, "coords_mm": [-56.33, 10.82, 0.0], "vm_mpa": 278.1}, "volume_mm3": 43418.3, "bbox_mm": [116.5, 67.9, 5.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.2, "safety_factor": 2.268, "max_disp_mm": 0.5053, "max_strain": 0.0007878758248316096, "volume_mm3": 74431.4, "bbox_mm": [116.5, 67.9, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.369, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 766, "family": "u_channel", "params": {"L": 103.3, "H": 45.1, "W": 46.0, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.3, 'H': 45.1, 'W': 46.0, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.3, 'H': 45.1, 'W': 46.0, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1476.5, "safety_factor": 0.169, "max_disp_mm": 4.4923, "max_strain": 0.010553927084923096, "peak": {"node": 87, "coords_mm": [52.61, 4.2, 4.2], "vm_mpa": 1476.5}, "volume_mm3": 1732.2, "bbox_mm": [57.3, 45.1, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 148.9, "safety_factor": 1.679, "max_disp_mm": 0.1573, "max_strain": 0.0010643190205957126, "volume_mm3": 9592.5, "bbox_mm": [57.3, 45.1, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.51, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 765, "family": "l_bracket", "params": {"L": 78.2, "H": 65.2, "W": 63.1, "T": 5.3, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.2, 'H': 65.2, 'W': 63.1, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.2, 'H': 65.2, 'W': 63.1, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 278.0, "safety_factor": 0.899, "max_disp_mm": 1.0323, "max_strain": 0.001987242094646984, "peak": {"node": 2150, "coords_mm": [8.69, -29.26, 65.2], "vm_mpa": 278.0}, "volume_mm3": 49729.7, "bbox_mm": [83.5, 63.1, 70.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.3, "safety_factor": 2.493, "max_disp_mm": 0.2155, "max_strain": 0.0007168361456979884, "volume_mm3": 99894.2, "bbox_mm": [88.5, 63.1, 75.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.594, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 767, "family": "rib_bracket", "params": {"L": 76.4, "H": 56.7, "W": 57.6, "T": 5.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.4, 'H': 56.7, 'W': 57.6, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.4, 'H': 56.7, 'W': 57.6, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 300.6, "safety_factor": 0.832, "max_disp_mm": 1.0422, "max_strain": 0.0021483956970143373, "peak": {"node": 1822, "coords_mm": [9.42, -21.6, 56.7], "vm_mpa": 300.6}, "volume_mm3": 46403.7, "bbox_mm": [82.2, 57.6, 62.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 106.6, "safety_factor": 2.345, "max_disp_mm": 0.1955, "max_strain": 0.0007620469783406977, "volume_mm3": 98485.6, "bbox_mm": [88.2, 57.6, 68.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.513, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 770, "family": "u_channel", "params": {"L": 75.9, "H": 31.4, "W": 32.4, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.9, 'H': 31.4, 'W': 32.4, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.9, 'H': 31.4, 'W': 32.4, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2146.6, "safety_factor": 0.116, "max_disp_mm": 5.7584, "max_strain": 0.015344153607383492, "peak": {"node": 262, "coords_mm": [36.25, 1.44, 2.8], "vm_mpa": 2146.6}, "volume_mm3": 565.3, "bbox_mm": [43.5, 31.4, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.3, "safety_factor": 2.493, "max_disp_mm": 0.0791, "max_strain": 0.0007169286323637056, "volume_mm3": 5118.8, "bbox_mm": [43.5, 31.4, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.376, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 769, "family": "l_bracket", "params": {"L": 92.5, "H": 74.8, "W": 46.0, "T": 3.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.5, 'H': 74.8, 'W': 46.0, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.5, 'H': 74.8, 'W': 46.0, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 442.8, "safety_factor": 0.565, "max_disp_mm": 3.0789, "max_strain": 0.0031654898430035204, "peak": {"node": 2636, "coords_mm": [1.76, -35.68, 78.1], "vm_mpa": 442.8}, "volume_mm3": 25897.1, "bbox_mm": [95.8, 46.0, 78.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 165.8, "safety_factor": 1.508, "max_disp_mm": 0.6146, "max_strain": 0.0011848595118796037, "volume_mm3": 67044.1, "bbox_mm": [100.8, 46.0, 83.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 0.944, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 771, "family": "rib_bracket", "params": {"L": 49.1, "H": 43.0, "W": 43.9, "T": 3.7, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.1, 'H': 43.0, 'W': 43.9, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.1, 'H': 43.0, 'W': 43.9, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 267.6, "safety_factor": 0.934, "max_disp_mm": 0.5417, "max_strain": 0.0019126428163517121, "peak": {"node": 1371, "coords_mm": [2.13, -32.88, 46.7], "vm_mpa": 267.6}, "volume_mm3": 15560.8, "bbox_mm": [52.8, 43.9, 46.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 91.2, "safety_factor": 2.742, "max_disp_mm": 0.0942, "max_strain": 0.0006517699917000479, "volume_mm3": 43349.5, "bbox_mm": [58.8, 43.9, 52.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.807, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 772, "family": "plate_holes", "params": {"L": 105.5, "H": null, "W": 56.9, "T": 4.1, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.5, 'H': None, 'W': 56.9, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.5, 'H': None, 'W': 56.9, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 392.4, "safety_factor": 0.637, "max_disp_mm": 2.6014, "max_strain": 0.002804849285843111, "peak": {"node": 430, "coords_mm": [-50.87, 17.32, 0.0], "vm_mpa": 392.4}, "volume_mm3": 24199.9, "bbox_mm": [105.5, 56.9, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 136.7, "safety_factor": 1.828, "max_disp_mm": 0.5908, "max_strain": 0.0009774675022883085, "volume_mm3": 47809.6, "bbox_mm": [105.5, 56.9, 8.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.191, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 773, "family": "l_bracket", "params": {"L": 61.8, "H": 54.3, "W": 53.9, "T": 4.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.8, 'H': 54.3, 'W': 53.9, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.8, 'H': 54.3, 'W': 53.9, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 244.8, "safety_factor": 1.021, "max_disp_mm": 0.6619, "max_strain": 0.0017501119318348907, "peak": {"node": 1938, "coords_mm": [15.17, -48.92, 58.5], "vm_mpa": 244.8}, "volume_mm3": 27233.5, "bbox_mm": [66.0, 53.9, 58.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 81.6, "safety_factor": 3.065, "max_disp_mm": 0.1289, "max_strain": 0.0005830912862235923, "volume_mm3": 62133.8, "bbox_mm": [71.0, 53.9, 63.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.044, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 774, "family": "u_channel", "params": {"L": 88.6, "H": 37.8, "W": 38.7, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.6, 'H': 37.8, 'W': 38.7, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.6, 'H': 37.8, 'W': 38.7, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1697.4, "safety_factor": 0.147, "max_disp_mm": 5.053, "max_strain": 0.01213350438503874, "peak": {"node": 264, "coords_mm": [45.5, 1.79, 0.0], "vm_mpa": 1697.4}, "volume_mm3": 1031.4, "bbox_mm": [49.9, 37.8, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.5, "safety_factor": 1.976, "max_disp_mm": 0.111, "max_strain": 0.0009044938521035286, "volume_mm3": 7057.5, "bbox_mm": [49.9, 37.8, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.828, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 775, "family": "rib_bracket", "params": {"L": 61.8, "H": 49.3, "W": 50.3, "T": 4.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.8, 'H': 49.3, 'W': 50.3, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.8, 'H': 49.3, 'W': 50.3, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 383.7, "safety_factor": 0.651, "max_disp_mm": 1.1308, "max_strain": 0.0027430943203683228, "peak": {"node": 1369, "coords_mm": [8.55, -29.54, 49.3], "vm_mpa": 383.7}, "volume_mm3": 27376.3, "bbox_mm": [66.5, 50.3, 54.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.2, "safety_factor": 2.152, "max_disp_mm": 0.1607, "max_strain": 0.0008304616632271464, "volume_mm3": 65554.0, "bbox_mm": [72.5, 50.3, 60.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.5, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 776, "family": "plate_holes", "params": {"L": 115.0, "H": null, "W": 66.4, "T": 5.4, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.0, 'H': None, 'W': 66.4, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.0, 'H': None, 'W': 66.4, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 295.8, "safety_factor": 0.845, "max_disp_mm": 2.0912, "max_strain": 0.002114098391441589, "peak": {"node": 1780, "coords_mm": [-55.59, -14.78, 0.0], "vm_mpa": 295.8}, "volume_mm3": 40386.2, "bbox_mm": [115.0, 66.4, 5.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.4, "safety_factor": 2.204, "max_disp_mm": 0.5258, "max_strain": 0.0008107560695342483, "volume_mm3": 70301.9, "bbox_mm": [115.0, 66.4, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.359, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 778, "family": "u_channel", "params": {"L": 101.3, "H": 44.1, "W": 45.0, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.3, 'H': 44.1, 'W': 45.0, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.3, 'H': 44.1, 'W': 45.0, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1668.2, "safety_factor": 0.15, "max_disp_mm": 4.6861, "max_strain": 0.011924747134960872, "peak": {"node": 330, "coords_mm": [55.74, 2.02, 4.1], "vm_mpa": 1668.2}, "volume_mm3": 1618.8, "bbox_mm": [56.3, 44.1, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 153.9, "safety_factor": 1.625, "max_disp_mm": 0.1559, "max_strain": 0.0010997661860753136, "volume_mm3": 9211.5, "bbox_mm": [56.3, 44.1, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.475, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 777, "family": "l_bracket", "params": {"L": 76.0, "H": 63.8, "W": 61.8, "T": 5.2, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.0, 'H': 63.8, 'W': 61.8, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.0, 'H': 63.8, 'W': 61.8, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 261.6, "safety_factor": 0.956, "max_disp_mm": 1.0353, "max_strain": 0.0018699870099356595, "peak": {"node": 2396, "coords_mm": [8.57, -24.67, 69.0], "vm_mpa": 261.6}, "volume_mm3": 46597.2, "bbox_mm": [81.2, 61.8, 69.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.1, "safety_factor": 2.402, "max_disp_mm": 0.207, "max_strain": 0.000744095400487056, "volume_mm3": 94554.0, "bbox_mm": [86.2, 61.8, 74.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.446, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 779, "family": "rib_bracket", "params": {"L": 74.5, "H": 55.7, "W": 56.6, "T": 5.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.5, 'H': 55.7, 'W': 56.6, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.5, 'H': 55.7, 'W': 56.6, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 323.2, "safety_factor": 0.773, "max_disp_mm": 1.0891, "max_strain": 0.0023105112883417154, "peak": {"node": 1723, "coords_mm": [8.96, -21.99, 55.7], "vm_mpa": 323.2}, "volume_mm3": 43043.2, "bbox_mm": [80.1, 56.6, 61.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.7, "safety_factor": 2.365, "max_disp_mm": 0.1936, "max_strain": 0.0007557156465274777, "volume_mm3": 93100.2, "bbox_mm": [86.1, 56.6, 67.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.591, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 782, "family": "u_channel", "params": {"L": 114.0, "H": 30.4, "W": 31.4, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.0, 'H': 30.4, 'W': 31.4, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.0, 'H': 30.4, 'W': 31.4, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4341.8, "safety_factor": 0.058, "max_disp_mm": 42.8143, "max_strain": 0.03103585640364321, "peak": {"node": 311, "coords_mm": [34.97, 1.28, 0.0], "vm_mpa": 4341.8}, "volume_mm3": 804.1, "bbox_mm": [82.6, 30.4, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 131.4, "safety_factor": 1.903, "max_disp_mm": 0.2654, "max_strain": 0.0009389096310614046, "volume_mm3": 11712.3, "bbox_mm": [82.6, 30.4, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.846, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 781, "family": "l_bracket", "params": {"L": 90.3, "H": 73.3, "W": 69.7, "T": 3.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.3, 'H': 73.3, 'W': 69.7, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.3, 'H': 73.3, 'W': 69.7, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 325.4, "safety_factor": 0.768, "max_disp_mm": 2.7012, "max_strain": 0.0023258277845408975, "peak": {"node": 2584, "coords_mm": [2.16, -23.63, 76.4], "vm_mpa": 325.4}, "volume_mm3": 36018.9, "bbox_mm": [93.4, 69.7, 76.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.0, "safety_factor": 2.314, "max_disp_mm": 0.3973, "max_strain": 0.0007721914457951225, "volume_mm3": 96936.7, "bbox_mm": [98.4, 69.7, 81.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.546, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 783, "family": "rib_bracket", "params": {"L": 47.1, "H": 42.0, "W": 43.0, "T": 3.6, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.1, 'H': 42.0, 'W': 43.0, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.1, 'H': 42.0, 'W': 43.0, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 291.0, "safety_factor": 0.859, "max_disp_mm": 0.4844, "max_strain": 0.0020801557092977856, "peak": {"node": 1373, "coords_mm": [1.63, -27.47, 45.6], "vm_mpa": 291.0}, "volume_mm3": 14350.0, "bbox_mm": [50.7, 43.0, 45.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 88.0, "safety_factor": 2.841, "max_disp_mm": 0.0877, "max_strain": 0.0006291071767270469, "volume_mm3": 40743.4, "bbox_mm": [56.7, 43.0, 51.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.982, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 784, "family": "plate_holes", "params": {"L": 104.0, "H": null, "W": 55.4, "T": 3.9, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.0, 'H': None, 'W': 55.4, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.0, 'H': None, 'W': 55.4, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 437.0, "safety_factor": 0.572, "max_disp_mm": 2.1536, "max_strain": 0.003123684433971795, "peak": {"node": 2547, "coords_mm": [-50.53, -14.45, 3.9], "vm_mpa": 437.0}, "volume_mm3": 22249.7, "bbox_mm": [104.0, 55.4, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.2, "safety_factor": 1.711, "max_disp_mm": 0.6184, "max_strain": 0.001044732268763552, "volume_mm3": 45069.9, "bbox_mm": [104.0, 55.4, 7.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.138, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 786, "family": "u_channel", "params": {"L": 86.6, "H": 36.8, "W": 37.7, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.6, 'H': 36.8, 'W': 37.7, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.6, 'H': 36.8, 'W': 37.7, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1874.4, "safety_factor": 0.133, "max_disp_mm": 5.3975, "max_strain": 0.013398854828989525, "peak": {"node": 261, "coords_mm": [44.34, 1.74, 0.0], "vm_mpa": 1874.4}, "volume_mm3": 951.4, "bbox_mm": [48.9, 36.8, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.1, "safety_factor": 1.983, "max_disp_mm": 0.1087, "max_strain": 0.0009013004830243854, "volume_mm3": 6741.9, "bbox_mm": [48.9, 36.8, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.849, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 787, "family": "rib_bracket", "params": {"L": 59.8, "H": 48.3, "W": 49.3, "T": 4.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.8, 'H': 48.3, 'W': 49.3, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.8, 'H': 48.3, 'W': 49.3, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 426.0, "safety_factor": 0.587, "max_disp_mm": 1.1768, "max_strain": 0.0030448408447412974, "peak": {"node": 1031, "coords_mm": [11.26, -45.09, 48.3], "vm_mpa": 426.0}, "volume_mm3": 24980.3, "bbox_mm": [64.3, 49.3, 52.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.3, "safety_factor": 2.227, "max_disp_mm": 0.1573, "max_strain": 0.0008023933388097034, "volume_mm3": 61393.3, "bbox_mm": [70.3, 49.3, 58.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.64, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 790, "family": "u_channel", "params": {"L": 99.3, "H": 43.1, "W": 44.0, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.3, 'H': 43.1, 'W': 44.0, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.3, 'H': 43.1, 'W': 44.0, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1686.4, "safety_factor": 0.148, "max_disp_mm": 4.8481, "max_strain": 0.012054952284058385, "peak": {"node": 329, "coords_mm": [56.96, 1.97, 4.0], "vm_mpa": 1686.4}, "volume_mm3": 1510.4, "bbox_mm": [55.3, 43.1, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 152.5, "safety_factor": 1.639, "max_disp_mm": 0.1511, "max_strain": 0.0010902507348829137, "volume_mm3": 8840.0, "bbox_mm": [55.3, 43.1, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.491, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 788, "family": "plate_holes", "params": {"L": 113.5, "H": null, "W": 64.9, "T": 5.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.5, 'H': None, 'W': 64.9, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.5, 'H': None, 'W': 64.9, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 332.1, "safety_factor": 0.753, "max_disp_mm": 2.2835, "max_strain": 0.0023739184890793313, "peak": {"node": 1884, "coords_mm": [-55.16, -11.03, 0.0], "vm_mpa": 332.1}, "volume_mm3": 37781.2, "bbox_mm": [113.5, 64.9, 5.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.8, "safety_factor": 2.086, "max_disp_mm": 0.5448, "max_strain": 0.0008566046924020121, "volume_mm3": 66843.7, "bbox_mm": [113.5, 64.9, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.333, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 789, "family": "l_bracket", "params": {"L": 73.8, "H": 62.3, "W": 60.6, "T": 5.0, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.8, 'H': 62.3, 'W': 60.6, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.8, 'H': 62.3, 'W': 60.6, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 276.3, "safety_factor": 0.905, "max_disp_mm": 1.0758, "max_strain": 0.0019751810627197447, "peak": {"node": 1879, "coords_mm": [8.99, -48.55, 62.3], "vm_mpa": 276.3}, "volume_mm3": 42753.3, "bbox_mm": [78.8, 60.6, 67.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.4, "safety_factor": 2.441, "max_disp_mm": 0.2047, "max_strain": 0.0007319942253989345, "volume_mm3": 88536.6, "bbox_mm": [83.8, 60.6, 72.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.537, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 791, "family": "rib_bracket", "params": {"L": 72.5, "H": 54.7, "W": 55.6, "T": 5.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.5, 'H': 54.7, 'W': 55.6, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.5, 'H': 54.7, 'W': 55.6, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 307.3, "safety_factor": 0.814, "max_disp_mm": 1.064, "max_strain": 0.0021965180363162653, "peak": {"node": 1656, "coords_mm": [7.34, -39.84, 54.7], "vm_mpa": 307.3}, "volume_mm3": 40579.7, "bbox_mm": [78.0, 55.6, 60.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.6, "safety_factor": 2.323, "max_disp_mm": 0.1863, "max_strain": 0.0007692955624130128, "volume_mm3": 88684.8, "bbox_mm": [84.0, 55.6, 66.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.509, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 794, "family": "u_channel", "params": {"L": 112.0, "H": 49.4, "W": 30.4, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.0, 'H': 49.4, 'W': 30.4, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.0, 'H': 49.4, 'W': 30.4, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4301.4, "safety_factor": 0.058, "max_disp_mm": 45.0548, "max_strain": 0.030747243745777603, "peak": {"node": 437, "coords_mm": [34.23, 1.36, 2.6], "vm_mpa": 4301.4}, "volume_mm3": 868.0, "bbox_mm": [81.6, 49.4, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 140.0, "safety_factor": 1.786, "max_disp_mm": 0.2651, "max_strain": 0.0010004965773425612, "volume_mm3": 13528.1, "bbox_mm": [81.6, 49.4, 10.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.728, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 795, "family": "rib_bracket", "params": {"L": 45.1, "H": 41.0, "W": 42.0, "T": 3.4, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.1, 'H': 41.0, 'W': 42.0, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.1, 'H': 41.0, 'W': 42.0, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 252.4, "safety_factor": 0.99, "max_disp_mm": 0.5461, "max_strain": 0.0018042969072526063, "peak": {"node": 966, "coords_mm": [2.16, -28.44, 44.4], "vm_mpa": 252.4}, "volume_mm3": 12780.6, "bbox_mm": [48.5, 42.0, 44.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 89.5, "safety_factor": 2.793, "max_disp_mm": 0.0847, "max_strain": 0.0006398825299416993, "volume_mm3": 37703.4, "bbox_mm": [54.5, 42.0, 50.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.802, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 796, "family": "plate_holes", "params": {"L": 102.5, "H": null, "W": 53.9, "T": 3.7, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.5, 'H': None, 'W': 53.9, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.5, 'H': None, 'W': 53.9, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 394.4, "safety_factor": 0.634, "max_disp_mm": 1.8957, "max_strain": 0.002819576848358032, "peak": {"node": 2394, "coords_mm": [-49.71, -3.67, 3.7], "vm_mpa": 394.4}, "volume_mm3": 20232.3, "bbox_mm": [102.5, 53.9, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.2, "safety_factor": 2.029, "max_disp_mm": 0.5188, "max_strain": 0.0008807671868414624, "volume_mm3": 42105.2, "bbox_mm": [102.5, 53.9, 7.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.395, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 798, "family": "u_channel", "params": {"L": 84.6, "H": 35.8, "W": 36.7, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.6, 'H': 35.8, 'W': 36.7, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.6, 'H': 35.8, 'W': 36.7, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1899.8, "safety_factor": 0.132, "max_disp_mm": 5.6495, "max_strain": 0.013579777855994455, "peak": {"node": 279, "coords_mm": [40.7, 1.63, 3.3], "vm_mpa": 1899.8}, "volume_mm3": 875.6, "bbox_mm": [47.9, 35.8, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.1, "safety_factor": 1.967, "max_disp_mm": 0.1082, "max_strain": 0.000908648452075012, "volume_mm3": 6434.9, "bbox_mm": [47.9, 35.8, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.835, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 799, "family": "rib_bracket", "params": {"L": 57.8, "H": 47.3, "W": 48.3, "T": 4.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.8, 'H': 47.3, 'W': 48.3, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.8, 'H': 47.3, 'W': 48.3, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 424.3, "safety_factor": 0.589, "max_disp_mm": 1.1134, "max_strain": 0.003032946965404541, "peak": {"node": 1593, "coords_mm": [6.12, -6.24, 51.7], "vm_mpa": 424.3}, "volume_mm3": 23270.9, "bbox_mm": [62.2, 48.3, 51.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.7, "safety_factor": 2.124, "max_disp_mm": 0.1503, "max_strain": 0.0008414214663822875, "volume_mm3": 58018.0, "bbox_mm": [68.2, 48.3, 57.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.535, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 800, "family": "plate_holes", "params": {"L": 112.0, "H": null, "W": 63.4, "T": 5.0, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.0, 'H': None, 'W': 63.4, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.0, 'H': None, 'W': 63.4, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 306.5, "safety_factor": 0.816, "max_disp_mm": 2.0795, "max_strain": 0.0021912122585183214, "peak": {"node": 3111, "coords_mm": [-54.57, -8.52, 5.0], "vm_mpa": 306.5}, "volume_mm3": 35001.3, "bbox_mm": [112.0, 63.4, 5.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.7, "safety_factor": 2.365, "max_disp_mm": 0.4761, "max_strain": 0.0007557141283613338, "volume_mm3": 63002.4, "bbox_mm": [112.0, 63.4, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.549, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 802, "family": "u_channel", "params": {"L": 97.3, "H": 42.1, "W": 43.0, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.3, 'H': 42.1, 'W': 43.0, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.3, 'H': 42.1, 'W': 43.0, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1697.0, "safety_factor": 0.147, "max_disp_mm": 5.2479, "max_strain": 0.012130106792611721, "peak": {"node": 284, "coords_mm": [54.96, 2.03, 0.0], "vm_mpa": 1697.0}, "volume_mm3": 1406.9, "bbox_mm": [54.3, 42.1, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 149.7, "safety_factor": 1.67, "max_disp_mm": 0.1494, "max_strain": 0.0010701968082750574, "volume_mm3": 8477.9, "bbox_mm": [54.3, 42.1, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.522, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 801, "family": "l_bracket", "params": {"L": 71.5, "H": 60.8, "W": 59.3, "T": 4.9, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.5, 'H': 60.8, 'W': 59.3, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.5, 'H': 60.8, 'W': 59.3, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 267.0, "safety_factor": 0.936, "max_disp_mm": 1.049, "max_strain": 0.0019084620910830407, "peak": {"node": 1544, "coords_mm": [11.31, -53.12, 60.8], "vm_mpa": 267.0}, "volume_mm3": 39866.2, "bbox_mm": [76.4, 59.3, 65.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.1, "safety_factor": 2.497, "max_disp_mm": 0.1964, "max_strain": 0.0007157447944173945, "volume_mm3": 83481.4, "bbox_mm": [81.4, 59.3, 70.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.56, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 803, "family": "rib_bracket", "params": {"L": 70.5, "H": 53.7, "W": 54.6, "T": 5.3, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.5, 'H': 53.7, 'W': 54.6, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.5, 'H': 53.7, 'W': 54.6, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 321.8, "safety_factor": 0.777, "max_disp_mm": 1.0999, "max_strain": 0.002300404900002241, "peak": {"node": 2233, "coords_mm": [6.44, -18.61, 59.0], "vm_mpa": 321.8}, "volume_mm3": 37474.7, "bbox_mm": [75.8, 54.6, 59.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.0, "safety_factor": 2.293, "max_disp_mm": 0.1838, "max_strain": 0.0007794616133512578, "volume_mm3": 83600.8, "bbox_mm": [81.8, 54.6, 65.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.516, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 804, "family": "plate_holes", "params": {"L": 121.5, "H": null, "W": 72.9, "T": 6.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.5, 'H': None, 'W': 72.9, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.5, 'H': None, 'W': 72.9, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 224.7, "safety_factor": 1.112, "max_disp_mm": 1.5397, "max_strain": 0.0016064090275808999, "peak": {"node": 612, "coords_mm": [-58.63, -1.4, 0.0], "vm_mpa": 224.7}, "volume_mm3": 53941.7, "bbox_mm": [121.5, 72.9, 6.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.3, "safety_factor": 2.544, "max_disp_mm": 0.4514, "max_strain": 0.0007023303419843163, "volume_mm3": 88742.8, "bbox_mm": [121.5, 72.9, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.432, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 806, "family": "u_channel", "params": {"L": 110.0, "H": 48.4, "W": 49.4, "T": 2.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.0, 'H': 48.4, 'W': 49.4, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.0, 'H': 48.4, 'W': 49.4, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3631.3, "safety_factor": 0.069, "max_disp_mm": 20.8107, "max_strain": 0.025956775164993538, "peak": {"node": 309, "coords_mm": [57.93, 1.26, 0.0], "vm_mpa": 3631.3}, "volume_mm3": 665.6, "bbox_mm": [60.6, 48.4, 2.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.7, "safety_factor": 2.458, "max_disp_mm": 0.1115, "max_strain": 0.0007271092472817186, "volume_mm3": 10859.6, "bbox_mm": [60.6, 48.4, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.389, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 805, "family": "l_bracket", "params": {"L": 85.8, "H": 70.3, "W": 67.2, "T": 5.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.8, 'H': 70.3, 'W': 67.2, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.8, 'H': 70.3, 'W': 67.2, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 228.5, "safety_factor": 1.094, "max_disp_mm": 0.9983, "max_strain": 0.0016335438889851777, "peak": {"node": 1921, "coords_mm": [10.24, -47.58, 70.3], "vm_mpa": 228.5}, "volume_mm3": 63102.1, "bbox_mm": [91.6, 67.2, 76.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 86.8, "safety_factor": 2.88, "max_disp_mm": 0.2305, "max_strain": 0.0006204211010969295, "volume_mm3": 121129.3, "bbox_mm": [96.6, 67.2, 81.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.786, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 808, "family": "plate_holes", "params": {"L": 101.0, "H": null, "W": 52.4, "T": 3.5, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.0, 'H': None, 'W': 52.4, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.0, 'H': None, 'W': 52.4, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 360.9, "safety_factor": 0.693, "max_disp_mm": 2.2303, "max_strain": 0.002579563123778281, "peak": {"node": 102, "coords_mm": [-50.5, 8.73, 3.5], "vm_mpa": 360.9}, "volume_mm3": 18325.5, "bbox_mm": [101.0, 52.4, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.1, "safety_factor": 1.982, "max_disp_mm": 0.5446, "max_strain": 0.0009016168056926884, "volume_mm3": 39268.9, "bbox_mm": [101.0, 52.4, 7.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.289, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 809, "family": "l_bracket", "params": {"L": 55.0, "H": 49.8, "W": 50.2, "T": 3.8, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.0, 'H': 49.8, 'W': 50.2, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.0, 'H': 49.8, 'W': 50.2, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 233.5, "safety_factor": 1.071, "max_disp_mm": 0.4484, "max_strain": 0.001668775573107892, "peak": {"node": 1860, "coords_mm": [3.27, -28.75, 53.6], "vm_mpa": 233.5}, "volume_mm3": 20716.5, "bbox_mm": [58.8, 50.2, 53.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 79.8, "safety_factor": 3.132, "max_disp_mm": 0.1124, "max_strain": 0.0005705647198219653, "volume_mm3": 50183.9, "bbox_mm": [63.8, 50.2, 58.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.061, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 807, "family": "rib_bracket", "params": {"L": 83.1, "H": 40.0, "W": 41.0, "T": 3.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.1, 'H': 40.0, 'W': 41.0, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.1, 'H': 40.0, 'W': 41.0, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 550.9, "safety_factor": 0.454, "max_disp_mm": 3.2651, "max_strain": 0.003938076446344154, "peak": {"node": 1903, "coords_mm": [1.72, -22.35, 43.3], "vm_mpa": 550.9}, "volume_mm3": 17101.9, "bbox_mm": [86.4, 41.0, 43.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 139.4, "safety_factor": 1.793, "max_disp_mm": 0.2927, "max_strain": 0.0009964929751902635, "volume_mm3": 62267.5, "bbox_mm": [94.4, 41.0, 51.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.34, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 810, "family": "u_channel", "params": {"L": 82.6, "H": 34.8, "W": 35.7, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.6, 'H': 34.8, 'W': 35.7, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.6, 'H': 34.8, 'W': 35.7, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2007.6, "safety_factor": 0.125, "max_disp_mm": 5.7093, "max_strain": 0.014350230407408564, "peak": {"node": 87, "coords_mm": [41.33, 3.2, 0.0], "vm_mpa": 2007.6}, "volume_mm3": 803.8, "bbox_mm": [46.9, 34.8, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.6, "safety_factor": 2.023, "max_disp_mm": 0.1036, "max_strain": 0.0008835233262177065, "volume_mm3": 6136.4, "bbox_mm": [46.9, 34.8, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.898, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 811, "family": "rib_bracket", "params": {"L": 55.8, "H": 46.4, "W": 47.3, "T": 4.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.8, 'H': 46.4, 'W': 47.3, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.8, 'H': 46.4, 'W': 47.3, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 280.9, "safety_factor": 0.89, "max_disp_mm": 0.6654, "max_strain": 0.0020079938991198277, "peak": {"node": 1601, "coords_mm": [11.31, -36.76, 50.6], "vm_mpa": 280.9}, "volume_mm3": 21137.4, "bbox_mm": [60.0, 47.3, 50.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 87.8, "safety_factor": 2.849, "max_disp_mm": 0.1087, "max_strain": 0.0006272673675691345, "volume_mm3": 54228.5, "bbox_mm": [66.0, 47.3, 56.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.959, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 812, "family": "plate_holes", "params": {"L": 110.5, "H": null, "W": 61.9, "T": 4.8, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.5, 'H': None, 'W': 61.9, 'T': 4.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.5, 'H': None, 'W': 61.9, 'T': 4.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 316.9, "safety_factor": 0.789, "max_disp_mm": 2.2769, "max_strain": 0.0022648907132346305, "peak": {"node": 2992, "coords_mm": [-53.7, -7.39, 4.8], "vm_mpa": 316.9}, "volume_mm3": 32349.2, "bbox_mm": [110.5, 61.9, 4.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.6, "safety_factor": 2.182, "max_disp_mm": 0.4969, "max_strain": 0.0008189114280029962, "volume_mm3": 59306.9, "bbox_mm": [110.5, 61.9, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.393, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 814, "family": "u_channel", "params": {"L": 95.3, "H": 41.1, "W": 42.1, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.3, 'H': 41.1, 'W': 42.1, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.3, 'H': 41.1, 'W': 42.1, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1660.2, "safety_factor": 0.151, "max_disp_mm": 5.3699, "max_strain": 0.011867425195888504, "peak": {"node": 276, "coords_mm": [47.75, 1.86, 0.0], "vm_mpa": 1660.2}, "volume_mm3": 1306.8, "bbox_mm": [53.2, 41.1, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 156.6, "safety_factor": 1.597, "max_disp_mm": 0.1468, "max_strain": 0.0011192055844749583, "volume_mm3": 8115.4, "bbox_mm": [53.2, 41.1, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.446, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 813, "family": "l_bracket", "params": {"L": 69.3, "H": 59.3, "W": 58.1, "T": 4.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.3, 'H': 59.3, 'W': 58.1, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.3, 'H': 59.3, 'W': 58.1, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 304.1, "safety_factor": 0.822, "max_disp_mm": 1.1021, "max_strain": 0.002173486417706753, "peak": {"node": 1756, "coords_mm": [7.91, -41.34, 59.3], "vm_mpa": 304.1}, "volume_mm3": 36400.2, "bbox_mm": [74.0, 58.1, 64.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.1, "safety_factor": 2.379, "max_disp_mm": 0.1931, "max_strain": 0.0007511031842485927, "volume_mm3": 77941.7, "bbox_mm": [79.0, 58.1, 69.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.557, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 815, "family": "rib_bracket", "params": {"L": 68.5, "H": 52.7, "W": 53.6, "T": 5.2, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.5, 'H': 52.7, 'W': 53.6, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.5, 'H': 52.7, 'W': 53.6, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 352.2, "safety_factor": 0.71, "max_disp_mm": 1.1108, "max_strain": 0.0025177058247650938, "peak": {"node": 2352, "coords_mm": [7.95, -42.08, 57.9], "vm_mpa": 352.2}, "volume_mm3": 35230.2, "bbox_mm": [73.7, 53.6, 57.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.3, "safety_factor": 2.131, "max_disp_mm": 0.1781, "max_strain": 0.0008386000055430502, "volume_mm3": 79482.4, "bbox_mm": [79.7, 53.6, 63.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.421, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 816, "family": "plate_holes", "params": {"L": 120.0, "H": null, "W": 71.4, "T": 6.0, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.0, 'H': None, 'W': 71.4, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.0, 'H': None, 'W': 71.4, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 255.7, "safety_factor": 0.978, "max_disp_mm": 1.645, "max_strain": 0.0018277118334986545, "peak": {"node": 2075, "coords_mm": [-58.36, -7.36, 0.0], "vm_mpa": 255.7}, "volume_mm3": 50465.5, "bbox_mm": [120.0, 71.4, 6.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.7, "safety_factor": 2.41, "max_disp_mm": 0.4691, "max_strain": 0.0007414647052940421, "volume_mm3": 84109.2, "bbox_mm": [120.0, 71.4, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.432, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 818, "family": "u_channel", "params": {"L": 108.0, "H": 47.4, "W": 48.4, "T": 4.4, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.0, 'H': 47.4, 'W': 48.4, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.0, 'H': 47.4, 'W': 48.4, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1000.0, "safety_factor": 0.25, "max_disp_mm": 2.8572, "max_strain": 0.00714827772463749, "peak": {"node": 344, "coords_mm": [58.87, 2.31, 4.4], "vm_mpa": 1000.0}, "volume_mm3": 1986.3, "bbox_mm": [59.6, 47.4, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 94.2, "safety_factor": 2.655, "max_disp_mm": 0.1096, "max_strain": 0.0006730301635577142, "volume_mm3": 10448.3, "bbox_mm": [59.6, 47.4, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.405, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 817, "family": "l_bracket", "params": {"L": 83.5, "H": 68.8, "W": 66.0, "T": 5.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.5, 'H': 68.8, 'W': 66.0, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.5, 'H': 68.8, 'W': 66.0, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 215.0, "safety_factor": 1.163, "max_disp_mm": 0.9727, "max_strain": 0.0015372113427406136, "peak": {"node": 1869, "coords_mm": [10.66, -53.23, 68.8], "vm_mpa": 215.0}, "volume_mm3": 59439.6, "bbox_mm": [89.2, 66.0, 74.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.2, "safety_factor": 2.625, "max_disp_mm": 0.2234, "max_strain": 0.0006807365597311007, "volume_mm3": 115110.6, "bbox_mm": [94.2, 66.0, 79.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.463, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 819, "family": "rib_bracket", "params": {"L": 81.2, "H": 59.0, "W": 60.0, "T": 3.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.2, 'H': 59.0, 'W': 60.0, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.2, 'H': 59.0, 'W': 60.0, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 461.2, "safety_factor": 0.542, "max_disp_mm": 2.5885, "max_strain": 0.0032969482246440526, "peak": {"node": 2574, "coords_mm": [2.17, -41.27, 62.1], "vm_mpa": 461.2}, "volume_mm3": 26653.8, "bbox_mm": [84.3, 60.0, 62.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.8, "safety_factor": 2.196, "max_disp_mm": 0.3201, "max_strain": 0.0008135858245731058, "volume_mm3": 81517.8, "bbox_mm": [90.3, 60.0, 68.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.654, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 821, "family": "l_bracket", "params": {"L": 52.8, "H": 48.3, "W": 48.9, "T": 3.6, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 52.8, 'H': 48.3, 'W': 48.9, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 52.8, 'H': 48.3, 'W': 48.9, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 211.9, "safety_factor": 1.18, "max_disp_mm": 0.5107, "max_strain": 0.001514782157318937, "peak": {"node": 1630, "coords_mm": [2.41, -35.73, 51.9], "vm_mpa": 211.9}, "volume_mm3": 18431.4, "bbox_mm": [56.4, 48.9, 51.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 84.2, "safety_factor": 2.97, "max_disp_mm": 0.1089, "max_strain": 0.000601648624457057, "volume_mm3": 46133.2, "bbox_mm": [61.4, 48.9, 56.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.791, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 820, "family": "plate_holes", "params": {"L": 129.5, "H": null, "W": 50.9, "T": 3.3, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.5, 'H': None, 'W': 50.9, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.5, 'H': None, 'W': 50.9, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 482.1, "safety_factor": 0.519, "max_disp_mm": 5.7525, "max_strain": 0.0034464169708131017, "peak": {"node": 132, "coords_mm": [-64.75, -10.91, 3.3], "vm_mpa": 482.1}, "volume_mm3": 21565.5, "bbox_mm": [129.5, 50.9, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.4, "safety_factor": 2.224, "max_disp_mm": 0.6696, "max_strain": 0.0008033736091419342, "volume_mm3": 60775.5, "bbox_mm": [129.5, 50.9, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.706, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 822, "family": "u_channel", "params": {"L": 80.7, "H": 33.8, "W": 34.7, "T": 3.1, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.7, 'H': 33.8, 'W': 34.7, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.7, 'H': 33.8, 'W': 34.7, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1788.6, "safety_factor": 0.14, "max_disp_mm": 4.7691, "max_strain": 0.01278499287078674, "peak": {"node": 245, "coords_mm": [38.99, 1.73, 0.0], "vm_mpa": 1788.6}, "volume_mm3": 737.1, "bbox_mm": [46.0, 33.8, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.9, "safety_factor": 2.552, "max_disp_mm": 0.0806, "max_strain": 0.0007001388623490583, "volume_mm3": 5854.7, "bbox_mm": [46.0, 33.8, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.413, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 823, "family": "rib_bracket", "params": {"L": 53.8, "H": 45.4, "W": 46.3, "T": 4.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.8, 'H': 45.4, 'W': 46.3, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.8, 'H': 45.4, 'W': 46.3, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 258.4, "safety_factor": 0.967, "max_disp_mm": 0.6145, "max_strain": 0.0018471201881762752, "peak": {"node": 1174, "coords_mm": [2.01, -23.18, 49.5], "vm_mpa": 258.4}, "volume_mm3": 19609.4, "bbox_mm": [57.9, 46.3, 49.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.5, "safety_factor": 2.675, "max_disp_mm": 0.104, "max_strain": 0.0006681510600442215, "volume_mm3": 51112.0, "bbox_mm": [63.9, 46.3, 55.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.707, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 824, "family": "plate_holes", "params": {"L": 109.0, "H": null, "W": 60.4, "T": 4.6, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.0, 'H': None, 'W': 60.4, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.0, 'H': None, 'W': 60.4, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 341.8, "safety_factor": 0.731, "max_disp_mm": 2.5136, "max_strain": 0.0024430284215506237, "peak": {"node": 469, "coords_mm": [-52.41, 4.83, 0.0], "vm_mpa": 341.8}, "volume_mm3": 29822.1, "bbox_mm": [109.0, 60.4, 4.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.9, "safety_factor": 2.139, "max_disp_mm": 0.5186, "max_strain": 0.0008353294114449636, "volume_mm3": 55754.4, "bbox_mm": [109.0, 60.4, 8.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.408, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 825, "family": "l_bracket", "params": {"L": 67.1, "H": 57.8, "W": 56.8, "T": 4.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.1, 'H': 57.8, 'W': 56.8, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.1, 'H': 57.8, 'W': 56.8, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 317.8, "safety_factor": 0.787, "max_disp_mm": 1.0756, "max_strain": 0.002271429978854158, "peak": {"node": 2365, "coords_mm": [7.41, -38.51, 62.4], "vm_mpa": 317.8}, "volume_mm3": 33835.8, "bbox_mm": [71.7, 56.8, 62.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.4, "safety_factor": 2.305, "max_disp_mm": 0.1846, "max_strain": 0.0007751413497616909, "volume_mm3": 73340.2, "bbox_mm": [76.7, 56.8, 67.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.519, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 826, "family": "u_channel", "params": {"L": 93.3, "H": 40.1, "W": 41.1, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.3, 'H': 40.1, 'W': 41.1, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.3, 'H': 40.1, 'W': 41.1, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1623.8, "safety_factor": 0.154, "max_disp_mm": 4.735, "max_strain": 0.011606991517880591, "peak": {"node": 275, "coords_mm": [46.01, 2.1, 0.0], "vm_mpa": 1623.8}, "volume_mm3": 1212.9, "bbox_mm": [52.2, 40.1, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.5, "safety_factor": 1.961, "max_disp_mm": 0.1179, "max_strain": 0.0009114300632883159, "volume_mm3": 7771.8, "bbox_mm": [52.2, 40.1, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.807, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 827, "family": "rib_bracket", "params": {"L": 66.5, "H": 51.7, "W": 52.6, "T": 5.0, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.5, 'H': 51.7, 'W': 52.6, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.5, 'H': 51.7, 'W': 52.6, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 347.0, "safety_factor": 0.72, "max_disp_mm": 1.1411, "max_strain": 0.0024806551471342514, "peak": {"node": 1871, "coords_mm": [5.88, -5.75, 56.7], "vm_mpa": 347.0}, "volume_mm3": 32401.6, "bbox_mm": [71.5, 52.6, 56.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.5, "safety_factor": 2.283, "max_disp_mm": 0.1746, "max_strain": 0.000782877853575226, "volume_mm3": 74755.1, "bbox_mm": [77.5, 52.6, 62.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.562, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 828, "family": "plate_holes", "params": {"L": 118.5, "H": null, "W": 69.9, "T": 5.8, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.5, 'H': None, 'W': 69.9, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.5, 'H': None, 'W': 69.9, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 268.0, "safety_factor": 0.933, "max_disp_mm": 1.7793, "max_strain": 0.001915426556584964, "peak": {"node": 2117, "coords_mm": [-57.16, 1.39, 5.8], "vm_mpa": 268.0}, "volume_mm3": 47131.2, "bbox_mm": [118.5, 69.9, 5.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 106.2, "safety_factor": 2.353, "max_disp_mm": 0.4865, "max_strain": 0.00075941034197995, "volume_mm3": 79635.5, "bbox_mm": [118.5, 69.9, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.42, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 829, "family": "l_bracket", "params": {"L": 81.3, "H": 67.3, "W": 64.8, "T": 5.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.3, 'H': 67.3, 'W': 64.8, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.3, 'H': 67.3, 'W': 64.8, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 242.2, "safety_factor": 1.032, "max_disp_mm": 1.0232, "max_strain": 0.0017313956850493685, "peak": {"node": 3176, "coords_mm": [6.48, -16.17, 72.8], "vm_mpa": 242.2}, "volume_mm3": 54921.2, "bbox_mm": [86.8, 64.8, 72.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.5, "safety_factor": 2.764, "max_disp_mm": 0.2213, "max_strain": 0.0006466007056612932, "volume_mm3": 108251.6, "bbox_mm": [91.8, 64.8, 77.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.732, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 830, "family": "u_channel", "params": {"L": 106.0, "H": 46.4, "W": 47.4, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.0, 'H': 46.4, 'W': 47.4, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.0, 'H': 46.4, 'W': 47.4, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1580.2, "safety_factor": 0.158, "max_disp_mm": 4.4089, "max_strain": 0.011295635805086702, "peak": {"node": 349, "coords_mm": [53.4, 2.07, 4.3], "vm_mpa": 1580.2}, "volume_mm3": 1861.9, "bbox_mm": [58.6, 46.4, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.7, "safety_factor": 1.692, "max_disp_mm": 0.1626, "max_strain": 0.0010559585750600068, "volume_mm3": 10046.7, "bbox_mm": [58.6, 46.4, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.534, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 834, "family": "u_channel", "params": {"L": 78.7, "H": 32.8, "W": 33.7, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.7, 'H': 32.8, 'W': 33.7, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.7, 'H': 32.8, 'W': 33.7, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1915.2, "safety_factor": 0.131, "max_disp_mm": 4.9123, "max_strain": 0.013690133937427256, "peak": {"node": 257, "coords_mm": [40.23, 1.53, 3.0], "vm_mpa": 1915.2}, "volume_mm3": 673.2, "bbox_mm": [45.0, 32.8, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.3, "safety_factor": 2.544, "max_disp_mm": 0.0804, "max_strain": 0.0007024291027368198, "volume_mm3": 5572.8, "bbox_mm": [45.0, 32.8, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.414, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 835, "family": "rib_bracket", "params": {"L": 51.8, "H": 44.4, "W": 45.3, "T": 3.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.8, 'H': 44.4, 'W': 45.3, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.8, 'H': 44.4, 'W': 45.3, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 266.9, "safety_factor": 0.937, "max_disp_mm": 0.4859, "max_strain": 0.0019077082958936708, "peak": {"node": 1540, "coords_mm": [1.89, -25.06, 48.3], "vm_mpa": 266.9}, "volume_mm3": 17684.7, "bbox_mm": [55.7, 45.3, 48.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 87.2, "safety_factor": 2.867, "max_disp_mm": 0.0998, "max_strain": 0.0006233534527081799, "volume_mm3": 47582.7, "bbox_mm": [61.7, 45.3, 54.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.93, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 832, "family": "plate_holes", "params": {"L": 128.0, "H": null, "W": 79.4, "T": 3.1, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.0, 'H': None, 'W': 79.4, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.0, 'H': None, 'W': 79.4, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 417.9, "safety_factor": 0.598, "max_disp_mm": 4.1313, "max_strain": 0.002987088983022436, "peak": {"node": 2443, "coords_mm": [-62.7, -8.68, 0.0], "vm_mpa": 417.9}, "volume_mm3": 31330.6, "bbox_mm": [128.0, 79.4, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.7, "safety_factor": 2.088, "max_disp_mm": 0.8215, "max_strain": 0.0008557242726727906, "volume_mm3": 71757.2, "bbox_mm": [128.0, 79.4, 7.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.49, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 838, "family": "u_channel", "params": {"L": 91.3, "H": 39.1, "W": 40.1, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.3, 'H': 39.1, 'W': 40.1, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.3, 'H': 39.1, 'W': 40.1, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1686.8, "safety_factor": 0.148, "max_disp_mm": 4.8964, "max_strain": 0.012057449128635348, "peak": {"node": 270, "coords_mm": [45.01, 2.21, 0.0], "vm_mpa": 1686.8}, "volume_mm3": 1123.6, "bbox_mm": [51.2, 39.1, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.1, "safety_factor": 1.951, "max_disp_mm": 0.1158, "max_strain": 0.0009158988672890773, "volume_mm3": 7437.3, "bbox_mm": [51.2, 39.1, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.803, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 836, "family": "plate_holes", "params": {"L": 107.5, "H": null, "W": 58.9, "T": 4.4, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.5, 'H': None, 'W': 58.9, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.5, 'H': None, 'W': 58.9, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 340.7, "safety_factor": 0.734, "max_disp_mm": 2.5414, "max_strain": 0.002435381749249126, "peak": {"node": 2708, "coords_mm": [-51.85, 13.12, 4.4], "vm_mpa": 340.7}, "volume_mm3": 27417.4, "bbox_mm": [107.5, 58.9, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.8, "safety_factor": 1.972, "max_disp_mm": 0.5439, "max_strain": 0.0009060962007704139, "volume_mm3": 52342.2, "bbox_mm": [107.5, 58.9, 8.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.238, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 837, "family": "l_bracket", "params": {"L": 64.8, "H": 56.3, "W": 55.6, "T": 4.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.8, 'H': 56.3, 'W': 55.6, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.8, 'H': 56.3, 'W': 55.6, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 322.1, "safety_factor": 0.776, "max_disp_mm": 1.0786, "max_strain": 0.002302206942077763, "peak": {"node": 1576, "coords_mm": [8.43, -10.47, 56.3], "vm_mpa": 322.1}, "volume_mm3": 30702.3, "bbox_mm": [69.2, 55.6, 60.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.4, "safety_factor": 2.306, "max_disp_mm": 0.1809, "max_strain": 0.0007749861991907062, "volume_mm3": 68204.5, "bbox_mm": [74.2, 55.6, 65.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.53, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 839, "family": "rib_bracket", "params": {"L": 64.5, "H": 50.7, "W": 51.6, "T": 4.9, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.5, 'H': 50.7, 'W': 51.6, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.5, 'H': 50.7, 'W': 51.6, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 355.4, "safety_factor": 0.703, "max_disp_mm": 1.1363, "max_strain": 0.002540519615975939, "peak": {"node": 1721, "coords_mm": [6.31, -23.6, 55.6], "vm_mpa": 355.4}, "volume_mm3": 30366.1, "bbox_mm": [69.4, 51.6, 55.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.9, "safety_factor": 2.215, "max_disp_mm": 0.1676, "max_strain": 0.0008067767925973551, "volume_mm3": 70923.7, "bbox_mm": [75.4, 51.6, 61.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.512, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 840, "family": "plate_holes", "params": {"L": 117.0, "H": null, "W": 68.4, "T": 5.6, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.0, 'H': None, 'W': 68.4, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.0, 'H': None, 'W': 68.4, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 301.7, "safety_factor": 0.829, "max_disp_mm": 1.9236, "max_strain": 0.002156926003007839, "peak": {"node": 2052, "coords_mm": [-57.23, -13.44, 0.0], "vm_mpa": 301.7}, "volume_mm3": 43936.0, "bbox_mm": [117.0, 68.4, 5.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.3, "safety_factor": 2.168, "max_disp_mm": 0.5077, "max_strain": 0.000824401502430442, "volume_mm3": 75318.9, "bbox_mm": [117.0, 68.4, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.339, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 842, "family": "u_channel", "params": {"L": 104.0, "H": 45.5, "W": 46.4, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.0, 'H': 45.5, 'W': 46.4, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.0, 'H': 45.5, 'W': 46.4, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1408.9, "safety_factor": 0.177, "max_disp_mm": 4.5208, "max_strain": 0.010071238207606649, "peak": {"node": 306, "coords_mm": [57.06, 2.05, 0.0], "vm_mpa": 1408.9}, "volume_mm3": 1744.6, "bbox_mm": [57.6, 45.5, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.5, "safety_factor": 1.707, "max_disp_mm": 0.1587, "max_strain": 0.0010469281686117148, "volume_mm3": 9665.3, "bbox_mm": [57.6, 45.5, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.529, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 841, "family": "l_bracket", "params": {"L": 79.1, "H": 65.8, "W": 63.5, "T": 5.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.1, 'H': 65.8, 'W': 63.5, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.1, 'H': 65.8, 'W': 63.5, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 241.5, "safety_factor": 1.035, "max_disp_mm": 1.0243, "max_strain": 0.0017264110881166884, "peak": {"node": 1764, "coords_mm": [9.13, -6.36, 65.8], "vm_mpa": 241.5}, "volume_mm3": 51537.9, "bbox_mm": [84.5, 63.5, 71.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.2, "safety_factor": 2.545, "max_disp_mm": 0.2145, "max_strain": 0.0007020808602592249, "volume_mm3": 102560.1, "bbox_mm": [89.5, 63.5, 76.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.51, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 843, "family": "rib_bracket", "params": {"L": 77.2, "H": 57.0, "W": 58.0, "T": 5.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.2, 'H': 57.0, 'W': 58.0, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.2, 'H': 57.0, 'W': 58.0, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 289.4, "safety_factor": 0.864, "max_disp_mm": 1.068, "max_strain": 0.002068432968496077, "peak": {"node": 1655, "coords_mm": [7.89, -39.88, 57.0], "vm_mpa": 289.4}, "volume_mm3": 47096.0, "bbox_mm": [83.0, 58.0, 62.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.1, "safety_factor": 2.449, "max_disp_mm": 0.1994, "max_strain": 0.0007297980947163283, "volume_mm3": 99922.4, "bbox_mm": [89.0, 58.0, 68.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.585, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 846, "family": "u_channel", "params": {"L": 76.7, "H": 31.8, "W": 32.7, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.7, 'H': 31.8, 'W': 32.7, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.7, 'H': 31.8, 'W': 32.7, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2178.4, "safety_factor": 0.115, "max_disp_mm": 5.1312, "max_strain": 0.015571486663972369, "peak": {"node": 232, "coords_mm": [36.63, 1.49, 0.0], "vm_mpa": 2178.4}, "volume_mm3": 613.1, "bbox_mm": [44.0, 31.8, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.0, "safety_factor": 2.381, "max_disp_mm": 0.0781, "max_strain": 0.0007505482443753033, "volume_mm3": 5299.1, "bbox_mm": [44.0, 31.8, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.266, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 847, "family": "rib_bracket", "params": {"L": 49.8, "H": 43.4, "W": 44.3, "T": 3.8, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.8, 'H': 43.4, 'W': 44.3, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.8, 'H': 43.4, 'W': 44.3, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 270.8, "safety_factor": 0.923, "max_disp_mm": 0.5174, "max_strain": 0.0019359695903945595, "peak": {"node": 1445, "coords_mm": [2.17, -18.49, 47.2], "vm_mpa": 270.8}, "volume_mm3": 16329.0, "bbox_mm": [53.6, 44.3, 47.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 86.4, "safety_factor": 2.894, "max_disp_mm": 0.0942, "max_strain": 0.0006175099278189658, "volume_mm3": 44716.4, "bbox_mm": [59.6, 44.3, 53.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.971, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 845, "family": "l_bracket", "params": {"L": 93.3, "H": 45.3, "W": 46.4, "T": 3.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 93.3, 'H': 45.3, 'W': 46.4, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 93.3, 'H': 45.3, 'W': 46.4, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 463.1, "safety_factor": 0.54, "max_disp_mm": 4.2618, "max_strain": 0.0033101236300588973, "peak": {"node": 1568, "coords_mm": [2.11, -23.2, 48.6], "vm_mpa": 463.1}, "volume_mm3": 21727.7, "bbox_mm": [96.6, 46.4, 48.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.1, "safety_factor": 2.031, "max_disp_mm": 0.3632, "max_strain": 0.0008798764003040557, "volume_mm3": 71162.3, "bbox_mm": [103.6, 46.4, 55.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.491, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 848, "family": "plate_holes", "params": {"L": 106.0, "H": null, "W": 57.4, "T": 4.2, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.0, 'H': None, 'W': 57.4, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.0, 'H': None, 'W': 57.4, 'T': 4.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 344.6, "safety_factor": 0.726, "max_disp_mm": 2.7382, "max_strain": 0.002463018895257687, "peak": {"node": 2655, "coords_mm": [-51.48, -12.42, 4.2], "vm_mpa": 344.6}, "volume_mm3": 25132.2, "bbox_mm": [106.0, 57.4, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.9, "safety_factor": 1.925, "max_disp_mm": 0.573, "max_strain": 0.0009285194433847017, "volume_mm3": 49067.7, "bbox_mm": [106.0, 57.4, 8.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.199, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 850, "family": "u_channel", "params": {"L": 89.4, "H": 38.1, "W": 39.1, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.4, 'H': 38.1, 'W': 39.1, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 89.4, 'H': 38.1, 'W': 39.1, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1757.2, "safety_factor": 0.142, "max_disp_mm": 5.2505, "max_strain": 0.012560483533360702, "peak": {"node": 267, "coords_mm": [45.08, 1.38, 0.0], "vm_mpa": 1757.2}, "volume_mm3": 1040.0, "bbox_mm": [50.3, 38.1, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.4, "safety_factor": 2.076, "max_disp_mm": 0.1139, "max_strain": 0.0008608558349541693, "volume_mm3": 7120.7, "bbox_mm": [50.3, 38.1, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.934, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 849, "family": "l_bracket", "params": {"L": 62.6, "H": 54.8, "W": 54.4, "T": 4.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 62.6, 'H': 54.8, 'W': 54.4, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 62.6, 'H': 54.8, 'W': 54.4, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 246.1, "safety_factor": 1.016, "max_disp_mm": 0.7562, "max_strain": 0.0017593380326170673, "peak": {"node": 1478, "coords_mm": [14.0, -3.92, 54.8], "vm_mpa": 246.1}, "volume_mm3": 28468.1, "bbox_mm": [66.9, 54.4, 59.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 79.6, "safety_factor": 3.141, "max_disp_mm": 0.1296, "max_strain": 0.0005689837361520926, "volume_mm3": 64100.1, "bbox_mm": [71.9, 54.4, 64.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.125, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 851, "family": "rib_bracket", "params": {"L": 62.5, "H": 49.7, "W": 50.7, "T": 4.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.5, 'H': 49.7, 'W': 50.7, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.5, 'H': 49.7, 'W': 50.7, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 372.8, "safety_factor": 0.671, "max_disp_mm": 1.1897, "max_strain": 0.0026645587332628303, "peak": {"node": 1740, "coords_mm": [5.7, -33.41, 54.4], "vm_mpa": 372.8}, "volume_mm3": 27856.1, "bbox_mm": [67.2, 50.7, 54.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.2, "safety_factor": 2.169, "max_disp_mm": 0.1644, "max_strain": 0.0008238005796643175, "volume_mm3": 66672.0, "bbox_mm": [73.2, 50.7, 60.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.499, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 854, "family": "u_channel", "params": {"L": 102.0, "H": 44.5, "W": 45.4, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.0, 'H': 44.5, 'W': 45.4, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.0, 'H': 44.5, 'W': 45.4, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1554.8, "safety_factor": 0.161, "max_disp_mm": 4.7271, "max_strain": 0.011113736063597508, "peak": {"node": 326, "coords_mm": [48.98, 1.81, 4.1], "vm_mpa": 1554.8}, "volume_mm3": 1630.6, "bbox_mm": [56.6, 44.5, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.3, "safety_factor": 1.709, "max_disp_mm": 0.1563, "max_strain": 0.0010454981443170444, "volume_mm3": 9282.9, "bbox_mm": [56.6, 44.5, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.548, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 852, "family": "plate_holes", "params": {"L": 115.5, "H": null, "W": 66.9, "T": 5.4, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.5, 'H': None, 'W': 66.9, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.5, 'H': None, 'W': 66.9, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 314.5, "safety_factor": 0.795, "max_disp_mm": 2.1262, "max_strain": 0.0022484448906064875, "peak": {"node": 1828, "coords_mm": [-55.76, -7.63, 0.0], "vm_mpa": 314.5}, "volume_mm3": 40877.3, "bbox_mm": [115.5, 66.9, 5.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.2, "safety_factor": 2.17, "max_disp_mm": 0.5297, "max_strain": 0.0008233524271875478, "volume_mm3": 71156.8, "bbox_mm": [115.5, 66.9, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.376, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 853, "family": "l_bracket", "params": {"L": 76.8, "H": 64.3, "W": 62.3, "T": 5.2, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.8, 'H': 64.3, 'W': 62.3, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.8, 'H': 64.3, 'W': 62.3, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 264.2, "safety_factor": 0.946, "max_disp_mm": 1.0514, "max_strain": 0.0018884769937504691, "peak": {"node": 1776, "coords_mm": [9.3, -47.31, 64.3], "vm_mpa": 264.2}, "volume_mm3": 47395.3, "bbox_mm": [82.0, 62.3, 69.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.9, "safety_factor": 2.405, "max_disp_mm": 0.2119, "max_strain": 0.000743011614006868, "volume_mm3": 96145.1, "bbox_mm": [87.0, 62.3, 74.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.459, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 858, "family": "u_channel", "params": {"L": 114.7, "H": 30.8, "W": 31.7, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.7, 'H': 30.8, 'W': 31.7, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.7, 'H': 30.8, 'W': 31.7, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4016.4, "safety_factor": 0.062, "max_disp_mm": 39.9595, "max_strain": 0.028709791761050932, "peak": {"node": 66, "coords_mm": [39.36, 2.8, 2.8], "vm_mpa": 4016.4}, "volume_mm3": 870.2, "bbox_mm": [83.0, 30.8, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 130.8, "safety_factor": 1.912, "max_disp_mm": 0.2583, "max_strain": 0.0009348776369547187, "volume_mm3": 12013.9, "bbox_mm": [83.0, 30.8, 10.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.849, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 855, "family": "rib_bracket", "params": {"L": 75.2, "H": 56.0, "W": 57.0, "T": 5.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.2, 'H': 56.0, 'W': 57.0, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.2, 'H': 56.0, 'W': 57.0, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 300.1, "safety_factor": 0.833, "max_disp_mm": 1.0647, "max_strain": 0.0021451191457813267, "peak": {"node": 1003, "coords_mm": [7.7, -38.44, 56.0], "vm_mpa": 300.1}, "volume_mm3": 44478.8, "bbox_mm": [80.9, 57.0, 61.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.7, "safety_factor": 2.321, "max_disp_mm": 0.1926, "max_strain": 0.0007700180705561226, "volume_mm3": 95300.0, "bbox_mm": [86.9, 57.0, 67.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.488, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 859, "family": "rib_bracket", "params": {"L": 47.9, "H": 42.4, "W": 43.3, "T": 3.6, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.9, 'H': 42.4, 'W': 43.3, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.9, 'H': 42.4, 'W': 43.3, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 303.3, "safety_factor": 0.824, "max_disp_mm": 0.551, "max_strain": 0.0021682303967240197, "peak": {"node": 1388, "coords_mm": [1.81, -20.43, 46.0], "vm_mpa": 303.3}, "volume_mm3": 14637.1, "bbox_mm": [51.5, 43.3, 46.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 89.0, "safety_factor": 2.809, "max_disp_mm": 0.0914, "max_strain": 0.0006362429515301316, "volume_mm3": 41526.4, "bbox_mm": [57.5, 43.3, 52.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.985, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 857, "family": "l_bracket", "params": {"L": 91.1, "H": 73.8, "W": 45.2, "T": 3.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.1, 'H': 73.8, 'W': 45.2, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.1, 'H': 73.8, 'W': 45.2, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 455.9, "safety_factor": 0.548, "max_disp_mm": 3.4382, "max_strain": 0.0032585535503879344, "peak": {"node": 2400, "coords_mm": [2.18, -19.98, 77.0], "vm_mpa": 455.9}, "volume_mm3": 24314.0, "bbox_mm": [94.3, 45.2, 77.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.9, "safety_factor": 1.986, "max_disp_mm": 0.3566, "max_strain": 0.0008999805416835484, "volume_mm3": 80728.1, "bbox_mm": [101.3, 45.2, 84.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.437, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 860, "family": "plate_holes", "params": {"L": 104.5, "H": null, "W": 55.9, "T": 4.0, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.5, 'H': None, 'W': 55.9, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.5, 'H': None, 'W': 55.9, 'T': 4.0, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 368.5, "safety_factor": 0.678, "max_disp_mm": 2.3378, "max_strain": 0.0026342848248710415, "peak": {"node": 1487, "coords_mm": [-50.89, -14.66, 0.0], "vm_mpa": 368.5}, "volume_mm3": 22964.1, "bbox_mm": [104.5, 55.9, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.3, "safety_factor": 1.697, "max_disp_mm": 0.6067, "max_strain": 0.001052797707444157, "volume_mm3": 45928.2, "bbox_mm": [104.5, 55.9, 8.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.019, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 862, "family": "u_channel", "params": {"L": 87.4, "H": 37.1, "W": 38.1, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.4, 'H': 37.1, 'W': 38.1, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 87.4, 'H': 37.1, 'W': 38.1, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1909.5, "safety_factor": 0.131, "max_disp_mm": 5.5247, "max_strain": 0.013649701399585996, "peak": {"node": 92, "coords_mm": [43.92, 3.4, 0.0], "vm_mpa": 1909.5}, "volume_mm3": 959.5, "bbox_mm": [49.3, 37.1, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.2, "safety_factor": 1.935, "max_disp_mm": 0.1119, "max_strain": 0.0009235743624899153, "volume_mm3": 6803.7, "bbox_mm": [49.3, 37.1, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.804, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 861, "family": "l_bracket", "params": {"L": 60.3, "H": 53.3, "W": 53.1, "T": 4.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 60.3, 'H': 53.3, 'W': 53.1, 'T': 4.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 60.3, 'H': 53.3, 'W': 53.1, 'T': 4.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 211.6, "safety_factor": 1.181, "max_disp_mm": 0.5779, "max_strain": 0.0015125742221505157, "peak": {"node": 1982, "coords_mm": [1.84, -32.6, 57.4], "vm_mpa": 211.6}, "volume_mm3": 25624.5, "bbox_mm": [64.4, 53.1, 57.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.6, "safety_factor": 2.992, "max_disp_mm": 0.1263, "max_strain": 0.0005973560306155579, "volume_mm3": 59289.9, "bbox_mm": [69.4, 53.1, 62.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.81, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 863, "family": "rib_bracket", "params": {"L": 60.5, "H": 48.7, "W": 49.7, "T": 4.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.5, 'H': 48.7, 'W': 49.7, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.5, 'H': 48.7, 'W': 49.7, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 399.9, "safety_factor": 0.625, "max_disp_mm": 1.1284, "max_strain": 0.0028585412154184236, "peak": {"node": 1627, "coords_mm": [5.82, -23.15, 53.3], "vm_mpa": 399.9}, "volume_mm3": 26017.0, "bbox_mm": [65.1, 49.7, 53.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.4, "safety_factor": 2.307, "max_disp_mm": 0.1567, "max_strain": 0.0007747844756047854, "volume_mm3": 63113.0, "bbox_mm": [71.1, 49.7, 59.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.681, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 866, "family": "u_channel", "params": {"L": 100.0, "H": 43.5, "W": 44.4, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.0, 'H': 43.5, 'W': 44.4, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.0, 'H': 43.5, 'W': 44.4, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1720.1, "safety_factor": 0.145, "max_disp_mm": 4.9303, "max_strain": 0.012295682163967675, "peak": {"node": 288, "coords_mm": [57.42, 1.97, 0.0], "vm_mpa": 1720.1}, "volume_mm3": 1521.6, "bbox_mm": [55.6, 43.5, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.3, "safety_factor": 1.698, "max_disp_mm": 0.1542, "max_strain": 0.0010526404952386904, "volume_mm3": 8910.0, "bbox_mm": [55.6, 43.5, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.552, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 864, "family": "plate_holes", "params": {"L": 114.0, "H": null, "W": 65.4, "T": 5.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.0, 'H': None, 'W': 65.4, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.0, 'H': None, 'W': 65.4, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 341.3, "safety_factor": 0.732, "max_disp_mm": 2.2959, "max_strain": 0.002439883023661751, "peak": {"node": 1929, "coords_mm": [-55.53, 7.25, 0.0], "vm_mpa": 341.3}, "volume_mm3": 38246.4, "bbox_mm": [114.0, 65.4, 5.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.1, "safety_factor": 1.998, "max_disp_mm": 0.5484, "max_strain": 0.0008942581079395416, "volume_mm3": 67666.6, "bbox_mm": [114.0, 65.4, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.266, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 865, "family": "l_bracket", "params": {"L": 74.6, "H": 62.8, "W": 61.0, "T": 5.1, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.6, 'H': 62.8, 'W': 61.0, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.6, 'H': 62.8, 'W': 61.0, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 307.6, "safety_factor": 0.813, "max_disp_mm": 1.036, "max_strain": 0.002199010146776315, "peak": {"node": 1981, "coords_mm": [8.91, -30.96, 62.8], "vm_mpa": 307.6}, "volume_mm3": 44331.7, "bbox_mm": [79.7, 61.0, 67.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.5, "safety_factor": 2.304, "max_disp_mm": 0.2035, "max_strain": 0.0007757374585269878, "volume_mm3": 90874.7, "bbox_mm": [84.7, 61.0, 72.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.491, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 867, "family": "rib_bracket", "params": {"L": 73.2, "H": 55.0, "W": 56.0, "T": 5.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.2, 'H': 55.0, 'W': 56.0, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.2, 'H': 55.0, 'W': 56.0, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 306.8, "safety_factor": 0.815, "max_disp_mm": 1.0922, "max_strain": 0.002193281418405038, "peak": {"node": 1717, "coords_mm": [8.75, -21.86, 55.0], "vm_mpa": 306.8}, "volume_mm3": 41179.6, "bbox_mm": [78.7, 56.0, 60.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 116.7, "safety_factor": 2.141, "max_disp_mm": 0.1899, "max_strain": 0.0008345412381593479, "volume_mm3": 89966.8, "bbox_mm": [84.7, 56.0, 66.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.327, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 870, "family": "u_channel", "params": {"L": 112.7, "H": 49.8, "W": 30.7, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.7, 'H': 49.8, 'W': 30.7, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.7, 'H': 49.8, 'W': 30.7, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4019.6, "safety_factor": 0.062, "max_disp_mm": 41.5622, "max_strain": 0.028732936534954682, "peak": {"node": 434, "coords_mm": [39.52, 1.37, 2.7], "vm_mpa": 4019.6}, "volume_mm3": 941.1, "bbox_mm": [82.0, 49.8, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 134.3, "safety_factor": 1.861, "max_disp_mm": 0.2586, "max_strain": 0.0009601058163854849, "volume_mm3": 13864.7, "bbox_mm": [82.0, 49.8, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.799, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 869, "family": "l_bracket", "params": {"L": 88.9, "H": 72.3, "W": 68.9, "T": 3.0, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 88.9, 'H': 72.3, 'W': 68.9, 'T': 3.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 88.9, 'H': 72.3, 'W': 68.9, 'T': 3.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 380.3, "safety_factor": 0.657, "max_disp_mm": 2.2773, "max_strain": 0.0027181891233600823, "peak": {"node": 3537, "coords_mm": [1.91, -48.02, 75.3], "vm_mpa": 380.3}, "volume_mm3": 33940.1, "bbox_mm": [91.9, 68.9, 75.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.7, "safety_factor": 2.218, "max_disp_mm": 0.4001, "max_strain": 0.000805769823594421, "volume_mm3": 93263.0, "bbox_mm": [96.9, 68.9, 80.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.56, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 871, "family": "rib_bracket", "params": {"L": 45.9, "H": 41.4, "W": 42.3, "T": 3.5, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.9, 'H': 41.4, 'W': 42.3, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.9, 'H': 41.4, 'W': 42.3, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 315.1, "safety_factor": 0.793, "max_disp_mm": 0.5272, "max_strain": 0.0022523317526188216, "peak": {"node": 1263, "coords_mm": [2.17, -16.22, 44.9], "vm_mpa": 315.1}, "volume_mm3": 13442.9, "bbox_mm": [49.4, 42.3, 44.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.7, "safety_factor": 2.667, "max_disp_mm": 0.0859, "max_strain": 0.0006700301381400237, "volume_mm3": 38899.1, "bbox_mm": [55.4, 42.3, 50.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.874, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 872, "family": "plate_holes", "params": {"L": 103.0, "H": null, "W": 54.4, "T": 3.8, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.0, 'H': None, 'W': 54.4, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.0, 'H': None, 'W': 54.4, 'T': 3.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 410.1, "safety_factor": 0.61, "max_disp_mm": 2.3818, "max_strain": 0.0029311669842069753, "peak": {"node": 2438, "coords_mm": [-49.92, 11.13, 3.8], "vm_mpa": 410.1}, "volume_mm3": 21077.3, "bbox_mm": [103.0, 54.4, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 154.1, "safety_factor": 1.622, "max_disp_mm": 0.636, "max_strain": 0.001101543771810546, "volume_mm3": 43263.9, "bbox_mm": [103.0, 54.4, 7.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.013, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 874, "family": "u_channel", "params": {"L": 85.4, "H": 36.1, "W": 37.1, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 85.4, 'H': 36.1, 'W': 37.1, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 85.4, 'H': 36.1, 'W': 37.1, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1964.8, "safety_factor": 0.127, "max_disp_mm": 5.7823, "max_strain": 0.014044577545507352, "peak": {"node": 295, "coords_mm": [45.99, 1.61, 3.3], "vm_mpa": 1964.8}, "volume_mm3": 883.2, "bbox_mm": [48.3, 36.1, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.4, "safety_factor": 1.963, "max_disp_mm": 0.1095, "max_strain": 0.0009104465252551371, "volume_mm3": 6495.4, "bbox_mm": [48.3, 36.1, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.836, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 875, "family": "rib_bracket", "params": {"L": 58.5, "H": 47.7, "W": 48.7, "T": 4.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.5, 'H': 47.7, 'W': 48.7, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.5, 'H': 47.7, 'W': 48.7, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 429.4, "safety_factor": 0.582, "max_disp_mm": 1.1645, "max_strain": 0.003069300280593538, "peak": {"node": 1257, "coords_mm": [5.94, -42.56, 47.7], "vm_mpa": 429.4}, "volume_mm3": 23699.4, "bbox_mm": [62.9, 48.7, 52.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.8, "safety_factor": 2.086, "max_disp_mm": 0.1537, "max_strain": 0.0008567007989186367, "volume_mm3": 59055.6, "bbox_mm": [68.9, 48.7, 58.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.504, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 876, "family": "plate_holes", "params": {"L": 112.5, "H": null, "W": 64.0, "T": 5.0, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.5, 'H': None, 'W': 64.0, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.5, 'H': None, 'W': 64.0, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 300.4, "safety_factor": 0.832, "max_disp_mm": 2.082, "max_strain": 0.002147067523504568, "peak": {"node": 1721, "coords_mm": [-54.76, -6.17, 0.0], "vm_mpa": 300.4}, "volume_mm3": 35497.3, "bbox_mm": [112.5, 64.0, 5.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.1, "safety_factor": 2.312, "max_disp_mm": 0.4768, "max_strain": 0.0007730621016448643, "volume_mm3": 63895.2, "bbox_mm": [112.5, 64.0, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.479, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 878, "family": "u_channel", "params": {"L": 98.0, "H": 42.5, "W": 43.4, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.0, 'H': 42.5, 'W': 43.4, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.0, 'H': 42.5, 'W': 43.4, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1652.5, "safety_factor": 0.151, "max_disp_mm": 5.3165, "max_strain": 0.011812616564851977, "peak": {"node": 281, "coords_mm": [53.33, 2.36, 0.0], "vm_mpa": 1652.5}, "volume_mm3": 1417.6, "bbox_mm": [54.6, 42.5, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.3, "safety_factor": 1.709, "max_disp_mm": 0.1492, "max_strain": 0.0010457939251067455, "volume_mm3": 8546.5, "bbox_mm": [54.6, 42.5, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.558, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 877, "family": "l_bracket", "params": {"L": 72.4, "H": 61.3, "W": 59.8, "T": 4.9, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 72.4, 'H': 61.3, 'W': 59.8, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 72.4, 'H': 61.3, 'W': 59.8, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 274.0, "safety_factor": 0.912, "max_disp_mm": 1.084, "max_strain": 0.001958611982644138, "peak": {"node": 2294, "coords_mm": [6.25, -19.44, 66.2], "vm_mpa": 274.0}, "volume_mm3": 40612.6, "bbox_mm": [77.3, 59.8, 66.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.3, "safety_factor": 2.518, "max_disp_mm": 0.201, "max_strain": 0.0007096811032879933, "volume_mm3": 85014.1, "bbox_mm": [82.3, 59.8, 71.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.606, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 879, "family": "rib_bracket", "params": {"L": 71.2, "H": 54.1, "W": 55.0, "T": 5.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.2, 'H': 54.1, 'W': 55.0, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.2, 'H': 54.1, 'W': 55.0, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 319.6, "safety_factor": 0.782, "max_disp_mm": 1.0666, "max_strain": 0.0022846127568998714, "peak": {"node": 1606, "coords_mm": [6.99, -11.26, 54.1], "vm_mpa": 319.6}, "volume_mm3": 38817.9, "bbox_mm": [76.6, 55.0, 59.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.3, "safety_factor": 2.169, "max_disp_mm": 0.1837, "max_strain": 0.0008239830131732867, "volume_mm3": 85710.9, "bbox_mm": [82.6, 55.0, 65.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.387, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 882, "family": "u_channel", "params": {"L": 110.7, "H": 48.8, "W": 49.7, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.7, 'H': 48.8, 'W': 49.7, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.7, 'H': 48.8, 'W': 49.7, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3838.5, "safety_factor": 0.065, "max_disp_mm": 18.917, "max_strain": 0.027438218839773786, "peak": {"node": 327, "coords_mm": [55.89, 1.31, 0.0], "vm_mpa": 3838.5}, "volume_mm3": 724.7, "bbox_mm": [61.0, 48.8, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 163.4, "safety_factor": 1.53, "max_disp_mm": 0.2389, "max_strain": 0.0011676963231158062, "volume_mm3": 7484.8, "bbox_mm": [61.0, 48.8, 8.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.465, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 880, "family": "plate_holes", "params": {"L": 122.0, "H": null, "W": 73.5, "T": 6.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.0, 'H': None, 'W': 73.5, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 122.0, 'H': None, 'W': 73.5, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 214.1, "safety_factor": 1.168, "max_disp_mm": 1.4683, "max_strain": 0.0015301745324499206, "peak": {"node": 667, "coords_mm": [-58.9, 4.0, 0.0], "vm_mpa": 214.1}, "volume_mm3": 55502.5, "bbox_mm": [122.0, 73.5, 6.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 94.8, "safety_factor": 2.638, "max_disp_mm": 0.443, "max_strain": 0.0006774645362610285, "volume_mm3": 90742.2, "bbox_mm": [122.0, 73.5, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.47, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 884, "family": "plate_holes", "params": {"L": 101.5, "H": null, "W": 53.0, "T": 3.6, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.5, 'H': None, 'W': 53.0, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.5, 'H': None, 'W': 53.0, 'T': 3.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 393.8, "safety_factor": 0.635, "max_disp_mm": 2.0226, "max_strain": 0.0028151387725785333, "peak": {"node": 2363, "coords_mm": [-49.23, 8.46, 3.6], "vm_mpa": 393.8}, "volume_mm3": 19162.6, "bbox_mm": [101.5, 53.0, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.7, "safety_factor": 1.973, "max_disp_mm": 0.5333, "max_strain": 0.0009055627754176879, "volume_mm3": 40454.4, "bbox_mm": [101.5, 53.0, 7.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.339, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 883, "family": "rib_bracket", "params": {"L": 83.9, "H": 40.4, "W": 41.3, "T": 3.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.9, 'H': 40.4, 'W': 41.3, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.9, 'H': 40.4, 'W': 41.3, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 648.9, "safety_factor": 0.385, "max_disp_mm": 4.4788, "max_strain": 0.004638538520888916, "peak": {"node": 1937, "coords_mm": [3.37, -29.26, 43.7], "vm_mpa": 648.9}, "volume_mm3": 17390.6, "bbox_mm": [87.2, 41.3, 43.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.6, "safety_factor": 1.99, "max_disp_mm": 0.2989, "max_strain": 0.0008978850557261175, "volume_mm3": 63283.2, "bbox_mm": [95.2, 41.3, 51.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.605, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 885, "family": "l_bracket", "params": {"L": 55.9, "H": 50.3, "W": 50.6, "T": 3.8, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.9, 'H': 50.3, 'W': 50.6, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 55.9, 'H': 50.3, 'W': 50.6, 'T': 3.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 224.0, "safety_factor": 1.116, "max_disp_mm": 0.515, "max_strain": 0.0016009600791247205, "peak": {"node": 1871, "coords_mm": [1.84, -13.68, 54.1], "vm_mpa": 224.0}, "volume_mm3": 21150.8, "bbox_mm": [59.7, 50.6, 54.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.9, "safety_factor": 2.98, "max_disp_mm": 0.1168, "max_strain": 0.0005995968067031469, "volume_mm3": 51207.2, "bbox_mm": [64.7, 50.6, 59.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.864, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 886, "family": "u_channel", "params": {"L": 83.4, "H": 35.1, "W": 36.1, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.4, 'H': 35.1, 'W': 36.1, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 83.4, 'H': 35.1, 'W': 36.1, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2102.0, "safety_factor": 0.119, "max_disp_mm": 5.8641, "max_strain": 0.015025459099439236, "peak": {"node": 252, "coords_mm": [40.25, 1.65, 0.0], "vm_mpa": 2102.0}, "volume_mm3": 811.0, "bbox_mm": [47.3, 35.1, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.2, "safety_factor": 1.95, "max_disp_mm": 0.1064, "max_strain": 0.0009164482335597553, "volume_mm3": 6195.6, "bbox_mm": [47.3, 35.1, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.831, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 887, "family": "rib_bracket", "params": {"L": 56.6, "H": 46.7, "W": 47.7, "T": 4.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.6, 'H': 46.7, 'W': 47.7, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.6, 'H': 46.7, 'W': 47.7, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 303.3, "safety_factor": 0.824, "max_disp_mm": 0.7969, "max_strain": 0.00216832019362909, "peak": {"node": 905, "coords_mm": [12.65, -7.75, 46.7], "vm_mpa": 303.3}, "volume_mm3": 22069.8, "bbox_mm": [60.9, 47.7, 51.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.0, "safety_factor": 2.777, "max_disp_mm": 0.1103, "max_strain": 0.0006434527728156037, "volume_mm3": 55812.8, "bbox_mm": [66.9, 47.7, 57.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.953, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 888, "family": "plate_holes", "params": {"L": 111.0, "H": null, "W": 62.5, "T": 4.9, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.0, 'H': None, 'W': 62.5, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.0, 'H': None, 'W': 62.5, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 304.4, "safety_factor": 0.821, "max_disp_mm": 2.1753, "max_strain": 0.0021757981972406813, "peak": {"node": 1362, "coords_mm": [-53.47, -7.49, 0.0], "vm_mpa": 304.4}, "volume_mm3": 33501.1, "bbox_mm": [111.0, 62.5, 4.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.4, "safety_factor": 2.244, "max_disp_mm": 0.4842, "max_strain": 0.0007965020426407049, "volume_mm3": 60849.0, "bbox_mm": [111.0, 62.5, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.422, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 890, "family": "u_channel", "params": {"L": 96.1, "H": 41.5, "W": 42.4, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.1, 'H': 41.5, 'W': 42.4, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.1, 'H': 41.5, 'W': 42.4, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1693.0, "safety_factor": 0.148, "max_disp_mm": 5.4887, "max_strain": 0.012101485192990046, "peak": {"node": 282, "coords_mm": [48.04, 1.85, 0.0], "vm_mpa": 1693.0}, "volume_mm3": 1319.8, "bbox_mm": [53.7, 41.5, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 150.9, "safety_factor": 1.657, "max_disp_mm": 0.1501, "max_strain": 0.0010786523811783467, "volume_mm3": 8201.8, "bbox_mm": [53.7, 41.5, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.509, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 889, "family": "l_bracket", "params": {"L": 70.1, "H": 59.8, "W": 58.5, "T": 4.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 70.1, 'H': 59.8, 'W': 58.5, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 70.1, 'H': 59.8, 'W': 58.5, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 321.9, "safety_factor": 0.777, "max_disp_mm": 1.0725, "max_strain": 0.002301325446055158, "peak": {"node": 1807, "coords_mm": [8.31, -5.28, 59.8], "vm_mpa": 321.9}, "volume_mm3": 37823.8, "bbox_mm": [74.9, 58.5, 64.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.5, "safety_factor": 2.462, "max_disp_mm": 0.1936, "max_strain": 0.000725771286355456, "volume_mm3": 80090.0, "bbox_mm": [79.9, 58.5, 69.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.686, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 891, "family": "rib_bracket", "params": {"L": 69.2, "H": 53.1, "W": 54.0, "T": 5.2, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.2, 'H': 53.1, 'W': 54.0, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 69.2, 'H': 53.1, 'W': 54.0, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 349.6, "safety_factor": 0.715, "max_disp_mm": 1.1161, "max_strain": 0.0024989185984803054, "peak": {"node": 1606, "coords_mm": [8.65, -19.67, 53.1], "vm_mpa": 349.6}, "volume_mm3": 35802.0, "bbox_mm": [74.4, 54.0, 58.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.0, "safety_factor": 2.315, "max_disp_mm": 0.1809, "max_strain": 0.0007720757230085488, "volume_mm3": 80740.8, "bbox_mm": [80.4, 54.0, 64.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.599, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 892, "family": "plate_holes", "params": {"L": 120.5, "H": null, "W": 72.0, "T": 6.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.5, 'H': None, 'W': 72.0, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.5, 'H': None, 'W': 72.0, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 235.6, "safety_factor": 1.061, "max_disp_mm": 1.5688, "max_strain": 0.001684329212979952, "peak": {"node": 2261, "coords_mm": [-58.13, 14.94, 6.1], "vm_mpa": 235.6}, "volume_mm3": 51965.4, "bbox_mm": [120.5, 72.0, 6.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.3, "safety_factor": 2.517, "max_disp_mm": 0.4573, "max_strain": 0.0007101135275844522, "volume_mm3": 86041.1, "bbox_mm": [120.5, 72.0, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.456, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 894, "family": "u_channel", "params": {"L": 108.7, "H": 47.8, "W": 48.8, "T": 4.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.7, 'H': 47.8, 'W': 48.8, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.7, 'H': 47.8, 'W': 48.8, 'T': 4.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 846.0, "safety_factor": 0.295, "max_disp_mm": 2.65, "max_strain": 0.006047561067275633, "peak": {"node": 297, "coords_mm": [54.76, 2.18, 0.0], "vm_mpa": 846.0}, "volume_mm3": 2089.8, "bbox_mm": [59.9, 47.8, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.2, "safety_factor": 2.599, "max_disp_mm": 0.1066, "max_strain": 0.0006875051183160553, "volume_mm3": 10716.3, "bbox_mm": [59.9, 47.8, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.304, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 893, "family": "l_bracket", "params": {"L": 84.4, "H": 69.3, "W": 66.5, "T": 5.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 84.4, 'H': 69.3, 'W': 66.5, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 84.4, 'H': 69.3, 'W': 66.5, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 225.2, "safety_factor": 1.11, "max_disp_mm": 1.0032, "max_strain": 0.001609710617103169, "peak": {"node": 2252, "coords_mm": [11.07, -34.31, 69.3], "vm_mpa": 225.2}, "volume_mm3": 60420.6, "bbox_mm": [90.1, 66.5, 75.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.1, "safety_factor": 2.602, "max_disp_mm": 0.2287, "max_strain": 0.0006867492924527419, "volume_mm3": 116978.8, "bbox_mm": [95.1, 66.5, 80.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.492, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 896, "family": "plate_holes", "params": {"L": 100.0, "H": null, "W": 51.5, "T": 3.4, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.0, 'H': None, 'W': 51.5, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.0, 'H': None, 'W': 51.5, 'T': 3.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 418.8, "safety_factor": 0.597, "max_disp_mm": 2.4089, "max_strain": 0.0029937537195706197, "peak": {"node": 1233, "coords_mm": [-48.21, -12.26, 0.0], "vm_mpa": 418.8}, "volume_mm3": 17317.7, "bbox_mm": [100.0, 51.5, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 133.5, "safety_factor": 1.872, "max_disp_mm": 0.5565, "max_strain": 0.0009545758537917645, "volume_mm3": 37691.5, "bbox_mm": [100.0, 51.5, 7.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.275, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 898, "family": "u_channel", "params": {"L": 81.4, "H": 34.1, "W": 35.1, "T": 3.1, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.4, 'H': 34.1, 'W': 35.1, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 81.4, 'H': 34.1, 'W': 35.1, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2252.2, "safety_factor": 0.111, "max_disp_mm": 6.2367, "max_strain": 0.01609929985055996, "peak": {"node": 240, "coords_mm": [46.39, 1.58, 0.0], "vm_mpa": 2252.2}, "volume_mm3": 742.9, "bbox_mm": [46.3, 34.1, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.1, "safety_factor": 1.982, "max_disp_mm": 0.1038, "max_strain": 0.0009015167706922816, "volume_mm3": 5904.4, "bbox_mm": [46.3, 34.1, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.871, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 895, "family": "rib_bracket", "params": {"L": 81.9, "H": 59.4, "W": 40.3, "T": 3.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.9, 'H': 59.4, 'W': 40.3, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.9, 'H': 59.4, 'W': 40.3, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 636.5, "safety_factor": 0.393, "max_disp_mm": 4.942, "max_strain": 0.004550129318556047, "peak": {"node": 1410, "coords_mm": [2.3, -19.81, 62.6], "vm_mpa": 636.5}, "volume_mm3": 18634.7, "bbox_mm": [85.1, 40.3, 62.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 140.7, "safety_factor": 1.777, "max_disp_mm": 0.2932, "max_strain": 0.0010054304675371866, "volume_mm3": 68832.4, "bbox_mm": [93.1, 40.3, 70.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.385, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 899, "family": "rib_bracket", "params": {"L": 54.6, "H": 45.7, "W": 46.7, "T": 4.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.6, 'H': 45.7, 'W': 46.7, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.6, 'H': 45.7, 'W': 46.7, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 262.5, "safety_factor": 0.952, "max_disp_mm": 0.5584, "max_strain": 0.0018765531110137687, "peak": {"node": 1406, "coords_mm": [2.15, -35.61, 49.8], "vm_mpa": 262.5}, "volume_mm3": 19989.5, "bbox_mm": [58.7, 46.7, 49.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 77.7, "safety_factor": 3.219, "max_disp_mm": 0.1064, "max_strain": 0.0005551275560229657, "volume_mm3": 52072.4, "bbox_mm": [64.7, 46.7, 55.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.267, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 902, "family": "u_channel", "params": {"L": 94.1, "H": 40.5, "W": 41.4, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.1, 'H': 40.5, 'W': 41.4, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.1, 'H': 40.5, 'W': 41.4, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1667.7, "safety_factor": 0.15, "max_disp_mm": 4.8944, "max_strain": 0.011921134535997486, "peak": {"node": 278, "coords_mm": [46.97, 1.81, 0.0], "vm_mpa": 1667.7}, "volume_mm3": 1225.3, "bbox_mm": [52.7, 40.5, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.2, "safety_factor": 2.03, "max_disp_mm": 0.1217, "max_strain": 0.0008804088271342755, "volume_mm3": 7856.5, "bbox_mm": [52.7, 40.5, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.88, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 900, "family": "plate_holes", "params": {"L": 109.5, "H": null, "W": 61.0, "T": 4.7, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.5, 'H': None, 'W': 61.0, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.5, 'H': None, 'W': 61.0, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 323.5, "safety_factor": 0.773, "max_disp_mm": 2.402, "max_strain": 0.002312111238250161, "peak": {"node": 1356, "coords_mm": [-52.7, 2.47, 0.0], "vm_mpa": 323.5}, "volume_mm3": 30921.2, "bbox_mm": [109.5, 61.0, 4.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.3, "safety_factor": 2.095, "max_disp_mm": 0.5051, "max_strain": 0.0008531228473106565, "volume_mm3": 57237.0, "bbox_mm": [109.5, 61.0, 8.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.322, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 901, "family": "l_bracket", "params": {"L": 67.9, "H": 58.3, "W": 57.3, "T": 4.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.9, 'H': 58.3, 'W': 57.3, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.9, 'H': 58.3, 'W': 57.3, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 296.2, "safety_factor": 0.844, "max_disp_mm": 1.1033, "max_strain": 0.0021175947521691997, "peak": {"node": 1622, "coords_mm": [9.04, -44.38, 58.3], "vm_mpa": 296.2}, "volume_mm3": 34476.3, "bbox_mm": [72.5, 57.3, 62.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.3, "safety_factor": 2.445, "max_disp_mm": 0.1897, "max_strain": 0.0007310302675113974, "volume_mm3": 74700.9, "bbox_mm": [77.5, 57.3, 67.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.601, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 903, "family": "rib_bracket", "params": {"L": 67.2, "H": 52.1, "W": 53.0, "T": 5.1, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.2, 'H': 52.1, 'W': 53.0, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 67.2, 'H': 52.1, 'W': 53.0, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 335.5, "safety_factor": 0.745, "max_disp_mm": 1.1013, "max_strain": 0.0023980821943600144, "peak": {"node": 1528, "coords_mm": [8.83, -41.0, 52.1], "vm_mpa": 335.5}, "volume_mm3": 33625.3, "bbox_mm": [72.3, 53.0, 57.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.3, "safety_factor": 2.078, "max_disp_mm": 0.1742, "max_strain": 0.0008601605829468109, "volume_mm3": 76714.3, "bbox_mm": [78.3, 53.0, 63.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.332, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 904, "family": "plate_holes", "params": {"L": 119.1, "H": null, "W": 70.5, "T": 5.9, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.1, 'H': None, 'W': 70.5, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.1, 'H': None, 'W': 70.5, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 274.5, "safety_factor": 0.911, "max_disp_mm": 1.7106, "max_strain": 0.0019618507327294164, "peak": {"node": 2055, "coords_mm": [-57.97, 7.29, 0.0], "vm_mpa": 274.5}, "volume_mm3": 48612.9, "bbox_mm": [119.1, 70.5, 5.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.6, "safety_factor": 2.414, "max_disp_mm": 0.4783, "max_strain": 0.000740192204640665, "volume_mm3": 81570.8, "bbox_mm": [119.1, 70.5, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.503, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 906, "family": "u_channel", "params": {"L": 106.7, "H": 46.8, "W": 47.8, "T": 4.4, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.7, 'H': 46.8, 'W': 47.8, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.7, 'H': 46.8, 'W': 47.8, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1293.3, "safety_factor": 0.193, "max_disp_mm": 4.0887, "max_strain": 0.009244457845145255, "peak": {"node": 347, "coords_mm": [56.35, 2.11, 4.4], "vm_mpa": 1293.3}, "volume_mm3": 1961.2, "bbox_mm": [58.9, 46.8, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 140.9, "safety_factor": 1.774, "max_disp_mm": 0.1579, "max_strain": 0.0010071416494195904, "volume_mm3": 10307.6, "bbox_mm": [58.9, 46.8, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.581, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 905, "family": "l_bracket", "params": {"L": 82.1, "H": 67.8, "W": 65.2, "T": 5.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.1, 'H': 67.8, 'W': 65.2, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 82.1, 'H': 67.8, 'W': 65.2, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 232.3, "safety_factor": 1.076, "max_disp_mm": 1.0034, "max_strain": 0.0016605517294502052, "peak": {"node": 2856, "coords_mm": [6.11, -33.62, 73.4], "vm_mpa": 232.3}, "volume_mm3": 56776.2, "bbox_mm": [87.7, 65.2, 73.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.6, "safety_factor": 2.561, "max_disp_mm": 0.2218, "max_strain": 0.0006978968079790137, "volume_mm3": 110924.8, "bbox_mm": [92.7, 65.2, 78.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.484, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 907, "family": "rib_bracket", "params": {"L": 79.9, "H": 58.4, "W": 59.3, "T": 3.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.9, 'H': 58.4, 'W': 59.3, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.9, 'H': 58.4, 'W': 59.3, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 462.5, "safety_factor": 0.541, "max_disp_mm": 2.9125, "max_strain": 0.003306176483184263, "peak": {"node": 1946, "coords_mm": [2.14, -33.37, 61.4], "vm_mpa": 462.5}, "volume_mm3": 25137.3, "bbox_mm": [82.9, 59.3, 61.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.6, "safety_factor": 2.074, "max_disp_mm": 0.3163, "max_strain": 0.0008618223440508795, "volume_mm3": 78614.0, "bbox_mm": [88.9, 59.3, 67.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.533, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 909, "family": "l_bracket", "params": {"L": 51.4, "H": 47.3, "W": 48.1, "T": 3.5, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 51.4, 'H': 47.3, 'W': 48.1, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 51.4, 'H': 47.3, 'W': 48.1, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 225.7, "safety_factor": 1.108, "max_disp_mm": 0.4678, "max_strain": 0.0016132823278742878, "peak": {"node": 1658, "coords_mm": [1.48, -30.05, 50.8], "vm_mpa": 225.7}, "volume_mm3": 17205.4, "bbox_mm": [54.9, 48.1, 50.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 86.5, "safety_factor": 2.889, "max_disp_mm": 0.1057, "max_strain": 0.0006186583877123753, "volume_mm3": 43828.7, "bbox_mm": [59.9, 48.1, 55.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.781, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 910, "family": "u_channel", "params": {"L": 79.4, "H": 33.1, "W": 34.1, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.4, 'H': 33.1, 'W': 34.1, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 79.4, 'H': 33.1, 'W': 34.1, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1777.4, "safety_factor": 0.141, "max_disp_mm": 5.4029, "max_strain": 0.012704901938859871, "peak": {"node": 86, "coords_mm": [39.59, 3.0, 0.0], "vm_mpa": 1777.4}, "volume_mm3": 678.6, "bbox_mm": [45.3, 33.1, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.6, "safety_factor": 2.368, "max_disp_mm": 0.0814, "max_strain": 0.0007548129170145673, "volume_mm3": 5621.4, "bbox_mm": [45.3, 33.1, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.227, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 908, "family": "plate_holes", "params": {"L": 128.6, "H": null, "W": 80.0, "T": 3.2, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.6, 'H': None, 'W': 80.0, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.6, 'H': None, 'W': 80.0, 'T': 3.2, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 333.7, "safety_factor": 0.749, "max_disp_mm": 3.7041, "max_strain": 0.0023853754611849946, "peak": {"node": 129, "coords_mm": [-64.3, 10.0, 3.2], "vm_mpa": 333.7}, "volume_mm3": 32740.6, "bbox_mm": [128.6, 80.0, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 111.3, "safety_factor": 2.246, "max_disp_mm": 0.7952, "max_strain": 0.0007956158624351402, "volume_mm3": 73666.4, "bbox_mm": [128.6, 80.0, 7.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.497, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 911, "family": "rib_bracket", "params": {"L": 52.6, "H": 44.7, "W": 45.7, "T": 4.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.6, 'H': 44.7, 'W': 45.7, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.6, 'H': 44.7, 'W': 45.7, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 281.4, "safety_factor": 0.888, "max_disp_mm": 0.5374, "max_strain": 0.002011785631461917, "peak": {"node": 1164, "coords_mm": [2.0, -22.55, 48.7], "vm_mpa": 281.4}, "volume_mm3": 18517.6, "bbox_mm": [56.6, 45.7, 48.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 87.1, "safety_factor": 2.872, "max_disp_mm": 0.1013, "max_strain": 0.0006223279324546349, "volume_mm3": 49036.1, "bbox_mm": [62.6, 45.7, 54.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.983, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 912, "family": "plate_holes", "params": {"L": 108.1, "H": null, "W": 59.5, "T": 4.5, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.1, 'H': None, 'W': 59.5, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.1, 'H': None, 'W': 59.5, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 378.5, "safety_factor": 0.66, "max_disp_mm": 2.6082, "max_strain": 0.002705842687322417, "peak": {"node": 1649, "coords_mm": [-51.9, 1.24, 4.5], "vm_mpa": 378.5}, "volume_mm3": 28491.4, "bbox_mm": [108.1, 59.5, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.6, "safety_factor": 2.006, "max_disp_mm": 0.5325, "max_strain": 0.0008906233078161065, "volume_mm3": 53817.1, "bbox_mm": [108.1, 59.5, 8.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.346, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 913, "family": "l_bracket", "params": {"L": 65.6, "H": 56.9, "W": 56.1, "T": 4.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.6, 'H': 56.9, 'W': 56.1, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.6, 'H': 56.9, 'W': 56.1, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 325.5, "safety_factor": 0.768, "max_disp_mm": 1.0974, "max_strain": 0.0023264538457681665, "peak": {"node": 2367, "coords_mm": [5.24, -32.52, 61.4], "vm_mpa": 325.5}, "volume_mm3": 32061.2, "bbox_mm": [70.1, 56.1, 61.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.9, "safety_factor": 2.428, "max_disp_mm": 0.1816, "max_strain": 0.0007358827329764867, "volume_mm3": 70349.4, "bbox_mm": [75.1, 56.1, 66.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.66, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 914, "family": "u_channel", "params": {"L": 92.1, "H": 39.5, "W": 40.4, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.1, 'H': 39.5, 'W': 40.4, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.1, 'H': 39.5, 'W': 40.4, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1670.0, "safety_factor": 0.15, "max_disp_mm": 5.0405, "max_strain": 0.011937343049624585, "peak": {"node": 307, "coords_mm": [45.33, 2.21, 3.6], "vm_mpa": 1670.0}, "volume_mm3": 1135.3, "bbox_mm": [51.7, 39.5, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 132.3, "safety_factor": 1.89, "max_disp_mm": 0.1191, "max_strain": 0.0009455026559637436, "volume_mm3": 7520.3, "bbox_mm": [51.7, 39.5, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.74, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 915, "family": "rib_bracket", "params": {"L": 65.2, "H": 51.1, "W": 52.0, "T": 4.9, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.2, 'H': 51.1, 'W': 52.0, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 65.2, 'H': 51.1, 'W': 52.0, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 375.8, "safety_factor": 0.665, "max_disp_mm": 1.1739, "max_strain": 0.0026862710392346377, "peak": {"node": 1243, "coords_mm": [7.01, -28.5, 51.1], "vm_mpa": 375.8}, "volume_mm3": 30881.8, "bbox_mm": [70.1, 52.0, 56.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.0, "safety_factor": 2.212, "max_disp_mm": 0.1711, "max_strain": 0.0008077204455352612, "volume_mm3": 72097.0, "bbox_mm": [76.1, 52.0, 62.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.547, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 916, "family": "plate_holes", "params": {"L": 117.6, "H": null, "W": 69.0, "T": 5.7, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.6, 'H': None, 'W': 69.0, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.6, 'H': None, 'W': 69.0, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 295.2, "safety_factor": 0.847, "max_disp_mm": 1.8544, "max_strain": 0.0021102468848836218, "peak": {"node": 590, "coords_mm": [-56.85, -1.26, 0.0], "vm_mpa": 295.2}, "volume_mm3": 45356.7, "bbox_mm": [117.6, 69.0, 5.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.0, "safety_factor": 2.294, "max_disp_mm": 0.499, "max_strain": 0.0007789660186643252, "volume_mm3": 77186.0, "bbox_mm": [117.6, 69.0, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.447, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 918, "family": "u_channel", "params": {"L": 104.7, "H": 45.8, "W": 46.8, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.7, 'H': 45.8, 'W': 46.8, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.7, 'H': 45.8, 'W': 46.8, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1624.3, "safety_factor": 0.154, "max_disp_mm": 4.2135, "max_strain": 0.01161084177149322, "peak": {"node": 348, "coords_mm": [55.18, 2.07, 4.3], "vm_mpa": 1624.3}, "volume_mm3": 1837.9, "bbox_mm": [57.9, 45.8, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.5, "safety_factor": 1.695, "max_disp_mm": 0.1561, "max_strain": 0.00105432054303487, "volume_mm3": 9908.8, "bbox_mm": [57.9, 45.8, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.541, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 917, "family": "l_bracket", "params": {"L": 79.9, "H": 66.4, "W": 64.0, "T": 5.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.9, 'H': 66.4, 'W': 64.0, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.9, 'H': 66.4, 'W': 64.0, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 245.5, "safety_factor": 1.018, "max_disp_mm": 1.0321, "max_strain": 0.0017550139726539196, "peak": {"node": 2145, "coords_mm": [8.95, -34.5, 66.4], "vm_mpa": 245.5}, "volume_mm3": 52427.5, "bbox_mm": [85.3, 64.0, 71.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.8, "safety_factor": 2.584, "max_disp_mm": 0.2193, "max_strain": 0.0006916352164974812, "volume_mm3": 104299.5, "bbox_mm": [90.3, 64.0, 76.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.566, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 921, "family": "l_bracket", "params": {"L": 94.2, "H": 45.9, "W": 46.9, "T": 3.4, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.2, 'H': 45.9, 'W': 46.9, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 94.2, 'H': 45.9, 'W': 46.9, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 410.1, "safety_factor": 0.61, "max_disp_mm": 3.3818, "max_strain": 0.0029317232400324555, "peak": {"node": 1599, "coords_mm": [2.13, -18.51, 49.3], "vm_mpa": 410.1}, "volume_mm3": 22882.5, "bbox_mm": [97.6, 46.9, 49.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 157.8, "safety_factor": 1.584, "max_disp_mm": 0.6191, "max_strain": 0.0011279648569677044, "volume_mm3": 58503.1, "bbox_mm": [102.6, 46.9, 54.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 0.975, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 922, "family": "u_channel", "params": {"L": 77.4, "H": 32.2, "W": 33.1, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.4, 'H': 32.2, 'W': 33.1, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 77.4, 'H': 32.2, 'W': 33.1, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1730.8, "safety_factor": 0.144, "max_disp_mm": 5.2609, "max_strain": 0.01237194283602464, "peak": {"node": 257, "coords_mm": [41.94, 1.48, 2.9], "vm_mpa": 1730.8}, "volume_mm3": 619.0, "bbox_mm": [44.3, 32.2, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.8, "safety_factor": 2.481, "max_disp_mm": 0.0785, "max_strain": 0.0007201930000892631, "volume_mm3": 5354.6, "bbox_mm": [44.3, 32.2, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.337, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 919, "family": "rib_bracket", "params": {"L": 77.9, "H": 57.4, "W": 58.3, "T": 5.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.9, 'H': 57.4, 'W': 58.3, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 77.9, 'H': 57.4, 'W': 58.3, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 210.6, "safety_factor": 1.187, "max_disp_mm": 0.7834, "max_strain": 0.0015055106276405782, "peak": {"node": 1553, "coords_mm": [11.98, -30.91, 57.4], "vm_mpa": 210.6}, "volume_mm3": 48568.6, "bbox_mm": [83.8, 58.3, 63.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 80.2, "safety_factor": 3.116, "max_disp_mm": 0.1489, "max_strain": 0.0005735305680580864, "volume_mm3": 102122.9, "bbox_mm": [89.8, 58.3, 69.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.929, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 923, "family": "rib_bracket", "params": {"L": 50.6, "H": 43.7, "W": 44.7, "T": 3.8, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.6, 'H': 43.7, 'W': 44.7, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 50.6, 'H': 43.7, 'W': 44.7, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 286.5, "safety_factor": 0.873, "max_disp_mm": 0.6066, "max_strain": 0.002047922554775647, "peak": {"node": 1367, "coords_mm": [2.15, -21.11, 47.5], "vm_mpa": 286.5}, "volume_mm3": 16663.3, "bbox_mm": [54.4, 44.7, 47.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 84.2, "safety_factor": 2.97, "max_disp_mm": 0.0974, "max_strain": 0.0006017971587953739, "volume_mm3": 45602.0, "bbox_mm": [60.4, 44.7, 53.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.097, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 924, "family": "plate_holes", "params": {"L": 106.6, "H": null, "W": 58.0, "T": 4.3, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.6, 'H': None, 'W': 58.0, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 106.6, 'H': None, 'W': 58.0, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 386.3, "safety_factor": 0.647, "max_disp_mm": 2.7041, "max_strain": 0.0027615330362871513, "peak": {"node": 2755, "coords_mm": [-43.88, -25.12, 4.3], "vm_mpa": 386.3}, "volume_mm3": 26153.8, "bbox_mm": [106.6, 58.0, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.8, "safety_factor": 1.941, "max_disp_mm": 0.5597, "max_strain": 0.0009207314755753949, "volume_mm3": 50482.8, "bbox_mm": [106.6, 58.0, 8.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.294, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 925, "family": "l_bracket", "params": {"L": 63.4, "H": 55.4, "W": 54.8, "T": 4.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 63.4, 'H': 55.4, 'W': 54.8, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 63.4, 'H': 55.4, 'W': 54.8, 'T': 4.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 234.0, "safety_factor": 1.068, "max_disp_mm": 0.7187, "max_strain": 0.001672542138523284, "peak": {"node": 1681, "coords_mm": [14.55, -29.26, 59.7], "vm_mpa": 234.0}, "volume_mm3": 29007.3, "bbox_mm": [67.7, 54.8, 59.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 78.2, "safety_factor": 3.196, "max_disp_mm": 0.1326, "max_strain": 0.0005591975946556159, "volume_mm3": 65284.9, "bbox_mm": [72.7, 54.8, 64.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.127, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 926, "family": "u_channel", "params": {"L": 90.1, "H": 38.5, "W": 39.4, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.1, 'H': 38.5, 'W': 39.4, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.1, 'H': 38.5, 'W': 39.4, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1849.5, "safety_factor": 0.135, "max_disp_mm": 5.4203, "max_strain": 0.013220825327142026, "peak": {"node": 269, "coords_mm": [47.86, 1.38, 0.0], "vm_mpa": 1849.5}, "volume_mm3": 1049.8, "bbox_mm": [50.7, 38.5, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 133.1, "safety_factor": 1.879, "max_disp_mm": 0.1183, "max_strain": 0.0009512528710664548, "volume_mm3": 7192.9, "bbox_mm": [50.7, 38.5, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.743, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 927, "family": "rib_bracket", "params": {"L": 63.3, "H": 50.1, "W": 51.0, "T": 4.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.3, 'H': 50.1, 'W': 51.0, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 63.3, 'H': 50.1, 'W': 51.0, 'T': 4.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 379.3, "safety_factor": 0.659, "max_disp_mm": 1.1559, "max_strain": 0.002711515413995711, "peak": {"node": 1395, "coords_mm": [6.41, -40.13, 50.1], "vm_mpa": 379.3}, "volume_mm3": 28935.4, "bbox_mm": [68.1, 51.0, 54.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.0, "safety_factor": 2.1, "max_disp_mm": 0.1651, "max_strain": 0.0008508407460918646, "volume_mm3": 68409.4, "bbox_mm": [74.1, 51.0, 60.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.441, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 928, "family": "plate_holes", "params": {"L": 116.1, "H": null, "W": 67.5, "T": 5.5, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.1, 'H': None, 'W': 67.5, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.1, 'H': None, 'W': 67.5, 'T': 5.5, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 296.3, "safety_factor": 0.844, "max_disp_mm": 2.0242, "max_strain": 0.002117885993466337, "peak": {"node": 1998, "coords_mm": [-56.04, 0.07, 5.5], "vm_mpa": 296.3}, "volume_mm3": 42238.2, "bbox_mm": [116.1, 67.5, 5.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.2, "safety_factor": 2.209, "max_disp_mm": 0.5175, "max_strain": 0.0008091015679047759, "volume_mm3": 72956.9, "bbox_mm": [116.1, 67.5, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.365, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 930, "family": "u_channel", "params": {"L": 102.8, "H": 44.8, "W": 45.8, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.8, 'H': 44.8, 'W': 45.8, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 102.8, 'H': 44.8, 'W': 45.8, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1663.2, "safety_factor": 0.15, "max_disp_mm": 4.4943, "max_strain": 0.011888797757456401, "peak": {"node": 328, "coords_mm": [53.77, 2.2, 4.2], "vm_mpa": 1663.2}, "volume_mm3": 1721.7, "bbox_mm": [57.0, 44.8, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 148.5, "safety_factor": 1.683, "max_disp_mm": 0.1554, "max_strain": 0.0010615680236011507, "volume_mm3": 9530.1, "bbox_mm": [57.0, 44.8, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.533, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 929, "family": "l_bracket", "params": {"L": 77.7, "H": 64.9, "W": 62.7, "T": 5.3, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 77.7, 'H': 64.9, 'W': 62.7, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 77.7, 'H': 64.9, 'W': 62.7, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 247.9, "safety_factor": 1.008, "max_disp_mm": 1.0337, "max_strain": 0.0017721294364935873, "peak": {"node": 2635, "coords_mm": [6.49, -27.47, 70.2], "vm_mpa": 247.9}, "volume_mm3": 49148.6, "bbox_mm": [83.0, 62.7, 70.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.9, "safety_factor": 2.453, "max_disp_mm": 0.2127, "max_strain": 0.0007286219113986219, "volume_mm3": 98744.3, "bbox_mm": [88.0, 62.7, 75.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.444, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 931, "family": "rib_bracket", "params": {"L": 75.9, "H": 56.4, "W": 57.4, "T": 5.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.9, 'H': 56.4, 'W': 57.4, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 75.9, 'H': 56.4, 'W': 57.4, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 290.1, "safety_factor": 0.862, "max_disp_mm": 1.0843, "max_strain": 0.002073918845472715, "peak": {"node": 1581, "coords_mm": [7.88, -36.15, 56.4], "vm_mpa": 290.1}, "volume_mm3": 45150.8, "bbox_mm": [81.6, 57.4, 62.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.3, "safety_factor": 2.542, "max_disp_mm": 0.1961, "max_strain": 0.0007030066235554454, "volume_mm3": 96707.5, "bbox_mm": [87.6, 57.4, 68.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.68, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 934, "family": "u_channel", "params": {"L": 75.4, "H": 31.2, "W": 32.1, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.4, 'H': 31.2, 'W': 32.1, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 75.4, 'H': 31.2, 'W': 32.1, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1950.3, "safety_factor": 0.128, "max_disp_mm": 5.6192, "max_strain": 0.013940948122809474, "peak": {"node": 232, "coords_mm": [35.94, 1.44, 0.0], "vm_mpa": 1950.3}, "volume_mm3": 562.1, "bbox_mm": [43.3, 31.2, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.1, "safety_factor": 2.472, "max_disp_mm": 0.0774, "max_strain": 0.0007229743054189843, "volume_mm3": 5087.8, "bbox_mm": [43.3, 31.2, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.344, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 933, "family": "l_bracket", "params": {"L": 91.9, "H": 74.4, "W": 45.7, "T": 3.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.9, 'H': 74.4, 'W': 45.7, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 91.9, 'H': 74.4, 'W': 45.7, 'T': 3.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 574.7, "safety_factor": 0.435, "max_disp_mm": 3.4997, "max_strain": 0.004107853886023086, "peak": {"node": 2564, "coords_mm": [1.79, -25.28, 77.6], "vm_mpa": 574.7}, "volume_mm3": 24787.7, "bbox_mm": [95.1, 45.7, 77.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.7, "safety_factor": 2.021, "max_disp_mm": 0.3617, "max_strain": 0.000884155680081896, "volume_mm3": 82273.7, "bbox_mm": [102.1, 45.7, 84.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.586, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 935, "family": "rib_bracket", "params": {"L": 48.6, "H": 42.7, "W": 43.7, "T": 3.7, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.6, 'H': 42.7, 'W': 43.7, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 48.6, 'H': 42.7, 'W': 43.7, 'T': 3.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 276.3, "safety_factor": 0.905, "max_disp_mm": 0.4883, "max_strain": 0.0019753149853531547, "peak": {"node": 1425, "coords_mm": [2.06, -25.49, 46.4], "vm_mpa": 276.3}, "volume_mm3": 15360.6, "bbox_mm": [52.3, 43.7, 46.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 84.8, "safety_factor": 2.949, "max_disp_mm": 0.0921, "max_strain": 0.0006059677257411442, "volume_mm3": 42812.9, "bbox_mm": [58.3, 43.7, 52.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.044, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 936, "family": "plate_holes", "params": {"L": 105.1, "H": null, "W": 56.5, "T": 4.1, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.1, 'H': None, 'W': 56.5, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.1, 'H': None, 'W': 56.5, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 385.9, "safety_factor": 0.648, "max_disp_mm": 2.7862, "max_strain": 0.002758343966661376, "peak": {"node": 2718, "coords_mm": [-51.16, -12.32, 4.1], "vm_mpa": 385.9}, "volume_mm3": 23934.2, "bbox_mm": [105.1, 56.5, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 137.3, "safety_factor": 1.821, "max_disp_mm": 0.5912, "max_strain": 0.0009816069986738165, "volume_mm3": 47284.7, "bbox_mm": [105.1, 56.5, 8.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.173, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 938, "family": "u_channel", "params": {"L": 88.1, "H": 37.5, "W": 38.4, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.1, 'H': 37.5, 'W': 38.4, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.1, 'H': 37.5, 'W': 38.4, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2152.0, "safety_factor": 0.116, "max_disp_mm": 5.5417, "max_strain": 0.015382936693274705, "peak": {"node": 263, "coords_mm": [45.12, 1.74, 0.0], "vm_mpa": 2152.0}, "volume_mm3": 968.7, "bbox_mm": [49.7, 37.5, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 131.5, "safety_factor": 1.901, "max_disp_mm": 0.1148, "max_strain": 0.0009399501294359911, "volume_mm3": 6874.4, "bbox_mm": [49.7, 37.5, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.785, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 937, "family": "l_bracket", "params": {"L": 61.2, "H": 53.9, "W": 53.6, "T": 4.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.2, 'H': 53.9, 'W': 53.6, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 61.2, 'H': 53.9, 'W': 53.6, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 235.1, "safety_factor": 1.063, "max_disp_mm": 0.7277, "max_strain": 0.0016806905048849339, "peak": {"node": 1443, "coords_mm": [8.16, -21.93, 53.9], "vm_mpa": 235.1}, "volume_mm3": 26856.8, "bbox_mm": [65.4, 53.6, 58.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 78.3, "safety_factor": 3.193, "max_disp_mm": 0.1271, "max_strain": 0.0005596199416001909, "volume_mm3": 61294.8, "bbox_mm": [70.4, 53.6, 63.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.13, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 939, "family": "rib_bracket", "params": {"L": 61.3, "H": 49.1, "W": 50.0, "T": 4.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.3, 'H': 49.1, 'W': 50.0, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 61.3, 'H': 49.1, 'W': 50.0, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 408.4, "safety_factor": 0.612, "max_disp_mm": 1.1921, "max_strain": 0.0029190705265466567, "peak": {"node": 783, "coords_mm": [6.59, -41.36, 49.1], "vm_mpa": 408.4}, "volume_mm3": 26450.0, "bbox_mm": [65.9, 50.0, 53.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.4, "safety_factor": 2.205, "max_disp_mm": 0.1607, "max_strain": 0.0008104379365940185, "volume_mm3": 64130.0, "bbox_mm": [71.9, 50.0, 59.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.593, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 940, "family": "plate_holes", "params": {"L": 114.6, "H": null, "W": 66.0, "T": 5.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.6, 'H': None, 'W': 66.0, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 114.6, 'H': None, 'W': 66.0, 'T': 5.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 317.4, "safety_factor": 0.788, "max_disp_mm": 2.2053, "max_strain": 0.0022690777279919198, "peak": {"node": 3196, "coords_mm": [-55.48, -12.16, 5.3], "vm_mpa": 317.4}, "volume_mm3": 39254.6, "bbox_mm": [114.6, 66.0, 5.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 121.1, "safety_factor": 2.064, "max_disp_mm": 0.5393, "max_strain": 0.0008656072335881105, "volume_mm3": 68880.6, "bbox_mm": [114.6, 66.0, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.277, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 942, "family": "u_channel", "params": {"L": 100.8, "H": 43.8, "W": 44.8, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.8, 'H': 43.8, 'W': 44.8, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 100.8, 'H': 43.8, 'W': 44.8, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1648.7, "safety_factor": 0.152, "max_disp_mm": 4.6024, "max_strain": 0.011784845674740233, "peak": {"node": 331, "coords_mm": [55.49, 2.02, 4.1], "vm_mpa": 1648.7}, "volume_mm3": 1608.7, "bbox_mm": [56.0, 43.8, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 148.1, "safety_factor": 1.688, "max_disp_mm": 0.1526, "max_strain": 0.0010589540290973918, "volume_mm3": 9150.3, "bbox_mm": [56.0, 43.8, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.536, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 941, "family": "l_bracket", "params": {"L": 75.4, "H": 63.4, "W": 61.5, "T": 5.1, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 75.4, 'H': 63.4, 'W': 61.5, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 75.4, 'H': 63.4, 'W': 61.5, 'T': 5.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 274.5, "safety_factor": 0.911, "max_disp_mm": 1.0752, "max_strain": 0.0019624637515344057, "peak": {"node": 2013, "coords_mm": [8.83, -56.04, 63.4], "vm_mpa": 274.5}, "volume_mm3": 45134.2, "bbox_mm": [80.5, 61.5, 68.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.8, "safety_factor": 2.457, "max_disp_mm": 0.2093, "max_strain": 0.0007273468266387898, "volume_mm3": 92489.2, "bbox_mm": [85.5, 61.5, 73.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.546, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 943, "family": "rib_bracket", "params": {"L": 73.9, "H": 55.4, "W": 56.4, "T": 5.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.9, 'H': 55.4, 'W': 56.4, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 73.9, 'H': 55.4, 'W': 56.4, 'T': 5.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 305.4, "safety_factor": 0.819, "max_disp_mm": 1.0659, "max_strain": 0.002182916912019591, "peak": {"node": 1714, "coords_mm": [9.69, -10.42, 55.4], "vm_mpa": 305.4}, "volume_mm3": 42606.8, "bbox_mm": [79.5, 56.4, 61.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.2, "safety_factor": 2.399, "max_disp_mm": 0.1898, "max_strain": 0.00074502870588371, "volume_mm3": 92182.4, "bbox_mm": [85.5, 56.4, 67.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.58, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 946, "family": "u_channel", "params": {"L": 113.4, "H": 30.2, "W": 31.1, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.4, 'H': 30.2, 'W': 31.1, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 113.4, 'H': 30.2, 'W': 31.1, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4176.2, "safety_factor": 0.06, "max_disp_mm": 41.8765, "max_strain": 0.02985179167627753, "peak": {"node": 359, "coords_mm": [37.45, 1.37, 2.7], "vm_mpa": 4176.2}, "volume_mm3": 800.4, "bbox_mm": [82.3, 30.2, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 136.8, "safety_factor": 1.828, "max_disp_mm": 0.2623, "max_strain": 0.00097780713443225, "volume_mm3": 11655.1, "bbox_mm": [82.3, 30.2, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.768, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 945, "family": "l_bracket", "params": {"L": 89.7, "H": 72.9, "W": 69.4, "T": 3.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 89.7, 'H': 72.9, 'W': 69.4, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 89.7, 'H': 72.9, 'W': 69.4, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 320.5, "safety_factor": 0.78, "max_disp_mm": 2.5096, "max_strain": 0.0022906677435443174, "peak": {"node": 2524, "coords_mm": [2.15, -35.95, 76.0], "vm_mpa": 320.5}, "volume_mm3": 35648.7, "bbox_mm": [92.8, 69.4, 76.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.5, "safety_factor": 2.223, "max_disp_mm": 0.394, "max_strain": 0.0008039944800594112, "volume_mm3": 95957.3, "bbox_mm": [97.8, 69.4, 81.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.443, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 947, "family": "rib_bracket", "params": {"L": 46.6, "H": 41.8, "W": 42.7, "T": 3.5, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.6, 'H': 41.8, 'W': 42.7, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 46.6, 'H': 41.8, 'W': 42.7, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 298.6, "safety_factor": 0.837, "max_disp_mm": 0.6541, "max_strain": 0.0021345119376915776, "peak": {"node": 1362, "coords_mm": [1.99, -32.12, 45.3], "vm_mpa": 298.6}, "volume_mm3": 13734.5, "bbox_mm": [50.1, 42.7, 45.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 98.6, "safety_factor": 2.535, "max_disp_mm": 0.0886, "max_strain": 0.0007048445597783791, "volume_mm3": 39713.1, "bbox_mm": [56.1, 42.7, 51.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.698, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 948, "family": "plate_holes", "params": {"L": 103.6, "H": null, "W": 55.0, "T": 3.9, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.6, 'H': None, 'W': 55.0, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 103.6, 'H': None, 'W': 55.0, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 420.4, "safety_factor": 0.595, "max_disp_mm": 2.1111, "max_strain": 0.003005303281497402, "peak": {"node": 1400, "coords_mm": [-50.25, -16.23, 0.0], "vm_mpa": 420.4}, "volume_mm3": 22001.7, "bbox_mm": [103.6, 55.0, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.4, "safety_factor": 1.708, "max_disp_mm": 0.6143, "max_strain": 0.0010465324546533614, "volume_mm3": 44567.5, "bbox_mm": [103.6, 55.0, 7.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.113, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 950, "family": "u_channel", "params": {"L": 86.1, "H": 36.5, "W": 37.4, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.1, 'H': 36.5, 'W': 37.4, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.1, 'H': 36.5, 'W': 37.4, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2180.6, "safety_factor": 0.115, "max_disp_mm": 5.7731, "max_strain": 0.015586855313361736, "peak": {"node": 298, "coords_mm": [46.38, 1.69, 3.3], "vm_mpa": 2180.6}, "volume_mm3": 891.9, "bbox_mm": [48.7, 36.5, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.6, "safety_factor": 1.975, "max_disp_mm": 0.1114, "max_strain": 0.0009049962497002211, "volume_mm3": 6564.6, "bbox_mm": [48.7, 36.5, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.86, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 951, "family": "rib_bracket", "params": {"L": 59.3, "H": 48.1, "W": 49.0, "T": 4.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.3, 'H': 48.1, 'W': 49.0, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 59.3, 'H': 48.1, 'W': 49.0, 'T': 4.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 405.2, "safety_factor": 0.617, "max_disp_mm": 1.1142, "max_strain": 0.0028966349674824986, "peak": {"node": 1632, "coords_mm": [6.15, -2.12, 52.6], "vm_mpa": 405.2}, "volume_mm3": 24673.9, "bbox_mm": [63.8, 49.0, 52.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.5, "safety_factor": 2.109, "max_disp_mm": 0.1538, "max_strain": 0.0008473756476408875, "volume_mm3": 60659.6, "bbox_mm": [69.8, 49.0, 58.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.492, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 952, "family": "plate_holes", "params": {"L": 113.1, "H": null, "W": 64.5, "T": 5.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.1, 'H': None, 'W': 64.5, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.1, 'H': None, 'W': 64.5, 'T': 5.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 320.8, "safety_factor": 0.779, "max_disp_mm": 2.3765, "max_strain": 0.0022931892900784736, "peak": {"node": 1916, "coords_mm": [-54.4, 8.68, 5.1], "vm_mpa": 320.8}, "volume_mm3": 36691.5, "bbox_mm": [113.1, 64.5, 5.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.6, "safety_factor": 2.022, "max_disp_mm": 0.561, "max_strain": 0.0008836696624144476, "volume_mm3": 65469.2, "bbox_mm": [113.1, 64.5, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.243, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 954, "family": "u_channel", "params": {"L": 98.8, "H": 42.8, "W": 43.8, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.8, 'H': 42.8, 'W': 43.8, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 98.8, 'H': 42.8, 'W': 43.8, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1613.8, "safety_factor": 0.155, "max_disp_mm": 4.9172, "max_strain": 0.011535370160733175, "peak": {"node": 287, "coords_mm": [51.75, 2.08, 0.0], "vm_mpa": 1613.8}, "volume_mm3": 1500.8, "bbox_mm": [55.0, 42.8, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 144.9, "safety_factor": 1.726, "max_disp_mm": 0.1488, "max_strain": 0.0010354414071742995, "volume_mm3": 8780.0, "bbox_mm": [55.0, 42.8, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.571, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 953, "family": "l_bracket", "params": {"L": 73.2, "H": 61.9, "W": 60.2, "T": 5.0, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.2, 'H': 61.9, 'W': 60.2, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 73.2, 'H': 61.9, 'W': 60.2, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 275.9, "safety_factor": 0.906, "max_disp_mm": 1.0614, "max_strain": 0.0019723981926623, "peak": {"node": 1594, "coords_mm": [8.99, -28.7, 61.9], "vm_mpa": 275.9}, "volume_mm3": 42170.1, "bbox_mm": [78.2, 60.2, 66.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.5, "safety_factor": 2.304, "max_disp_mm": 0.202, "max_strain": 0.0007757906206305485, "volume_mm3": 87350.2, "bbox_mm": [83.2, 60.2, 71.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.397, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 955, "family": "rib_bracket", "params": {"L": 71.9, "H": 54.4, "W": 55.4, "T": 5.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.9, 'H': 54.4, 'W': 55.4, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 71.9, 'H': 54.4, 'W': 55.4, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 332.7, "safety_factor": 0.751, "max_disp_mm": 1.1048, "max_strain": 0.002378537692753404, "peak": {"node": 2441, "coords_mm": [7.28, -14.82, 59.8], "vm_mpa": 332.7}, "volume_mm3": 39399.4, "bbox_mm": [77.3, 55.4, 59.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 106.2, "safety_factor": 2.354, "max_disp_mm": 0.1875, "max_strain": 0.0007592905727127644, "volume_mm3": 86965.8, "bbox_mm": [83.3, 55.4, 65.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.602, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 958, "family": "u_channel", "params": {"L": 111.5, "H": 49.2, "W": 30.1, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.5, 'H': 49.2, 'W': 30.1, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 111.5, 'H': 49.2, 'W': 30.1, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4779.7, "safety_factor": 0.052, "max_disp_mm": 46.4686, "max_strain": 0.034165752129501514, "peak": {"node": 435, "coords_mm": [33.93, 1.36, 2.6], "vm_mpa": 4779.7}, "volume_mm3": 865.3, "bbox_mm": [81.4, 49.2, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 132.9, "safety_factor": 1.882, "max_disp_mm": 0.2629, "max_strain": 0.000949654499318334, "volume_mm3": 13483.2, "bbox_mm": [81.4, 49.2, 10.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.829, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 960, "family": "plate_holes", "params": {"L": 102.1, "H": null, "W": 53.5, "T": 3.7, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.1, 'H': None, 'W': 53.5, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.1, 'H': None, 'W': 53.5, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 389.5, "safety_factor": 0.642, "max_disp_mm": 1.9868, "max_strain": 0.0027843803169659643, "peak": {"node": 1384, "coords_mm": [-49.69, -13.44, 0.0], "vm_mpa": 389.5}, "volume_mm3": 20001.5, "bbox_mm": [102.1, 53.5, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.2, "safety_factor": 1.949, "max_disp_mm": 0.5183, "max_strain": 0.0009166929681229401, "volume_mm3": 41624.7, "bbox_mm": [102.1, 53.5, 7.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.308, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 962, "family": "u_channel", "params": {"L": 84.1, "H": 35.5, "W": 36.5, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.1, 'H': 35.5, 'W': 36.5, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.1, 'H': 35.5, 'W': 36.5, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1977.1, "safety_factor": 0.126, "max_disp_mm": 6.3458, "max_strain": 0.014132470041280399, "peak": {"node": 89, "coords_mm": [42.17, 3.2, 0.0], "vm_mpa": 1977.1}, "volume_mm3": 818.2, "bbox_mm": [47.6, 35.5, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 129.4, "safety_factor": 1.932, "max_disp_mm": 0.1096, "max_strain": 0.000924791829954191, "volume_mm3": 6254.9, "bbox_mm": [47.6, 35.5, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.806, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 959, "family": "rib_bracket", "params": {"L": 84.6, "H": 40.8, "W": 41.7, "T": 3.4, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.6, 'H': 40.8, 'W': 41.7, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 84.6, 'H': 40.8, 'W': 41.7, 'T': 3.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 620.8, "safety_factor": 0.403, "max_disp_mm": 3.5024, "max_strain": 0.004437318974774062, "peak": {"node": 1315, "coords_mm": [2.13, -20.87, 44.2], "vm_mpa": 620.8}, "volume_mm3": 18261.3, "bbox_mm": [88.0, 41.7, 44.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.0, "safety_factor": 1.954, "max_disp_mm": 0.2967, "max_strain": 0.0009147168959999567, "volume_mm3": 65032.0, "bbox_mm": [96.0, 41.7, 52.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.551, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 963, "family": "rib_bracket", "params": {"L": 57.3, "H": 47.1, "W": 48.0, "T": 4.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.3, 'H': 47.1, 'W': 48.0, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 57.3, 'H': 47.1, 'W': 48.0, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 347.7, "safety_factor": 0.719, "max_disp_mm": 0.8178, "max_strain": 0.0024853703213043674, "peak": {"node": 1228, "coords_mm": [9.52, -44.39, 47.1], "vm_mpa": 347.7}, "volume_mm3": 22435.7, "bbox_mm": [61.6, 48.0, 51.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.1, "safety_factor": 2.774, "max_disp_mm": 0.1133, "max_strain": 0.0006441986118172356, "volume_mm3": 56707.7, "bbox_mm": [67.6, 48.0, 57.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.055, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 964, "family": "plate_holes", "params": {"L": 111.6, "H": null, "W": 63.0, "T": 4.9, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.6, 'H': None, 'W': 63.0, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 111.6, 'H': None, 'W': 63.0, 'T': 4.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 295.8, "safety_factor": 0.845, "max_disp_mm": 2.1923, "max_strain": 0.0021147192881768207, "peak": {"node": 2984, "coords_mm": [-54.1, 3.68, 4.9], "vm_mpa": 295.8}, "volume_mm3": 33958.3, "bbox_mm": [111.6, 63.0, 4.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.9, "safety_factor": 2.316, "max_disp_mm": 0.4875, "max_strain": 0.000771444775058398, "volume_mm3": 61679.4, "bbox_mm": [111.6, 63.0, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.471, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 966, "family": "u_channel", "params": {"L": 96.8, "H": 41.8, "W": 42.8, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.8, 'H': 41.8, 'W': 42.8, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 96.8, 'H': 41.8, 'W': 42.8, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1625.1, "safety_factor": 0.154, "max_disp_mm": 5.1627, "max_strain": 0.011616629591040309, "peak": {"node": 284, "coords_mm": [53.0, 2.03, 0.0], "vm_mpa": 1625.1}, "volume_mm3": 1397.8, "bbox_mm": [54.0, 41.8, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.6, "safety_factor": 1.705, "max_disp_mm": 0.1446, "max_strain": 0.0010482613097467508, "volume_mm3": 8419.1, "bbox_mm": [54.0, 41.8, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.551, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 965, "family": "l_bracket", "params": {"L": 71.0, "H": 60.4, "W": 59.0, "T": 4.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.0, 'H': 60.4, 'W': 59.0, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.0, 'H': 60.4, 'W': 59.0, 'T': 4.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 312.9, "safety_factor": 0.799, "max_disp_mm": 1.0906, "max_strain": 0.002236744415905017, "peak": {"node": 2612, "coords_mm": [6.39, -20.86, 65.2], "vm_mpa": 312.9}, "volume_mm3": 38571.8, "bbox_mm": [75.8, 59.0, 65.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.0, "safety_factor": 2.452, "max_disp_mm": 0.199, "max_strain": 0.0007289523840115851, "volume_mm3": 81641.8, "bbox_mm": [80.8, 59.0, 70.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.653, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 967, "family": "rib_bracket", "params": {"L": 70.0, "H": 53.4, "W": 54.4, "T": 5.3, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.0, 'H': 53.4, 'W': 54.4, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.0, 'H': 53.4, 'W': 54.4, 'T': 5.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 327.0, "safety_factor": 0.764, "max_disp_mm": 1.0943, "max_strain": 0.0023375676123282966, "peak": {"node": 2311, "coords_mm": [7.46, -25.05, 58.7], "vm_mpa": 327.0}, "volume_mm3": 37106.8, "bbox_mm": [75.3, 54.4, 58.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.2, "safety_factor": 2.134, "max_disp_mm": 0.1809, "max_strain": 0.0008374338581286069, "volume_mm3": 82802.8, "bbox_mm": [81.3, 54.4, 64.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.369, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 968, "family": "plate_holes", "params": {"L": 121.1, "H": null, "W": 72.5, "T": 6.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.1, 'H': None, 'W': 72.5, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.1, 'H': None, 'W': 72.5, 'T': 6.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 246.7, "safety_factor": 1.013, "max_disp_mm": 1.5048, "max_strain": 0.0017635959451665717, "peak": {"node": 605, "coords_mm": [-58.47, 0.08, 0.0], "vm_mpa": 246.7}, "volume_mm3": 53460.6, "bbox_mm": [121.1, 72.5, 6.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.1, "safety_factor": 2.496, "max_disp_mm": 0.4488, "max_strain": 0.0007158695436962289, "volume_mm3": 87951.2, "bbox_mm": [121.1, 72.5, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.483, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 969, "family": "l_bracket", "params": {"L": 85.2, "H": 69.9, "W": 66.9, "T": 5.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.2, 'H': 69.9, 'W': 66.9, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 85.2, 'H': 69.9, 'W': 66.9, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 212.0, "safety_factor": 1.179, "max_disp_mm": 0.9867, "max_strain": 0.0015152261018912038, "peak": {"node": 3331, "coords_mm": [8.6, -44.42, 75.7], "vm_mpa": 212.0}, "volume_mm3": 62432.4, "bbox_mm": [91.0, 66.9, 75.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.3, "safety_factor": 2.767, "max_disp_mm": 0.2275, "max_strain": 0.0006457590633809176, "volume_mm3": 119866.1, "bbox_mm": [96.0, 66.9, 80.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.588, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 970, "family": "u_channel", "params": {"L": 109.5, "H": 48.2, "W": 49.1, "T": 2.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.5, 'H': 48.2, 'W': 49.1, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 109.5, 'H': 48.2, 'W': 49.1, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3988.3, "safety_factor": 0.063, "max_disp_mm": 21.0532, "max_strain": 0.02850860779024148, "peak": {"node": 310, "coords_mm": [57.6, 1.26, 0.0], "vm_mpa": 3988.3}, "volume_mm3": 663.1, "bbox_mm": [60.4, 48.2, 2.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.0, "safety_factor": 2.474, "max_disp_mm": 0.1106, "max_strain": 0.0007222333623793364, "volume_mm3": 10815.5, "bbox_mm": [60.4, 48.2, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.412, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 972, "family": "plate_holes", "params": {"L": 100.6, "H": null, "W": 52.0, "T": 3.5, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.6, 'H': None, 'W': 52.0, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 100.6, 'H': None, 'W': 52.0, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 384.6, "safety_factor": 0.65, "max_disp_mm": 2.0626, "max_strain": 0.0027489937217065144, "peak": {"node": 130, "coords_mm": [-50.3, -11.14, 0.0], "vm_mpa": 384.6}, "volume_mm3": 18111.3, "bbox_mm": [100.6, 52.0, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 132.3, "safety_factor": 1.889, "max_disp_mm": 0.5513, "max_strain": 0.0009458002060179302, "volume_mm3": 38809.9, "bbox_mm": [100.6, 52.0, 7.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.239, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 973, "family": "l_bracket", "params": {"L": 54.5, "H": 49.4, "W": 49.8, "T": 3.7, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 54.5, 'H': 49.4, 'W': 49.8, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 54.5, 'H': 49.4, 'W': 49.8, 'T': 3.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 219.6, "safety_factor": 1.139, "max_disp_mm": 0.5465, "max_strain": 0.0015695672086420043, "peak": {"node": 1283, "coords_mm": [2.15, -41.09, 53.1], "vm_mpa": 219.6}, "volume_mm3": 19826.4, "bbox_mm": [58.2, 49.8, 53.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.3, "safety_factor": 3.002, "max_disp_mm": 0.1138, "max_strain": 0.0005951926342230442, "volume_mm3": 48785.1, "bbox_mm": [63.2, 49.8, 58.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.864, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 971, "family": "rib_bracket", "params": {"L": 82.6, "H": 59.8, "W": 40.7, "T": 3.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.6, 'H': 59.8, 'W': 40.7, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 82.6, 'H': 59.8, 'W': 40.7, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 633.5, "safety_factor": 0.395, "max_disp_mm": 3.6317, "max_strain": 0.004528180863815108, "peak": {"node": 1947, "coords_mm": [1.87, -29.99, 63.0], "vm_mpa": 633.5}, "volume_mm3": 18962.9, "bbox_mm": [85.8, 40.7, 63.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 143.6, "safety_factor": 1.741, "max_disp_mm": 0.2969, "max_strain": 0.0010266556931372468, "volume_mm3": 70017.0, "bbox_mm": [93.8, 40.7, 71.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.346, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 974, "family": "u_channel", "params": {"L": 82.1, "H": 34.5, "W": 35.5, "T": 3.1, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.1, 'H': 34.5, 'W': 35.5, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.1, 'H': 34.5, 'W': 35.5, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2084.2, "safety_factor": 0.12, "max_disp_mm": 6.1228, "max_strain": 0.014898023515727044, "peak": {"node": 278, "coords_mm": [39.55, 1.6, 3.1], "vm_mpa": 2084.2}, "volume_mm3": 749.6, "bbox_mm": [46.6, 34.5, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 122.2, "safety_factor": 2.046, "max_disp_mm": 0.1049, "max_strain": 0.0008733196164030288, "volume_mm3": 5962.3, "bbox_mm": [46.6, 34.5, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.926, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 975, "family": "rib_bracket", "params": {"L": 55.3, "H": 46.1, "W": 47.0, "T": 4.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.3, 'H': 46.1, 'W': 47.0, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 55.3, 'H': 46.1, 'W': 47.0, 'T': 4.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 270.6, "safety_factor": 0.924, "max_disp_mm": 0.6798, "max_strain": 0.0019344532437536451, "peak": {"node": 1169, "coords_mm": [16.84, -3.78, 46.1], "vm_mpa": 270.6}, "volume_mm3": 20845.4, "bbox_mm": [59.5, 47.0, 50.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 90.4, "safety_factor": 2.766, "max_disp_mm": 0.1069, "max_strain": 0.0006460032746209085, "volume_mm3": 53501.0, "bbox_mm": [65.5, 47.0, 56.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.842, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 976, "family": "plate_holes", "params": {"L": 110.1, "H": null, "W": 61.5, "T": 4.7, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.1, 'H': None, 'W': 61.5, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.1, 'H': None, 'W': 61.5, 'T': 4.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 336.0, "safety_factor": 0.744, "max_disp_mm": 2.4077, "max_strain": 0.0024017846867360583, "peak": {"node": 1757, "coords_mm": [-52.92, -9.84, 4.7], "vm_mpa": 336.0}, "volume_mm3": 31351.9, "bbox_mm": [110.1, 61.5, 4.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.5, "safety_factor": 2.183, "max_disp_mm": 0.5129, "max_strain": 0.0008185855608134152, "volume_mm3": 58034.4, "bbox_mm": [110.1, 61.5, 8.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.439, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 978, "family": "u_channel", "params": {"L": 94.8, "H": 40.8, "W": 41.8, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.8, 'H': 40.8, 'W': 41.8, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 94.8, 'H': 40.8, 'W': 41.8, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1743.9, "safety_factor": 0.143, "max_disp_mm": 5.3284, "max_strain": 0.012465586342163987, "peak": {"node": 314, "coords_mm": [49.86, 1.86, 3.8], "vm_mpa": 1743.9}, "volume_mm3": 1299.6, "bbox_mm": [53.0, 40.8, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 156.1, "safety_factor": 1.602, "max_disp_mm": 0.1428, "max_strain": 0.001115517309264134, "volume_mm3": 8067.4, "bbox_mm": [53.0, 40.8, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.459, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 977, "family": "l_bracket", "params": {"L": 68.7, "H": 58.9, "W": 57.8, "T": 4.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.7, 'H': 58.9, 'W': 57.8, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 68.7, 'H': 58.9, 'W': 57.8, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 306.8, "safety_factor": 0.815, "max_disp_mm": 1.0898, "max_strain": 0.0021932976649196466, "peak": {"node": 2153, "coords_mm": [7.32, -28.25, 63.6], "vm_mpa": 306.8}, "volume_mm3": 35940.6, "bbox_mm": [73.4, 57.8, 63.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.9, "safety_factor": 2.383, "max_disp_mm": 0.1902, "max_strain": 0.0007498202533011584, "volume_mm3": 76978.6, "bbox_mm": [78.4, 57.8, 68.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.569, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 979, "family": "rib_bracket", "params": {"L": 68.0, "H": 52.4, "W": 53.4, "T": 5.1, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.0, 'H': 52.4, 'W': 53.4, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.0, 'H': 52.4, 'W': 53.4, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 348.6, "safety_factor": 0.717, "max_disp_mm": 1.1522, "max_strain": 0.002492136891655948, "peak": {"node": 1413, "coords_mm": [7.23, -35.21, 52.4], "vm_mpa": 348.6}, "volume_mm3": 34178.7, "bbox_mm": [73.1, 53.4, 57.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.6, "safety_factor": 2.22, "max_disp_mm": 0.1788, "max_strain": 0.000805039343305079, "volume_mm3": 77945.3, "bbox_mm": [79.1, 53.4, 63.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.503, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 980, "family": "plate_holes", "params": {"L": 119.6, "H": null, "W": 71.0, "T": 6.0, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.6, 'H': None, 'W': 71.0, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 119.6, 'H': None, 'W': 71.0, 'T': 6.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 249.5, "safety_factor": 1.002, "max_disp_mm": 1.6422, "max_strain": 0.0017835177951017259, "peak": {"node": 2142, "coords_mm": [-58.39, 21.85, 0.0], "vm_mpa": 249.5}, "volume_mm3": 50007.1, "bbox_mm": [119.6, 71.0, 6.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.6, "safety_factor": 2.436, "max_disp_mm": 0.4678, "max_strain": 0.0007337161209290362, "volume_mm3": 83345.2, "bbox_mm": [119.6, 71.0, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.434, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 982, "family": "u_channel", "params": {"L": 107.5, "H": 47.2, "W": 48.1, "T": 4.4, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.5, 'H': 47.2, 'W': 48.1, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 107.5, 'H': 47.2, 'W': 48.1, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 966.8, "safety_factor": 0.259, "max_disp_mm": 2.7952, "max_strain": 0.00691048902816147, "peak": {"node": 340, "coords_mm": [54.11, 2.09, 4.4], "vm_mpa": 966.8}, "volume_mm3": 1978.6, "bbox_mm": [59.4, 47.2, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.5, "safety_factor": 2.617, "max_disp_mm": 0.1075, "max_strain": 0.0006827898549046941, "volume_mm3": 10405.0, "bbox_mm": [59.4, 47.2, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.359, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 981, "family": "l_bracket", "params": {"L": 83.0, "H": 68.4, "W": 65.7, "T": 5.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.0, 'H': 68.4, 'W': 65.7, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.0, 'H': 68.4, 'W': 65.7, 'T': 5.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 228.4, "safety_factor": 1.095, "max_disp_mm": 1.013, "max_strain": 0.001632745135480305, "peak": {"node": 1933, "coords_mm": [10.74, -48.68, 68.4], "vm_mpa": 228.4}, "volume_mm3": 57763.4, "bbox_mm": [88.6, 65.7, 74.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.0, "safety_factor": 2.633, "max_disp_mm": 0.2265, "max_strain": 0.0006787956881144741, "volume_mm3": 112820.0, "bbox_mm": [93.6, 65.7, 79.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.538, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 983, "family": "rib_bracket", "params": {"L": 80.6, "H": 58.8, "W": 59.7, "T": 3.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.6, 'H': 58.8, 'W': 59.7, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 80.6, 'H': 58.8, 'W': 59.7, 'T': 3.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 426.8, "safety_factor": 0.586, "max_disp_mm": 2.9121, "max_strain": 0.003050846478358163, "peak": {"node": 1976, "coords_mm": [2.15, -23.63, 61.9], "vm_mpa": 426.8}, "volume_mm3": 26372.5, "bbox_mm": [83.7, 59.7, 61.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.4, "safety_factor": 2.026, "max_disp_mm": 0.3156, "max_strain": 0.0008822552959786966, "volume_mm3": 80675.6, "bbox_mm": [89.7, 59.7, 67.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.44, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 985, "family": "l_bracket", "params": {"L": 52.2, "H": 47.9, "W": 48.6, "T": 3.6, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 52.2, 'H': 47.9, 'W': 48.6, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 52.2, 'H': 47.9, 'W': 48.6, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 222.0, "safety_factor": 1.126, "max_disp_mm": 0.4966, "max_strain": 0.0015866785992551093, "peak": {"node": 1252, "coords_mm": [1.98, -20.66, 51.5], "vm_mpa": 222.0}, "volume_mm3": 18143.4, "bbox_mm": [55.8, 48.6, 51.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 87.0, "safety_factor": 2.874, "max_disp_mm": 0.1062, "max_strain": 0.0006216917552589951, "volume_mm3": 45432.3, "bbox_mm": [60.8, 48.6, 56.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.748, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 986, "family": "u_channel", "params": {"L": 80.1, "H": 33.5, "W": 34.5, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.1, 'H': 33.5, 'W': 34.5, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.1, 'H': 33.5, 'W': 34.5, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2084.1, "safety_factor": 0.12, "max_disp_mm": 5.2811, "max_strain": 0.014897105845395102, "peak": {"node": 245, "coords_mm": [40.83, 1.53, 0.0], "vm_mpa": 2084.1}, "volume_mm3": 684.9, "bbox_mm": [45.6, 33.5, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.5, "safety_factor": 2.513, "max_disp_mm": 0.0819, "max_strain": 0.0007110134471194047, "volume_mm3": 5678.1, "bbox_mm": [45.6, 33.5, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.393, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 984, "family": "plate_holes", "params": {"L": 129.1, "H": null, "W": 50.5, "T": 3.3, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.1, 'H': None, 'W': 50.5, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.1, 'H': None, 'W': 50.5, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 631.2, "safety_factor": 0.396, "max_disp_mm": 5.7573, "max_strain": 0.004511597774413274, "peak": {"node": 2856, "coords_mm": [-63.17, 2.38, 3.3], "vm_mpa": 631.2}, "volume_mm3": 21327.9, "bbox_mm": [129.1, 50.5, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 119.3, "safety_factor": 2.095, "max_disp_mm": 0.6693, "max_strain": 0.0008530784907113815, "volume_mm3": 60105.9, "bbox_mm": [129.1, 50.5, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.699, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 987, "family": "rib_bracket", "params": {"L": 53.3, "H": 45.1, "W": 46.0, "T": 4.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.3, 'H': 45.1, 'W': 46.0, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 53.3, 'H': 45.1, 'W': 46.0, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 263.7, "safety_factor": 0.948, "max_disp_mm": 0.5242, "max_strain": 0.0018850697069092324, "peak": {"node": 1642, "coords_mm": [1.44, -20.51, 49.1], "vm_mpa": 263.7}, "volume_mm3": 18841.6, "bbox_mm": [57.3, 46.0, 49.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 94.0, "safety_factor": 2.659, "max_disp_mm": 0.1047, "max_strain": 0.0006719759223285608, "volume_mm3": 49864.0, "bbox_mm": [63.3, 46.0, 55.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.711, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 988, "family": "plate_holes", "params": {"L": 108.6, "H": null, "W": 60.0, "T": 4.5, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.6, 'H': None, 'W': 60.0, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 108.6, 'H': None, 'W': 60.0, 'T': 4.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 365.5, "safety_factor": 0.684, "max_disp_mm": 2.6147, "max_strain": 0.0026123423369498367, "peak": {"node": 1291, "coords_mm": [-52.15, 1.24, 0.0], "vm_mpa": 365.5}, "volume_mm3": 28869.6, "bbox_mm": [108.6, 60.0, 4.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.1, "safety_factor": 2.082, "max_disp_mm": 0.5325, "max_strain": 0.0008583879182346519, "volume_mm3": 54531.5, "bbox_mm": [108.6, 60.0, 8.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.398, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 990, "family": "u_channel", "params": {"L": 92.8, "H": 39.9, "W": 40.8, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.8, 'H': 39.9, 'W': 40.8, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 92.8, 'H': 39.9, 'W': 40.8, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1553.2, "safety_factor": 0.161, "max_disp_mm": 4.7174, "max_strain": 0.011102565158185383, "peak": {"node": 97, "coords_mm": [46.91, 3.7, 0.0], "vm_mpa": 1553.2}, "volume_mm3": 1207.5, "bbox_mm": [52.0, 39.9, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.0, "safety_factor": 2.001, "max_disp_mm": 0.1165, "max_strain": 0.0008931749498644395, "volume_mm3": 7734.2, "bbox_mm": [52.0, 39.9, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.84, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 989, "family": "l_bracket", "params": {"L": 66.5, "H": 57.4, "W": 56.5, "T": 4.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.5, 'H': 57.4, 'W': 56.5, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 66.5, 'H': 57.4, 'W': 56.5, 'T': 4.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 327.9, "safety_factor": 0.762, "max_disp_mm": 1.0967, "max_strain": 0.0023437380835275258, "peak": {"node": 1924, "coords_mm": [7.33, -31.81, 61.9], "vm_mpa": 327.9}, "volume_mm3": 32645.7, "bbox_mm": [71.0, 56.5, 61.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.6, "safety_factor": 2.367, "max_disp_mm": 0.1864, "max_strain": 0.0007550446822384377, "volume_mm3": 71602.5, "bbox_mm": [76.0, 56.5, 66.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.604, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 991, "family": "rib_bracket", "params": {"L": 66.0, "H": 51.4, "W": 52.4, "T": 5.0, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.0, 'H': 51.4, 'W': 52.4, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.0, 'H': 51.4, 'W': 52.4, 'T': 5.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 360.5, "safety_factor": 0.694, "max_disp_mm": 1.124, "max_strain": 0.0025765658628810403, "peak": {"node": 2093, "coords_mm": [6.47, -23.54, 56.4], "vm_mpa": 360.5}, "volume_mm3": 32068.8, "bbox_mm": [71.0, 52.4, 56.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.8, "safety_factor": 2.217, "max_disp_mm": 0.1713, "max_strain": 0.0008060987969112543, "volume_mm3": 74009.8, "bbox_mm": [77.0, 52.4, 62.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.523, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 992, "family": "plate_holes", "params": {"L": 118.1, "H": null, "W": 69.5, "T": 5.8, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.1, 'H': None, 'W': 69.5, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.1, 'H': None, 'W': 69.5, 'T': 5.8, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 265.4, "safety_factor": 0.942, "max_disp_mm": 1.7683, "max_strain": 0.0018970661924307458, "peak": {"node": 3136, "coords_mm": [-56.99, -8.63, 5.8], "vm_mpa": 265.4}, "volume_mm3": 46695.0, "bbox_mm": [118.1, 69.5, 5.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 108.1, "safety_factor": 2.314, "max_disp_mm": 0.4878, "max_strain": 0.0007723733049631877, "volume_mm3": 78898.5, "bbox_mm": [118.1, 69.5, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.372, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 994, "family": "u_channel", "params": {"L": 105.5, "H": 46.2, "W": 47.1, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.5, 'H': 46.2, 'W': 47.1, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 105.5, 'H': 46.2, 'W': 47.1, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1462.2, "safety_factor": 0.171, "max_disp_mm": 4.399, "max_strain": 0.01045226448069359, "peak": {"node": 313, "coords_mm": [50.74, 2.0, 0.0], "vm_mpa": 1462.2}, "volume_mm3": 1854.5, "bbox_mm": [58.4, 46.2, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 160.8, "safety_factor": 1.555, "max_disp_mm": 0.1608, "max_strain": 0.0011491668769891227, "volume_mm3": 10004.3, "bbox_mm": [58.4, 46.2, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.384, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 993, "family": "l_bracket", "params": {"L": 80.7, "H": 66.9, "W": 64.4, "T": 5.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.7, 'H': 66.9, 'W': 64.4, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 80.7, 'H': 66.9, 'W': 64.4, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 241.0, "safety_factor": 1.037, "max_disp_mm": 1.0108, "max_strain": 0.001722955364597917, "peak": {"node": 2802, "coords_mm": [7.02, -31.02, 72.4], "vm_mpa": 241.0}, "volume_mm3": 54228.0, "bbox_mm": [86.2, 64.4, 72.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.5, "safety_factor": 2.513, "max_disp_mm": 0.219, "max_strain": 0.0007111637939736441, "volume_mm3": 106907.2, "bbox_mm": [91.2, 64.4, 77.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.476, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 997, "family": "l_bracket", "params": {"L": 95.0, "H": 46.4, "W": 47.4, "T": 3.4, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 95.0, 'H': 46.4, 'W': 47.4, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 95.0, 'H': 46.4, 'W': 47.4, 'T': 3.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 477.2, "safety_factor": 0.524, "max_disp_mm": 3.4512, "max_strain": 0.003411052120745082, "peak": {"node": 2339, "coords_mm": [2.21, -33.63, 49.8], "vm_mpa": 477.2}, "volume_mm3": 23336.0, "bbox_mm": [98.4, 47.4, 49.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 162.6, "safety_factor": 1.538, "max_disp_mm": 0.6263, "max_strain": 0.0011619561718235905, "volume_mm3": 59644.4, "bbox_mm": [103.4, 47.4, 54.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.014, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 995, "family": "rib_bracket", "params": {"L": 78.7, "H": 57.8, "W": 58.7, "T": 5.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 78.7, 'H': 57.8, 'W': 58.7, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 78.7, 'H': 57.8, 'W': 58.7, 'T': 5.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 227.5, "safety_factor": 1.099, "max_disp_mm": 0.7948, "max_strain": 0.0016260380383032792, "peak": {"node": 1875, "coords_mm": [7.6, -35.38, 57.8], "vm_mpa": 227.5}, "volume_mm3": 49317.4, "bbox_mm": [84.6, 58.7, 63.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 77.1, "safety_factor": 3.241, "max_disp_mm": 0.1526, "max_strain": 0.0005514607073810381, "volume_mm3": 103661.9, "bbox_mm": [90.6, 58.7, 69.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.142, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 996, "family": "plate_holes", "params": {"L": 127.6, "H": null, "W": 79.0, "T": 3.1, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.6, 'H': None, 'W': 79.0, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 127.6, 'H': None, 'W': 79.0, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 342.6, "safety_factor": 0.73, "max_disp_mm": 4.1339, "max_strain": 0.0024490830915174996, "peak": {"node": 2489, "coords_mm": [-61.7, 3.76, 3.1], "vm_mpa": 342.6}, "volume_mm3": 31073.9, "bbox_mm": [127.6, 79.0, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.8, "safety_factor": 2.104, "max_disp_mm": 0.8162, "max_strain": 0.0008493351284337361, "volume_mm3": 71169.3, "bbox_mm": [127.6, 79.0, 7.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.374, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 998, "family": "u_channel", "params": {"L": 78.2, "H": 32.5, "W": 33.5, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.2, 'H': 32.5, 'W': 33.5, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.2, 'H': 32.5, 'W': 33.5, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2139.4, "safety_factor": 0.117, "max_disp_mm": 5.4163, "max_strain": 0.015292433876841226, "peak": {"node": 259, "coords_mm": [39.94, 1.48, 2.9], "vm_mpa": 2139.4}, "volume_mm3": 624.9, "bbox_mm": [44.7, 32.5, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.6, "safety_factor": 2.39, "max_disp_mm": 0.0811, "max_strain": 0.000747685790399524, "volume_mm3": 5410.0, "bbox_mm": [44.7, 32.5, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.273, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 999, "family": "rib_bracket", "params": {"L": 51.3, "H": 44.1, "W": 45.1, "T": 3.9, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.3, 'H': 44.1, 'W': 45.1, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 51.3, 'H': 44.1, 'W': 45.1, 'T': 3.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 282.7, "safety_factor": 0.884, "max_disp_mm": 0.4805, "max_strain": 0.0020205264723594293, "peak": {"node": 1544, "coords_mm": [1.84, -24.96, 48.0], "vm_mpa": 282.7}, "volume_mm3": 17465.9, "bbox_mm": [55.2, 45.1, 48.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.9, "safety_factor": 2.661, "max_disp_mm": 0.0977, "max_strain": 0.0006714513647543033, "volume_mm3": 47015.4, "bbox_mm": [61.2, 45.1, 54.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.777, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1000, "family": "plate_holes", "params": {"L": 107.1, "H": null, "W": 58.5, "T": 4.3, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.1, 'H': None, 'W': 58.5, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.1, 'H': None, 'W': 58.5, 'T': 4.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 375.1, "safety_factor": 0.666, "max_disp_mm": 2.7457, "max_strain": 0.0026813157692967262, "peak": {"node": 1596, "coords_mm": [-52.18, 3.71, 0.0], "vm_mpa": 375.1}, "volume_mm3": 26508.7, "bbox_mm": [107.1, 58.5, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 131.4, "safety_factor": 1.902, "max_disp_mm": 0.5622, "max_strain": 0.0009395526002827371, "volume_mm3": 51168.0, "bbox_mm": [107.1, 58.5, 8.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.236, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1002, "family": "u_channel", "params": {"L": 90.8, "H": 38.9, "W": 39.8, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.8, 'H': 38.9, 'W': 39.8, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 90.8, 'H': 38.9, 'W': 39.8, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1660.2, "safety_factor": 0.151, "max_disp_mm": 4.8351, "max_strain": 0.011867359236571279, "peak": {"node": 268, "coords_mm": [45.87, 1.6, 0.0], "vm_mpa": 1660.2}, "volume_mm3": 1118.4, "bbox_mm": [51.0, 38.9, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.5, "safety_factor": 2.075, "max_disp_mm": 0.1144, "max_strain": 0.0008614179820481848, "volume_mm3": 7400.4, "bbox_mm": [51.0, 38.9, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.924, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1001, "family": "l_bracket", "params": {"L": 64.2, "H": 55.9, "W": 55.3, "T": 4.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.2, 'H': 55.9, 'W': 55.3, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 64.2, 'H': 55.9, 'W': 55.3, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 308.1, "safety_factor": 0.811, "max_disp_mm": 1.0469, "max_strain": 0.0022024285733173773, "peak": {"node": 1432, "coords_mm": [6.46, -25.17, 55.9], "vm_mpa": 308.1}, "volume_mm3": 30293.3, "bbox_mm": [68.6, 55.3, 60.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.8, "safety_factor": 2.364, "max_disp_mm": 0.1781, "max_strain": 0.0007560536977833285, "volume_mm3": 67316.7, "bbox_mm": [73.6, 55.3, 65.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.552, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1003, "family": "rib_bracket", "params": {"L": 64.0, "H": 50.4, "W": 51.4, "T": 4.9, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.0, 'H': 50.4, 'W': 51.4, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.0, 'H': 50.4, 'W': 51.4, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 361.8, "safety_factor": 0.691, "max_disp_mm": 1.1131, "max_strain": 0.0025861387291789073, "peak": {"node": 1401, "coords_mm": [6.46, -6.12, 50.4], "vm_mpa": 361.8}, "volume_mm3": 30046.9, "bbox_mm": [68.9, 51.4, 55.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.9, "safety_factor": 2.175, "max_disp_mm": 0.1652, "max_strain": 0.0008215679241732528, "volume_mm3": 70200.6, "bbox_mm": [74.9, 51.4, 61.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.484, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1004, "family": "plate_holes", "params": {"L": 116.6, "H": null, "W": 68.0, "T": 5.6, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.6, 'H': None, 'W': 68.0, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 116.6, 'H': None, 'W': 68.0, 'T': 5.6, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 297.7, "safety_factor": 0.84, "max_disp_mm": 1.9334, "max_strain": 0.0021279259388204555, "peak": {"node": 3505, "coords_mm": [-57.03, -13.36, 5.6], "vm_mpa": 297.7}, "volume_mm3": 43521.6, "bbox_mm": [116.6, 68.0, 5.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.1, "safety_factor": 2.172, "max_disp_mm": 0.5057, "max_strain": 0.0008226704476372737, "volume_mm3": 74608.5, "bbox_mm": [116.6, 68.0, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.332, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1006, "family": "u_channel", "params": {"L": 103.5, "H": 45.2, "W": 46.1, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.5, 'H': 45.2, 'W': 46.1, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 103.5, 'H': 45.2, 'W': 46.1, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1368.5, "safety_factor": 0.183, "max_disp_mm": 4.5737, "max_strain": 0.009782512589646757, "peak": {"node": 298, "coords_mm": [54.11, 2.21, 0.0], "vm_mpa": 1368.5}, "volume_mm3": 1735.8, "bbox_mm": [57.4, 45.2, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 149.6, "safety_factor": 1.672, "max_disp_mm": 0.1568, "max_strain": 0.0010690666338880853, "volume_mm3": 9613.3, "bbox_mm": [57.4, 45.2, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.489, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1005, "family": "l_bracket", "params": {"L": 78.5, "H": 65.4, "W": 63.2, "T": 5.3, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.5, 'H': 65.4, 'W': 63.2, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 78.5, 'H': 65.4, 'W': 63.2, 'T': 5.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 251.4, "safety_factor": 0.994, "max_disp_mm": 1.0513, "max_strain": 0.0017969218901506805, "peak": {"node": 2643, "coords_mm": [6.59, -35.41, 70.7], "vm_mpa": 251.4}, "volume_mm3": 49976.0, "bbox_mm": [83.8, 63.2, 70.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.2, "safety_factor": 2.446, "max_disp_mm": 0.217, "max_strain": 0.0007306847802824205, "volume_mm3": 100378.0, "bbox_mm": [88.8, 63.2, 75.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.451, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1010, "family": "u_channel", "params": {"L": 76.2, "H": 31.5, "W": 32.5, "T": 2.8, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.2, 'H': 31.5, 'W': 32.5, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.2, 'H': 31.5, 'W': 32.5, 'T': 2.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2371.0, "safety_factor": 0.105, "max_disp_mm": 5.5137, "max_strain": 0.0169485082809096, "peak": {"node": 262, "coords_mm": [36.36, 1.44, 2.8], "vm_mpa": 2371.0}, "volume_mm3": 567.6, "bbox_mm": [43.7, 31.5, 2.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.9, "safety_factor": 2.407, "max_disp_mm": 0.0792, "max_strain": 0.0007423395007915335, "volume_mm3": 5142.0, "bbox_mm": [43.7, 31.5, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.302, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1007, "family": "rib_bracket", "params": {"L": 76.7, "H": 56.8, "W": 57.7, "T": 5.8, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.7, 'H': 56.8, 'W': 57.7, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 76.7, 'H': 56.8, 'W': 57.7, 'T': 5.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 292.7, "safety_factor": 0.854, "max_disp_mm": 1.0388, "max_strain": 0.002092181513787759, "peak": {"node": 1552, "coords_mm": [9.22, -27.66, 56.8], "vm_mpa": 292.7}, "volume_mm3": 46618.1, "bbox_mm": [82.5, 57.7, 62.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.8, "safety_factor": 2.255, "max_disp_mm": 0.1971, "max_strain": 0.000792318049130272, "volume_mm3": 98929.0, "bbox_mm": [88.5, 57.7, 68.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.401, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1011, "family": "rib_bracket", "params": {"L": 49.3, "H": 43.1, "W": 44.1, "T": 3.8, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.3, 'H': 43.1, 'W': 44.1, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 49.3, 'H': 43.1, 'W': 44.1, 'T': 3.8, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 261.0, "safety_factor": 0.958, "max_disp_mm": 0.5076, "max_strain": 0.0018659289661425995, "peak": {"node": 1463, "coords_mm": [1.5, -25.67, 46.9], "vm_mpa": 261.0}, "volume_mm3": 16121.2, "bbox_mm": [53.1, 44.1, 46.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 87.9, "safety_factor": 2.846, "max_disp_mm": 0.0921, "max_strain": 0.000628016508445497, "volume_mm3": 44168.8, "bbox_mm": [59.1, 44.1, 52.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.888, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1009, "family": "l_bracket", "params": {"L": 92.8, "H": 74.9, "W": 46.1, "T": 3.3, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.8, 'H': 74.9, 'W': 46.1, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 92.8, 'H': 74.9, 'W': 46.1, 'T': 3.3, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 452.4, "safety_factor": 0.553, "max_disp_mm": 4.6415, "max_strain": 0.0032339340702435414, "peak": {"node": 2606, "coords_mm": [2.03, -28.06, 78.2], "vm_mpa": 452.4}, "volume_mm3": 26014.2, "bbox_mm": [96.1, 46.1, 78.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.2, "safety_factor": 2.029, "max_disp_mm": 0.362, "max_strain": 0.0008805949649167939, "volume_mm3": 84519.7, "bbox_mm": [103.1, 46.1, 85.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.477, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1012, "family": "plate_holes", "params": {"L": 105.6, "H": null, "W": 57.0, "T": 4.1, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.6, 'H': None, 'W': 57.0, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 105.6, 'H': None, 'W': 57.0, 'T': 4.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 398.1, "safety_factor": 0.628, "max_disp_mm": 2.7943, "max_strain": 0.002845849433257257, "peak": {"node": 2712, "coords_mm": [-51.38, -7.51, 4.1], "vm_mpa": 398.1}, "volume_mm3": 24266.5, "bbox_mm": [105.6, 57.0, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 137.8, "safety_factor": 1.814, "max_disp_mm": 0.5914, "max_strain": 0.00098494966492503, "volume_mm3": 47941.2, "bbox_mm": [105.6, 57.0, 8.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.186, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1014, "family": "u_channel", "params": {"L": 88.8, "H": 37.9, "W": 38.8, "T": 3.5, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.8, 'H': 37.9, 'W': 38.8, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 88.8, 'H': 37.9, 'W': 38.8, 'T': 3.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1669.1, "safety_factor": 0.15, "max_disp_mm": 5.0211, "max_strain": 0.01193117028311517, "peak": {"node": 300, "coords_mm": [43.17, 1.78, 3.5], "vm_mpa": 1669.1}, "volume_mm3": 1033.9, "bbox_mm": [50.0, 37.9, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.9, "safety_factor": 1.97, "max_disp_mm": 0.1115, "max_strain": 0.0009072392456438014, "volume_mm3": 7075.6, "bbox_mm": [50.0, 37.9, 9.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.82, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1013, "family": "l_bracket", "params": {"L": 62.0, "H": 54.4, "W": 54.0, "T": 4.2, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 62.0, 'H': 54.4, 'W': 54.0, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 62.0, 'H': 54.4, 'W': 54.0, 'T': 4.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 236.8, "safety_factor": 1.056, "max_disp_mm": 0.6773, "max_strain": 0.0016928723074503326, "peak": {"node": 2040, "coords_mm": [6.38, -40.5, 58.6], "vm_mpa": 236.8}, "volume_mm3": 27352.1, "bbox_mm": [66.2, 54.0, 58.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.4, "safety_factor": 2.999, "max_disp_mm": 0.1304, "max_strain": 0.0005958757551238404, "volume_mm3": 62398.1, "bbox_mm": [71.2, 54.0, 63.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.943, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1015, "family": "rib_bracket", "params": {"L": 62.0, "H": 49.4, "W": 50.4, "T": 4.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.0, 'H': 49.4, 'W': 50.4, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 62.0, 'H': 49.4, 'W': 50.4, 'T': 4.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 415.7, "safety_factor": 0.601, "max_disp_mm": 1.1578, "max_strain": 0.002971258509313387, "peak": {"node": 1988, "coords_mm": [5.59, -14.33, 54.1], "vm_mpa": 415.7}, "volume_mm3": 27501.8, "bbox_mm": [66.7, 50.4, 54.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.7, "safety_factor": 2.107, "max_disp_mm": 0.1615, "max_strain": 0.000848295530338087, "volume_mm3": 65846.1, "bbox_mm": [72.7, 50.4, 60.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.505, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1018, "family": "u_channel", "params": {"L": 101.5, "H": 44.2, "W": 45.1, "T": 4.1, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.5, 'H': 44.2, 'W': 45.1, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 101.5, 'H': 44.2, 'W': 45.1, 'T': 4.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1626.9, "safety_factor": 0.154, "max_disp_mm": 4.8792, "max_strain": 0.011629190751069253, "peak": {"node": 343, "coords_mm": [53.39, 2.02, 4.1], "vm_mpa": 1626.9}, "volume_mm3": 1622.2, "bbox_mm": [56.4, 44.2, 4.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 155.5, "safety_factor": 1.608, "max_disp_mm": 0.1565, "max_strain": 0.0011113195024116933, "volume_mm3": 9231.9, "bbox_mm": [56.4, 44.2, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.454, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1016, "family": "plate_holes", "params": {"L": 115.1, "H": null, "W": 66.5, "T": 5.4, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.1, 'H': None, 'W': 66.5, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 115.1, 'H': None, 'W': 66.5, 'T': 5.4, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 314.2, "safety_factor": 0.796, "max_disp_mm": 2.1016, "max_strain": 0.002245607999861995, "peak": {"node": 2004, "coords_mm": [-55.58, -9.92, 5.4], "vm_mpa": 314.2}, "volume_mm3": 40484.2, "bbox_mm": [115.1, 66.5, 5.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 113.2, "safety_factor": 2.208, "max_disp_mm": 0.5276, "max_strain": 0.0008094216183011587, "volume_mm3": 70472.5, "bbox_mm": [115.1, 66.5, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.412, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1017, "family": "l_bracket", "params": {"L": 76.3, "H": 63.9, "W": 62.0, "T": 5.2, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.3, 'H': 63.9, 'W': 62.0, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 76.3, 'H': 63.9, 'W': 62.0, 'T': 5.2, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 274.6, "safety_factor": 0.91, "max_disp_mm": 1.037, "max_strain": 0.00196295237413541, "peak": {"node": 1722, "coords_mm": [7.28, -23.54, 63.9], "vm_mpa": 274.6}, "volume_mm3": 46877.0, "bbox_mm": [81.5, 62.0, 69.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.7, "safety_factor": 2.509, "max_disp_mm": 0.2087, "max_strain": 0.0007123683146013979, "volume_mm3": 95113.0, "bbox_mm": [86.5, 62.0, 74.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.598, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1019, "family": "rib_bracket", "params": {"L": 74.7, "H": 55.8, "W": 56.7, "T": 5.7, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.7, 'H': 55.8, 'W': 56.7, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 74.7, 'H': 55.8, 'W': 56.7, 'T': 5.7, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 337.1, "safety_factor": 0.742, "max_disp_mm": 1.0374, "max_strain": 0.0024097488439972607, "peak": {"node": 1731, "coords_mm": [9.12, -22.19, 55.8], "vm_mpa": 337.1}, "volume_mm3": 44018.5, "bbox_mm": [80.4, 56.7, 61.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.4, "safety_factor": 2.285, "max_disp_mm": 0.1896, "max_strain": 0.0007821748452068589, "volume_mm3": 94334.1, "bbox_mm": [86.4, 56.7, 67.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.543, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1022, "family": "u_channel", "params": {"L": 114.2, "H": 30.5, "W": 31.5, "T": 2.7, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.2, 'H': 30.5, 'W': 31.5, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 114.2, 'H': 30.5, 'W': 31.5, 'T': 2.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4116.7, "safety_factor": 0.061, "max_disp_mm": 41.6528, "max_strain": 0.029426955342993496, "peak": {"node": 309, "coords_mm": [35.07, 1.28, 0.0], "vm_mpa": 4116.7}, "volume_mm3": 805.5, "bbox_mm": [82.7, 30.5, 2.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 134.2, "safety_factor": 1.862, "max_disp_mm": 0.266, "max_strain": 0.0009595194568808987, "volume_mm3": 11735.2, "bbox_mm": [82.7, 30.5, 10.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.802, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1021, "family": "l_bracket", "params": {"L": 90.5, "H": 73.4, "W": 69.9, "T": 3.1, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.5, 'H': 73.4, 'W': 69.9, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 90.5, 'H': 73.4, 'W': 69.9, 'T': 3.1, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 369.9, "safety_factor": 0.676, "max_disp_mm": 2.9659, "max_strain": 0.002643971963886612, "peak": {"node": 3448, "coords_mm": [2.16, -58.67, 76.5], "vm_mpa": 369.9}, "volume_mm3": 36187.2, "bbox_mm": [93.6, 69.9, 76.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.0, "safety_factor": 2.294, "max_disp_mm": 0.4013, "max_strain": 0.0007789325034127951, "volume_mm3": 97384.7, "bbox_mm": [98.6, 69.9, 81.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.618, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1023, "family": "rib_bracket", "params": {"L": 47.3, "H": 42.1, "W": 43.1, "T": 3.6, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.3, 'H': 42.1, 'W': 43.1, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 47.3, 'H': 42.1, 'W': 43.1, 'T': 3.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 259.6, "safety_factor": 0.963, "max_disp_mm": 0.4809, "max_strain": 0.0018553659525069694, "peak": {"node": 1409, "coords_mm": [3.17, -16.88, 45.7], "vm_mpa": 259.6}, "volume_mm3": 14429.9, "bbox_mm": [50.9, 43.1, 45.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 89.1, "safety_factor": 2.805, "max_disp_mm": 0.089, "max_strain": 0.0006371852959756497, "volume_mm3": 40962.2, "bbox_mm": [56.9, 43.1, 51.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.841, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1024, "family": "plate_holes", "params": {"L": 104.1, "H": null, "W": 55.6, "T": 3.9, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.1, 'H': None, 'W': 55.6, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 104.1, 'H': None, 'W': 55.6, 'T': 3.9, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 404.9, "safety_factor": 0.617, "max_disp_mm": 2.3222, "max_strain": 0.0028942085089527694, "peak": {"node": 2577, "coords_mm": [-50.65, 14.47, 3.9], "vm_mpa": 404.9}, "volume_mm3": 22352.5, "bbox_mm": [104.1, 55.6, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 145.4, "safety_factor": 1.719, "max_disp_mm": 0.6183, "max_strain": 0.0010394648773207696, "volume_mm3": 45278.1, "bbox_mm": [104.1, 55.6, 7.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.102, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1026, "family": "u_channel", "params": {"L": 86.8, "H": 36.9, "W": 37.8, "T": 3.4, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.8, 'H': 36.9, 'W': 37.8, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 86.8, 'H': 36.9, 'W': 37.8, 'T': 3.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1715.9, "safety_factor": 0.146, "max_disp_mm": 5.2684, "max_strain": 0.012265298170292696, "peak": {"node": 73, "coords_mm": [43.6, 3.4, 3.4], "vm_mpa": 1715.9}, "volume_mm3": 953.7, "bbox_mm": [49.0, 36.9, 3.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 127.8, "safety_factor": 1.956, "max_disp_mm": 0.1106, "max_strain": 0.0009134454441401595, "volume_mm3": 6759.5, "bbox_mm": [49.0, 36.9, 9.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.811, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1027, "family": "rib_bracket", "params": {"L": 60.0, "H": 48.5, "W": 49.4, "T": 4.6, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.0, 'H': 48.5, 'W': 49.4, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 60.0, 'H': 48.5, 'W': 49.4, 'T': 4.6, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 395.0, "safety_factor": 0.633, "max_disp_mm": 1.0997, "max_strain": 0.002823559605520644, "peak": {"node": 1288, "coords_mm": [7.86, -34.71, 48.5], "vm_mpa": 395.0}, "volume_mm3": 25700.8, "bbox_mm": [64.6, 49.4, 53.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.6, "safety_factor": 2.125, "max_disp_mm": 0.1543, "max_strain": 0.0008409626767354219, "volume_mm3": 62365.5, "bbox_mm": [70.6, 49.4, 59.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.492, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1028, "family": "plate_holes", "params": {"L": 113.6, "H": null, "W": 65.1, "T": 5.2, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.6, 'H': None, 'W': 65.1, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 113.6, 'H': None, 'W': 65.1, 'T': 5.2, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 330.2, "safety_factor": 0.757, "max_disp_mm": 2.2969, "max_strain": 0.0023606030441382306, "peak": {"node": 3333, "coords_mm": [-54.95, -2.59, 5.2], "vm_mpa": 330.2}, "volume_mm3": 37933.1, "bbox_mm": [113.6, 65.1, 5.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.5, "safety_factor": 2.025, "max_disp_mm": 0.5465, "max_strain": 0.000882633201200687, "volume_mm3": 67112.4, "bbox_mm": [113.6, 65.1, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.268, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1030, "family": "u_channel", "params": {"L": 99.5, "H": 43.2, "W": 44.2, "T": 4.0, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.5, 'H': 43.2, 'W': 44.2, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 99.5, 'H': 43.2, 'W': 44.2, 'T': 4.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1457.1, "safety_factor": 0.172, "max_disp_mm": 4.9089, "max_strain": 0.01041544832060576, "peak": {"node": 83, "coords_mm": [50.64, 4.0, 4.0], "vm_mpa": 1457.1}, "volume_mm3": 1512.0, "bbox_mm": [55.3, 43.2, 4.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 143.2, "safety_factor": 1.746, "max_disp_mm": 0.1495, "max_strain": 0.001023456427667858, "volume_mm3": 8850.0, "bbox_mm": [55.3, 43.2, 10.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.575, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1029, "family": "l_bracket", "params": {"L": 74.0, "H": 62.4, "W": 60.7, "T": 5.0, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.0, 'H': 62.4, 'W': 60.7, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 74.0, 'H': 62.4, 'W': 60.7, 'T': 5.0, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 272.3, "safety_factor": 0.918, "max_disp_mm": 1.0777, "max_strain": 0.0019466562941995791, "peak": {"node": 1897, "coords_mm": [6.77, -41.91, 62.4], "vm_mpa": 272.3}, "volume_mm3": 42914.9, "bbox_mm": [79.0, 60.7, 67.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 105.4, "safety_factor": 2.372, "max_disp_mm": 0.2065, "max_strain": 0.0007534624144957353, "volume_mm3": 88864.8, "bbox_mm": [84.0, 60.7, 72.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.454, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1031, "family": "rib_bracket", "params": {"L": 72.7, "H": 54.8, "W": 55.7, "T": 5.5, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.7, 'H': 54.8, 'W': 55.7, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 72.7, 'H': 54.8, 'W': 55.7, 'T': 5.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 308.7, "safety_factor": 0.81, "max_disp_mm": 1.0771, "max_strain": 0.0022064833629362587, "peak": {"node": 1733, "coords_mm": [8.71, -33.94, 54.8], "vm_mpa": 308.7}, "volume_mm3": 40744.5, "bbox_mm": [78.2, 55.7, 60.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.1, "safety_factor": 2.171, "max_disp_mm": 0.1883, "max_strain": 0.0008229822659014865, "volume_mm3": 89036.5, "bbox_mm": [84.2, 55.7, 66.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.362, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1034, "family": "u_channel", "params": {"L": 112.2, "H": 49.5, "W": 30.5, "T": 2.6, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.2, 'H': 49.5, 'W': 30.5, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 112.2, 'H': 49.5, 'W': 30.5, 'T': 2.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 4943.8, "safety_factor": 0.051, "max_disp_mm": 46.6577, "max_strain": 0.03533881296756301, "peak": {"node": 438, "coords_mm": [34.29, 1.31, 2.6], "vm_mpa": 4943.8}, "volume_mm3": 869.3, "bbox_mm": [81.7, 49.5, 2.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 137.5, "safety_factor": 1.819, "max_disp_mm": 0.2654, "max_strain": 0.0009826074968919782, "volume_mm3": 13550.6, "bbox_mm": [81.7, 49.5, 10.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.768, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1035, "family": "rib_bracket", "params": {"L": 45.4, "H": 41.1, "W": 42.1, "T": 3.5, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.4, 'H': 41.1, 'W': 42.1, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 45.4, 'H': 41.1, 'W': 42.1, 'T': 3.5, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 266.4, "safety_factor": 0.939, "max_disp_mm": 0.5271, "max_strain": 0.0019040573351235444, "peak": {"node": 964, "coords_mm": [2.14, -13.62, 44.6], "vm_mpa": 266.4}, "volume_mm3": 13261.5, "bbox_mm": [48.9, 42.1, 44.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.7, "safety_factor": 2.985, "max_disp_mm": 0.0837, "max_strain": 0.0005986153611302003, "volume_mm3": 38395.2, "bbox_mm": [54.9, 42.1, 50.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.047, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1038, "family": "u_channel", "params": {"L": 84.9, "H": 35.9, "W": 36.8, "T": 3.3, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.9, 'H': 35.9, 'W': 36.8, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 84.9, 'H': 35.9, 'W': 36.8, 'T': 3.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2019.9, "safety_factor": 0.124, "max_disp_mm": 5.7097, "max_strain": 0.014438757876580149, "peak": {"node": 283, "coords_mm": [40.83, 1.69, 3.3], "vm_mpa": 2019.9}, "volume_mm3": 878.8, "bbox_mm": [48.1, 35.9, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 123.8, "safety_factor": 2.019, "max_disp_mm": 0.1082, "max_strain": 0.000885163278671167, "volume_mm3": 6460.8, "bbox_mm": [48.1, 35.9, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.895, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1037, "family": "l_bracket", "params": {"L": 57.5, "H": 51.4, "W": 51.5, "T": 3.9, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 57.5, 'H': 51.4, 'W': 51.5, 'T': 3.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 57.5, 'H': 51.4, 'W': 51.5, 'T': 3.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 227.7, "safety_factor": 1.098, "max_disp_mm": 0.6468, "max_strain": 0.0016277332302460515, "peak": {"node": 1907, "coords_mm": [3.26, -22.1, 55.3], "vm_mpa": 227.7}, "volume_mm3": 22655.9, "bbox_mm": [61.4, 51.5, 55.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.5, "safety_factor": 2.994, "max_disp_mm": 0.1195, "max_strain": 0.0005968118156426167, "volume_mm3": 53993.6, "bbox_mm": [66.4, 51.5, 60.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.896, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1036, "family": "plate_holes", "params": {"L": 102.6, "H": null, "W": 54.1, "T": 3.7, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.6, 'H': None, 'W': 54.1, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 102.6, 'H': None, 'W': 54.1, 'T': 3.7, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 340.8, "safety_factor": 0.734, "max_disp_mm": 1.9124, "max_strain": 0.002435871711919606, "peak": {"node": 2411, "coords_mm": [-49.48, -16.34, 3.7], "vm_mpa": 340.8}, "volume_mm3": 20328.2, "bbox_mm": [102.6, 54.1, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 125.4, "safety_factor": 1.993, "max_disp_mm": 0.5231, "max_strain": 0.0008966349022473765, "volume_mm3": 42304.7, "bbox_mm": [102.6, 54.1, 7.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.259, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1039, "family": "rib_bracket", "params": {"L": 58.0, "H": 47.5, "W": 48.4, "T": 4.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.0, 'H': 47.5, 'W': 48.4, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 58.0, 'H': 47.5, 'W': 48.4, 'T': 4.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 470.7, "safety_factor": 0.531, "max_disp_mm": 1.1117, "max_strain": 0.0033646190198392584, "peak": {"node": 1593, "coords_mm": [5.93, -44.79, 51.9], "vm_mpa": 470.7}, "volume_mm3": 23404.3, "bbox_mm": [62.4, 48.4, 51.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 109.6, "safety_factor": 2.281, "max_disp_mm": 0.1509, "max_strain": 0.0007833319844678907, "volume_mm3": 58339.4, "bbox_mm": [68.4, 48.4, 57.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.75, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1040, "family": "plate_holes", "params": {"L": 112.1, "H": null, "W": 63.6, "T": 5.0, "fix_extra": 4.0, "force": 1000, "holes": 4.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.1, 'H': None, 'W': 63.6, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 112.1, 'H': None, 'W': 63.6, 'T': 5.0, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 299.3, "safety_factor": 0.835, "max_disp_mm": 2.0702, "max_strain": 0.0021395626026184805, "peak": {"node": 1811, "coords_mm": [-54.16, -8.09, 5.0], "vm_mpa": 299.3}, "volume_mm3": 35145.1, "bbox_mm": [112.1, 63.6, 5.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 106.5, "safety_factor": 2.348, "max_disp_mm": 0.4739, "max_strain": 0.0007611292401823629, "volume_mm3": 63261.3, "bbox_mm": [112.1, 63.6, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.513, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1041, "family": "l_bracket", "params": {"L": 71.8, "H": 60.9, "W": 59.5, "T": 4.9, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.8, 'H': 60.9, 'W': 59.5, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 71.8, 'H': 60.9, 'W': 59.5, 'T': 4.9, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 298.6, "safety_factor": 0.837, "max_disp_mm": 1.062, "max_strain": 0.0021345204439574116, "peak": {"node": 2249, "coords_mm": [6.11, -33.51, 65.8], "vm_mpa": 298.6}, "volume_mm3": 40117.3, "bbox_mm": [76.7, 59.5, 65.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.0, "safety_factor": 2.526, "max_disp_mm": 0.1966, "max_strain": 0.0007073911961298171, "volume_mm3": 83998.5, "bbox_mm": [81.7, 59.5, 70.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.689, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1042, "family": "u_channel", "params": {"L": 97.5, "H": 42.2, "W": 43.2, "T": 3.9, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.5, 'H': 42.2, 'W': 43.2, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 97.5, 'H': 42.2, 'W': 43.2, 'T': 3.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1698.6, "safety_factor": 0.147, "max_disp_mm": 5.1695, "max_strain": 0.012142096977811533, "peak": {"node": 323, "coords_mm": [53.11, 2.22, 3.9], "vm_mpa": 1698.6}, "volume_mm3": 1408.4, "bbox_mm": [54.3, 42.2, 3.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 146.7, "safety_factor": 1.705, "max_disp_mm": 0.1474, "max_strain": 0.0010483683355663018, "volume_mm3": 8487.7, "bbox_mm": [54.3, 42.2, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.557, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1043, "family": "rib_bracket", "params": {"L": 70.7, "H": 53.8, "W": 54.7, "T": 5.4, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.7, 'H': 53.8, 'W': 54.7, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 70.7, 'H': 53.8, 'W': 54.7, 'T': 5.4, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 321.9, "safety_factor": 0.777, "max_disp_mm": 1.0769, "max_strain": 0.00230118665374172, "peak": {"node": 2405, "coords_mm": [5.92, -31.06, 59.2], "vm_mpa": 321.9}, "volume_mm3": 38369.9, "bbox_mm": [76.1, 54.7, 59.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 103.0, "safety_factor": 2.428, "max_disp_mm": 0.181, "max_strain": 0.0007359246266707028, "volume_mm3": 84744.5, "bbox_mm": [82.1, 54.7, 65.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.652, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1044, "family": "plate_holes", "params": {"L": 121.6, "H": null, "W": 73.1, "T": 6.3, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.6, 'H': None, 'W': 73.1, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 121.6, 'H': None, 'W': 73.1, 'T': 6.3, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 229.3, "safety_factor": 1.09, "max_disp_mm": 1.463, "max_strain": 0.0016387317062361642, "peak": {"node": 627, "coords_mm": [-58.93, 11.06, 0.0], "vm_mpa": 229.3}, "volume_mm3": 55010.8, "bbox_mm": [121.6, 73.1, 6.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 94.5, "safety_factor": 2.646, "max_disp_mm": 0.4395, "max_strain": 0.0006752966047390864, "volume_mm3": 89938.4, "bbox_mm": [121.6, 73.1, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.556, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1045, "family": "l_bracket", "params": {"L": 86.0, "H": 70.4, "W": 67.4, "T": 5.8, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 86.0, 'H': 70.4, 'W': 67.4, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 86.0, 'H': 70.4, 'W': 67.4, 'T': 5.8, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 220.5, "safety_factor": 1.134, "max_disp_mm": 1.0028, "max_strain": 0.001575847918398587, "peak": {"node": 1404, "coords_mm": [10.12, -57.43, 70.4], "vm_mpa": 220.5}, "volume_mm3": 63407.2, "bbox_mm": [91.8, 67.4, 76.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 93.0, "safety_factor": 2.688, "max_disp_mm": 0.2312, "max_strain": 0.0006648268059461135, "volume_mm3": 121708.2, "bbox_mm": [96.8, 67.4, 81.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.554, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1046, "family": "u_channel", "params": {"L": 110.2, "H": 48.5, "W": 49.5, "T": 2.5, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.2, 'H': 48.5, 'W': 49.5, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 110.2, 'H': 48.5, 'W': 49.5, 'T': 2.5, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 3683.4, "safety_factor": 0.068, "max_disp_mm": 21.504, "max_strain": 0.02632978586879225, "peak": {"node": 308, "coords_mm": [60.46, 1.26, 0.0], "vm_mpa": 3683.4}, "volume_mm3": 666.9, "bbox_mm": [60.7, 48.5, 2.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 96.5, "safety_factor": 2.589, "max_disp_mm": 0.1117, "max_strain": 0.0006901409564254579, "volume_mm3": 10881.7, "bbox_mm": [60.7, 48.5, 10.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.521, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1048, "family": "plate_holes", "params": {"L": 101.2, "H": null, "W": 52.6, "T": 3.5, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.2, 'H': None, 'W': 52.6, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 101.2, 'H': None, 'W': 52.6, 'T': 3.5, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 408.2, "safety_factor": 0.612, "max_disp_mm": 2.2963, "max_strain": 0.0029177897270021473, "peak": {"node": 2330, "coords_mm": [-48.91, -13.13, 3.5], "vm_mpa": 408.2}, "volume_mm3": 18433.0, "bbox_mm": [101.2, 52.6, 3.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 132.9, "safety_factor": 1.881, "max_disp_mm": 0.5538, "max_strain": 0.0009500608220600941, "volume_mm3": 39499.3, "bbox_mm": [101.2, 52.6, 7.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.269, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1050, "family": "u_channel", "params": {"L": 82.9, "H": 34.9, "W": 35.8, "T": 3.2, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.9, 'H': 34.9, 'W': 35.8, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 82.9, 'H': 34.9, 'W': 35.8, 'T': 3.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2211.5, "safety_factor": 0.113, "max_disp_mm": 5.95, "max_strain": 0.015808104252045443, "peak": {"node": 87, "coords_mm": [41.44, 3.2, 0.0], "vm_mpa": 2211.5}, "volume_mm3": 806.9, "bbox_mm": [47.1, 34.9, 3.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 124.1, "safety_factor": 2.014, "max_disp_mm": 0.105, "max_strain": 0.0008873312996555225, "volume_mm3": 6161.8, "bbox_mm": [47.1, 34.9, 9.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.901, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1047, "family": "rib_bracket", "params": {"L": 83.4, "H": 40.1, "W": 41.1, "T": 3.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.4, 'H': 40.1, 'W': 41.1, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 83.4, 'H': 40.1, 'W': 41.1, 'T': 3.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 588.3, "safety_factor": 0.425, "max_disp_mm": 3.292, "max_strain": 0.004205130589249438, "peak": {"node": 1813, "coords_mm": [1.89, -10.82, 43.4], "vm_mpa": 588.3}, "volume_mm3": 17197.9, "bbox_mm": [86.7, 41.1, 43.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 132.2, "safety_factor": 1.89, "max_disp_mm": 0.2962, "max_strain": 0.0009453099600819551, "volume_mm3": 62605.2, "bbox_mm": [94.7, 41.1, 51.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.465, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1051, "family": "rib_bracket", "params": {"L": 56.0, "H": 46.5, "W": 47.4, "T": 4.3, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.0, 'H': 46.5, 'W': 47.4, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 56.0, 'H': 46.5, 'W': 47.4, 'T': 4.3, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 309.8, "safety_factor": 0.807, "max_disp_mm": 0.7119, "max_strain": 0.0022145756690354415, "peak": {"node": 1714, "coords_mm": [14.15, -43.54, 50.8], "vm_mpa": 309.8}, "volume_mm3": 21768.0, "bbox_mm": [60.3, 47.4, 50.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 86.2, "safety_factor": 2.902, "max_disp_mm": 0.1069, "max_strain": 0.0006158364504288053, "volume_mm3": 55071.2, "bbox_mm": [66.3, 47.4, 56.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.095, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1052, "family": "plate_holes", "params": {"L": 110.7, "H": null, "W": 62.1, "T": 4.8, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.7, 'H': None, 'W': 62.1, 'T': 4.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 110.7, 'H': None, 'W': 62.1, 'T': 4.8, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 307.8, "safety_factor": 0.812, "max_disp_mm": 2.2766, "max_strain": 0.00219998079381484, "peak": {"node": 1333, "coords_mm": [-53.21, -2.48, 0.0], "vm_mpa": 307.8}, "volume_mm3": 32514.9, "bbox_mm": [110.7, 62.1, 4.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 114.8, "safety_factor": 2.177, "max_disp_mm": 0.4976, "max_strain": 0.0008209259064751877, "volume_mm3": 59610.7, "bbox_mm": [110.7, 62.1, 8.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.365, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1053, "family": "l_bracket", "params": {"L": 69.5, "H": 59.4, "W": 58.2, "T": 4.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.5, 'H': 59.4, 'W': 58.2, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 69.5, 'H': 59.4, 'W': 58.2, 'T': 4.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 304.1, "safety_factor": 0.822, "max_disp_mm": 1.0812, "max_strain": 0.00217343747232376, "peak": {"node": 1035, "coords_mm": [6.65, -30.17, 59.4], "vm_mpa": 304.1}, "volume_mm3": 36544.9, "bbox_mm": [74.2, 58.2, 64.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 101.9, "safety_factor": 2.455, "max_disp_mm": 0.195, "max_strain": 0.0007280423503381472, "volume_mm3": 78245.2, "bbox_mm": [79.2, 58.2, 69.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.632, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1054, "family": "u_channel", "params": {"L": 95.5, "H": 41.2, "W": 42.2, "T": 3.8, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.5, 'H': 41.2, 'W': 42.2, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 95.5, 'H': 41.2, 'W': 42.2, 'T': 3.8, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1637.9, "safety_factor": 0.153, "max_disp_mm": 5.2986, "max_strain": 0.011707926465911683, "peak": {"node": 79, "coords_mm": [48.48, 3.8, 3.8], "vm_mpa": 1637.9}, "volume_mm3": 1309.7, "bbox_mm": [53.3, 41.2, 3.8], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 150.9, "safety_factor": 1.657, "max_disp_mm": 0.1467, "max_strain": 0.0010783921300745029, "volume_mm3": 8134.6, "bbox_mm": [53.3, 41.2, 9.8], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.504, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1055, "family": "rib_bracket", "params": {"L": 68.7, "H": 52.8, "W": 53.7, "T": 5.2, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.7, 'H': 52.8, 'W': 53.7, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 68.7, 'H': 52.8, 'W': 53.7, 'T': 5.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 366.2, "safety_factor": 0.683, "max_disp_mm": 1.124, "max_strain": 0.0026178922715650163, "peak": {"node": 1555, "coords_mm": [7.05, -18.29, 52.8], "vm_mpa": 366.2}, "volume_mm3": 35379.7, "bbox_mm": [73.9, 53.7, 58.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 110.9, "safety_factor": 2.255, "max_disp_mm": 0.1784, "max_strain": 0.0007924741254065386, "volume_mm3": 79811.1, "bbox_mm": [79.9, 53.7, 64.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.572, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1056, "family": "plate_holes", "params": {"L": 120.2, "H": null, "W": 71.6, "T": 6.1, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.2, 'H': None, 'W': 71.6, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 120.2, 'H': None, 'W': 71.6, 'T': 6.1, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 232.1, "safety_factor": 1.077, "max_disp_mm": 1.5665, "max_strain": 0.0016590779388696633, "peak": {"node": 1696, "coords_mm": [-57.97, 17.28, 0.0], "vm_mpa": 232.1}, "volume_mm3": 51540.4, "bbox_mm": [120.2, 71.6, 6.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.1, "safety_factor": 2.573, "max_disp_mm": 0.458, "max_strain": 0.0006944202970049828, "volume_mm3": 85337.3, "bbox_mm": [120.2, 71.6, 10.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.496, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1058, "family": "u_channel", "params": {"L": 108.2, "H": 47.6, "W": 48.5, "T": 4.4, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.2, 'H': 47.6, 'W': 48.5, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 108.2, 'H': 47.6, 'W': 48.5, 'T': 4.4, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 960.3, "safety_factor": 0.26, "max_disp_mm": 2.7807, "max_strain": 0.00686433464702528, "peak": {"node": 306, "coords_mm": [54.4, 2.12, 0.0], "vm_mpa": 960.3}, "volume_mm3": 1992.1, "bbox_mm": [59.7, 47.6, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 95.3, "safety_factor": 2.622, "max_disp_mm": 0.1098, "max_strain": 0.0006815223759225774, "volume_mm3": 10480.7, "bbox_mm": [59.7, 47.6, 10.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.362, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1057, "family": "l_bracket", "params": {"L": 83.8, "H": 69.0, "W": 66.1, "T": 5.7, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.8, 'H': 69.0, 'W': 66.1, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 83.8, 'H': 69.0, 'W': 66.1, 'T': 5.7, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 225.3, "safety_factor": 1.11, "max_disp_mm": 0.9867, "max_strain": 0.0016105562348364866, "peak": {"node": 1857, "coords_mm": [9.57, -21.2, 69.0], "vm_mpa": 225.3}, "volume_mm3": 59718.0, "bbox_mm": [89.5, 66.1, 74.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 97.7, "safety_factor": 2.559, "max_disp_mm": 0.2257, "max_strain": 0.0006982848045415136, "volume_mm3": 115638.6, "bbox_mm": [94.5, 66.1, 79.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.45, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1061, "family": "l_bracket", "params": {"L": 53.1, "H": 48.5, "W": 49.1, "T": 3.6, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 53.1, 'H': 48.5, 'W': 49.1, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 53.1, 'H': 48.5, 'W': 49.1, 'T': 3.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 227.7, "safety_factor": 1.098, "max_disp_mm": 0.5192, "max_strain": 0.0016272757742941439, "peak": {"node": 1633, "coords_mm": [2.14, -18.38, 52.1], "vm_mpa": 227.7}, "volume_mm3": 18595.2, "bbox_mm": [56.7, 49.1, 52.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 78.1, "safety_factor": 3.201, "max_disp_mm": 0.1095, "max_strain": 0.0005582226169419397, "volume_mm3": 46533.1, "bbox_mm": [61.7, 49.1, 57.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.103, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1059, "family": "rib_bracket", "params": {"L": 81.4, "H": 59.1, "W": 40.1, "T": 3.2, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.4, 'H': 59.1, 'W': 40.1, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 81.4, 'H': 59.1, 'W': 40.1, 'T': 3.2, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 684.1, "safety_factor": 0.365, "max_disp_mm": 3.5212, "max_strain": 0.004890030969479278, "peak": {"node": 2017, "coords_mm": [1.6, -21.82, 62.3], "vm_mpa": 684.1}, "volume_mm3": 18439.6, "bbox_mm": [84.6, 40.1, 62.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 150.4, "safety_factor": 1.662, "max_disp_mm": 0.2896, "max_strain": 0.0010750589792753698, "volume_mm3": 68131.5, "bbox_mm": [92.6, 40.1, 70.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.297, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1062, "family": "u_channel", "params": {"L": 80.9, "H": 33.9, "W": 34.8, "T": 3.1, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.9, 'H': 33.9, 'W': 34.8, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 80.9, 'H': 33.9, 'W': 34.8, 'T': 3.1, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 2220.7, "safety_factor": 0.113, "max_disp_mm": 6.1589, "max_strain": 0.015873601959478977, "peak": {"node": 242, "coords_mm": [43.64, 1.58, 0.0], "vm_mpa": 2220.7}, "volume_mm3": 739.0, "bbox_mm": [46.1, 33.9, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.7, "safety_factor": 2.106, "max_disp_mm": 0.1025, "max_strain": 0.0008484473273193639, "volume_mm3": 5871.2, "bbox_mm": [46.1, 33.9, 9.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.994, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1060, "family": "plate_holes", "params": {"L": 129.7, "H": null, "W": 51.1, "T": 3.3, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.7, 'H': None, 'W': 51.1, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 129.7, 'H': None, 'W': 51.1, 'T': 3.3, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 661.3, "safety_factor": 0.378, "max_disp_mm": 5.7138, "max_strain": 0.004727194597024333, "peak": {"node": 2876, "coords_mm": [-63.46, -2.41, 3.3], "vm_mpa": 661.3}, "volume_mm3": 21684.7, "bbox_mm": [129.7, 51.1, 3.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.2, "safety_factor": 2.114, "max_disp_mm": 0.6681, "max_strain": 0.000845226930974516, "volume_mm3": 61111.4, "bbox_mm": [129.7, 51.1, 9.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.736, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1063, "family": "rib_bracket", "params": {"L": 54.1, "H": 45.5, "W": 46.4, "T": 4.1, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.1, 'H': 45.5, 'W': 46.4, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 54.1, 'H': 45.5, 'W': 46.4, 'T': 4.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 262.8, "safety_factor": 0.951, "max_disp_mm": 0.5841, "max_strain": 0.0018787905670705326, "peak": {"node": 1197, "coords_mm": [2.11, -28.08, 49.6], "vm_mpa": 262.8}, "volume_mm3": 19727.9, "bbox_mm": [58.2, 46.4, 49.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 94.1, "safety_factor": 2.656, "max_disp_mm": 0.1042, "max_strain": 0.0006727638867784234, "volume_mm3": 51409.8, "bbox_mm": [64.2, 46.4, 55.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.705, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1064, "family": "plate_holes", "params": {"L": 109.2, "H": null, "W": 60.6, "T": 4.6, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.2, 'H': None, 'W': 60.6, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 109.2, 'H': None, 'W': 60.6, 'T': 4.6, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 344.7, "safety_factor": 0.725, "max_disp_mm": 2.5217, "max_strain": 0.0024641378129014488, "peak": {"node": 2863, "coords_mm": [-53.03, -12.13, 4.6], "vm_mpa": 344.7}, "volume_mm3": 29978.1, "bbox_mm": [109.2, 60.6, 4.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 117.9, "safety_factor": 2.12, "max_disp_mm": 0.5221, "max_strain": 0.0008428551267854936, "volume_mm3": 56046.1, "bbox_mm": [109.2, 60.6, 8.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.395, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1066, "family": "u_channel", "params": {"L": 93.6, "H": 40.2, "W": 41.2, "T": 3.7, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.6, 'H': 40.2, 'W': 41.2, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 93.6, 'H': 40.2, 'W': 41.2, 'T': 3.7, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1499.6, "safety_factor": 0.167, "max_disp_mm": 4.7636, "max_strain": 0.010719647109738828, "peak": {"node": 313, "coords_mm": [46.11, 2.12, 3.7], "vm_mpa": 1499.6}, "volume_mm3": 1217.0, "bbox_mm": [52.4, 40.2, 3.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 118.7, "safety_factor": 2.106, "max_disp_mm": 0.1194, "max_strain": 0.0008484014934411206, "volume_mm3": 7800.1, "bbox_mm": [52.4, 40.2, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.94, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1065, "family": "l_bracket", "params": {"L": 67.3, "H": 58.0, "W": 57.0, "T": 4.6, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.3, 'H': 58.0, 'W': 57.0, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 67.3, 'H': 58.0, 'W': 57.0, 'T': 4.6, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 313.7, "safety_factor": 0.797, "max_disp_mm": 1.0712, "max_strain": 0.0022422031079697854, "peak": {"node": 1342, "coords_mm": [14.72, -5.09, 58.0], "vm_mpa": 313.7}, "volume_mm3": 34059.8, "bbox_mm": [71.9, 57.0, 62.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.6, "safety_factor": 2.391, "max_disp_mm": 0.1861, "max_strain": 0.0007475570539739925, "volume_mm3": 73817.3, "bbox_mm": [76.9, 57.0, 67.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.594, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1067, "family": "rib_bracket", "params": {"L": 66.7, "H": 51.8, "W": 52.8, "T": 5.1, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.7, 'H': 51.8, 'W': 52.8, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 66.7, 'H': 51.8, 'W': 52.8, 'T': 5.1, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 336.5, "safety_factor": 0.743, "max_disp_mm": 1.0912, "max_strain": 0.0024050190775976392, "peak": {"node": 1266, "coords_mm": [8.59, -10.69, 51.8], "vm_mpa": 336.5}, "volume_mm3": 33283.0, "bbox_mm": [71.8, 52.8, 56.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 115.7, "safety_factor": 2.161, "max_disp_mm": 0.1713, "max_strain": 0.0008270248599030658, "volume_mm3": 75956.0, "bbox_mm": [77.8, 52.8, 62.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.418, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1068, "family": "plate_holes", "params": {"L": 118.7, "H": null, "W": 70.1, "T": 5.9, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.7, 'H': None, 'W': 70.1, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 118.7, 'H': None, 'W': 70.1, 'T': 5.9, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 274.7, "safety_factor": 0.91, "max_disp_mm": 1.7016, "max_strain": 0.001963918639305531, "peak": {"node": 3597, "coords_mm": [-57.79, 7.25, 5.9], "vm_mpa": 274.7}, "volume_mm3": 48166.4, "bbox_mm": [118.7, 70.1, 5.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 107.2, "safety_factor": 2.333, "max_disp_mm": 0.4765, "max_strain": 0.0007660938133983395, "volume_mm3": 80821.5, "bbox_mm": [118.7, 70.1, 9.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.423, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1069, "family": "l_bracket", "params": {"L": 81.6, "H": 67.5, "W": 64.9, "T": 5.5, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.6, 'H': 67.5, 'W': 64.9, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 81.6, 'H': 67.5, 'W': 64.9, 'T': 5.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 233.0, "safety_factor": 1.073, "max_disp_mm": 1.0296, "max_strain": 0.0016655004510266874, "peak": {"node": 1256, "coords_mm": [7.69, -13.81, 67.5], "vm_mpa": 233.0}, "volume_mm3": 55184.5, "bbox_mm": [87.1, 64.9, 73.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 100.0, "safety_factor": 2.501, "max_disp_mm": 0.223, "max_strain": 0.000714650032675172, "volume_mm3": 108759.4, "bbox_mm": [92.1, 64.9, 78.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.428, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1070, "family": "u_channel", "params": {"L": 106.2, "H": 46.6, "W": 47.5, "T": 4.3, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.2, 'H': 46.6, 'W': 47.5, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 106.2, 'H': 46.6, 'W': 47.5, 'T': 4.3, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1570.7, "safety_factor": 0.159, "max_disp_mm": 4.3028, "max_strain": 0.011227275451324195, "peak": {"node": 347, "coords_mm": [53.51, 2.07, 4.3], "vm_mpa": 1570.7}, "volume_mm3": 1867.5, "bbox_mm": [58.7, 46.6, 4.3], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 147.9, "safety_factor": 1.69, "max_disp_mm": 0.1633, "max_strain": 0.001057367158169002, "volume_mm3": 10078.6, "bbox_mm": [58.7, 46.6, 10.3], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.531, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1073, "family": "l_bracket", "params": {"L": 50.8, "H": 47.0, "W": 47.8, "T": 3.5, "fix_extra": 5.0, "force": 1200, "holes": null, "hole_d": null}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1200 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 50.8, 'H': 47.0, 'W': 47.8, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 50.8, 'H': 47.0, 'W': 47.8, 'T': 3.5, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 226.2, "safety_factor": 1.105, "max_disp_mm": 0.4589, "max_strain": 0.001616558688089824, "peak": {"node": 1644, "coords_mm": [2.04, -27.43, 50.5], "vm_mpa": 226.2}, "volume_mm3": 16947.5, "bbox_mm": [54.3, 47.8, 50.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 83.7, "safety_factor": 2.986, "max_disp_mm": 0.1035, "max_strain": 0.0005985143758892755, "volume_mm3": 43189.7, "bbox_mm": [59.3, 47.8, 55.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.88, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1071, "family": "rib_bracket", "params": {"L": 79.4, "H": 58.1, "W": 59.1, "T": 3.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.4, 'H': 58.1, 'W': 59.1, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 79.4, 'H': 58.1, 'W': 59.1, 'T': 3.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 434.8, "safety_factor": 0.575, "max_disp_mm": 2.4798, "max_strain": 0.003108165940692723, "peak": {"node": 1922, "coords_mm": [2.24, -30.57, 61.1], "vm_mpa": 434.8}, "volume_mm3": 24910.7, "bbox_mm": [82.4, 59.1, 61.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 122.8, "safety_factor": 2.035, "max_disp_mm": 0.3142, "max_strain": 0.0008781389585593335, "volume_mm3": 77923.3, "bbox_mm": [88.4, 59.1, 67.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.46, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1072, "family": "plate_holes", "params": {"L": 128.2, "H": null, "W": 79.6, "T": 3.1, "fix_extra": 4.0, "force": 800, "holes": 2.0, "hole_d": 6.0}, "load": {"force_n": 800, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 800 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.2, 'H': None, 'W': 79.6, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 128.2, 'H': None, 'W': 79.6, 'T': 3.1, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 6.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 496.1, "safety_factor": 0.504, "max_disp_mm": 3.4758, "max_strain": 0.003546167105873266, "peak": {"node": 2446, "coords_mm": [-62.83, -8.71, 0.0], "vm_mpa": 496.1}, "volume_mm3": 31459.3, "bbox_mm": [128.2, 79.6, 3.1], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 128.7, "safety_factor": 1.942, "max_disp_mm": 0.8251, "max_strain": 0.0009200875185594421, "volume_mm3": 72052.0, "bbox_mm": [128.2, 79.6, 7.1], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.438, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1074, "family": "u_channel", "params": {"L": 78.9, "H": 32.9, "W": 33.8, "T": 3.0, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.9, 'H': 32.9, 'W': 33.8, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 78.9, 'H': 32.9, 'W': 33.8, 'T': 3.0, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1718.9, "safety_factor": 0.145, "max_disp_mm": 5.2661, "max_strain": 0.012286866567303963, "peak": {"node": 223, "coords_mm": [37.78, 1.56, 0.0], "vm_mpa": 1718.9}, "volume_mm3": 675.0, "bbox_mm": [45.1, 32.9, 3.0], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.1, "safety_factor": 2.449, "max_disp_mm": 0.0794, "max_strain": 0.0007296931521598827, "volume_mm3": 5589.0, "bbox_mm": [45.1, 32.9, 9.0], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.304, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1075, "family": "rib_bracket", "params": {"L": 52.1, "H": 44.5, "W": 45.4, "T": 4.0, "fix_extra": 6.0, "force": 1500, "holes": null, "hole_d": null}, "load": {"force_n": 1500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 1500 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.1, 'H': 44.5, 'W': 45.4, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 52.1, 'H': 44.5, 'W': 45.4, 'T': 4.0, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 259.1, "safety_factor": 0.965, "max_disp_mm": 0.4473, "max_strain": 0.0018519860103279287, "peak": {"node": 1136, "coords_mm": [2.24, -22.85, 48.5], "vm_mpa": 259.1}, "volume_mm3": 18269.0, "bbox_mm": [56.1, 45.4, 48.5], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 92.1, "safety_factor": 2.713, "max_disp_mm": 0.0994, "max_strain": 0.000658626014430294, "volume_mm3": 48396.4, "bbox_mm": [62.1, 45.4, 54.5], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.748, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1078, "family": "u_channel", "params": {"L": 91.6, "H": 39.2, "W": 40.2, "T": 3.6, "fix_extra": 4.0, "force": 500, "holes": null, "hole_d": null}, "load": {"force_n": 500, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 500 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.6, 'H': 39.2, 'W': 40.2, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 91.6, 'H': 39.2, 'W': 40.2, 'T': 3.6, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1890.4, "safety_factor": 0.132, "max_disp_mm": 4.9873, "max_strain": 0.013512780816903826, "peak": {"node": 308, "coords_mm": [49.38, 1.84, 3.6], "vm_mpa": 1890.4}, "volume_mm3": 1127.5, "bbox_mm": [51.4, 39.2, 3.6], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.6, "safety_factor": 1.974, "max_disp_mm": 0.1169, "max_strain": 0.000905283054805652, "volume_mm3": 7465.0, "bbox_mm": [51.4, 39.2, 9.6], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.842, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1076, "family": "plate_holes", "params": {"L": 107.7, "H": null, "W": 59.1, "T": 4.4, "fix_extra": 4.0, "force": 1000, "holes": 2.0, "hole_d": 8.0}, "load": {"force_n": 1000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1000 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.7, 'H': None, 'W': 59.1, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 107.7, 'H': None, 'W': 59.1, 'T': 4.4, 'fix_extra': 4.0, 'holes': 2.0, 'hole_d': 8.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 392.3, "safety_factor": 0.637, "max_disp_mm": 2.7433, "max_strain": 0.002803883973367154, "peak": {"node": 1680, "coords_mm": [-51.72, -6.16, 4.4], "vm_mpa": 392.3}, "volume_mm3": 27564.0, "bbox_mm": [107.7, 59.1, 4.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 126.8, "safety_factor": 1.971, "max_disp_mm": 0.547, "max_strain": 0.0009066567707318759, "volume_mm3": 52622.1, "bbox_mm": [107.7, 59.1, 8.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.334, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1077, "family": "l_bracket", "params": {"L": 65.1, "H": 56.5, "W": 55.7, "T": 4.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.1, 'H': 56.5, 'W': 55.7, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 65.1, 'H': 56.5, 'W': 55.7, 'T': 4.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 316.2, "safety_factor": 0.791, "max_disp_mm": 1.0651, "max_strain": 0.0022605506601813758, "peak": {"node": 1819, "coords_mm": [7.32, -29.91, 60.9], "vm_mpa": 316.2}, "volume_mm3": 30880.1, "bbox_mm": [69.5, 55.7, 60.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 104.0, "safety_factor": 2.403, "max_disp_mm": 0.1833, "max_strain": 0.0007435294924498898, "volume_mm3": 68589.0, "bbox_mm": [74.5, 55.7, 65.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.613, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1079, "family": "rib_bracket", "params": {"L": 64.7, "H": 50.8, "W": 51.8, "T": 4.9, "fix_extra": 6.0, "force": 2000, "holes": null, "hole_d": null}, "load": {"force_n": 2000, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a rib bracket that survives 2000 N (cantilever load). The thicken the load-bearing wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (good)\ndef rib_bracket_good(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.7, 'H': 50.8, 'W': 51.8, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - rib_bracket (bad)\ndef rib_bracket_bad(p):\n return _export(rib_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef rib_bracket(L, H, W, T):\n \"\"\"Wall + shelf (the batch-3 angle bracket). Weak = thin wall; strong = thick.\"\"\"\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n return wp.close().extrude(W)\n\nparams = {'L': 64.7, 'H': 50.8, 'W': 51.8, 'T': 4.9, 'fix_extra': 6.0, 'holes': None, 'hole_d': None}\nresult = rib_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin load-bearing wall - bends and yields at the fixed end", "failure_class": "thin-wall-yield", "fix": "thicken the load-bearing wall", "bad": {"vm_mpa": 362.7, "safety_factor": 0.689, "max_disp_mm": 1.1192, "max_strain": 0.002592732043545707, "peak": {"node": 1387, "coords_mm": [8.87, -19.73, 50.8], "vm_mpa": 362.7}, "volume_mm3": 30559.9, "bbox_mm": [69.6, 51.8, 55.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 120.5, "safety_factor": 2.074, "max_disp_mm": 0.1677, "max_strain": 0.0008616535247138395, "volume_mm3": 71368.0, "bbox_mm": [75.6, 51.8, 61.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.385, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1080, "family": "plate_holes", "params": {"L": 117.2, "H": null, "W": 68.6, "T": 5.7, "fix_extra": 4.0, "force": 1200, "holes": 4.0, "hole_d": 10.0}, "load": {"force_n": 1200, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a plate holes that survives 1200 N (cantilever load). The thicken the plate version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - plate_holes (good)\ndef plate_holes_good(p):\n return _make_plate(p, p[\"T\"] + p[\"_fix\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.2, 'H': None, 'W': 68.6, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - plate_holes (bad)\ndef plate_holes_bad(p):\n return _make_plate(p, p[\"T\"])\ndef _make_plate(p, T):\n return _export(plate_holes(p[\"L\"], p[\"W\"], T, p[\"holes\"], p.get(\"hole_d\", 8.0)), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef plate_holes(L, W, T, holes, hole_d=8.0, hole_x=15.0, hole_y=20.0):\n \"\"\"Flat plate, holes near one short end. Weak = thin; strong = thick. Cantilever load.\"\"\"\n res = (cq.Workplane(\"XY\").rect(L, W).extrude(T)\n .faces(\">Z\").workplane()\n .pushPoints([(hole_x, hole_y), (hole_x, -hole_y)] * (holes // 2))\n .hole(hole_d))\n return res\n\nparams = {'L': 117.2, 'H': None, 'W': 68.6, 'T': 5.7, 'fix_extra': 4.0, 'holes': 4.0, 'hole_d': 10.0}\nresult = plate_holes_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "stress concentrates at the bolt holes near the fixed end; too thin to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the plate", "bad": {"vm_mpa": 269.0, "safety_factor": 0.929, "max_disp_mm": 1.8456, "max_strain": 0.0019226051475983341, "peak": {"node": 637, "coords_mm": [-56.66, 13.76, 0.0], "vm_mpa": 269.0}, "volume_mm3": 44932.2, "bbox_mm": [117.2, 68.6, 5.7], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 112.3, "safety_factor": 2.227, "max_disp_mm": 0.496, "max_strain": 0.0008025516671158976, "volume_mm3": 76463.6, "bbox_mm": [117.2, 68.6, 9.7], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.297, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1082, "family": "u_channel", "params": {"L": 104.2, "H": 45.6, "W": 46.5, "T": 4.2, "fix_extra": 4.0, "force": 600, "holes": null, "hole_d": null}, "load": {"force_n": 600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 600 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.2, 'H': 45.6, 'W': 46.5, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 104.2, 'H': 45.6, 'W': 46.5, 'T': 4.2, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1608.7, "safety_factor": 0.155, "max_disp_mm": 4.5598, "max_strain": 0.011499258964744394, "peak": {"node": 350, "coords_mm": [52.35, 2.04, 4.2], "vm_mpa": 1608.7}, "volume_mm3": 1748.1, "bbox_mm": [57.7, 45.6, 4.2], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 148.4, "safety_factor": 1.685, "max_disp_mm": 0.1613, "max_strain": 0.001060790358381039, "volume_mm3": 9686.1, "bbox_mm": [57.7, 45.6, 10.2], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.529, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1081, "family": "l_bracket", "params": {"L": 79.3, "H": 66.0, "W": 63.7, "T": 5.4, "fix_extra": 5.0, "force": 1600, "holes": null, "hole_d": null}, "load": {"force_n": 1600, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a l bracket that survives 1600 N (cantilever load). The thicken the bracket version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - l_bracket (good)\ndef l_bracket_good(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.3, 'H': 66.0, 'W': 63.7, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - l_bracket (bad)\ndef l_bracket_bad(p):\n return _export(l_bracket(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"], 0.0), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef l_bracket(L, H, W, T, fillet=0.0):\n pts = [(0, 0), (T, 0), (T, H), (T + L, H), (T + L, H + T), (0, H + T)]\n wp = cq.Workplane(\"XZ\")\n for i in range(len(pts) - 1):\n x1, z1 = pts[i]; x2, z2 = pts[i + 1]\n wp = wp.moveTo(x1, z1).lineTo(x2, z2)\n wp = wp.close().extrude(W)\n if fillet > 0:\n wp = wp.edges(\"|Y\").edges(cq.selectors.NearestToPointSelector((T, H, W / 2))).fillet(fillet)\n return wp\n\nparams = {'L': 79.3, 'H': 66.0, 'W': 63.7, 'T': 5.4, 'fix_extra': 5.0, 'holes': None, 'hole_d': None}\nresult = l_bracket_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin L arms - the load path folds at the joint; not enough material to carry the bending", "failure_class": "thin-wall-yield", "fix": "thicken the bracket", "bad": {"vm_mpa": 249.4, "safety_factor": 1.003, "max_disp_mm": 1.0112, "max_strain": 0.0017824128825772553, "peak": {"node": 2143, "coords_mm": [8.82, -34.4, 66.0], "vm_mpa": 249.4}, "volume_mm3": 51837.8, "bbox_mm": [84.7, 63.7, 71.4], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 99.9, "safety_factor": 2.504, "max_disp_mm": 0.2157, "max_strain": 0.0007137773309649328, "volume_mm3": 103148.1, "bbox_mm": [89.7, 63.7, 76.4], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 1.501, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"} {"id": 1086, "family": "u_channel", "params": {"L": 76.9, "H": 31.9, "W": 32.8, "T": 2.9, "fix_extra": 4.0, "force": 400, "holes": null, "hole_d": null}, "load": {"force_n": 400, "mode": "cantilever", "mesh_mm": 2.5, "yield_mpa": 250.0, "material": "steel-250"}, "prompt": "Design a u channel that survives 400 N (cantilever load). The thicken the channel wall version passes.", "code_good": "import cadquery as cq\n\n# Forge dataset record - u_channel (good)\ndef u_channel_good(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"] + p[\"_fix\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.9, 'H': 31.9, 'W': 32.8, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_good(params)\ncq.exporters.export(result, 'part.STEP')\n", "code_bad": "import cadquery as cq\n\n# Forge dataset record - u_channel (bad)\ndef u_channel_bad(p):\n return _export(u_channel(p[\"L\"], p[\"H\"], p[\"W\"], p[\"T\"]), p[\"_step\"])\ndef _export(shape, path):\n cq.exporters.export(shape, path)\n bb = shape.val().BoundingBox()\n return {\"bbox_mm\": [round(bb.xlen, 3), round(bb.ylen, 3), round(bb.zlen, 3)],\n \"volume_mm3\": round(shape.val().Volume(), 1)}\ndef u_channel(L, H, W, T):\n \"\"\"U profile: web (bottom) + two legs. Weak = thin; strong = thick.\"\"\"\n pts = [(0, 0), (W, 0), (W, H), (W + T, H), (W + T, T), (L, T), (L, 0)] # simplified U in XY\n wp = cq.Workplane(\"XY\")\n for i in range(len(pts) - 1):\n x1, y1 = pts[i]; x2, y2 = pts[i + 1]\n wp = wp.moveTo(x1, y1).lineTo(x2, y2)\n wp = wp.close().extrude(T)\n return wp\n\nparams = {'L': 76.9, 'H': 31.9, 'W': 32.8, 'T': 2.9, 'fix_extra': 4.0, 'holes': None, 'hole_d': None}\nresult = u_channel_bad(params)\ncq.exporters.export(result, 'part.STEP')\n", "where_it_fails": "thin channel wall in the bending zone", "failure_class": "thin-wall-yield", "fix": "thicken the channel wall", "bad": {"vm_mpa": 1944.8, "safety_factor": 0.129, "max_disp_mm": 5.1407, "max_strain": 0.013901697074399911, "peak": {"node": 232, "coords_mm": [36.74, 1.49, 0.0], "vm_mpa": 1944.8}, "volume_mm3": 614.8, "bbox_mm": [44.1, 31.9, 2.9], "step": "bad.STEP", "heatmap": "heatmap_bad.png"}, "good": {"vm_mpa": 102.6, "safety_factor": 2.435, "max_disp_mm": 0.0786, "max_strain": 0.0007337585383164501, "volume_mm3": 5315.0, "bbox_mm": [44.1, 31.9, 8.9], "step": "good.STEP", "heatmap": "heatmap_good.png"}, "pass_margin": 2.307, "system_prompt": "You are an expert CAD engineer writing CadQuery (Python). Produce a single watertight solid matching the spec and export it to 'part.STEP'. Output ONLY the python code in one fenced code block, no explanations.", "fea_engine": "CalculiX ccx 2.22", "solver_status": "converged"}