1
0
Fork 0
mirror of https://github.com/Luzifer/3dmodels.git synced 2024-10-18 13:14:18 +00:00
This commit is contained in:
Knut Ahlers 2020-01-03 15:07:04 +01:00
parent 4ca0dd66d9
commit 5c686b1f15
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -1,7 +1,7 @@
// title : Sonoff DEV box for lamp post // title : Sonoff DEV box for lamp post
// author : Knut Ahlers // author : Knut Ahlers
// license : MIT License // license : MIT License
// revision : 0.003 // revision : 0.1
// file : sonoff_dev_lamp.jscad // file : sonoff_dev_lamp.jscad
// All measurements in mm // All measurements in mm
@ -13,84 +13,170 @@ const boardSupportRadius = 1 // 2mm (holes do have 3mm)
const boardSupportEdgeDist = 2.5 // 2.5mm from the edges const boardSupportEdgeDist = 2.5 // 2.5mm from the edges
const lampPostRadius = 7.5 // 15mm diameter const lampPostRadius = 7.5 // 15mm diameter
const lampPostSupport = lampPostRadius + 4.5 // adjust for proper grip const lampPostSupport = lampPostRadius + 4.5 // adjust for proper grip
const screwBaseSize = 3 // block to screw the screw into
const screwHeadRadius = 1.25 // screw head diameter = 2*screwHeadRadius
const screwDiameter = 0.4 // diameter for the hole the screw is screwed into
const wall = 2.5 // wall thickness const wall = 2.5 // wall thickness
function main() { function main() {
return [ const boardSupport = cylinder({
union( h: boardSupportHeight + wall,
// Housing with holder r: boardSupportRadius,
difference( center: true,
union( })
// Main housing block
cube({ size: [ const screwHeadSink = sphere({
boardSize + innerSpace + wall, r: screwHeadRadius,
boardSize + innerSpace + wall, center: true,
innerSpaceHeight + wall, })
], center: true }),
// Lamp post holder const screwHole = cylinder({
difference( h: screwBaseSize,
cylinder({ r: screwDiameter,
h: boardSize + innerSpace + wall, center: true,
r: lampPostSupport, })
center: true,
resolution: 100, const screwBase = difference(
}), cube({ size: [screwBaseSize, screwBaseSize, screwBaseSize], center: true }),
cylinder({ screwHole
h: boardSize + innerSpace + wall, )
r: lampPostRadius,
center: true, return [
resolution: 100, // Housing without lid
}).translate([-7.5, 0, 0]) union(
) // Housing with holder
.rotateY(90) difference(
.translate([0, 0, (innerSpaceHeight + wall)/2]) union(
), // Main housing block
// Inner housing cube({ size: [
cube({ size: [ boardSize + innerSpace + wall,
boardSize + innerSpace, boardSize + innerSpace + wall,
boardSize + innerSpace, innerSpaceHeight + wall,
innerSpaceHeight, ], center: true }),
], center: true }).translate([0, 0, wall * -1]) // Lamp post holder
), difference(
// Board supports cylinder({
cylinder({ h: boardSize + innerSpace + wall,
h: boardSupportHeight + wall, r: lampPostSupport,
r: boardSupportRadius, center: true,
center: true, resolution: 100,
}).translate([ }),
boardSize / 2 - boardSupportEdgeDist, cylinder({
boardSize / 2 - boardSupportEdgeDist, h: boardSize + innerSpace + wall,
(innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2, r: lampPostRadius,
]), center: true,
cylinder({ resolution: 100,
h: boardSupportHeight + wall, }).translate([-7.5, 0, 0])
r: boardSupportRadius, )
center: true, .rotateY(90)
}).translate([ .translate([0, 0, (innerSpaceHeight + wall)/2])
(boardSize / 2 - boardSupportEdgeDist) * -1, ),
boardSize / 2 - boardSupportEdgeDist, // Inner housing
(innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2, cube({ size: [
]), boardSize + innerSpace,
cylinder({ boardSize + innerSpace,
h: boardSupportHeight + wall, innerSpaceHeight,
r: boardSupportRadius, ], center: true }).translate([0, 0, wall * -1])
center: true, ),
}).translate([
boardSize / 2 - boardSupportEdgeDist, // Board supports
(boardSize / 2 - boardSupportEdgeDist) * -1, translate([
(innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2, boardSize / 2 - boardSupportEdgeDist,
]), boardSize / 2 - boardSupportEdgeDist,
cylinder({ (innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2,
h: boardSupportHeight + wall, ], boardSupport),
r: boardSupportRadius, translate([
center: true, (boardSize / 2 - boardSupportEdgeDist) * -1,
}).translate([ boardSize / 2 - boardSupportEdgeDist,
(boardSize / 2 - boardSupportEdgeDist) * -1, (innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2,
(boardSize / 2 - boardSupportEdgeDist) * -1, ], boardSupport),
(innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2, translate([
]) boardSize / 2 - boardSupportEdgeDist,
).translate([0, 0, (innerSpaceHeight + wall)/2]) (boardSize / 2 - boardSupportEdgeDist) * -1,
] (innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2,
], boardSupport),
translate([
(boardSize / 2 - boardSupportEdgeDist) * -1,
(boardSize / 2 - boardSupportEdgeDist) * -1,
(innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2,
], boardSupport),
// Screw bases
translate([
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
((innerSpaceHeight + wall) / 2 - screwBaseSize / 2) * -1,
], screwBase),
translate([
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
((innerSpaceHeight + wall) / 2 - screwBaseSize / 2) * -1,
], screwBase),
translate([
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
((innerSpaceHeight + wall) / 2 - screwBaseSize / 2) * -1,
], screwBase),
translate([
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
((innerSpaceHeight + wall) / 2 - screwBaseSize / 2) * -1,
], screwBase)
).translate([(boardSize + innerSpace + wall + 5) * -0.5, 0, (innerSpaceHeight + wall)/2]),
// Lid
difference(
cube({ size: [
boardSize + innerSpace + wall,
boardSize + innerSpace + wall,
wall,
], center: true }),
// Screw holes
translate([
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
0,
], screwHole),
translate([
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
0,
], screwHole),
translate([
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
0,
], screwHole),
translate([
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
0,
], screwHole),
// Screw head sinks
translate([
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
screwHeadRadius - wall / 3,
], screwHeadSink),
translate([
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
screwHeadRadius - wall / 3,
], screwHeadSink),
translate([
(boardSize + innerSpace) / 2 - screwBaseSize / 2,
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
screwHeadRadius - wall / 3,
], screwHeadSink),
translate([
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
screwHeadRadius - wall / 3,
], screwHeadSink)
).translate([(boardSize + innerSpace + wall + 5) * 0.5, 0, wall/2])
]
} }
// vim: set ft=javascript: // vim: set ft=javascript: