2025-03-06 18:01:24 -05:00
// Shelf Bracket
// This is a bracket that holds a shelf. It is made of aluminum and is designed to hold a force of 300 lbs. The bracket is 6 inches wide and the force is applied at the end of the shelf, 12 inches from the wall. The bracket has a factor of safety of 1.2. The legs of the bracket are 5 inches and 2 inches long. The thickness of the bracket is calculated from the constraints provided.
// Define constants
sigmaAllow = 35000 // psi (6061-T6 aluminum)
2025-03-13 23:38:51 -07:00
width = 6 // inch
2025-03-06 18:01:24 -05:00
p = 300 // Force on shelf - lbs
factorOfSafety = 1.2 // FOS of 1.2
2025-03-13 23:38:51 -07:00
shelfMountL = 5 // inches
wallMountL = 2 // inches
2025-03-06 18:01:24 -05:00
shelfDepth = 12 // Shelf is 12 inches in depth from the wall
moment = shelfDepth * p // assume the force is applied at the end of the shelf to be conservative (lb-in)
// Calculate required thickness of bracket
thickness = sqrt(moment * factorOfSafety * 6 / (sigmaAllow * width)) // this is the calculation of two brackets holding up the shelf (inches)
2025-03-13 23:38:51 -07:00
filletRadius = .25
extFilletRadius = filletRadius + thickness
mountingHoleDiameter = 0.5
2025-03-06 18:01:24 -05:00
2025-03-13 23:38:51 -07:00
sketch001 = startSketchOn('XZ')
2025-03-06 18:01:24 -05:00
|> startProfileAt([0, 0], %)
2025-03-13 23:38:51 -07:00
|> xLine(length = shelfMountL - thickness, tag = $seg01)
|> yLine(length = thickness, tag = $seg02)
|> xLine(length = -shelfMountL, tag = $seg03)
|> yLine(length = -wallMountL, tag = $seg04)
|> xLine(length = thickness, tag = $seg05)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg06)
2025-03-06 18:01:24 -05:00
|> close()
2025-03-13 23:38:51 -07:00
|> extrude(%, length = width)
2025-03-06 18:01:24 -05:00
|> fillet(
radius = extFilletRadius,
2025-03-13 23:38:51 -07:00
tags = [getNextAdjacentEdge(seg03)],
2025-03-06 18:01:24 -05:00
)
|> fillet(
2025-03-13 23:38:51 -07:00
radius = filletRadius,
tags = [getNextAdjacentEdge(seg06)],
2025-03-06 18:01:24 -05:00
)
2025-03-13 23:38:51 -07:00
|> fillet(
radius = filletRadius,
tags = [seg02, getOppositeEdge(seg02)],
)
|> fillet(
radius = filletRadius,
tags = [seg05, getOppositeEdge(seg05)],
)
sketch002 = startSketchOn(sketch001, seg03)
|> circle(
center = [-1.25, 1],
radius = mountingHoleDiameter / 2,
)
|> patternLinear2d(
instances = 2,
distance = 2.5,
axis = [-1, 0],
)
|> patternLinear2d(
instances = 2,
distance = 4,
axis = [0, 1],
)
|> extrude(%, length = -thickness-.01)
sketch003 = startSketchOn(sketch001, seg04)
|> circle(
center = [1, -1],
radius = mountingHoleDiameter / 2,
)
|> patternLinear2d(
instances = 2,
distance = 4,
axis = [1, 0],
)
|> extrude(%, length = -thickness-0.1)