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

Update Samples with SSI #159

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ screenshots/main.kcl
step/main.kcl
/project.toml
thumbnail.png
/thumbnail.png
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ When you submit a PR to add or modify KCL samples, images and STEP files will be
[![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))
Expand Down
121 changes: 44 additions & 77 deletions a-parametric-bearing-pillow-block/main.kcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,90 +15,57 @@ padding = 1.5
bearingDia = 3

// (Needs to be updated). Sketch the block and extrude up to where the counterbore diameter starts.
block = startSketchOn('XY')
extrude001 = startSketchOn('XY')
|> startProfileAt([-width / 2, -length / 2], %)
|> line(endAbsolute = [width / 2, -length / 2])
|> line(endAbsolute = [width / 2, length / 2])
|> line(endAbsolute = [-width / 2, length / 2])
|> close()
|> hole(circle({
center = [
|> extrude(length = height)

extrude002 = startSketchOn(extrude001, 'end')
|> circle({
center = [
-(width / 2 - (padding / 2)),
-(length / 2 - (padding / 2))
],
radius = holeDia / 2
}, %), %)
|> hole(circle({
center = [
-(width / 2 - (padding / 2)),
length / 2 - (padding / 2)
],
radius = holeDia / 2
}, %), %)
|> hole(circle({
center = [
width / 2 - (padding / 2),
length / 2 - (padding / 2)
],
radius = holeDia / 2
}, %), %)
|> hole(circle({
center = [
width / 2 - (padding / 2),
-(length / 2 - (padding / 2))
],
radius = holeDia / 2
}, %), %)
|> hole(circle({
center = [0, 0],
radius = bearingDia / 2
}, %), %)
|> extrude(length = height - cbDepth)
],
radius = cbDia / 2,
}, %)
|> patternLinear2d({
instances = 2,
distance = length - padding,
axis = [0, 1],
}, %)
|> patternLinear2d({
instances = 2,
distance = width - padding,
axis = [1, 0],
}, %)
|> extrude(%, length = -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({
plane = {
origin = { x = 0, y = 0, z = height - cbDepth },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
})
|> startProfileAt([-width / 2, -length / 2], %)
|> line(endAbsolute = [width / 2, -length / 2])
|> line(endAbsolute = [width / 2, length / 2])
|> line(endAbsolute = [-width / 2, length / 2])
|> close()
|> hole(circle({
center = [
extrude003 = startSketchOn(extrude001, 'start')
|> circle({
center = [
-(width / 2 - (padding / 2)),
-(length / 2 - (padding / 2))
],
radius = cbDia / 2
}, %), %)
|> hole(circle({
center = [
-(width / 2 - (padding / 2)),
length / 2 - (padding / 2)
],
radius = cbDia / 2
}, %), %)
|> hole(circle({
center = [
width / 2 - (padding / 2),
length / 2 - (padding / 2)
],
radius = cbDia / 2
}, %), %)
|> hole(circle({
center = [
width / 2 - (padding / 2),
-(length / 2 - (padding / 2))
],
radius = cbDia / 2
}, %), %)
|> hole(circle({
center = [0, 0],
radius = bearingDia / 2
}, %), %)
|> extrude(length = cbDepth)
],
radius = holeDia / 2,
}, %)
|> patternLinear2d({
instances = 2,
distance = length - padding,
axis = [0, 1],
}, %)
|> patternLinear2d({
instances = 2,
distance = width - padding,
axis = [1, 0],
}, %)
|> extrude(%, length = -height + cbDepth)

extrude004 = startSketchOn(extrude001, 'end')
|> circle({
center = [0, 0],
radius = bearingDia/2,
}, %)
|> extrude(%, length = -height)
Binary file modified screenshots/a-parametric-bearing-pillow-block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading