Last active
January 6, 2018 19:55
-
-
Save Octogonapus/014bedaddb018881bbd422a064d44d06 to your computer and use it in GitHub Desktop.
Mount for 4 393 motors with central output shaft
This file contains hidden or 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
double baseX = 126, baseXTab = 12; | |
double baseY = 49, baseYArch = 60.5; | |
double baseZ = 20.5; | |
double hsAxleX = 6.35; | |
double screwRadius = 5/2; | |
double tabCutoutX = 20, tabCutoutY = 23; | |
double gearTooloffset = 2, motorToolOffset = 0.5; | |
Vitamins.setGitRepoDatabase("https://github.com/octogonapus/Hardware-Dimensions.git") | |
CSG base = Extrude.points(new Vector3d(0, 0, baseZ), | |
new Vector3d(0, 0), | |
new Vector3d(-baseXTab, 5.5), | |
new Vector3d(-baseXTab, 5.5 + 12), | |
new Vector3d(0, 5.5 + 12 + 5.5), | |
new Vector3d(0, baseY), | |
new Vector3d(36, baseY), | |
new Vector3d(36 + 12, baseYArch), | |
new Vector3d(36 + 12 + 30, baseYArch), | |
new Vector3d(36 + 12 + 30 + 12, baseY), | |
new Vector3d(baseX, baseY), | |
new Vector3d(baseX, 5.5 + 12 + 5.5), | |
new Vector3d(baseX + baseXTab, 5.5 + 12), | |
new Vector3d(baseX + baseXTab, 5.5), | |
new Vector3d(baseX, 0)); | |
base = base.movex(-base.getMinX()); //Move base so its bottom left corner is at (0, 0) | |
base = base.movex(base.getTotalX() / -2).movey(base.getTotalY() / -2); //Move base so it's centered | |
CSG hs36t = Vitamins.get("vexGear", "HS36T"); | |
hs36t = hs36t.movez(base.getMaxZ() - (hs36t.getTotalZ())); | |
base = base.difference(hs36t.hull().toolOffset(gearTooloffset)); | |
CSG hs12t = Vitamins.get("vexGear", "HS12T"); | |
hs12t = hs12t.movez(base.getMaxZ() - (hs12t.getTotalZ())); | |
hs12t = hs12t.movex((hs36t.getTotalX()) / 2); | |
hs12t = hs12t.movey((hs36t.getTotalY()) / 2); | |
hs12t = hs12t.movex(-2.1).movey(-2.1); | |
CSG topRight12t = hs12t.rotz(25); | |
CSG bottomRight12t = hs12t.rotz(90); | |
CSG bottomLeft12t = hs12t.rotz(180); | |
CSG topLeft12t = hs12t.rotz(360 - 90 - 25); | |
List<CSG> all12t = [topRight12t, bottomRight12t, bottomLeft12t, topLeft12t]; | |
base = base.difference(topRight12t.hull().toolOffset(gearTooloffset)); | |
base = base.difference(bottomRight12t.hull().toolOffset(gearTooloffset)); | |
base = base.difference(bottomLeft12t.hull().toolOffset(gearTooloffset)); | |
base = base.difference(topLeft12t.hull().toolOffset(gearTooloffset)); | |
CSG insertHole = new Cube(hsAxleX, hsAxleX, 100).toCSG().toolOffset(0.05); | |
base = base.difference(insertHole); //36t | |
for (CSG gear : all12t) { | |
//Move axle to center of gear and make cutout | |
base = base.difference(insertHole.movex(gear.getCenterX()).movey(gear.getCenterY())); | |
} | |
CSG oneBar = Vitamins.get("vexFlatSheet", "Aluminum 1x5"); | |
oneBar = oneBar.rotz(-90); //Point along y | |
oneBar = oneBar.movey(-oneBar.getMinY()); //Line up edge with x axis | |
oneBar = oneBar.movey(-oneBar.getTotalY()/2); | |
CSG screwHole = new Cylinder(screwRadius, screwRadius, 100, 80).toCSG(); | |
CSG oneBarHoleTop = screwHole.movey(oneBar.getMaxY() - screwHole.getMaxY() - 4); | |
base = base.difference(oneBarHoleTop); | |
CSG oneBarHoleBottom = screwHole.movey(oneBar.getMinY() - screwHole.getMinY() + 4.3); | |
base = base.difference(oneBarHoleBottom); | |
CSG leftMountHole1 = screwHole.movex(base.getMinX() - screwHole.getMinX() + 4.4).movey(base.getMinY() + 12.6); | |
base = base.difference(leftMountHole1); | |
CSG leftMountHole2 = screwHole.movex(base.getMinX() - screwHole.getMinX() + 14.9).movey(base.getMinY() + 11.6); | |
base = base.difference(leftMountHole2); | |
CSG rightMountHole1 = screwHole.movex(base.getMaxX() - screwHole.getMaxX() - 1.9).movey(base.getMinY() + 12.6); | |
base = base.difference(rightMountHole1); | |
CSG rightMountHole2 = screwHole.movex(base.getMaxX() - screwHole.getMaxX() - 14.6).movey(base.getMinY() + 11.6); | |
base = base.difference(rightMountHole2); | |
CSG mountHoleBar = Vitamins.get("vexFlatSheet", "Aluminum 1x5"); | |
mountHoleBar = mountHoleBar.union(mountHoleBar.movex(mountHoleBar.getTotalX())); | |
mountHoleBar = mountHoleBar.union(mountHoleBar.movex(mountHoleBar.getTotalX())); | |
mountHoleBar = mountHoleBar.movex(-mountHoleBar.getMinX()).movey(-mountHoleBar.getMinY()); | |
mountHoleBar = mountHoleBar.movex(base.getMinX() + 0.7).movey(base.getMinY() + 11.6 - mountHoleBar.getTotalY() / 2); | |
CSG tabCutout = new Cube(tabCutoutX, tabCutoutY, 100).toCSG(); | |
tabCutout = tabCutout.movex(-tabCutout.getMinX()).movey(-tabCutout.getMinY()); //Put bottom left corner at (0, 0) | |
tabCutout = tabCutout.movex(base.getMinX()).movey(base.getMinY()).movez(-tabCutout.getMinZ()); | |
tabCutout = tabCutout.movez(5.4); | |
base = base.difference(tabCutout); | |
base = base.difference(tabCutout.movex(base.getTotalX() - tabCutout.getTotalX())); | |
CSG motor = Vitamins.get("vexMotor", "393"); | |
motor = motor.roty(180).rotz(90); | |
CSG topRightMotor = motor.movex(topRight12t.getCenterX()).movey(topRight12t.getCenterY()).movez(base.getMaxZ() - motor.getMinZ()); | |
topRightMotor = topRightMotor.movez(-14.5); | |
base = base.difference(topRightMotor.toolOffset(motorToolOffset)); | |
CSG bottomRightMotor = motor.movex(bottomRight12t.getCenterX()).movey(bottomRight12t.getCenterY()).movez(base.getMaxZ() - motor.getMinZ()); | |
bottomRightMotor = bottomRightMotor.movez(-14.5); | |
base = base.difference(bottomRightMotor.toolOffset(motorToolOffset)); | |
CSG otherMotor = Vitamins.get("vexMotor", "393"); | |
otherMotor = otherMotor.roty(180).rotz(-90); | |
CSG bottomLeftMotor = otherMotor.movex(bottomLeft12t.getCenterX()).movey(bottomLeft12t.getCenterY()).movez(base.getMaxZ() - otherMotor.getMinZ()); | |
bottomLeftMotor = bottomLeftMotor.movez(-14.5); | |
base = base.difference(bottomLeftMotor.toolOffset(motorToolOffset)); | |
CSG topLeftMotor = otherMotor.movex(topLeft12t.getCenterX()).movey(topLeft12t.getCenterY()).movez(base.getMaxZ() - otherMotor.getMinZ()); | |
topLeftMotor = topLeftMotor.movez(-14.5); | |
base = base.difference(topLeftMotor.toolOffset(motorToolOffset)); | |
hs36t.setName("hs36t") | |
hs12t.setName("hs12t") | |
CSG foo = Vitamins.get("vexCchannel", "Aluminum 5x15"); | |
foo = foo.movex(base.getMinX()).movey(base.getMinY()) | |
base = base.movey(-5.4); //To line up motor hole with plate | |
base.setName("base"); | |
return [base, foo, topRightMotor] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment