kcl-samples → parametric-bearing-pillow-block →
parametric-bearing-pillow-block

KCL
// 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 parameters
length = 6
width = 4
height = 1
cbDepth = .25
cbDia = .7
holeDia = .375
padding = 1.5
bearingDia = 3
// Sketch the block body
body = 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()
|> extrude(length = height)
counterBoreHoles = startSketchOn(body, face = END)
|> circle(
center = [
-(width / 2 - (padding / 2)),
-(length / 2 - (padding / 2))
],
radius = cbDia / 2,
)
|> patternLinear2d(instances = 2, distance = length - padding, axis = [0, 1])
|> patternLinear2d(instances = 2, distance = width - padding, axis = [1, 0])
|> extrude(%, length = -cbDepth)
boltHoles = startSketchOn(body, face = START)
|> circle(
center = [
-(width / 2 - (padding / 2)),
-(length / 2 - (padding / 2))
],
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)
centerHole = startSketchOn(body, face = END)
|> circle(center = [0, 0], radius = bearingDia / 2)
|> extrude(length = -height)