Skip to content

Commit

Permalink
Next (#172)
Browse files Browse the repository at this point in the history
* In the realm of scripts and screens, adding a dash of mechanical dreams.

* Update samples for kwarg patterns

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* patternTransform also uses kwargs

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* Restore accidental deletes

* Update offsetPlane for keyword args

* Fix up next

* Add color cube back to README.md

* Fix color-cube example

* boat (#141)

* boat

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* Update header of boat-parts.kcl

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* Add some more clarification to the description

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* update to latest unit syntax

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* Update for breaking changes in KCL

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* Update for breaking changes in KCL

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* Update for breaking changes in KCL

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* updated KCL for linear pattern 2d

* updated description

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* Update process (#168)

* KCL 37 release (#169)

- pattern functions and `offsetPlane` now use keyword arguments

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ryan Barton <[email protected]>

* Fix assemblies to not rely on import side-effects (#171)

* Fix walkie-talkie to not rely on import side-effects

* Fix robot arm also

* In the realm of scripts and screens, adding a dash of mechanical dreams.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* update requirements.txt and workflow

* In the realm of scripts and screens, adding a dash of mechanical dreams.

* update for new kw args

* In the realm of scripts and screens, adding a dash of mechanical dreams.

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Adam Chalmers <[email protected]>
Co-authored-by: Jonathan Tran <[email protected]>

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Adam Chalmers <[email protected]>
Co-authored-by: Jonathan Tran <[email protected]>
  • Loading branch information
4 people authored Feb 18, 2025
1 parent 9b54c12 commit 2015dce
Show file tree
Hide file tree
Showing 12 changed files with 30,330 additions and 21,494 deletions.
1 change: 1 addition & 0 deletions .github/workflows/output-from-kcl-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- requirements.txt
branches:
- main
- next
workflow_dispatch:

jobs:
Expand Down
136 changes: 136 additions & 0 deletions 3d-boaty/boat-parts.kcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
// 3D Boaty Function Library
// The following file describes various functions to build the 3D boaty. The name of this file is a bit of misnomer, the shape of the object is a typical park bench.

// Set units in millimeters (mm)
@settings(defaultLengthUnit = mm)

export dividerThickness = 4

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

export fn divider(plane) {
right = dividerSketch(plane)
|> extrude(length = dividerThickness / 2)
left = dividerSketch(plane)
|> extrude(length = -dividerThickness / 2)
shell(right, thickness = 1.5, faces = ["end"])
shell(left, thickness = 1.5, faces = ["start"])
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 = length)
connectorSketch(plane, [16, 8])
|> extrude(length = length)
return 0
}

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

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

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

export fn backSlats(plane, length) {
b = backSlatsSketch(plane)
|> extrude(length = 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(end = [0.3, 0.6])
|> line(end = [-0.3, 0.6])
|> xLine(-2.6, %)
|> line(end = [-0.3, -0.6])
|> line(end = [0.3, -0.6])
|> close()
return sketch006
}

export fn armRest(plane, offset) {
path = armRestPath( offsetPlane(plane, offset = offset))
profile = armRestProfile( offsetPlane("-XZ", offset = 20), offset)
sweep(profile, path = path)
return 0
}
34 changes: 34 additions & 0 deletions 3d-boaty/main.kcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// 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.

// Set units in millimeters (mm)
@settings(defaultLengthUnit = mm)

// Define the bench length
benchLength = 56

// 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"

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

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

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

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

// Create the arm rests
armRest("-YZ", benchLength / 2)
armRest("-YZ", -benchLength / 2)
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,56 @@ 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))
[![a-parametric-bearing-pillow-block](screenshots/a-parametric-bearing-pillow-block.png)](a-parametric-bearing-pillow-block/main.kcl)
#### [ball-bearing](ball-bearing/main.kcl) ([step](step/ball-bearing.step)) ([screenshot](screenshots/ball-bearing.png))
[![ball-bearing](screenshots/ball-bearing.png)](ball-bearing/main.kcl)
#### [bracket](bracket/main.kcl) ([step](step/bracket.step)) ([screenshot](screenshots/bracket.png))
[![bracket](screenshots/bracket.png)](bracket/main.kcl)
#### [car-wheel-assembly](car-wheel-assembly/main.kcl) ([step](step/car-wheel-assembly.step)) ([screenshot](screenshots/car-wheel-assembly.png))
[![car-wheel-assembly](screenshots/car-wheel-assembly.png)](car-wheel-assembly/main.kcl)
#### [color-cube](color-cube/main.kcl) ([step](step/color-cube.step)) ([screenshot](screenshots/color-cube.png))
[![color-cube](screenshots/color-cube.png)](color-cube/main.kcl)
#### [cycloidal-gear](cycloidal-gear/main.kcl) ([step](step/cycloidal-gear.step)) ([screenshot](screenshots/cycloidal-gear.png))
[![cycloidal-gear](screenshots/cycloidal-gear.png)](cycloidal-gear/main.kcl)
#### [dodecahedron](dodecahedron/main.kcl) ([step](step/dodecahedron.step)) ([screenshot](screenshots/dodecahedron.png))
[![dodecahedron](screenshots/dodecahedron.png)](dodecahedron/main.kcl)
#### [enclosure](enclosure/main.kcl) ([step](step/enclosure.step)) ([screenshot](screenshots/enclosure.png))
[![enclosure](screenshots/enclosure.png)](enclosure/main.kcl)
#### [exhaust-manifold](exhaust-manifold/main.kcl) ([step](step/exhaust-manifold.step)) ([screenshot](screenshots/exhaust-manifold.png))
[![exhaust-manifold](screenshots/exhaust-manifold.png)](exhaust-manifold/main.kcl)
#### [flange-with-patterns](flange-with-patterns/main.kcl) ([step](step/flange-with-patterns.step)) ([screenshot](screenshots/flange-with-patterns.png))
[![flange-with-patterns](screenshots/flange-with-patterns.png)](flange-with-patterns/main.kcl)
#### [flange-xy](flange-xy/main.kcl) ([step](step/flange-xy.step)) ([screenshot](screenshots/flange-xy.png))
[![flange-xy](screenshots/flange-xy.png)](flange-xy/main.kcl)
#### [focusrite-scarlett-mounting-bracket](focusrite-scarlett-mounting-bracket/main.kcl) ([step](step/focusrite-scarlett-mounting-bracket.step)) ([screenshot](screenshots/focusrite-scarlett-mounting-bracket.png))
[![focusrite-scarlett-mounting-bracket](screenshots/focusrite-scarlett-mounting-bracket.png)](focusrite-scarlett-mounting-bracket/main.kcl)
#### [food-service-spatula](food-service-spatula/main.kcl) ([step](step/food-service-spatula.step)) ([screenshot](screenshots/food-service-spatula.png))
[![food-service-spatula](screenshots/food-service-spatula.png)](food-service-spatula/main.kcl)
#### [french-press](french-press/main.kcl) ([step](step/french-press.step)) ([screenshot](screenshots/french-press.png))
[![french-press](screenshots/french-press.png)](french-press/main.kcl)
#### [gear-rack](gear-rack/main.kcl) ([step](step/gear-rack.step)) ([screenshot](screenshots/gear-rack.png))
[![gear-rack](screenshots/gear-rack.png)](gear-rack/main.kcl)
#### [gear](gear/main.kcl) ([step](step/gear.step)) ([screenshot](screenshots/gear.png))
[![gear](screenshots/gear.png)](gear/main.kcl)
#### [hex-nut](hex-nut/main.kcl) ([step](step/hex-nut.step)) ([screenshot](screenshots/hex-nut.png))
[![hex-nut](screenshots/hex-nut.png)](hex-nut/main.kcl)
#### [i-beam](i-beam/main.kcl) ([step](step/i-beam.step)) ([screenshot](screenshots/i-beam.png))
[![i-beam](screenshots/i-beam.png)](i-beam/main.kcl)
#### [kitt](kitt/main.kcl) ([step](step/kitt.step)) ([screenshot](screenshots/kitt.png))
[![kitt](screenshots/kitt.png)](kitt/main.kcl)
#### [lego](lego/main.kcl) ([step](step/lego.step)) ([screenshot](screenshots/lego.png))
[![lego](screenshots/lego.png)](lego/main.kcl)
#### [mounting-plate](mounting-plate/main.kcl) ([step](step/mounting-plate.step)) ([screenshot](screenshots/mounting-plate.png))
[![mounting-plate](screenshots/mounting-plate.png)](mounting-plate/main.kcl)
#### [multi-axis-robot](multi-axis-robot/main.kcl) ([step](step/multi-axis-robot.step)) ([screenshot](screenshots/multi-axis-robot.png))
[![multi-axis-robot](screenshots/multi-axis-robot.png)](multi-axis-robot/main.kcl)
#### [pipe-flange-assembly](pipe-flange-assembly/main.kcl) ([step](step/pipe-flange-assembly.step)) ([screenshot](screenshots/pipe-flange-assembly.png))
[![pipe-flange-assembly](screenshots/pipe-flange-assembly.png)](pipe-flange-assembly/main.kcl)
#### [pipe-with-bend](pipe-with-bend/main.kcl) ([step](step/pipe-with-bend.step)) ([screenshot](screenshots/pipe-with-bend.png))
[![pipe-with-bend](screenshots/pipe-with-bend.png)](pipe-with-bend/main.kcl)
#### [pipe](pipe/main.kcl) ([step](step/pipe.step)) ([screenshot](screenshots/pipe.png))
Expand All @@ -59,5 +89,7 @@ When you submit a PR to add or modify KCL samples, images and STEP files will be
[![sheet-metal-bracket](screenshots/sheet-metal-bracket.png)](sheet-metal-bracket/main.kcl)
#### [socket-head-cap-screw](socket-head-cap-screw/main.kcl) ([step](step/socket-head-cap-screw.step)) ([screenshot](screenshots/socket-head-cap-screw.png))
[![socket-head-cap-screw](screenshots/socket-head-cap-screw.png)](socket-head-cap-screw/main.kcl)
#### [walkie-talkie](walkie-talkie/main.kcl) ([step](step/walkie-talkie.step)) ([screenshot](screenshots/walkie-talkie.png))
[![walkie-talkie](screenshots/walkie-talkie.png)](walkie-talkie/main.kcl)
#### [washer](washer/main.kcl) ([step](step/washer.step)) ([screenshot](screenshots/washer.png))
[![washer](screenshots/washer.png)](washer/main.kcl)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pillow==11.1.0
requests==2.32.3
zoo-kcl==0.3.0
zoo-kcl==0.3.37
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.
Binary file modified screenshots/car-wheel-assembly.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/multi-axis-robot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2015dce

Please sign in to comment.