-
Notifications
You must be signed in to change notification settings - Fork 5
Project: Battery Holder
pentacular edited this page Aug 21, 2019
·
6 revisions
const Battery = ({ diameter = 18.5, height = 66 } = {}) =>
Cylinder({ apothem: diameter / 2, height })
.rotateY(90)
.as('battery');
const Bracket = () =>
assemble(
Cube(8 - 0.2, 32 - 0.2, 3.2 * 7 - 0.2),
Lego
.studSheet({ width: 8, length: 32, height: 3.2 })
.move(0, 0, 3.2 * 7 / 2),
Lego
.socketSheet({ width: 8, length: 32, height: 3.2 })
.move(0, 0, -3.2 * 7 / 2));
const assembly = assemble(
Bracket()
.move(-72 / 2)
.as('end'),
Bracket()
.move(72 / 2)
.as('start'),
Bracket()
.as('middle'),
Battery());
await assembly
.keep('middle')
.material('metal')
.color('beige')
.center()
.writeStl('bracket.stl');
await
assemble(
intersection(Cube(4, 32, 32),
Battery()),
Cube(4, 4, 2)
.move(0, 0, -2)
.drop(),
Cube(4, 4, 2)
.move(0, 0, 2)
.drop(),
Cylinder(0.5, 4)
.rotateY(90)
.drop())
.material('paper')
.color('beige')
.rotateY(90)
.writeStl('plug.stl');