const routerDiameter = 12.7
const mmInInch = 25.4
const templateDiameter = mmInInch * 11 / 16
const templateGap = ((templateDiameter - routerDiameter) / 2) -0.5
const slateWidthHalf = 41.5 / 2
const minClampingDistance = 50 + 30
const templateThickness = 10
const radius = 10
const depth = 30
const length001 = slateWidthHalf - radius
const length002 = depth + minClampingDistance
const sketch001 = startSketchOn('XZ')
  |> startProfileAt([0, depth - templateGap], %)
  |> xLine(length001, %, $seg01)
  |> arc({
       angleEnd: 0,
       angleStart: 90,
       radius: radius - templateGap
     }, %)
  |> yLineTo(-templateGap * 2 - (templateDiameter / 2), %, $seg05)
  |> xLineTo(slateWidthHalf + templateThickness, %, $seg04)
  |> yLine(-length002, %, $seg03)
  |> xLineTo(0, %, $seg02)
  |> xLine(-segLen(seg02, %), %)
  |> yLine(segLen(seg03, %), %)
  |> xLine(segLen(seg04, %), %)
  |> yLine(segLen(seg05, %), %)
  |> arc({
       angleEnd: 90,
       angleStart: 180,
       radius: radius - templateGap
     }, %)
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()
const extrude001 = extrude(sketch001, length = 5)
const sketch002 = startSketchOn(extrude001, 'START')
  |> startProfileAt([
       -slateWidthHalf,
       -templateGap * 2 - (templateDiameter / 2)
     ], %)
  |> xLine(-7, %, $rectangleSegmentA001)
  |> angledLine([
       segAng(rectangleSegmentA001, %) + 90,
       minClampingDistance
     ], %, $rectangleSegmentB001)
  |> angledLine([
       segAng(rectangleSegmentA001, %),
       -segLen(rectangleSegmentA001, %)
     ], %, $rectangleSegmentC001)
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()
const extrude002 = extrude(sketch002, length = 7.5)
const sketch003 = startSketchOn(extrude001, 'START')
  |> startProfileAt([
       slateWidthHalf,
       -templateGap * 2 - (templateDiameter / 2)
     ], %)
  |> xLine(7, %, $rectangleSegmentA002)
  |> angledLine([
       segAng(rectangleSegmentA002, %) - 90,
       minClampingDistance
     ], %)
  |> angledLine([
       segAng(rectangleSegmentA002, %),
       -segLen(rectangleSegmentA002, %)
     ], %)
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close()
const extrude003 = extrude(sketch003, length = 7.5)
