{
 "brief": "A motor mount bracket made from 6 mm plate. The base is 90 x 60 mm, lying on Z = 0 and centred on the origin. An upright plate, 60 mm wide and 70 mm tall, stands on the base's -X edge. The upright has a 22 mm hole for the motor shaft at Z = 40, and four 4.5 mm holes for M4 screws on a 31 mm square around it. The base has two 6.6 mm holes for M6 bolts at X = 25, Y = +/-18. Two triangular gussets, 6 mm thick and centred at Y = +/-24, brace the upright; each runs 40 mm along the base and 40 mm up the upright. Round the base's two +X corners to R8.",
 "spec": {
  "name": "motor-mount",
  "bbox": {
   "size": [
    90,
    60,
    70
   ],
   "min": [
    -45,
    -30,
    0
   ]
  },
  "holes": [
   {
    "diameter": 22,
    "axis": "x",
    "through": true,
    "center": [
     0,
     40
    ]
   },
   {
    "diameter": 4.5,
    "axis": "x",
    "through": true,
    "center": [
     15.5,
     55.5
    ]
   },
   {
    "diameter": 4.5,
    "axis": "x",
    "through": true,
    "center": [
     -15.5,
     55.5
    ]
   },
   {
    "diameter": 4.5,
    "axis": "x",
    "through": true,
    "center": [
     15.5,
     24.5
    ]
   },
   {
    "diameter": 4.5,
    "axis": "x",
    "through": true,
    "center": [
     -15.5,
     24.5
    ]
   },
   {
    "diameter": 6.6,
    "axis": "z",
    "through": true,
    "center": [
     25,
     18
    ]
   },
   {
    "diameter": 6.6,
    "axis": "z",
    "through": true,
    "center": [
     25,
     -18
    ]
   }
  ],
  "holes_exact": true,
  "probes": [
   {
    "point": [
     -42,
     0,
     40
    ],
    "expect": "empty",
    "note": "motor shaft hole"
   },
   {
    "point": [
     -10,
     24,
     12
    ],
    "expect": "solid",
    "note": "gusset at +Y"
   },
   {
    "point": [
     -10,
     -24,
     12
    ],
    "expect": "solid",
    "note": "gusset at -Y"
   },
   {
    "point": [
     -10,
     0,
     12
    ],
    "expect": "empty",
    "note": "open between gussets"
   },
   {
    "point": [
     43,
     28,
     3
    ],
    "expect": "empty",
    "note": "rounded corner"
   },
   {
    "point": [
     0,
     0,
     3
    ],
    "expect": "solid",
    "note": "base"
   }
  ]
 },
 "attempts": [
  {
   "code": "from build123d import *\n\nMIN_Z = (Align.CENTER, Align.CENTER, Align.MIN)\npart = Box(90, 60, 6, align=MIN_Z)\ncorners = part.edges().filter_by(Axis.Z).filter_by(lambda e: e.center().X > 40)\npart = fillet(corners, 8)\npart += Pos(-42, 0, 0) * Box(6, 60, 70, align=MIN_Z)\nfor y in (-24, 24):\n    tri = Plane.XZ * Polygon((-39, 6), (1, 6), (-39, 46), align=None)\n    part += Pos(0, y, 0) * extrude(tri, 3, both=True)\npart -= Pos(-42, 0, 40) * Rot(0, 90, 0) * Cylinder(22, 20)\nfor y in (-15.5, 15.5):\n    for z in (24.5, 55.5):\n        part -= Pos(-42, y, z) * Rot(90, 0, 0) * Cylinder(2.25, 20)\nfor y in (-18, 18):\n    part -= Pos(25, y, 0) * Cylinder(3.3, 20, align=MIN_Z)\nresult = part\n",
   "report": "FAIL motor-mount: 12/18 checks passed\n  x hole d=22 axis=x at (0, 40) through: expected 1 matching, got 0 matching\n  x hole d=4.5 axis=x at (15.5, 55.5) through: expected 1 matching, got 0 matching; nearest: d=4.5 axis=y at (-42, 24.5) blind; d=4.5 axis=y at (-42, 55.5) blind\n  x hole d=4.5 axis=x at (-15.5, 55.5) through: expected 1 matching, got 0 matching; nearest: d=4.5 axis=y at (-42, 24.5) blind; d=4.5 axis=y at (-42, 55.5) blind\n  x hole d=4.5 axis=x at (15.5, 24.5) through: expected 1 matching, got 0 matching; nearest: d=4.5 axis=y at (-42, 24.5) blind; d=4.5 axis=y at (-42, 55.5) blind\n  x hole d=4.5 axis=x at (-15.5, 24.5) through: expected 1 matching, got 0 matching; nearest: d=4.5 axis=y at (-42, 24.5) blind; d=4.5 axis=y at (-42, 55.5) blind\n  x no unexpected holes: expected none, got d=44 axis=x at (0, 40); d=4.5 axis=y at (-42, 24.5); d=4.5 axis=y at (-42, 55.5)\n  hint: found d=44 where d=22 was expected: Cylinder() takes the RADIUS.\n  hint: d=4.5 hole runs along y instead of x: along X use Rot(0, 90, 0) * Cylinder(...), along Y use Rot(90, 0, 0) * Cylinder(...).\n  hint: d=4.5 hole runs along y instead of x: along X use Rot(0, 90, 0) * Cylinder(...), along Y use Rot(90, 0, 0) * Cylinder(...).\n  hint: d=4.5 hole runs along y instead of x: along X use Rot(0, 90, 0) * Cylinder(...), along Y use Rot(90, 0, 0) * Cylinder(...).\n  hint: d=4.5 hole runs along y instead of x: along X use Rot(0, 90, 0) * Cylinder(...), along Y use Rot(90, 0, 0) * Cylinder(...).\n  ok: valid solid; solid count; bbox size; bbox position (min corner); hole d=6.6 axis=z at (25, 18) through; hole d=6.6 axis=z at (25, -18) through; probe (-42, 0, 40) motor shaft hole; probe (-10, 24, 12) gusset at +Y; probe (-10, -24, 12) gusset at -Y; probe (-10, 0, 12) open between gussets; probe (43, 28, 3) rounded corner; probe (0, 0, 3) base",
   "measure": "valid=True solids=1 faces=30\nbbox size=[90.0, 60.0, 70.0] min=[-45.0, -30.0, 0.0] max=[45.0, 30.0, 70.0]\nvolume=54615.58 mm3  area=22323.26 mm2\nholes (5):\n  d=44.0 axis=x center=[0.0, 40.0] through span=[-45.0, -32.0]\n  d=4.5 axis=y center=[-42.0, 24.5] blind depth=51.0 span=[-25.5, 25.5]\n  d=4.5 axis=y center=[-42.0, 55.5] blind depth=51.0 span=[-25.5, 25.5]\n  d=6.6 axis=z center=[25.0, -18.0] through span=[0.0, 6.0]\n  d=6.6 axis=z center=[25.0, 18.0] through span=[0.0, 6.0]"
  },
  {
   "code": "from build123d import *\n\nMIN_Z = (Align.CENTER, Align.CENTER, Align.MIN)\npart = Box(90, 60, 6, align=MIN_Z)\ncorners = part.edges().filter_by(Axis.Z).filter_by(lambda e: e.center().X > 40)\npart = fillet(corners, 8)\npart += Pos(-42, 0, 0) * Box(6, 60, 70, align=MIN_Z)\nfor y in (-24, 24):\n    tri = Plane.XZ * Polygon((-39, 6), (1, 6), (-39, 46), align=None)\n    part += Pos(0, y, 0) * extrude(tri, 3, both=True)\npart -= Pos(-42, 0, 40) * Rot(0, 90, 0) * Cylinder(11, 20)\nfor y in (-15.5, 15.5):\n    for z in (24.5, 55.5):\n        part -= Pos(-42, y, z) * Rot(0, 90, 0) * Cylinder(2.25, 20)\nfor y in (-18, 18):\n    part -= Pos(25, y, 0) * Cylinder(3.3, 20, align=MIN_Z)\nresult = part\n",
   "report": "PASS motor-mount: 18/18 checks passed\n  ok: valid solid; solid count; bbox size; bbox position (min corner); hole d=22 axis=x at (0, 40) through; hole d=4.5 axis=x at (15.5, 55.5) through; hole d=4.5 axis=x at (-15.5, 55.5) through; hole d=4.5 axis=x at (15.5, 24.5) through; hole d=4.5 axis=x at (-15.5, 24.5) through; hole d=6.6 axis=z at (25, 18) through; hole d=6.6 axis=z at (25, -18) through; no unexpected holes; probe (-42, 0, 40) motor shaft hole; probe (-10, 24, 12) gusset at +Y; probe (-10, -24, 12) gusset at -Y; probe (-10, 0, 12) open between gussets; probe (43, 28, 3) rounded corner; probe (0, 0, 3) base",
   "measure": "valid=True solids=1 faces=23\nbbox size=[90.0, 60.0, 70.0] min=[-45.0, -30.0, 0.0] max=[45.0, 30.0, 70.0]\nvolume=61802.14 mm3  area=23849.13 mm2\nholes (7):\n  d=22.0 axis=x center=[0.0, 40.0] through span=[-45.0, -39.0]\n  d=4.5 axis=x center=[-15.5, 24.5] through span=[-45.0, -39.0]\n  d=4.5 axis=x center=[-15.5, 55.5] through span=[-45.0, -39.0]\n  d=4.5 axis=x center=[15.5, 24.5] through span=[-45.0, -39.0]\n  d=4.5 axis=x center=[15.5, 55.5] through span=[-45.0, -39.0]\n  d=6.6 axis=z center=[25.0, -18.0] through span=[0.0, 6.0]\n  d=6.6 axis=z center=[25.0, 18.0] through span=[0.0, 6.0]"
  }
 ]
}