Created
May 30, 2019 00:31
-
-
Save pentacular/ae71ca96b25c2dd627b9de5624c4ab67 to your computer and use it in GitHub Desktop.
Lego Train Motor Assembly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let motor = microGearMotor({ shaftDiameter: 3.1 }).as('motor'); | |
let rear = cube(3.2 * 4, 16 - 0.2, 15 - 0.2).translate(0).as('rear'); | |
let studSheet = readShape({ path: 'studs3' }, () => lego.studSheet({ width: 16 - 0.2, length: 32 - 0.2 })); | |
let socketSheet = readShape({ path: 'sockets4' }, () => lego.socketSheet({ width: 16 - 0.2, length: 32 - 0.2, studDiameter: 5.1, play: 0 })); | |
let bevelGear = readShape({ path: 'bevelGear' }, () => readLDraw({ part: '6589.dat' })); | |
let gear = assemble(bevelGear.rotateX(90).translate(0, 0, -1), | |
cylinder(4, 8).translate(0, 0, 0)) | |
.translate(0, 0, 8 * 3) | |
.as('gear'); | |
let sheet = assemble( | |
studSheet, | |
socketSheet.drop('void').translate(0, 0, -1.6)) | |
.rotateY(90) | |
.translate(5.5); | |
let thing = assemble(rear, sheet, gear, motor); | |
thing.drop('motor', 'void', 'gear').writeStl({ path: 'rear2.stl', disjoint: false }); | |
thing.keep('gear').center().writeStl({ path: 'gear2.stl', disjoint: false }); | |
undefined; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment