Skip to content

Commit

Permalink
Create 80-20-Rail (#39)
Browse files Browse the repository at this point in the history
* Create 80-20-Rail

An 80/20 extruded aluminum linear rail. T-slot profile adjustable by rail height, length, and base position

* Rename 80-20-Rail to 80-20-rail.kcl

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

---------

Co-authored-by: Jess Frazelle <jessfraz@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 29, 2024
1 parent 9730ffb commit d0aec8c
Show file tree
Hide file tree
Showing 7 changed files with 7,087 additions and 554 deletions.
68 changes: 68 additions & 0 deletions 80-20-rail.kcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// 80/20 Rail
// An 80/20 extruded aluminum linear rail. T-slot profile adjustable by rail height, length, and base position


// define function
fn rail8020 = (originStart, railHeight, height) => {
const plane001 = {
plane: {
origin: [originStart[0], originStart[1], 0],
x_axis: [1.0, 0.0, 0.0],
y_axis: [0.0, 1.0, 0.0],
z_axis: [0.0, 0.0, 1.0]
}
}

// sketch rail center
const sketch001 = startSketchOn(plane001)
|> startProfileAt([0.322 * railHeight, 0.322 * railHeight], %)
|> angledLine([0, 0.356 * railHeight], %, $rectangleSegmentA001)
|> angledLine([
segAng(rectangleSegmentA001, %) + 90,
0.356 * railHeight
], %, $rectangleSegmentB001)
|> angledLine([
segAng(rectangleSegmentA001, %),
-segLen(rectangleSegmentA001, %)
], %, $rectangleSegmentC001)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> hole(circle([.5 * railHeight, .5 * railHeight], .205 * railHeight / 2, %), %)
|> extrude(height, %)

// sketch T-slot corner
const sketch002 = startSketchOn(plane001)
|> startProfileAt([0, 0.372 * railHeight], %)
|> yLine(-0.372 * railHeight, %)
|> xLine(0.372 * railHeight, %)
|> yLine(0.087 * railHeight, %)
|> xLine(-0.2 * railHeight, %)
|> angledLineToY({ angle: 45, to: 0.322 * railHeight }, %)
|> angledLineToX({ angle: 180, to: 0.322 * railHeight }, %)
|> yLine(0.1 * railHeight, %)
|> angledLineToX({ angle: -135, to: 0.087 * railHeight }, %)
|> angledLineToY({ angle: 90, to: 0.372 * railHeight }, %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
const pattern001 = extrude(height, sketch002)

// circular pattern 3D T-slot corner feature
|> patternCircular3d({
axis: [0, 0, 1],
center: [
railHeight / 2 + originStart[0],
railHeight / 2 + originStart[1],
0
],
repetitions: 3,
arcDegrees: 360,
rotateDuplicates: true
}, %)
return pattern001
}

// generate 4 adjustable rails
rail8020([0, 0], 1.5, 50)
rail8020([0, 20], 1, 60)
rail8020([30, 0], 1, 70)
rail8020([30, 20], 1, 80)
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.

---
#### [80-20-rail](80-20-rail.kcl) ([step](STEP-output-of-samples/80-20-rail.step)) ([screenshot](screenshots-of-samples/80-20-rail.png))
[![80-20-rail](screenshots-of-samples/80-20-rail.png)](80-20-rail.kcl)
#### [a-parametric-bearing-pillow-block](a-parametric-bearing-pillow-block.kcl) ([step](STEP-output-of-samples/a-parametric-bearing-pillow-block.step)) ([screenshot](screenshots-of-samples/a-parametric-bearing-pillow-block.png))
[![a-parametric-bearing-pillow-block](screenshots-of-samples/a-parametric-bearing-pillow-block.png)](a-parametric-bearing-pillow-block.kcl)
#### [ball-bearing](ball-bearing.kcl) ([step](STEP-output-of-samples/ball-bearing.step)) ([screenshot](screenshots-of-samples/ball-bearing.png))
Expand Down
Loading

0 comments on commit d0aec8c

Please sign in to comment.