Created
June 19, 2019 02:15
-
-
Save boxysean/f1522de0bb1ee557c25d93da20736d71 to your computer and use it in GitHub Desktop.
Outside corner for fixing da cubes
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
// All units inches | |
var extrude_ = 0.1; | |
var nutSize = 0.375; | |
var threadDiameter = 0.22; | |
var screwPosition = [0.5, 0.5]; | |
function makeHalf() { | |
var half = polygon([ | |
[0,0.7], | |
[0.7,0], | |
[1,0], | |
[1,0.3], | |
[0.3,1], | |
[0,1], | |
]); | |
// var cutOut = circle({r: 0.66, center: true}); | |
// half = difference(half, cutOut); | |
return half; | |
} | |
function makeSide() { | |
var outside = makeHalf(); | |
var thread = circle({r: threadDiameter/2.0, center: true}) | |
.translate(screwPosition); | |
outside = difference(outside, thread); | |
outside = linear_extrude({height: extrude_}, outside); | |
return outside; | |
var inside = makeHalf(); | |
// var nut = square({size: [nutSize, nutSize], center: true}) | |
// .rotateZ(45) | |
// .translate(screwPosition); | |
// inside = difference(inside, nut); | |
inside = linear_extrude({height: extrude_ / 2.0}, inside); | |
inside = inside.translate([0, 0, extrude_ / 2.0]); | |
var side = union(inside, outside); | |
return side; | |
} | |
function main() { | |
s1 = makeSide(); | |
s2 = makeSide().mirroredZ().rotateX(90); | |
s3 = makeSide().mirroredZ().rotateY(-90); | |
return union(s1, s2, s3).scale(10); | |
// return s1.scale(10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment