Skip to content
This repository was archived by the owner on Mar 8, 2025. It is now read-only.

Commit

Permalink
Merge branch 'main' into kurt-chicken-coop
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	step/80-20-rail.step
#	step/a-parametric-bearing-pillow-block.step
#	step/ball-bearing.step
#	step/bracket.step
#	step/car-wheel-assembly.step
#	step/dodecahedron.step
#	step/enclosure.step
#	step/flange-with-patterns.step
#	step/flange-xy.step
#	step/focusrite-scarlett-mounting-bracket.step
#	step/food-service-spatula.step
#	step/french-press.step
#	step/gear-rack.step
#	step/gear.step
#	step/hex-nut.step
#	step/i-beam.step
#	step/kitt.step
#	step/lego.step
#	step/mounting-plate.step
#	step/multi-axis-robot.step
#	step/pipe-flange-assembly.step
#	step/pipe-with-bend.step
#	step/pipe.step
#	step/poopy-shoe.step
#	step/router-template-cross-bar.step
#	step/router-template-slate.step
#	step/sheet-metal-bracket.step
#	step/socket-head-cap-screw.step
#	step/walkie-talkie.step
#	step/washer.step
  • Loading branch information
r-barton committed Feb 14, 2025
2 parents 49b2543 + 3e1bcb4 commit cbc9af7
Show file tree
Hide file tree
Showing 164 changed files with 52,551 additions and 46,620 deletions.
Binary file removed .DS_Store
Binary file not shown.
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 @@ -10,6 +10,7 @@ on:
- '**/*.kcl'
- '**/project.toml'
- .github/workflows/output-from-kcl-samples.yml
- requirements.txt
branches:
- main
workflow_dispatch:
Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.vscode

.idea
.idea
.DS_Store
screenshots/main.kcl
step/main.kcl
/project.toml
thumbnail.png
6 changes: 4 additions & 2 deletions 80-20-rail/main.kcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// 80/20 Rail
// An 80/20 extruded aluminum linear rail. T-slot profile adjustable by profile height, rail length, and origin position

// Set units
@settings(defaultLengthUnit = in)

// Define function
fn rail8020(originStart, railHeight, railLength) {
Expand Down Expand Up @@ -184,7 +186,7 @@ fn rail8020(originStart, railHeight, railLength) {
angleEnd = -90,
radius = 0.072 / 4 * railHeight
}, %)
|> close(%)
|> close()

