1
0
Fork 0
mirror of https://github.com/Luzifer/3dmodels.git synced 2024-12-23 02:41:19 +00:00

Add vents to housing for env sensors

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-01-03 18:16:53 +01:00
parent 17b0d31b95
commit b50433f5bb
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
3 changed files with 19222 additions and 7083 deletions

View file

@ -6,4 +6,4 @@ In case you have use for those models thankfully to Github you can preview all m
| Model | Source | Version | Title | | Model | Source | Version | Title |
| ----- | ------ | ------- | ----- | | ----- | ------ | ------- | ----- |
| [`sonoff_dev_housing.stl`](sonoff_dev_housing.stl) | [`sonoff_dev_housing.jscad`](sonoff_dev_housing.jscad) | 0.1 | Sonoff DEV box for lamp post | | [`sonoff_dev_housing.stl`](sonoff_dev_housing.stl) | [`sonoff_dev_housing.jscad`](sonoff_dev_housing.jscad) | 0.2 | Sonoff DEV box for lamp post |

View file

@ -1,8 +1,6 @@
// title : Sonoff DEV box for lamp post // title : Sonoff DEV box for lamp post
// author : Knut Ahlers // author : Knut Ahlers
// license : MIT License // revision : 0.2
// revision : 0.1
// file : sonoff_dev_lamp.jscad
// All measurements in mm // All measurements in mm
const innerSpace = 15 // free room on the inside from the board not to bend the cables that hard const innerSpace = 15 // free room on the inside from the board not to bend the cables that hard
@ -16,167 +14,212 @@ const lampPostSupport = lampPostRadius + 4.5 // adjust for proper grip
const screwBaseSize = 3 // block to screw the screw into const screwBaseSize = 3 // block to screw the screw into
const screwHeadRadius = 1.25 // screw head diameter = 2*screwHeadRadius const screwHeadRadius = 1.25 // screw head diameter = 2*screwHeadRadius
const screwDiameter = 0.4 // diameter for the hole the screw is screwed into const screwDiameter = 0.4 // diameter for the hole the screw is screwed into
const ventSize = 1
const ventWidth = (boardSize + innerSpace - 5 * ventSize) / 2
const wall = 2.5 // wall thickness const wall = 2.5 // wall thickness
function addVents(obj) {
const ventRow = difference(
union(
cube({ size: [
boardSize + innerSpace + wall + 10,
ventWidth * 2 + ventSize,
ventSize,
], center: true }),
cube({ size: [
ventWidth * 2 + ventSize,
boardSize + innerSpace + wall + 10,
ventSize,
], center: true })
),
union(
cube({ size: [
boardSize + innerSpace + wall + 10,
ventSize * 3,
ventSize
], center: true}),
cube({ size: [
ventSize * 3,
boardSize + innerSpace + wall + 10,
ventSize
], center: true})
)
)
const endZ = ((innerSpaceHeight + wall) / 2) * -1 + 1.5 * ventSize
const startZ = ((innerSpaceHeight + wall) / 2) - 2 * ventSize - wall
for (let z = startZ; z >= endZ; z -= 3 * ventSize) {
obj = difference(
obj,
ventRow.translate([0, 0, z])
)
}
return obj
}
function main() { function main() {
const boardSupport = cylinder({ const boardSupport = cylinder({
h: boardSupportHeight + wall, h: boardSupportHeight + wall,
r: boardSupportRadius, r: boardSupportRadius,
center: true, center: true,
}) })
const screwHeadSink = sphere({ const screwHeadSink = sphere({
r: screwHeadRadius, r: screwHeadRadius,
center: true, center: true,
}) })
const screwHole = cylinder({ const screwHole = cylinder({
h: screwBaseSize, h: screwBaseSize,
r: screwDiameter, r: screwDiameter,
center: true, center: true,
}) })
const screwBase = difference( const screwBase = difference(
cube({ size: [screwBaseSize, screwBaseSize, screwBaseSize], center: true }), cube({ size: [screwBaseSize, screwBaseSize, screwBaseSize], center: true }),
screwHole screwHole
) )
return [ return [
// Housing without lid // Housing without lid
union( union(
// Housing with holder // Housing with holder
difference( addVents(
union( difference(
// Main housing block union(
cube({ size: [ // Main housing block
boardSize + innerSpace + wall, cube({ size: [
boardSize + innerSpace + wall, boardSize + innerSpace + wall,
innerSpaceHeight + wall, boardSize + innerSpace + wall,
], center: true }), innerSpaceHeight + wall,
// Lamp post holder ], center: true }),
difference( // Lamp post holder
cylinder({ difference(
h: boardSize + innerSpace + wall, cylinder({
r: lampPostSupport, h: boardSize + innerSpace + wall,
center: true, r: lampPostSupport,
resolution: 100, center: true,
}), resolution: 100,
cylinder({ }),
h: boardSize + innerSpace + wall, cylinder({
r: lampPostRadius, h: boardSize + innerSpace + wall,
center: true, r: lampPostRadius,
resolution: 100, center: true,
}).translate([-7.5, 0, 0]) resolution: 100,
) }).translate([-7.5, 0, 0])
.rotateY(90) )
.translate([0, 0, (innerSpaceHeight + wall)/2]) .rotateY(90)
), .translate([0, 0, (innerSpaceHeight + wall)/2])
// Inner housing ),
cube({ size: [
boardSize + innerSpace,
boardSize + innerSpace,
innerSpaceHeight,
], center: true }).translate([0, 0, wall * -1])
),
// Board supports // Inner housing
translate([ cube({ size: [
boardSize / 2 - boardSupportEdgeDist, boardSize + innerSpace,
boardSize / 2 - boardSupportEdgeDist, boardSize + innerSpace,
(innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2, innerSpaceHeight,
], boardSupport), ], center: true }).translate([0, 0, wall * -1])
translate([ )
(boardSize / 2 - boardSupportEdgeDist) * -1, ),
boardSize / 2 - boardSupportEdgeDist,
(innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2,
], boardSupport),
translate([
boardSize / 2 - boardSupportEdgeDist,
(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 // Board supports
translate([ translate([
(boardSize + innerSpace) / 2 - screwBaseSize / 2, boardSize / 2 - boardSupportEdgeDist,
(boardSize + innerSpace) / 2 - screwBaseSize / 2, boardSize / 2 - boardSupportEdgeDist,
((innerSpaceHeight + wall) / 2 - screwBaseSize / 2) * -1, (innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2,
], screwBase), ], boardSupport),
translate([ translate([
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1, (boardSize / 2 - boardSupportEdgeDist) * -1,
(boardSize + innerSpace) / 2 - screwBaseSize / 2, boardSize / 2 - boardSupportEdgeDist,
((innerSpaceHeight + wall) / 2 - screwBaseSize / 2) * -1, (innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2,
], screwBase), ], boardSupport),
translate([ translate([
(boardSize + innerSpace) / 2 - screwBaseSize / 2, boardSize / 2 - boardSupportEdgeDist,
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1, (boardSize / 2 - boardSupportEdgeDist) * -1,
((innerSpaceHeight + wall) / 2 - screwBaseSize / 2) * -1, (innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2,
], screwBase), ], boardSupport),
translate([ translate([
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1, (boardSize / 2 - boardSupportEdgeDist) * -1,
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1, (boardSize / 2 - boardSupportEdgeDist) * -1,
((innerSpaceHeight + wall) / 2 - screwBaseSize / 2) * -1, (innerSpaceHeight + wall) / 2 - (boardSupportHeight + wall) / 2,
], screwBase) ], boardSupport),
).translate([(boardSize + innerSpace + wall + 5) * -0.5, 0, (innerSpaceHeight + wall)/2]),
// Lid // Screw bases
difference( translate([
cube({ size: [ (boardSize + innerSpace) / 2 - screwBaseSize / 2,
boardSize + innerSpace + wall, (boardSize + innerSpace) / 2 - screwBaseSize / 2,
boardSize + innerSpace + wall, ((innerSpaceHeight + wall) / 2 - screwBaseSize / 2) * -1,
wall, ], screwBase),
], center: true }), 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]),
// Screw holes // Lid
translate([ difference(
(boardSize + innerSpace) / 2 - screwBaseSize / 2, cube({ size: [
(boardSize + innerSpace) / 2 - screwBaseSize / 2, boardSize + innerSpace + wall,
0, boardSize + innerSpace + wall,
], screwHole), wall,
translate([ ], center: true }),
((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 // Screw holes
translate([ translate([
(boardSize + innerSpace) / 2 - screwBaseSize / 2, (boardSize + innerSpace) / 2 - screwBaseSize / 2,
(boardSize + innerSpace) / 2 - screwBaseSize / 2, (boardSize + innerSpace) / 2 - screwBaseSize / 2,
screwHeadRadius - wall / 3, 0,
], screwHeadSink), ], screwHole),
translate([ translate([
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1, ((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
(boardSize + innerSpace) / 2 - screwBaseSize / 2, (boardSize + innerSpace) / 2 - screwBaseSize / 2,
screwHeadRadius - wall / 3, 0,
], screwHeadSink), ], screwHole),
translate([ translate([
(boardSize + innerSpace) / 2 - screwBaseSize / 2, (boardSize + innerSpace) / 2 - screwBaseSize / 2,
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1, ((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
screwHeadRadius - wall / 3, 0,
], screwHeadSink), ], screwHole),
translate([ translate([
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1, ((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1, ((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
screwHeadRadius - wall / 3, 0,
], screwHeadSink) ], screwHole),
).translate([(boardSize + innerSpace + wall + 5) * 0.5, 0, wall/2])
] // 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:

File diff suppressed because it is too large Load diff