update starting example (#1742)

update starting example
This commit is contained in:
Josh Gomez
2024-03-15 16:05:26 -07:00
committed by GitHub
parent 816870253e
commit 788ae5dbab

View File

@ -1,29 +1,36 @@
export const bracket = `const sigmaAllow = 15000 // psi export const bracket = `// Mounting Plate
const width = 11 // inch // A flat piece of material, often metal or plastic, that serves as a support or base for attaching, securing, or mounting various types of equipment, devices, or components.
const p = 150 // Force on shelf - lbs
const distance = 12 // inches
const FOS = 2
const thickness = sqrt(distance * p * FOS * 6 / ( sigmaAllow * width ))
const filletR = thickness * 2
const shelfMountL = 9
const wallMountL = 8
const bracket = startSketchOn('XY') // Create a function that defines the body width and length of the mounting plate. Tag the corners so they can be passed through the fillet function.
|> startProfileAt([0, 0], %) fn rectShape = (pos, w, l) => {
|> line([0, wallMountL], %) const rr = startSketchOn('XY')
|> tangentialArc({ |> startProfileAt([pos[0] - (w / 2), pos[1] - (l / 2)], %)
radius: filletR, |> lineTo([pos[0] + w / 2, pos[1] - (l / 2)], %, 'edge1')
offset: 90 |> lineTo([pos[0] + w / 2, pos[1] + l / 2], %, 'edge2')
}, %) |> lineTo([pos[0] - (w / 2), pos[1] + l / 2], %, 'edge3')
|> line([-shelfMountL, 0], %) |> close(%, "edge4")
|> line([0, -thickness], %) return rr
|> line([shelfMountL, 0], %) }
|> tangentialArc({
radius: filletR - thickness, // Define the hole radius and x, y location constants
offset: -90 const holeRadius = 1
}, %) const holeIndex = 6
|> line([0, -wallMountL], %)
|> close(%) // Create the mounting plate extrusion, holes, and fillets
|> extrude(width, %) const part = rectShape([0, 0], 20, 20)
|> hole(circle([-holeIndex, holeIndex], holeRadius, %), %)
|> hole(circle([holeIndex, holeIndex], holeRadius, %), %)
|> hole(circle([-holeIndex, -holeIndex], holeRadius, %), %)
|> hole(circle([holeIndex, -holeIndex], holeRadius, %), %)
|> extrude(2, %)
|> fillet({
radius: 4,
tags: [
getNextAdjacentEdge("edge1", %),
getNextAdjacentEdge("edge2", %),
getNextAdjacentEdge("edge3", %),
getNextAdjacentEdge("edge4", %)
]
}, %)
` `