Skip to content

@codehero /gist:8274288
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
badly behaving jscad file
function getParameterDefinitions(){
return [
{
"name" : "showBuildPlate"
,"type" : "choice"
,"values" : [
"none"
,"ToM"
]
,"initial" : "none"
,"caption" : "Show build plate"
}
,{
"name" : "part"
,"type" : "choice"
,"values" : [
"dremelFork"
,"upright"
]
,"initial" : "dremelFork"
,"caption" : "part type"
}
,{
"name" : "maxDremelDiameter"
,"type" : "float"
,"initial" : 52
,"caption" : "maximum dremel diameter"
}
,{
"name" : "forkHolderDiameter"
,"type" : "float"
,"initial" : 6.25 * 2
,"caption" : "diameter of fork torus"
}
,{
"name" : "forkAxisHeight"
,"type" : "float"
,"initial" : 20
,"caption" : "canister diameter"
}
,{
"name" : "forkBoltDiameter"
,"type" : "float"
,"initial" : 5/16 * 25.4 * 1.03
,"caption" : "Diameter of fork bolt"
}
,{
"name" : "forkBoltWall"
,"type" : "float"
,"initial" : 3
,"caption" : "Diameter of fork bolt"
}
];
}
function main(params){
var ret = [];
if("dremelFork" == params.part){
var cubeThickness = params.forkBoltDiameter + params.forkBoltWall * 2;
var base = union(
torus({
"ri" : params.forkHolderDiameter / 2
,"ro" : (params.forkHolderDiameter + params.maxDremelDiameter) / 2
,"fni" : params.forkHolderDiameter * 2
,"fno" : (params.forkHolderDiameter + params.maxDremelDiameter) * 2
})
,CSG.cube({
"center" : [
-(params.forkHolderDiameter + params.maxDremelDiameter) / 2 - params.forkAxisHeight / 2,
0,
cubeThickness / 2
]
,"radius" : [params.forkAxisHeight / 2, cubeThickness / 2, cubeThickness / 2]
}).subtract(
rotate(-45, [0, 1, 0], CSG.cylinder({
"start" : [0, 0, -100]
,"end" : [0, 0, 100]
,"radius" : params.maxDremelDiameter / 2
,"resolution" : 2 * params.maxDremelDiameter
})).translate([params.forkHolderDiameter, 0 ,0])
)
);
var holes = union(
CSG.cube({
"center" : [100, 0, 0]
,"radius" : [100, 100, 100]
})
,CSG.cube({
"center" : [0, 0, -100]
,"radius" : [100, 100, 100]
})
,CSG.cylinder({
"start" : [100, 0, cubeThickness / 2]
,"end" : [-100, 0, cubeThickness / 2]
,"radius" : params.forkBoltDiameter / 2
,"resolution" : 2 * params.forkBoltDiameter
})
);
ret =[base.subtract(holes).center([true, true, false])];
}
if(params.showBuildPlate == "ToM")
ret.push(CAG.rectangle({"radius" : [60, 60]}));
return ret;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.