kcl-samples → ball-bearing

ball-bearing

ball-bearing

KCL

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

// Define constants like ball diameter, inside diamter, overhange length, and thickness
const outsideDiameter = 1.625 // inches
const sphereDia = 0.25 // inches
const shaftDia = 0.75 // inches
const overallThickness = 0.313 // inches
const wallThickness = 0.100 // inches
const overHangLength = .3 // inches
const nBalls = 10 
const chainWidth = sphereDia/2 // inches
const chainThickness = sphereDia/8 // inches
const linkDiameter = sphereDia/4 // inches

const customPlane = {
  plane: {
    origin: { x: 0, y: 0, z: -overallThickness/2 },
    xAxis: { x: 1, y: 0, z: 0 },
    yAxis: { x: 0, y: 1, z: 0 },
    zAxis: { x: 0, y: 0, z: 1 }
  }
}

// Sketch the inside bearing piece
const insideWallSketch = startSketchOn(customPlane)
  |> circle([0, 0], shaftDia/2 + wallThickness, %)
  |> hole(circle([0, 0], shaftDia/2, %), %)

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

// Create the sketch of one of the balls
const ballsSketch = startSketchOn("XY")
  |> startProfileAt([shaftDia/2 + wallThickness, 0.001], %)
  |> arc({
    angleEnd: 0,
    angleStart: 180,
    radius: sphereDia/2,
  }, %)
  |> close(%)

// Revolve the ball to make a sphere and pattern around the inside wall
const balls = revolve({
    axis: "X",
  }, ballsSketch)
  |> patternCircular3d({
      arcDegrees: 360,
      axis: [0, 0, 1],
      center: [0, 0, 0],
      repetitions: nBalls-1,
      rotateDuplicates: true
  }, %)

// Create the sketch for the chain around the balls
const chainSketch = startSketchOn("XY")
  |> startProfileAt([shaftDia/2 + wallThickness + sphereDia/2 - chainWidth/2, 0.125 * sin(toRadians(60))], %)
  |> arc({
    angleEnd: 60,
    angleStart: 120,
    radius: sphereDia/2,
  }, %)
  |> line([0, chainThickness], %)
  |> line([-chainWidth, 0], %)
  |> close(%)

// Revolve the chain sketch
const chainHead = revolve({
    axis: "X",
  }, chainSketch)
  |> patternCircular3d({
    arcDegrees: 360,
    axis: [0, 0, 1],
    center: [0, 0, 0],
    repetitions: nBalls-1,
    rotateDuplicates: true,
  }, %)

// Create the sketch for the links in between the chains 
const linkSketch = startSketchOn("XZ")
  |> circle([shaftDia/2 + wallThickness + sphereDia/2, 0], linkDiameter/2, %)

// Revolve the link sketch
const linkRevolve = revolve({
    axis: 'Y',
    angle: 360/nBalls
  }, linkSketch)
  |> patternCircular3d({
    arcDegrees: 360,
    axis: [0, 0, 1],
    center: [0, 0, 0],
    repetitions: nBalls-1,
    rotateDuplicates: true,
  }, %)

// Create the sketch for the outside walls
const outsideWallSketch = startSketchOn(customPlane)
  |> circle([0, 0], outsideDiameter/2, %)
  |> hole(circle([0, 0], shaftDia/2 + wallThickness + sphereDia, %), %)

const outsideWall = extrude(overallThickness, outsideWallSketch)

// https://www.mcmaster.com/60355K185/