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

Apply linter rules

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-01-04 05:05:10 +01:00
parent 4fe263c48b
commit 1452ae72f8
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -41,18 +41,18 @@ function addVents(obj) {
cube({ size: [ cube({ size: [
boardSize + innerSpace + wall + 10, boardSize + innerSpace + wall + 10,
ventSize * 3, ventSize * 3,
ventSize ventSize,
], center: true }), ], center: true }),
cube({ size: [ cube({ size: [
ventSize * 3, ventSize * 3,
boardSize + innerSpace + wall + 10, boardSize + innerSpace + wall + 10,
ventSize ventSize,
], center: true }) ], center: true })
) )
) )
const endZ = ((innerSpaceHeight + wall) / 2) * -1 + 1.5 * ventSize const endZ = (innerSpaceHeight + wall) / 2 * -1 + 1.5 * ventSize
const startZ = ((innerSpaceHeight + wall) / 2) - 2 * ventSize - wall const startZ = (innerSpaceHeight + wall) / 2 - 2 * ventSize - wall
for (let z = startZ; z >= endZ; z -= 3 * ventSize) { for (let z = startZ; z >= endZ; z -= 3 * ventSize) {
obj = difference( obj = difference(
obj, obj,
@ -63,6 +63,7 @@ function addVents(obj) {
return obj return obj
} }
/* exported main */
function main() { function main() {
const boardSupport = cylinder({ const boardSupport = cylinder({
h: boardSupportHeight + wall, h: boardSupportHeight + wall,
@ -92,8 +93,7 @@ function main() {
// Housing with holder // Housing with holder
difference( difference(
union( union(
addVents( addVents(difference(
difference(
union( union(
// Main housing block // Main housing block
cube({ size: [ cube({ size: [
@ -127,14 +127,13 @@ function main() {
boardSize + innerSpace, boardSize + innerSpace,
innerSpaceHeight, innerSpaceHeight,
], center: true }).translate([0, 0, wall * -0.5]) ], center: true }).translate([0, 0, wall * -0.5])
) )),
),
// Outer border of power inlet // Outer border of power inlet
cube({ size: [wall, powerInletWidth + wall * 2, powerInletHeight + wall * 2], center: true }) cube({ size: [wall, powerInletWidth + wall * 2, powerInletHeight + wall * 2], center: true })
.translate([ .translate([
(boardSize + innerSpace + wall) / 2, (boardSize + innerSpace + wall) / 2,
powerInletPosY, powerInletPosY,
(innerSpaceHeight + wall) / 2 - (wall + powerInletHeight / 2) (innerSpaceHeight + wall) / 2 - (wall + powerInletHeight / 2),
]) ])
), ),
// Inner space of power inlet // Inner space of power inlet
@ -142,7 +141,7 @@ function main() {
.translate([ .translate([
(boardSize + innerSpace + wall) / 2, (boardSize + innerSpace + wall) / 2,
powerInletPosY, powerInletPosY,
(innerSpaceHeight + wall) / 2 - (wall + powerInletHeight / 2) (innerSpaceHeight + wall) / 2 - (wall + powerInletHeight / 2),
]) ])
), ),
@ -242,7 +241,7 @@ function main() {
((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1, ((boardSize + innerSpace) / 2 - screwBaseSize / 2) * -1,
screwHeadRadius - wall / 3, screwHeadRadius - wall / 3,
], screwHeadSink) ], screwHeadSink)
).translate([(boardSize + innerSpace + wall + 5) * 0.5, 0, wall/2]) ).translate([(boardSize + innerSpace + wall + 5) * 0.5, 0, wall / 2]),
] ]
} }