kcl-samples

a-parametric-bearing-pillow-block

a-parametric-bearing-pillow-block

KCL

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

// Define constants such as length, width, height, counter-bore depth and diameter, bearing diameter, hole location padding, and more
const length = 40
const width = 30
const height = 10
const cbDepth = 2.1
const cbDia = 4.4
const holeDia = 2.4
const padding = 8
const bearingDia = 22

// (Needs to be updated). Sketch the block and extrude up to where the counterbore diameter starts.
const block = startSketchOn('XY')
  |> startProfileAt([-width / 2, -length / 2], %)
  |> lineTo([width / 2, -length / 2], %)
  |> lineTo([width / 2, length / 2], %)
  |> lineTo([-width / 2, length / 2], %)
  |> close(%)
  |> hole(circle([
       -(width / 2 - (padding / 2)),
       -(length / 2 - (padding / 2))
     ], holeDia / 2, %), %)
  |> hole(circle([
       -(width / 2 - (padding / 2)),
       length / 2 - (padding / 2)
     ], holeDia / 2, %), %)
  |> hole(circle([
       width / 2 - (padding / 2),
       length / 2 - (padding / 2)
     ], holeDia / 2, %), %)
  |> hole(circle([
       width / 2 - (padding / 2),
       -(length / 2 - (padding / 2))
     ], holeDia / 2, %), %)
  |> hole(circle([0, 0], bearingDia / 2, %), %)
  |> extrude(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.
const secondHalf = startSketchOn({
       plane: { 
         origin: { x: 0, y: 0, z: height-cbDepth },
         x_axis: { x: 1, y: 0, z: 0 },
         y_axis: { x: 0, y: 1, z: 0 },
         z_axis: { x: 0, y: 0, z: 1 },
       }
     })
  |> startProfileAt([-width / 2, -length / 2], %)
  |> lineTo([width / 2, -length / 2], %)
  |> lineTo([width / 2, length / 2], %)
  |> lineTo([-width / 2, length / 2], %)
  |> close(%)
  |> hole(circle([
       -(width / 2 - (padding / 2)),
       -(length / 2 - (padding / 2))
     ], cbDia / 2, %), %)
  |> hole(circle([
       -(width / 2 - (padding / 2)),
       length / 2 - (padding / 2)
     ], cbDia / 2, %), %)
  |> hole(circle([
       width / 2 - (padding / 2),
       length / 2 - (padding / 2)
     ], cbDia / 2, %), %)
  |> hole(circle([
       width / 2 - (padding / 2),
       -(length / 2 - (padding / 2))
     ], cbDia / 2, %), %)
  |> hole(circle([0, 0], bearingDia / 2, %), %)
  |> extrude(cbDepth, %)