2025-03-06 18:01:24 -05:00
// 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.
// Set units
@settings(defaultLengthUnit = in)
2025-04-04 11:03:13 -07:00
// Define parameters
2025-03-06 18:01:24 -05:00
outsideDiameter = 1.625
sphereDia = 0.25
shaftDia = 0.75
overallThickness = 0.313
wallThickness = 0.100
overHangLength = .3
nBalls = 10
chainWidth = sphereDia / 2
chainThickness = sphereDia / 8
linkDiameter = sphereDia / 4
// Sketch the inside bearing piece
2025-03-26 08:53:34 -07:00
insideWallSketch = startSketchOn(offsetPlane(XY, offset = -overallThickness / 2))
|> circle(center = [0, 0], radius = shaftDia / 2 + wallThickness)
|> hole(circle(center = [0, 0], radius = shaftDia / 2), %)
2025-03-06 18:01:24 -05:00
// Extrude the inside bearing piece
insideWall = extrude(insideWallSketch, length = overallThickness)
// Create the sketch of one of the balls
2025-03-26 08:53:34 -07:00
ballsSketch = startSketchOn(XY)
2025-03-06 18:01:24 -05:00
|> startProfileAt([shaftDia / 2 + wallThickness, 0.001], %)
2025-04-18 17:40:44 -05:00
|> arc(angleStart = 180, angleEnd = 0, radius = sphereDia / 2)
2025-03-06 18:01:24 -05:00
|> close()
// Revolve the ball to make a sphere and pattern around the inside wall
2025-04-03 22:44:52 +13:00
balls = revolve(ballsSketch, axis = X)
2025-03-06 18:01:24 -05:00
|> patternCircular3d(
arcDegrees = 360,
axis = [0, 0, 1],
center = [0, 0, 0],
instances = nBalls,
2025-03-26 08:53:34 -07:00
rotateDuplicates = true,
2025-03-06 18:01:24 -05:00
)
// Create the sketch for the chain around the balls
2025-03-26 08:53:34 -07:00
chainSketch = startSketchOn(XY)
2025-03-06 18:01:24 -05:00
|> startProfileAt([
shaftDia / 2 + wallThickness + sphereDia / 2 - (chainWidth / 2),
0.125 * sin(toRadians(60))
], %)
2025-04-18 17:40:44 -05:00
|> arc(angleStart = 120, angleEnd = 60, radius = sphereDia / 2)
2025-03-06 18:01:24 -05:00
|> line(end = [0, chainThickness])
|> line(end = [-chainWidth, 0])
|> close()
// Revolve the chain sketch
2025-04-03 22:44:52 +13:00
chainHead = revolve(chainSketch, axis = X)
2025-03-06 18:01:24 -05:00
|> patternCircular3d(
arcDegrees = 360,
axis = [0, 0, 1],
center = [0, 0, 0],
instances = nBalls,
2025-03-26 08:53:34 -07:00
rotateDuplicates = true,
2025-03-06 18:01:24 -05:00
)
// Create the sketch for the links in between the chains
2025-03-26 08:53:34 -07:00
linkSketch = startSketchOn(XZ)
2025-03-06 18:01:24 -05:00
|> circle(
center = [
shaftDia / 2 + wallThickness + sphereDia / 2,
0
],
2025-03-26 08:53:34 -07:00
radius = linkDiameter / 2,
2025-03-06 18:01:24 -05:00
)
// Revolve the link sketch
2025-04-03 22:44:52 +13:00
linkRevolve = revolve(linkSketch, axis = Y, angle = 360 / nBalls)
2025-03-06 18:01:24 -05:00
|> patternCircular3d(
arcDegrees = 360,
axis = [0, 0, 1],
center = [0, 0, 0],
instances = nBalls,
2025-03-26 08:53:34 -07:00
rotateDuplicates = true,
2025-03-06 18:01:24 -05:00
)
// Create the sketch for the outside walls
2025-03-26 08:53:34 -07:00
outsideWallSketch = startSketchOn(offsetPlane(XY, offset = -overallThickness / 2))
|> circle(center = [0, 0], radius = outsideDiameter / 2)
|> hole(circle(center = [0, 0], radius = shaftDia / 2 + wallThickness + sphereDia), %)
2025-03-06 18:01:24 -05:00
2025-04-04 12:55:21 -07:00
outsideWall = extrude(outsideWallSketch, length = overallThickness)