Add Bushing
This commit is contained in:
parent
43cd7701c9
commit
9a1da123dd
56
bushing.jscad
Normal file
56
bushing.jscad
Normal file
@ -0,0 +1,56 @@
|
||||
/// title : Basic Sleeved Rubber Bushing
|
||||
// author : Tim Farrell
|
||||
// license : MIT License
|
||||
// revision : 2
|
||||
// tags : Rubber
|
||||
// file : bushing.jscad
|
||||
|
||||
function getParameterDefinitions () {
|
||||
return [
|
||||
{name: 'overhang', type: 'float', initial: 7, min: 1, max: 40, step: 1, caption: 'Overhang'},
|
||||
{name: 'host_hole_diameter', type: 'float', initial: 13, min: 1, max: 40, step: 1, caption: 'Host hole diameter'},
|
||||
{name: 'host_hole_height', type: 'float', initial: 0.8, caption: 'Host hole height'},
|
||||
{name: 'bushing_height', type: 'float', initial: 4, min: 1, max: 40, step: 1, caption: 'Bushing height'},
|
||||
{name: 'bushing_diameter', type: 'float', initial: 10, min: 1, max: 40, step: 1, caption: 'Bushing diameter'}
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
function donut(p) {
|
||||
const outer_radius = p.overhang + p.host_hole_diameter/2 - p.bushing_height/2;
|
||||
const inner_radius = p.bushing_height/2;
|
||||
return torus({ ri: inner_radius, ro: outer_radius });
|
||||
}
|
||||
|
||||
function bushing_main(p) {
|
||||
return union(
|
||||
cylinder({
|
||||
r: p.overhang + p.host_hole_diameter/2 - p.bushing_height/2,
|
||||
h: p.bushing_height,
|
||||
center: true
|
||||
}),
|
||||
donut(p)
|
||||
);
|
||||
}
|
||||
|
||||
function host_hole(p) {
|
||||
const inner_radius = p.host_hole_diameter/2;
|
||||
const outer_radius = p.overhang + inner_radius;
|
||||
|
||||
return difference(
|
||||
cylinder({r: outer_radius, h: p.host_hole_height, center: true}),
|
||||
cylinder({r: inner_radius, h: p.host_hole_height, center: true})
|
||||
);
|
||||
}
|
||||
|
||||
function bushing_sleeve(p) {
|
||||
return cylinder({r: p.bushing_diameter/2, h: p.bushing_height, center: true});
|
||||
}
|
||||
|
||||
function main(p) {
|
||||
return difference(
|
||||
bushing_main(p),
|
||||
host_hole(p),
|
||||
bushing_sleeve(p)
|
||||
)
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user