main
Drew Owens 0.11.0 source 1b7115e 5d ago
{
 "id": "cswa-05-tool-block-step1",
 "title": "Official Tool Block, Step 1 (Q3): A 81, B 57, C 43",
 "source": "https://www.solidworks.com/sites/default/files/2017-12/CSWASampleExam.pdf (Dassault CSWA Sample Exam, 2017 edition; archive http://web.archive.org/web/20251230104817/https://www.solidworks.com/sites/default/files/2017-12/CSWASampleExam.pdf)",
 "official": true,
 "units": "MMGS",
 "origin": "the \u00d814 hole's centre; x right, y up, the profile on Front Plane extruded +Z (the exam says 'Part origin: Arbitrary' - mass only)",
 "material": {
  "name": "AISI 1020",
  "densityKgM3": 7900
 },
 "recipe": "tools/cswa/SOURCES.md, Part 1: the R19 arc is tangent to the 10\u00b0 line that starts on the hole's centreline at (0, 18) and ends at the right lobe's corner P = (A-43, B-33); the flank runs (A-14, B-57) to (A-43, -33); R29 is centred where the flank (extended) meets y = -14; R5 is tangent to R29 and to y = -14; 45\u00b0 chamfers 7 x 7 (left corners) and 5 x 5 (right lobe).",
 "variables": {
  "A": 81,
  "B": 57,
  "C": 43
 },
 "derived": [
  [
   "xR",
   "A-14"
  ],
  [
   "xRL",
   "A-43"
  ],
  [
   "yRT",
   "B-33"
  ],
  [
   "yRE",
   "B-57"
  ],
  [
   "yB",
   "-14"
  ],
  [
   "yV",
   "-33"
  ],
  [
   "th",
   "rad(10)"
  ],
  [
   "dx",
   "cos(th)"
  ],
  [
   "dy",
   "-sin(th)"
  ],
  [
   "nx",
   "sin(th)"
  ],
  [
   "ny",
   "cos(th)"
  ],
  [
   "ox",
   "19*nx - xRL"
  ],
  [
   "oy",
   "18 + 19*ny - yRT"
  ],
  [
   "bq",
   "2*(ox*dx + oy*dy)"
  ],
  [
   "cq",
   "ox^2 + oy^2 - 361"
  ],
  [
   "t",
   "(-bq - sqrt(bq^2 - 4*cq))/2"
  ],
  [
   "Tx",
   "t*dx"
  ],
  [
   "Ty",
   "18 + t*dy"
  ],
  [
   "fs",
   "(yB - yV)/(yRE - yV)"
  ],
  [
   "c29x",
   "xRL + fs*(xR - xRL)"
  ],
  [
   "c29y",
   "yB"
  ],
  [
   "xv",
   "c29x - sqrt(29^2 - (c29y - yV)^2)"
  ],
  [
   "c5y",
   "yB - 5"
  ],
  [
   "c5x",
   "c29x - sqrt(34^2 - 25)"
  ],
  [
   "tpx",
   "c5x + 5*(c29x - c5x)/34"
  ],
  [
   "tpy",
   "c5y + 5*(c29y - c5y)/34"
  ],
  [
   "a29",
   "(atan2(yV - c29y, xv - c29x) + atan2(tpy - c29y, tpx - c29x))/2"
  ],
  [
   "m29x",
   "c29x + 29*cos(a29)"
  ],
  [
   "m29y",
   "c29y + 29*sin(a29)"
  ],
  [
   "a5",
   "(atan2(tpy - c5y, tpx - c5x) + pi/2)/2"
  ],
  [
   "m5x",
   "c5x + 5*cos(a5)"
  ],
  [
   "m5y",
   "c5y + 5*sin(a5)"
  ]
 ],
 "expected": {
  "massG": 939.54,
  "tolerancePct": 1.0
 },
 "keyBasis": "the official key, option d (939.54 g); the recipe's profile area is 2765.79 mm\u00b2 (the reviewer's rebuild: 0.00 %)",
 "needsOps": [],
 "script": [
  {
   "op": "new_part"
  },
  {
   "op": "sketch",
   "plane": "Front Plane",
   "entities": [
    {
     "line": {
      "from": [
       0,
       18
      ],
      "to": [
       "=Tx",
       "=Ty"
      ]
     }
    },
    {
     "tangentArc": {
      "to": [
       "=xRL",
       "=yRT"
      ],
      "radiusMm": 19
     }
    },
    {
     "polyline": {
      "points": [
       [
        "=xRL",
        "=yRT"
       ],
       [
        "=xR",
        "=yRT"
       ],
       [
        "=xR",
        "=yRE"
       ],
       [
        "=xRL",
        "=yV"
       ],
       [
        "=xv",
        "=yV"
       ]
      ]
     }
    },
    {
     "arc3": {
      "start": [
       "=xv",
       "=yV"
      ],
      "mid": [
       "=m29x",
       "=m29y"
      ],
      "end": [
       "=tpx",
       "=tpy"
      ]
     }
    },
    {
     "arc3": {
      "start": [
       "=tpx",
       "=tpy"
      ],
      "mid": [
       "=m5x",
       "=m5y"
      ],
      "end": [
       "=c5x",
       -14
      ]
     }
    },
    {
     "polyline": {
      "points": [
       [
        "=c5x",
        -14
       ],
       [
        -14,
        -14
       ],
       [
        -14,
        18
       ],
       [
        0,
        18
       ]
      ]
     }
    },
    {
     "sketchChamfer": {
      "at": [
       -14,
       18
      ],
      "distanceMm": 7
     }
    },
    {
     "sketchChamfer": {
      "at": [
       -14,
       -14
      ],
      "distanceMm": 7
     }
    },
    {
     "sketchChamfer": {
      "at": [
       "=xR",
       "=yRT"
      ],
      "distanceMm": 5
     }
    },
    {
     "circle": {
      "centerMm": [
       0,
       0
      ],
      "diameterMm": 14
     }
    }
   ]
  },
  {
   "op": "extrude",
   "depthMm": "=C"
  },
  {
   "op": "set_material",
   "name": "AISI 1020",
   "densityKgM3": 7900
  }
 ]
}