Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boat #141

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

boat #141

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions 3d-boaty/boat-parts.kcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
// 3D Boaty Function Library
// The following file describes various functions to build the 3D boaty

export dividerThickness = 4

fn dividerSketch(plane) {
sketch000 = startSketchOn(plane)
|> startProfileAt([-16.82, 21.2], %)
|> line([-0.13, -1.27], %)
|> tangentialArcTo([-15.94, profileStartY(%) - 7.73], %)
|> tangentialArcTo([-16.6, profileStartY(%) - 15.52], %)
|> tangentialArcTo([-18.38, profileStartY(%) - 18.63], %)
|> line([-1.25, -2.6], %)
|> xLine(6.04, %)
|> line([6.68, 7.87], %)
|> tangentialArcTo([10.06, profileStartY(%) - 12.69], %)
|> line([7.28, -8.47], %)
|> xLine(5.98, %)
|> line([-1.3, 3.01], %)
|> tangentialArcTo([22.45, profileStartY(%) - 2.84], %)
|> tangentialArcTo([25.08, profileStartY(%) + 6.42], %)
|> line([2.35, 16.36], %)
|> line([1.78, 1.15], %)
|> tangentialArcTo([23.93, profileStartY(%) + 27.29], %)
|> line([-1.92, 0.21], %)
|> line([-3.74, -26.54], %)
|> tangentialArcTo([15.13, profileStartY(%) - 1.72], %)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
return sketch000
}

export fn divider(plane) {
right = dividerSketch(plane)
|> extrude(dividerThickness / 2, %)
left = dividerSketch(plane)
|> extrude(-dividerThickness / 2, %)
shell({ thickness = 1.5, faces = ["end"] }, right)
shell({ thickness = 1.5, faces = ["start"] }, left)
return 0
}

fn connectorSketch(plane, start) {
sketch001 = startSketchOn(plane)
|> startProfileAt(start, %)
|> polygon({
radius = 1.2,
numSides = 6,
center = profileStart(%),
inscribed = false
}, %)
return sketch001
}

export fn connector(plane, length) {
connectorSketch(plane, [-12, 8])
|> extrude(length, %)
connectorSketch(plane, [16, 8])
|> extrude(length, %)
return 0
}

fn seatSlatSketch(plane) {
sketch003 = startSketchOn(plane)
|> startProfileAt([-7, 19], %)
|> line([-10, 0.5], %)
|> line([0.2, 2.5], %)
|> line([1.5, 1.5], %)
|> line([6.9, -0.5], %)
|> line([1.5, -1.5], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> patternLinear2d({
instances = 3,
distance = 11,
axis = [1, -0.05]
}, %)
return sketch003
}

export fn seatSlats(plane, length) {
seatSlatSketch(plane)
|> extrude(length, %)
return 0
}

fn backSlatsSketch(plane) {
sketch004 = startSketchOn(plane)
|> startProfileAt([22, 38.5], %)
|> angledLine([173, 2], %)
|> line([-1.74, 2.03], %)
|> angledLine([82, 6.6], %)
|> line([2.23, 1.42], %)
|> angledLine([-7, 2], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> patternLinear2d({
instances = 2,
distance = 11,
axis = [-0.137, -1]
}, %)
return sketch004
}

export fn backSlats(plane, length) {
b = backSlatsSketch(plane)
|> extrude(length, %)
return b
}

fn armRestPath(plane) {
sketch005 = startSketchOn(plane)
|> startProfileAt([20, 33], %)
|> xLine(-20, %)
|> arc({
angleStart = 90,
angleEnd = 180,
radius = 10
}, %)
return sketch005
}

fn armRestProfile(plane, offset) {
sketch006 = startSketchOn(plane)
|> startProfileAt([offset, 32.4], %)
|> xLine(1.3, %)
|> line([0.3, 0.6], %)
|> line([-0.3, 0.6], %)
|> xLine(-2.6, %)
|> line([-0.3, -0.6], %)
|> line([0.3, -0.6], %)
|> close(%)
return sketch006
}

export fn armRest(plane, offset) {
path = armRestPath( offsetPlane(plane, offset))
profile = armRestProfile( offsetPlane("-XZ", 20), offset)
sweep({ path = path }, profile)
return 0
}
31 changes: 31 additions & 0 deletions 3d-boaty/main.kcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// 3D Boaty
// This is a slight remix of Depep1's original 3D Boaty (https://www.printables.com/model/1141963-3d-boaty). This is a tool used for benchmarking 3D FDM printers for bed adhesion, overhangs, bridging and top surface quality. The name of this file is a bit of misnomer, the shape of the object is a typical park bench.

// Import various constants and functions from our library
import dividerThickness from "boat-parts.kcl"
import divider from "boat-parts.kcl"
import connector from "boat-parts.kcl"
import seatSlats from "boat-parts.kcl"
import backSlats from "boat-parts.kcl"
import armRest from "boat-parts.kcl"

// Define the bench length in millimeters
benchLength = 56

// Create the dividers, these hold the seat and back slats
divider("YZ")
divider(offsetPlane("-YZ", benchLength / 2))
divider(offsetPlane("YZ", benchLength / 2))

// Create the connectors to join the dividers
connector(offsetPlane("YZ", -benchLength / 2), benchLength)

// Create the seat slats
seatSlats(offsetPlane("YZ", -benchLength / 2 - dividerThickness / 2), benchLength + dividerThickness)

// Create the back slats
backSlats(offsetPlane("YZ", -benchLength / 2 - dividerThickness / 2), benchLength + dividerThickness)

// Create the arm rests
armRest("-YZ", benchLength / 2)
armRest("YZ", benchLength / 2)
2 changes: 2 additions & 0 deletions 3d-boaty/project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings.modeling]
base_unit = "mm"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ KCL samples conform to a set of style guidelines to ensure consistency and reada
When you submit a PR to add or modify KCL samples, images and STEP files will be generated and added to the repository automatically.

---
#### [3d-boaty](3d-boaty/main.kcl) ([step](step/3d-boaty.step)) ([screenshot](screenshots/3d-boaty.png))
[![3d-boaty](screenshots/3d-boaty.png)](3d-boaty/main.kcl)
#### [80-20-rail](80-20-rail/main.kcl) ([step](step/80-20-rail.step)) ([screenshot](screenshots/80-20-rail.png))
[![80-20-rail](screenshots/80-20-rail.png)](80-20-rail/main.kcl)
#### [a-parametric-bearing-pillow-block](a-parametric-bearing-pillow-block/main.kcl) ([step](step/a-parametric-bearing-pillow-block.step)) ([screenshot](screenshots/a-parametric-bearing-pillow-block.png))
Expand Down
Binary file added screenshots/3d-boaty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading