Created
December 29, 2017 21:52
-
-
Save Octogonapus/a5d739653e319263be6b1201bd6952e2 to your computer and use it in GitHub Desktop.
getInsert
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
CSG getInsert(boolean isRound) { | |
CSG roundPart = new Cylinder(10/2, 10/2, 1.2, 80).toCSG(); | |
CSG shaft = new Cube(6.4, 6.4, 5.15).toCSG(); | |
CSG axleHole; | |
if (isRound) { | |
double diameter = Math.sqrt(Math.pow(3.1, 2) + Math.pow(3.1, 2)); | |
axleHole = new Cylinder(diameter/2, diameter/2, 5.15, 80).toCSG(); | |
} else { | |
axleHole = new Cube(3.1, 3.1, 5.15).toCSG(); | |
} | |
return roundPart.union(shaft.toZMin()).difference(axleHole.toZMin()); | |
} | |
return getInsert(true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment