2025-04-17 10:46:56 -07:00
|
|
|
// 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(XZ)
|
2025-04-25 16:01:35 -05:00
|
|
|
|> startProfile(at = [-0.0001, fanHeight])
|
2025-04-17 10:46:56 -07:00
|
|
|
|> xLine(endAbsolute = -15 + 1.5)
|
|
|
|
|> tangentialArc(radius = 1.5, angle = 90)
|
|
|
|
|> yLine(endAbsolute = 4.5)
|
|
|
|
|> xLine(endAbsolute = -13)
|
|
|
|
|> yLine(endAbsolute = profileStartY(%) - 5)
|
|
|
|
|> tangentialArc(radius = 1, angle = -90)
|
|
|
|
|> xLine(endAbsolute = -1)
|
|
|
|
|> yLine(length = 2)
|
|
|
|
|> xLine(length = -0.15)
|
|
|
|
|> line(endAbsolute = [
|
|
|
|
profileStartX(%) - 1,
|
|
|
|
profileStartY(%) - 1.4
|
|
|
|
])
|
|
|
|
|> xLine(endAbsolute = profileStartX(%))
|
|
|
|
|> yLine(endAbsolute = profileStartY(%))
|
|
|
|
|> close()
|
|
|
|
|> revolve(axis = {
|
|
|
|
direction = [0.0, 1.0],
|
|
|
|
origin = [0.0, 0.0]
|
|
|
|
})
|
|
|
|
|> appearance(color = "#f3e2d8")
|
|
|
|
|
|
|
|
// Create a function for a lofted fan blade cross section that rotates about the center hub of the fan
|
2025-04-29 08:41:31 +12:00
|
|
|
fn fanBlade(offsetHeight, startAngle: number(deg)) {
|
2025-04-17 10:46:56 -07:00
|
|
|
fanBlade = startSketchOn(offsetPlane(XY, offset = offsetHeight))
|
2025-04-25 16:01:35 -05:00
|
|
|
|> startProfile(at = [
|
2025-04-30 12:40:11 +12:00
|
|
|
15 * math::cos(startAngle),
|
|
|
|
15 * math::sin(startAngle)
|
2025-04-25 16:01:35 -05:00
|
|
|
])
|
2025-04-18 17:40:44 -05:00
|
|
|
|> arc(angleStart = startAngle, angleEnd = startAngle + 14, radius = 15)
|
|
|
|
|> arc(
|
|
|
|
endAbsolute = [
|
2025-04-30 12:40:11 +12:00
|
|
|
fanSize * 22 / 50 * math::cos(startAngle - 20),
|
|
|
|
fanSize * 22 / 50 * math::sin(startAngle - 20)
|
2025-04-17 10:46:56 -07:00
|
|
|
],
|
2025-04-18 17:40:44 -05:00
|
|
|
interiorAbsolute = [
|
2025-04-30 12:40:11 +12:00
|
|
|
fanSize * 11 / 50 * math::cos(startAngle + 3),
|
|
|
|
fanSize * 11 / 50 * math::sin(startAngle + 3)
|
2025-04-18 17:40:44 -05:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|> arc(
|
|
|
|
endAbsolute = [
|
2025-04-30 12:40:11 +12:00
|
|
|
fanSize * 22 / 50 * math::cos(startAngle - 24),
|
|
|
|
fanSize * 22 / 50 * math::sin(startAngle - 24)
|
2025-04-17 10:46:56 -07:00
|
|
|
],
|
2025-04-18 17:40:44 -05:00
|
|
|
interiorAbsolute = [
|
2025-04-30 12:40:11 +12:00
|
|
|
fanSize * 22 / 50 * math::cos(startAngle - 22),
|
|
|
|
fanSize * 22 / 50 * math::sin(startAngle - 22)
|
2025-04-18 17:40:44 -05:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|> arc(
|
|
|
|
endAbsolute = [profileStartX(%), profileStartY(%)],
|
|
|
|
interiorAbsolute = [
|
2025-04-30 12:40:11 +12:00
|
|
|
fanSize * 11 / 50 * math::cos(startAngle - 5),
|
|
|
|
fanSize * 11 / 50 * math::sin(startAngle - 5)
|
2025-04-18 17:40:44 -05:00
|
|
|
],
|
|
|
|
)
|
2025-04-17 10:46:56 -07:00
|
|
|
|> close()
|
|
|
|
return fanBlade
|
|
|
|
}
|
|
|
|
|
|
|
|
// Loft the fan blade cross sections into a single blade, then pattern them about the fan center
|
|
|
|
loft([
|
|
|
|
fanBlade(4.5, 50),
|
|
|
|
fanBlade((fanHeight - 2 - 4) / 2, 30),
|
|
|
|
fanBlade(fanHeight - 2, 0)
|
|
|
|
])
|
|
|
|
|> appearance(color = "#f3e2d8")
|
|
|
|
|> patternCircular3d(
|
|
|
|
%,
|
|
|
|
instances = 9,
|
|
|
|
axis = [0, 0, 1],
|
|
|
|
center = [0, 0, 0],
|
|
|
|
arcDegrees = 360,
|
|
|
|
rotateDuplicates = true,
|
|
|
|
)
|