kcl-samples

bracket

bracket

KCL

// Bracket
// This is a bracket that holds a shelf. It is made of aluminum and is designed to hold a force of 150 lbs. The bracket is 6 inches wide and the force is applied 6 inches from the wall. The bracket has a factor of safety of 2. The legs of the bracket are 5 inches and 8 inches long. The thickness of the bracket is calculated from the constrained provided. The inner and outer edges of the bend are filleted with a radius of 3/8 inch.

// define constants
const sigmaAllow = 15000 // psi
const width = 6 // inch
const p = 150 // Force on shelf - lbs
const distance = 6 // inches
const factorOfSafety = 2
const leg1 = 5 // inches
const leg2 = 8 // inches
const filletRadius = .375

// calculate required thickness of bracket
const thickness = sqrt(distance * p * factorOfSafety * 6 / (sigmaAllow * width))

// Sketch the bracket body and fillet the inner and outer edges of the bend
const bracket = startSketchOn('XY')
  |> startProfileAt([0,0], %)
  |> line([-leg2, 0], %, 'outerFillet')
  |> line([0, -leg1], %)
  |> line([thickness, 0], %)
  |> line([0, leg1-thickness], %, 'innerFillet')
  |> line([leg2-thickness, 0], %)
  |> close(%)
  |> extrude(width, %)
  |> fillet({
       radius: filletRadius,
       tags: [getPreviousAdjacentEdge('innerFillet', %)]
     }, %)
  |> fillet({
    radius: filletRadius + thickness,
    tags: [getPreviousAdjacentEdge('outerFillet', %)]
  }, %)