Skip to content

Instantly share code, notes, and snippets.

@jdellinger
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdellinger/719cde5a32ae54d51eff to your computer and use it in GitHub Desktop.
Save jdellinger/719cde5a32ae54d51eff to your computer and use it in GitHub Desktop.
3D Printed Wheel Adapter

OpenSCAD files for 3D Printed Wheel Adapter

The V2 version is still just a trial model, while V4 was for actual printing. To view the individual components in the V4 model, just comment out the view_assembly() call and uncomment the adjacent component you want to render.

base_height=5;
hub_bolt_radius=51.039;
riser_height=15;
riser_outer_radius=25;
riser_inner_radius=20;
bearing_diameter=38;
top_height=5;
top_bolt_radius=35.638;
fillet_radius=25;
outer_leaf_radius=10;
inner_leaf_radius=25;
bolt_diameter=8;
$fn=100;
full_adapter();
module full_adapter(){
difference(){
union(){
base_plate();
translate([0, 0, base_height]) riser();
translate([0,0,base_height+riser_height]) top_plate();
translate([0,0,base_height]) top_plate_fillet();
}
cylinder(h=base_height+riser_height+top_height, d=bearing_diameter);
}
}
module base_plate(){
difference(){
rotary_leafs(5, base_height, hub_bolt_radius, outer_leaf_radius, inner_leaf_radius, 2);
rotary_holes(5, hub_bolt_radius, bolt_diameter);
}
}
module top_plate(height=top_height){
difference(){
rotary_leafs(4, height, top_bolt_radius, outer_leaf_radius, inner_leaf_radius);
rotary_holes(4, top_bolt_radius, bolt_diameter);
}
}
module top_plate_fillet(){
difference(){
top_plate(riser_height);
translate([0,0,riser_height-fillet_radius]) rotate_extrude()
translate([top_bolt_radius+outer_leaf_radius,0,0])
circle(r=fillet_radius);
}
}
module rotary_leafs(n, height, radius, outer_radius, center_radius, step=1){
for (i = [0:step:n-1]) {
rotate(i*360/n)
hull(){
translate([0,radius,0])
cylinder(h=height, r=outer_radius);
cylinder(h=height, r=center_radius);
}
}
}
module rotary_holes(n, radius, hole_diameter){
for (i = [0:n]) {
rotate(i*360/n)
translate([0,radius,0])
cylinder(h=100, d=hole_diameter);
}
}
module riser(){
difference(){
cylinder(h=riser_height,r=riser_outer_radius);
cylinder(h=riser_height,r=riser_inner_radius);
}
}
base_height=5;
hub_bolt_radius=51;
riser_height=15;
riser_outer_radius=30;
bearing_diameter=42;
riser_inner_radius=bearing_diameter/2;
top_height=5;
top_bolt_radius=35.638;
outer_leaf_radius=10;
inner_leaf_radius=30;
bolt_diameter=9;
top_nut_diameter=13;
$fn=100;
view_assembly();
//flange_portion();
//wheel_portion();
//flange_portion_for_print();
module view_assembly(){
wheel_portion();
translate([0,0,10]) flange_portion();
}
module wheel_portion(){
difference(){
union(){
base_plate();
translate([0, 0, base_height]) riser();
}
translate([0,0,base_height]) rotary_holes(4, top_bolt_radius, top_nut_diameter);
translate([0,0,base_height]) mating_sockets(offset=.5);
cylinder(h=base_height+riser_height+top_height, d=bearing_diameter);
}
}
module flange_portion_for_print(){
rotate([0,180,0])
translate([0,0,-(base_height+riser_height+top_height)])
flange_portion();
}
module flange_portion(){
difference(){
union(){
translate([0,0,base_height+riser_height]) top_plate();
translate([0,0,base_height]) mating_sockets();
}
cylinder(h=base_height+riser_height+top_height, d=bearing_diameter);
}
}
module mating_sockets(offset=0){
step=1;
n=3;
w=riser_outer_radius-riser_inner_radius-4+offset;
socket_radius=(riser_outer_radius+riser_inner_radius)/2;
circ=2*3.14159*socket_radius;
angular_offset=(offset/circ)*360;
for (i = [0:step:n-1]) {
rotate((i*360/n)-(angular_offset/2))
translate([0,0,riser_height/2])
partial_rotate_extrude((360/(n*2))+angular_offset, socket_radius, 10)
square([w,riser_height], center=true);
}
}
module pie_slice(radius, angle, step) {
for(theta = [0:step:angle-step]) {
rotate([0,0,0]) linear_extrude(height = radius*2, center=true)
polygon( points = [[0,0],[radius * cos(theta+step) ,radius * sin(theta+step)],[radius*cos(theta),radius*sin(theta)]]);
}
}
module partial_rotate_extrude(angle, radius, convex) {
intersection () {
rotate_extrude(convexity=convex) translate([radius,0,0]) child(0);
pie_slice(radius*2, angle, angle/5);
}
}
module base_plate(){
difference(){
rotary_leafs(5, base_height, hub_bolt_radius, outer_leaf_radius, inner_leaf_radius, 2);
rotary_holes(5, hub_bolt_radius, bolt_diameter);
}
}
module top_plate(height=top_height){
difference(){
rotary_leafs(4, height, top_bolt_radius, outer_leaf_radius, inner_leaf_radius);
rotary_holes(4, top_bolt_radius, bolt_diameter);
}
}
module rotary_leafs(n, height, radius, outer_radius, center_radius, step=1){
for (i = [0:step:n-1]) {
rotate(i*360/n)
hull(){
translate([0,radius,0])
cylinder(h=height, r=outer_radius);
cylinder(h=height, r=center_radius);
}
}
}
module rotary_holes(n, radius, hole_diameter){
for (i = [0:n]) {
rotate(i*360/n)
translate([0,radius,0])
cylinder(h=100, d=hole_diameter);
}
}
module riser(){
difference(){
cylinder(h=riser_height,r=riser_outer_radius);
cylinder(h=riser_height,r=riser_inner_radius);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment