kcl-samples → poopy-shoe

poopy-shoe

poopy-shoe

KCL

// Poopy Shoe
// poop shute for bambu labs printer - optimized for printing.

const wallThickness = 0.125 // inches
const wallsWidth = 3 // inches
const height = 5.125 // inches
const filletRadius = 0.050 // inches
const backLength = 6 // inches
const exitHeight = 1 // inches
const frontLength = 7 // inches

const sketch001 = startSketchOn("-YZ")
  |> startProfileAt([wallsWidth / 2, 0], %)
  |> xLine(wallThickness / 2, %)
  |> angledLineToX({ angle: 60, to: wallsWidth }, %, $seg01)
  |> yLineTo(height, %)
  |> xLine(-wallThickness, %)
  |> yLineTo(segEndY(seg01), %)
  |> angledLineToX({
       angle: 60,
       to: wallsWidth / 2 + wallThickness / 2
     }, %)
  |> xLine(-wallThickness, %)
  |> angledLineToX({ angle: 180 - 60, to: wallThickness }, %)
  |> yLineTo(height, %)
  |> xLineTo(0, %)
  |> yLineTo(segEndY(seg01), %)
  |> angledLineToY({ angle: 180 - 60, to: 0 }, %)
  |> close(%)
const part001 = revolve({
  angle: 90,
  axis: {
    custom: {
      axis: [1.0, 0.0, 0.0],
      origin: [0.0, height + .0001, 0]
    }
  }
}, sketch001)

const sketch002 = startSketchOn('-YZ')
  |> startProfileAt([wallsWidth / 2, 0], %)
  |> xLine(wallThickness / 2, %)
  |> angledLineToX({ angle: 60, to: wallsWidth }, %, $seg02)
  |> yLineTo(height, %)
  |> xLine(-wallThickness, %)
  |> yLineTo(segEndY(seg01), %)
  |> angledLineToX({
       angle: 60,
       to: wallsWidth / 2 + wallThickness / 2
     }, %)
  |> xLine(-wallThickness, %)
  |> angledLineToX({ angle: 180 - 60, to: wallThickness }, %)
  |> yLineTo(height, %)
  |> xLineTo(0, %)
  |> yLineTo(segEndY(seg02), %)
  |> angledLineToY({ angle: 180 - 60, to: 0 }, %)
  |> close(%)
  |> extrude(backLength - height, %)

const customPlane = {
  plane: {
    origin: {
      x: 0,
      y: -(wallsWidth / 2 - (wallThickness / 2)),
      z: 0
    },
    xAxis: { x: 1, y: 0, z: 0 },
    yAxis: { x: 0, y: 0, z: 1 },
    zAxis: { x: 0, y: -1, z: 0 }
  }
}
const sketch003 = startSketchOn(customPlane)
  |> startProfileAt([0, 0], %)
  |> tangentialArc({ offset: 60, radius: height }, %)
  |> angledLineToY({ angle: 60, to: 0 }, %)
  |> close(%)
  |> extrude(wallThickness, %)

const sketch004 = startSketchOn(sketch002, 'END')
  |> startProfileAt([0, 0], %)
  |> yLineTo(height, %)
  |> xLineTo(wallThickness, %)
  |> yLineTo(segEndY(seg01), %)
  |> angledLineToX({
       angle: 180 - 60,
       to: wallsWidth / 2 - (wallThickness / 2)
     }, %)
  |> xLine(wallThickness, %)
  |> angledLineToY({ angle: 60, to: segEndY(seg01) }, %)
  |> yLineTo(height, %)
  |> xLine(wallThickness, %)
  |> tangentialArcTo([
       (frontLength - wallsWidth) / 2 + wallsWidth,
       height - ((height - exitHeight) / 2)
     ], %)
  |> tangentialArcTo([frontLength, exitHeight], %)
  |> yLineTo(0, %)
  |> close(%, $seg04)
  |> extrude(wallThickness, %)

const customPlane2 = {
  plane: {
    origin: {
      x: -1 * (backLength - height + wallsWidth),
      y: 0,
      z: 0
    },
    xAxis: { x: 0, y: -1, z: 0 },
    yAxis: { x: 0, y: 0, z: 1 },
    zAxis: { x: 1, y: 0, z: 0 }
  }
}
const sketch005 = startSketchOn(customPlane2)
  |> startProfileAt([0, 0], %)
  |> yLineTo(height, %)
  |> xLineTo(wallsWidth, %)
  |> tangentialArcTo([
       (frontLength - wallsWidth) / 2 + wallsWidth,
       height - ((height - exitHeight) / 2)
     ], %)
  |> tangentialArcTo([frontLength, exitHeight], %)
  |> yLineTo(0, %, $seg03)
  |> close(%)
  |> extrude(wallThickness, %)

const sketch006 = startSketchOn(sketch005, seg03)
  |> startProfileAt([0, -1 * (backLength - height)], %)
  |> xLineTo(-exitHeight, %)
  |> yLine(-wallsWidth, %)
  |> xLineTo(0, %)
  |> close(%)
  |> extrude(wallThickness, %)

const sketch007 = startSketchOn(sketch004, 'END')
  |> startProfileAt([0, 0], %)
  |> xLineTo(wallThickness, %)
  |> yLineTo(height, %)
  |> xLineTo(0, %)
  |> close(%)
  |> extrude(wallsWidth - (2 * wallThickness), %)

const customPlane3 = {
  plane: {
    origin: {
      x: -1 * (backLength - height + wallsWidth),
      y: 0,
      z: wallThickness
    },
    xAxis: { x: 0, y: -1, z: 0 },
    yAxis: { x: 1, y: 0, z: 0 },
    zAxis: { x: 0, y: 0, z: 1 }
  }
}

  const sketch008 = startSketchOn(customPlane3)
    |> startProfileAt([wallThickness, wallThickness], %)
    |> xLineTo(frontLength, %)
    |> yLine(wallsWidth-2*wallThickness, %)
    |> xLineTo(wallThickness, %)
    |> close(%)
    |> extrude(-wallThickness, %)