// Fan // Spinning axial fan that moves airflow // Set units @settings(defaultLengthUnit = mm) // Import parameters import * from "parameters.kcl" // Model the center of the fan fanCenter = startSketchOn(YZ) |> circle(center = [0, 0], radius = fanHeight / 2, tag = $centerBend) |> extrude(%, length = fanHeight) |> fillet(radius = 1.5, tags = [getOppositeEdge(centerBend)]) // Create a function for a lofted fan blade cross section that rotates about the center hub of the fan fn fanBlade(offsetHeight, startAngle) { fanBlade = startSketchOn(offsetPlane(YZ, offset = offsetHeight)) |> startProfile(at = [ 15 * cos(startAngle), 15 * sin(startAngle) ]) |> arc(angleStart = startAngle, angleEnd = startAngle + 14, radius = 15) |> arc( endAbsolute = [ fanSize * 22 / 50 * cos(startAngle - 20), fanSize * 22 / 50 * sin(startAngle - 20) ], interiorAbsolute = [ fanSize * 11 / 50 * cos(startAngle + 3), fanSize * 11 / 50 * sin(startAngle + 3) ], ) |> arc( endAbsolute = [ fanSize * 22 / 50 * cos(startAngle - 24), fanSize * 22 / 50 * sin(startAngle - 24) ], interiorAbsolute = [ fanSize * 22 / 50 * cos(startAngle - 22), fanSize * 22 / 50 * sin(startAngle - 22) ], ) |> arc( endAbsolute = [profileStartX(%), profileStartY(%)], interiorAbsolute = [ fanSize * 11 / 50 * cos(startAngle - 5), fanSize * 11 / 50 * sin(startAngle - 5) ], ) |> close() return fanBlade } // Loft the fan blade cross sections into a single blade, then pattern them about the fan center crossSections = [ fanBlade(offsetHeight = 4.5, startAngle = 50), fanBlade(offsetHeight = (fanHeight - 2 - 4) / 2, startAngle = 30), fanBlade(offsetHeight = fanHeight - 2, startAngle = 0) ] bladeLoft = loft(crossSections) |> patternCircular3d( instances = 9, axis = [1, 0, 0], center = [0, 0, 0], arcDegrees = 360, rotateDuplicates = true, ) [fanCenter, bladeLoft] |> appearance(color = "#110803")