// Sketch center hole of profile
|> hole(circle({
Expand All @@ -194,7 +196,7 @@ fn rail8020(originStart, railHeight, railLength) {
],
radius = .205 * railHeight / 2
}, %), %)
|> extrude(railLength, %)
|> extrude(length = railLength)
|> fillet({
radius = 0.06,
tags = [
Expand Down
8 changes: 0 additions & 8 deletions 80-20-rail/project.toml

This file was deleted.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ When you submit a PR to add or modify KCL samples, images and STEP files will be
[![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)
#### [chicken-coop](chicken-coop/main.kcl) ([step](step/chicken-coop.step)) ([screenshot](screenshots/chicken-coop.png))
[![chicken-coop](screenshots/chicken-coop.png)](chicken-coop/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))
Expand Down
22 changes: 12 additions & 10 deletions a-parametric-bearing-pillow-block/main.kcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// A Parametric Bearing Pillow Block
// A bearing pillow block, also known as a plummer block or pillow block bearing, is a pedestal used to provide support for a rotating shaft with the help of compatible bearings and various accessories. Housing a bearing, the pillow block provides a secure and stable foundation that allows the shaft to rotate smoothly within its machinery setup. These components are essential in a wide range of mechanical systems and machinery, playing a key role in reducing friction and supporting radial and axial loads.

// Set units
@settings(defaultLengthUnit = in)

// Define constants such as length, width, height, counter-bore depth and diameter, bearing diameter, hole location padding, and more
length = 6
Expand All @@ -15,10 +17,10 @@ bearingDia = 3
// (Needs to be updated). Sketch the block and extrude up to where the counterbore diameter starts.
block = startSketchOn('XY')
|> startProfileAt([-width / 2, -length / 2], %)
|> lineTo([width / 2, -length / 2], %)
|> lineTo([width / 2, length / 2], %)
|> lineTo([-width / 2, length / 2], %)
|> close(%)
|> line(endAbsolute = [width / 2, -length / 2])
|> line(endAbsolute = [width / 2, length / 2])
|> line(endAbsolute = [-width / 2, length / 2])
|> close()
|> hole(circle({
center = [
-(width / 2 - (padding / 2)),
Expand Down Expand Up @@ -51,7 +53,7 @@ block = startSketchOn('XY')
center = [0, 0],
radius = bearingDia / 2
}, %), %)
|> extrude(height - cbDepth, %)
|> extrude(length = height - cbDepth)

// Create a second sketch that creates the counterbore diameters and extrude the rest of the way to get the total height. Note: You cannot use startSketchOn(block, 'end'). The extrude lives outside the bounds, and the engine will not execute. This is a known issue.
secondHalf = startSketchOn({
Expand All @@ -63,10 +65,10 @@ secondHalf = startSketchOn({
}
})
|> startProfileAt([-width / 2, -length / 2], %)
|> lineTo([width / 2, -length / 2], %)
|> lineTo([width / 2, length / 2], %)
|> lineTo([-width / 2, length / 2], %)
|> close(%)
|> line(endAbsolute = [width / 2, -length / 2])
|> line(endAbsolute = [width / 2, length / 2])
|> line(endAbsolute = [-width / 2, length / 2])
|> close()
|> hole(circle({
center = [
-(width / 2 - (padding / 2)),
Expand Down Expand Up @@ -99,4 +101,4 @@ secondHalf = startSketchOn({
center = [0, 0],
radius = bearingDia / 2
}, %), %)
|> extrude(cbDepth, %)
|> extrude(length = cbDepth)
8 changes: 0 additions & 8 deletions a-parametric-bearing-pillow-block/project.toml

This file was deleted.

14 changes: 8 additions & 6 deletions ball-bearing/main.kcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Ball Bearing
// A ball bearing is a type of rolling-element bearing that uses balls to maintain the separation between the bearing races. The primary purpose of a ball bearing is to reduce rotational friction and support radial and axial loads.

// Set units
@settings(defaultLengthUnit = in)

// Define constants like ball diameter, inside diamter, overhange length, and thickness
outsideDiameter = 1.625
Expand Down Expand Up @@ -39,7 +41,7 @@ insideWallSketch = startSketchOn(customPlane)
}, %), %)

// Extrude the inside bearing piece
insideWall = extrude(overallThickness, insideWallSketch)
insideWall = extrude(insideWallSketch, length = overallThickness)

// Create the sketch of one of the balls
ballsSketch = startSketchOn("XY")
Expand All @@ -49,7 +51,7 @@ ballsSketch = startSketchOn("XY")
angleStart = 180,
radius = sphereDia / 2
}, %)
|> close(%)
|> close()

// Revolve the ball to make a sphere and pattern around the inside wall
balls = revolve({ axis = "X" }, ballsSketch)
Expand All @@ -72,9 +74,9 @@ chainSketch = startSketchOn("XY")
angleStart = 120,
radius = sphereDia / 2
}, %)
|> line([0, chainThickness], %)
|> line([-chainWidth, 0], %)
|> close(%)
|> line(end = [0, chainThickness])
|> line(end = [-chainWidth, 0])
|> close()

// Revolve the chain sketch
chainHead = revolve({ axis = "X" }, chainSketch)
Expand Down Expand Up @@ -117,6 +119,6 @@ outsideWallSketch = startSketchOn(customPlane)
radius = shaftDia / 2 + wallThickness + sphereDia
}, %), %)

outsideWall = extrude(overallThickness, outsideWallSketch)
outsideWall = extrude(outsideWallSketch, length = overallThickness)

// https://www.mcmaster.com/60355K185/
8 changes: 0 additions & 8 deletions ball-bearing/project.toml

This file was deleted.

28 changes: 15 additions & 13 deletions bracket/main.kcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Shelf Bracket
// This is a bracket that holds a shelf. It is made of aluminum and is designed to hold a force of 300 lbs. The bracket is 6 inches wide and the force is applied at the end of the shelf, 12 inches from the wall. The bracket has a factor of safety of 1.2. The legs of the bracket are 5 inches and 2 inches long. The thickness of the bracket is calculated from the constraints provided.

// Set units
@settings(defaultLengthUnit = in)

// Define constants
sigmaAllow = 35000 // psi (6061-T6 aluminum)
Expand All @@ -24,10 +26,10 @@ thickness = sqrt(moment * factorOfSafety * 6 / (sigmaAllow * width)) // this is
// Sketch the bracket body and fillet the inner and outer edges of the bend
bracketLeg1Sketch = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line([shelfMountL - filletRadius, 0], %, $fillet1)
|> line([0, width], %, $fillet2)
|> line([-shelfMountL + filletRadius, 0], %)
|> close(%)
|> line(end = [shelfMountL - filletRadius, 0], tag = $fillet1)
|> line(end = [0, width], tag = $fillet2)
|> line(end = [-shelfMountL + filletRadius, 0])
|> close()
|> hole(circle({
center = [1, 1],
radius = mountingHoleDiameter / 2
Expand All @@ -46,7 +48,7 @@ bracketLeg1Sketch = startSketchOn('XY')
}, %), %)

// Extrude the leg 2 bracket sketch
bracketLeg1Extrude = extrude(thickness, bracketLeg1Sketch)
bracketLeg1Extrude = extrude(bracketLeg1Sketch, length = thickness)
|> fillet({
radius = extFilletRadius,
tags = [
Expand All @@ -58,21 +60,21 @@ bracketLeg1Extrude = extrude(thickness, bracketLeg1Sketch)
// Sketch the fillet arc
filletSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> line([0, thickness], %)
|> line(end = [0, thickness])
|> arc({
angleEnd = 180,
angleStart = 90,
radius = filletRadius + thickness
}, %)
|> line([thickness, 0], %)
|> line(end = [thickness, 0])
|> arc({
angleEnd = 90,
angleStart = 180,
radius = filletRadius
}, %)

// Sketch the bend
filletExtrude = extrude(-width, filletSketch)
filletExtrude = extrude(filletSketch, length = -width)

// Create a custom plane for the leg that sits on the wall
customPlane = {
Expand All @@ -87,10 +89,10 @@ customPlane = {
// Create a sketch for the second leg
bracketLeg2Sketch = startSketchOn(customPlane)
|> startProfileAt([0, -filletRadius], %)
|> line([width, 0], %)
|> line([0, -wallMountL], %, $fillet3)
|> line([-width, 0], %, $fillet4)
|> close(%)
|> line(end = [width, 0])
|> line(end = [0, -wallMountL], tag = $fillet3)
|> line(end = [-width, 0], tag = $fillet4)
|> close()
|> hole(circle({
center = [1, -1.5],
radius = mountingHoleDiameter / 2
Expand All @@ -101,7 +103,7 @@ bracketLeg2Sketch = startSketchOn(customPlane)
}, %), %)

// Extrude the second leg
bracketLeg2Extrude = extrude(-thickness, bracketLeg2Sketch)
bracketLeg2Extrude = extrude(bracketLeg2Sketch, length = -thickness)
|> fillet({
radius = extFilletRadius,
tags = [
Expand Down
8 changes: 0 additions & 8 deletions bracket/project.toml

This file was deleted.

Loading

0 comments on commit cbc9af7

Please sign in to comment.