2025-03-27 10:57:01 -04:00
|
|
|
// Makeup Mirror
|
|
|
|
// A circular vanity mirror mounted on a swiveling arm with pivot joints, used for personal grooming.
|
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Set units
|
2025-03-27 10:57:01 -04:00
|
|
|
@settings(defaultLengthUnit = mm)
|
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Hinge parameters
|
2025-03-27 10:57:01 -04:00
|
|
|
hingeRadius = 8
|
|
|
|
hingeHeight = hingeRadius * 3
|
|
|
|
hingeGap = 0.5
|
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Arm parameters
|
2025-03-27 10:57:01 -04:00
|
|
|
armLength = 170
|
|
|
|
armRadius = 5
|
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Mirror parameters
|
2025-03-27 10:57:01 -04:00
|
|
|
mirrorRadius = 170 / 2
|
|
|
|
mirrorThickness = 10
|
|
|
|
archToMirrorGap = 5
|
|
|
|
archThickness = 1
|
|
|
|
archRadius = mirrorRadius + archToMirrorGap
|
|
|
|
|
|
|
|
// Geometry
|
2025-04-04 12:55:21 -07:00
|
|
|
// Add a function to create the hinge
|
2025-03-27 10:57:01 -04:00
|
|
|
fn hingeFn(x, y, z) {
|
|
|
|
hingeBody = startSketchOn(offsetPlane(XY, offset = z))
|
|
|
|
|> circle(center = [x, y], radius = hingeRadius)
|
|
|
|
|> extrude(length = hingeHeight)
|
|
|
|
return hingeBody
|
|
|
|
}
|
|
|
|
|
|
|
|
hingePartA1 = hingeFn(0, 0, 0)
|
|
|
|
hingePartA2 = hingeFn(0, 0, hingeHeight + hingeGap)
|
|
|
|
hingePartA3 = hingeFn(0, 0, hingeHeight * 2 + hingeGap * 2)
|
|
|
|
|
|
|
|
hingePartB2 = hingeFn(armLength, 0, hingeHeight + hingeGap)
|
|
|
|
hingePartB3 = hingeFn(armLength, 0, hingeHeight * 2 + hingeGap * 2)
|
|
|
|
|
|
|
|
hingePartC2 = hingeFn(armLength, -armLength, hingeHeight * 2 + hingeGap * 2)
|
|
|
|
hingePartC3 = hingeFn(armLength, -armLength, hingeHeight * 3 + hingeGap * 3)
|
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Add a function to create the arm
|
2025-03-27 10:57:01 -04:00
|
|
|
fn armFn(plane, offset, altitude) {
|
|
|
|
armBody = startSketchOn(plane)
|
|
|
|
|> circle(center = [offset, altitude], radius = armRadius)
|
|
|
|
|> extrude(length = armLength)
|
|
|
|
return armBody
|
|
|
|
}
|
|
|
|
|
|
|
|
armPartA = armFn(YZ, 0, hingeHeight * 1.5 + hingeGap)
|
|
|
|
armPartB = armFn(XZ, armLength, hingeHeight * 2.5 + hingeGap * 2)
|
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Add a function to create the mirror
|
2025-03-27 10:57:01 -04:00
|
|
|
fn mirrorFn(plane, offsetX, offsetY, altitude, radius, tiefe, gestellR, gestellD) {
|
2025-03-30 10:06:36 -07:00
|
|
|
armPlane = startSketchOn( offsetPlane(plane, offset = offsetY - (tiefe / 2)))
|
2025-03-27 10:57:01 -04:00
|
|
|
armBody = circle(armPlane, center = [offsetX, altitude], radius = radius)
|
|
|
|
|> extrude(length = tiefe)
|
|
|
|
|
2025-03-30 10:06:36 -07:00
|
|
|
archBody = startProfileAt([offsetX - gestellR, altitude], armPlane)
|
2025-03-27 10:57:01 -04:00
|
|
|
|> xLine(length = gestellD)
|
2025-04-18 17:40:44 -05:00
|
|
|
|> arc(interiorAbsolute = [offsetX, altitude - gestellR], endAbsolute = [offsetX + gestellR, altitude])
|
2025-03-27 10:57:01 -04:00
|
|
|
|> xLine(length = gestellD)
|
2025-04-18 17:40:44 -05:00
|
|
|
|> arc(
|
|
|
|
interiorAbsolute = [
|
2025-03-30 10:06:36 -07:00
|
|
|
offsetX,
|
|
|
|
altitude - gestellR - gestellD
|
|
|
|
],
|
2025-04-18 17:40:44 -05:00
|
|
|
endAbsolute = [profileStartX(%), profileStartY(%)],
|
|
|
|
)
|
2025-03-27 10:57:01 -04:00
|
|
|
|> close()
|
|
|
|
|> extrude(length = tiefe)
|
|
|
|
return armBody
|
|
|
|
}
|
|
|
|
|
2025-03-30 10:06:36 -07:00
|
|
|
mirror = mirrorFn(XZ, armLength, armLength, hingeHeight * 4 + hingeGap * 3 + mirrorRadius + archToMirrorGap + archThickness, mirrorRadius, mirrorThickness, archRadius, archThickness)
|