kcl-samples → bone-plate
bone-plate

KCL
// Bone Plate
// A bone plate is a medical device used in orthopedics to stabilize and fix bone fractures during the healing process. They are typically made of stainless steel or titanium and are secured to the bone with screws. Bone plates come in various types, including locking, compression, and bridge plates, each with specific applications
// Set units
@settings(defaultLengthUnit = mm)
// Define parameters
boltSize = 4.5
// Revolve the profile of a compression plate designed to fit a bone
plateRevolve = startSketchOn(YZ)
|> startProfile(at = [22.9, 0])
|> arc(angleStart = 180, angleEnd = 176, radius = 120)
|> arc(angleStart = -60, angleEnd = 54, radius = 5)
|> arc(angleStart = 180, angleEnd = 176, radius = 120)
|> arc(angleStart = -60, angleEnd = 54, radius = 5)
|> arc(angleStart = 180, angleEnd = 176, radius = 120)
|> arc(angleStart = -60, angleEnd = 54, radius = 5)
|> arc(angleStart = 180, angleEnd = 174, radius = 170)
|> tangentialArc(endAbsolute = [41.8, 91.88])
|> tangentialArc(endAbsolute = [56.92, 117.08], tag = $seg01)
|> angledLine(angle = tangentToEnd(seg01), length = 23.16)
|> tangentialArc(endAbsolute = [60.93, 140.44], tag = $seg02)
|> angledLine(angle = tangentToEnd(seg02), length = 25.65)
|> tangentialArc(endAbsolute = [48.35, 85.53])
|> tangentialArc(endAbsolute = [35.2, 67.73], tag = $seg03)
|> angledLine(angle = tangentToEnd(seg03), length = 49.06)
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
|> revolve(axis = Y, angle = 65, symmetric = true)
// Define a function to create and extrude holes
fn holeFn(@center) {
return startSketchOn(XZ)
|> circle(center = center, diameter = boltSize)
|> extrude(length = -100)
}
// Create a hole sketch with the size and location of each bolt hole
holeCenters = [
[0, 12.25],
[0, 29.5],
[0, 46.25],
[0, 77],
[0, 100],
[0, 130],
[-20, 130],
[20, 130]
]
// Use map to apply the hole creation function to the list of center coordinates
holes = map(holeCenters, f = holeFn)
// Cut each guiding clearance hole from the bone plate using a single subtract operation
solid = subtract([plateRevolve], tools = holes)