Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save milansimek/12ef1fe2a477c75f2f152b2e1580a2ff to your computer and use it in GitHub Desktop.

Select an option

Save milansimek/12ef1fe2a477c75f2f152b2e1580a2ff to your computer and use it in GitHub Desktop.
//The default sizes are for a bicycle with a 35mm diameter round frame, standard bicycle seat, 1/4-20 hardware (1 inch long for the middle bolt and 2.5 inch long for the 2 side bolts) with nylock nuts.
//More information at https://www.thingiverse.com/thing:4370283
/* [ Rendering settings ] */
//Which piece should be displayed? Note that the online Customizer will generate each piece individually as well as an .stl that includes all 3 pieces regardless of which view you select below.
part="All"; // [Top:Top Only,Middle:Middle Only,Bottom:Bottom Only,All:View All Three]
/* [General dimensions] */
//Width of all 3 adapter pieces.
width=75;
//Length of all 3 adapter pieces.
length=17;
//Height of each piece with top/middle/bottom referring to the orientation of the pieces once they are installed.
height_top=12;
height_middle=32;
height_bottom=12;
/* [Seat bars and bicycle bar dimensions] */
//Diameter of the 2 small bars on the underside of the seat.
diameter_seat_bars=8;
//Distance between the 2 small bars on the underside of the seat.
separation_seat_bars=41;
//Diameter of the horizontal bar the seat will be clamped to (the bicycle frame).
diameter_bicycle_bar=37;
/* [Bolt dimensions] */
//Distance center-to-center between the two bolts that clamp around the bicycle frame.
bolt_separation=58;
//Diameter of the shaft of the two bolts that clamp around the bicycle frame.
bolt_diameter=7;
//Diameter of the nuts across the points.
bolt_nut_diameter=13;
//Height of nut (used for recesses in the top piece).
bolt_nut_height=6;
//Diameter of the bolt head (used for recess in the middle piece).
bolt_head_diameter=13;
//Height of bolt head (used for recess in the middle piece).
bolt_head_inset=6;
/* [Brake or shifting line bottom of bar] */
//Tick this box if you want to add a recess for a brake line on the bottom of the bar that the seat will be clamped to.
enable_bottom_brakeline = true;
//Diameter of the brakeline that runs on the bottom side of the horizontal bar the seat will be clamped to.
diameter_brakeline=6;
//If the brakeline is off-center from the very bottom of the frame, set the angle here.
angle_brakeline=30;
/* [First brake or shifting line top of bar] */
//Tick this box if you want to add a recess for a brake line on the top of the bar that the seat will be clamped to.
enable_top_brakeline_one = true;
//Diameter of the shifting or brake line that runs on the top side of the horizontal bar the seat will be clamped to.
diameter_brakeline_top_one=6;
//If the shifting or brake line is off-center from the very top of the frame, set the angle here.
angle_brakeline_top_one=50;
//If the cable distance from the frame is more than the diameter defined above, set the distance here.
distance_brakeline_top_one=0;
/* [Second brake or shifting line top of bar] */
//Tick this box if you want to add a recess for a brake line on the top of the bar that the seat will be clamped to.
enable_top_brakeline_two = true;
//Diameter of the second shifting or brake line that runs on the top side of the horizontal bar the seat will be clamped to.
diameter_brakeline_top_two=6;
//If the second shifting or brake line is off-center from the very top of the frame, set the angle here.
angle_brakeline_top_two=-50;
//If the second cable distance from the frame is more than the diameter defined above, set the distance here.
distance_brakeline_top_two=0;
/* [Third brake or shifting line top of bar] */
//Tick this box if you want to add a recess for a brake line on the top of the bar that the seat will be clamped to.
enable_top_brakeline_three = true;
//Diameter of the third shifting or brake line that runs on the top side of the horizontal bar the seat will be clamped to.
diameter_brakeline_top_three=6;
//If the third shifting or brake line is off-center from the very top of the frame, set the angle here.
angle_brakeline_top_three=-70;
//If the third cable distance from the frame is more than the diameter defined above, set the distance here.
distance_brakeline_top_three=0;
/* [Hidden] */
//Quality of curved surfaces.
$fn=100;
if (part=="All"){
translate([0,length*2.5,height_top])rotate([180,0,0])top_piece();
middle_piece();
translate([0,-length/2,0])bottom_piece();}
if (part=="Top"){translate([0,length*2.5,height_top])rotate([180,0,0])top_piece();}
if (part=="Middle"){middle_piece();}
if (part=="Bottom"){translate([0,-length/2,0])bottom_piece();}
module bottom_piece(){
difference(){
union(){
difference(){
translate([0,-height_bottom,0])
cube([width,height_bottom,length]);
translate([width/2,diameter_bicycle_bar*0.1,-0.01])
cylinder(d=diameter_bicycle_bar,h=length+0.02);
}
translate([width/2,diameter_bicycle_bar*0.1,-0.01])
difference(){
cylinder(d=diameter_bicycle_bar+height_bottom*1.5,h=length+0.02);
translate([0,0,-0.01])
cylinder(d=diameter_bicycle_bar,h=length+0.04);
}
}
if(enable_bottom_brakeline==true){
translate([width/2,0,0])
rotate([0,0,angle_brakeline])
hull(){
translate([0,diameter_bicycle_bar*0.1-diameter_bicycle_bar/2,-0.02])
cylinder(d=diameter_brakeline,h=length+0.04);
translate([0,diameter_bicycle_bar*0.1-diameter_bicycle_bar/2-diameter_brakeline/4,-0.02])
cylinder(d=diameter_brakeline,h=length+0.04);
}
;
}
translate([0,0,-0.02])
cube([width,diameter_bicycle_bar*2,length+0.1]);
translate([width/2+bolt_separation/2,0.01,length/2])
rotate([90,0,0])
cylinder(d=bolt_diameter,h=height_middle+0.02);
translate([width/2-bolt_separation/2,0.01,length/2])
rotate([90,0,0])
cylinder(d=bolt_diameter,h=height_middle+0.02);
}
}
module middle_piece(){
difference(){
cube([width,length,height_middle]);
translate([width/2-separation_seat_bars/2,-0.01,-diameter_seat_bars*0.1])
rotate([-90,0,0])
cylinder(d=diameter_seat_bars,h=length+0.02);
translate([width/2+separation_seat_bars/2,-0.01,-diameter_seat_bars*0.1])
rotate([-90,0,0])
cylinder(d=diameter_seat_bars,h=length+0.02);
translate([width/2,-0.01,height_middle+diameter_bicycle_bar*0.1])
rotate([-90,0,0])
cylinder(d=diameter_bicycle_bar,h=length+0.02);
translate([width/2+bolt_separation/2,length/2,-0.01])
cylinder(d=bolt_diameter,h=height_middle+0.02);
translate([width/2-bolt_separation/2,length/2,-0.01])
cylinder(d=bolt_diameter,h=height_middle+0.02);
translate([width/2,length/2,-0.01])
cylinder(d=bolt_diameter,h=height_middle+0.02);
translate([width/2,length/2,height_middle+diameter_bicycle_bar*0.1-diameter_bicycle_bar/2-bolt_head_inset])
cylinder(d=bolt_head_diameter,h=bolt_head_inset*2);
if(enable_top_brakeline_one==true){
brakeline_middle(diameter_brakeline_top_one, angle_brakeline_top_one, distance_brakeline_top_one);
}
if(enable_top_brakeline_two==true){
brakeline_middle(diameter_brakeline_top_two, angle_brakeline_top_two, distance_brakeline_top_two);
}
if(enable_top_brakeline_three==true){
brakeline_middle(diameter_brakeline_top_three, angle_brakeline_top_three, distance_brakeline_top_three);
}
}
}
module top_piece(){
difference(){
cube([width,length,height_top]);
translate([width/2-separation_seat_bars/2,-0.01,-diameter_seat_bars*0.1])
rotate([-90,0,0])
cylinder(d=diameter_seat_bars,h=length+0.02);
translate([width/2+separation_seat_bars/2,-0.01,-diameter_seat_bars*0.1])
rotate([-90,0,0])
cylinder(d=diameter_seat_bars,h=length+0.02);
translate([width/2,length/2,0])
bolt();
translate([width/2-bolt_separation/2,length/2,0])
bolt();
translate([width/2+bolt_separation/2,length/2,0])
bolt();}
}
module bolt(){
rotate([0,0,360/12])
translate([0,0,height_top-bolt_nut_height-0.01])
cylinder(d=bolt_nut_diameter,h=bolt_nut_height+0.02,$fn=6);
translate([0,0,-0.01])
cylinder(d=bolt_diameter,h=height_top);
}
//for (i=[0:10]){
module brakeline_middle(diameter, angle, distance){
translate([width/2,-0.01,height_middle+diameter_bicycle_bar*0.1])
rotate([-90,180,0])
rotate([0,0,-angle])
translate([0,-diameter/2,0])
hull(){
translate([0,diameter_bicycle_bar*0.1-diameter_bicycle_bar/2,-0.02])
cylinder(d=diameter,h=length+0.04);
translate([0,diameter_bicycle_bar*0.1-diameter_bicycle_bar/2-diameter/4 - distance,-0.02])
cylinder(d=diameter,h=length+0.04);
}
;
}
//}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment