Files
modeling-app/public/kcl-samples/poopy-shoe/main.kcl
Nick Cameron aad583be2e Move axes to std constants; move helix, revolve, and mirror2d to be declared in KCL (#6105)
Move axes to std constants; move helix, revolve, and mirror2d to be declated in KCL

Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-04-03 09:44:52 +00:00

164 lines
4.5 KiB
Plaintext

// Poopy Shoe
// poop shute for bambu labs printer - optimized for printing.
// Set units
@settings(defaultLengthUnit = in)
wallThickness = 0.125
wallsWidth = 3
height = 5.125
filletRadius = 0.050
backLength = 6
exitHeight = 1
frontLength = 7
sketch001 = startSketchOn(-YZ)
|> startProfileAt([wallsWidth / 2, 0], %)
|> xLine(length = wallThickness / 2)
|> angledLineToX({ angle = 60, to = wallsWidth }, %, $seg01)
|> yLine(endAbsolute = height)
|> xLine(length = -wallThickness)
|> yLine(endAbsolute = segEndY(seg01))
|> angledLineToX({
angle = 60,
to = wallsWidth / 2 + wallThickness / 2
}, %)
|> xLine(length = -wallThickness)
|> angledLineToX({ angle = 180 - 60, to = wallThickness }, %)
|> yLine(endAbsolute = height)
|> xLine(endAbsolute = 0)
|> yLine(endAbsolute = segEndY(seg01))
|> angledLineToY({ angle = 180 - 60, to = 0 }, %)
|> close()
part001 = revolve(
sketch001,
angle = 90,
axis = {
direction = [1.0, 0.0],
origin = [0.0, height + .0001]
},
)
sketch002 = startSketchOn(-YZ)
|> startProfileAt([wallsWidth / 2, 0], %)
|> xLine(length = wallThickness / 2)
|> angledLineToX({ angle = 60, to = wallsWidth }, %, $seg02)
|> yLine(endAbsolute = height)
|> xLine(length = -wallThickness)
|> yLine(endAbsolute = segEndY(seg01))
|> angledLineToX({
angle = 60,
to = wallsWidth / 2 + wallThickness / 2
}, %)
|> xLine(length = -wallThickness)
|> angledLineToX({ angle = 180 - 60, to = wallThickness }, %)
|> yLine(endAbsolute = height)
|> xLine(endAbsolute = 0)
|> yLine(endAbsolute = segEndY(seg02))
|> angledLineToY({ angle = 180 - 60, to = 0 }, %)
|> close()
|> extrude(length = backLength - height)
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 }
}
}
sketch003 = startSketchOn(customPlane)
|> startProfileAt([0, 0], %)
|> tangentialArc({ offset = 60, radius = height }, %)
|> angledLineToY({ angle = 60, to = 0 }, %)
|> close()
|> extrude(length = wallThickness)
sketch004 = startSketchOn(sketch002, 'END')
|> startProfileAt([0, 0], %)
|> yLine(endAbsolute = height)
|> xLine(endAbsolute = wallThickness)
|> yLine(endAbsolute = segEndY(seg01))
|> angledLineToX({
angle = 180 - 60,
to = wallsWidth / 2 - (wallThickness / 2)
}, %)
|> xLine(length = wallThickness)
|> angledLineToY({ angle = 60, to = segEndY(seg01) }, %)
|> yLine(endAbsolute = height)
|> xLine(length = wallThickness)
|> tangentialArcTo([
(frontLength - wallsWidth) / 2 + wallsWidth,
height - ((height - exitHeight) / 2)
], %)
|> tangentialArcTo([frontLength, exitHeight], %)
|> yLine(endAbsolute = 0)
|> close(tag = $seg04)
|> extrude(length = wallThickness)
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 }
}
}
sketch005 = startSketchOn(customPlane2)
|> startProfileAt([0, 0], %)
|> yLine(endAbsolute = height)
|> xLine(endAbsolute = wallsWidth)
|> tangentialArcTo([
(frontLength - wallsWidth) / 2 + wallsWidth,
height - ((height - exitHeight) / 2)
], %)
|> tangentialArcTo([frontLength, exitHeight], %)
|> yLine(endAbsolute = 0, tag = $seg03)
|> close()
|> extrude(length = wallThickness)
sketch006 = startSketchOn(sketch005, seg03)
|> startProfileAt([0, -1 * (backLength - height)], %)
|> xLine(endAbsolute = -exitHeight)
|> yLine(length = -wallsWidth)
|> xLine(endAbsolute = 0)
|> close()
|> extrude(length = wallThickness)
sketch007 = startSketchOn(sketch004, 'END')
|> startProfileAt([0, 0], %)
|> xLine(endAbsolute = wallThickness)
|> yLine(endAbsolute = height)
|> xLine(endAbsolute = 0)
|> close()
|> extrude(length = wallsWidth - (2 * wallThickness))
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 }
}
}
sketch008 = startSketchOn(customPlane3)
|> startProfileAt([wallThickness, wallThickness], %)
|> xLine(endAbsolute = frontLength)
|> yLine(length = wallsWidth - (2 * wallThickness))
|> xLine(endAbsolute = wallThickness)
|> close()
|> extrude(length = -wallThickness)