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
| someVar = adjustedUSize == 2 | |
| ? stabilizerDistances[0] | |
| : keyUSize == 3 | |
| ? stabilizerDistances[1] | |
| : keyUSize == 6.25 | |
| ? stabilizerDistances[2] | |
| : keyUSize == 7 | |
| ? stabilizerDistances[3] | |
| : keyUSize > 7 && keyUSize < 11 | |
| ? stabilizerDistances[4] |
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
| $fn = 100; | |
| module roundedCube(length = 50, width = 40, height = 10, roundedRadius = 2) { | |
| linear_extrude(height) roundedSquare(length = length, width = width, roundedRadius = roundedRadius); | |
| } | |
| //This is a 2d object | |
| module roundedSquare(length = 50, width = 40, roundedRadius = 2) { | |
| adjustedLength = length - roundedRadius; | |
| adjustedWidth = width - roundedRadius; |
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
| function getOvalPoints(numOfPoints = 16, width = 4, height = 1, degreesAround = 360) = [ | |
| let(degreesPerPoint = degreesAround / numOfPoints) | |
| for (point = [0 : numOfPoints - 1]) | |
| let(angle = degreesPerPoint * point) | |
| ovalPoint(angle, width, height) | |
| ]; | |
| //returns [x,y] position of point given height and width of oval | |
| function ovalPoint(angle, width, height) = | |
| [height * sin(angle), width * cos(angle)]; |