/* FILE : Flex-XYStage-Evolved.scad AUTHOR : Denis Terwagne Jason Pettiaux DATE : 2020-01-24 LICENSE : Creative Commons Attribution 4.0 International [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) */ $fn=100; // Flexure beam_length=25; beam_width=1; // Spacing between inside flexures and between flexures and base spacing=5; //Width of the base of the flexure base_width=4; //Flexure external dimension base_x=45; base_y=45; //Central stage size platform_size=45; pole_width=10; screw_size=1.5; case_size= 100; thickness=4; interStageLength = base_x/2-base_width-spacing/2; module roundRect(w, l, h, r){ //translate([r,r,0]) minkowski(){ cube([w-2*r, l-2*r, h/2],center=true); cylinder(r=r, h=h/2,center=true); } } module ExternalLateralSpacing(){ // Placing the lateral space between the intermediate stage and the central stage of the flexures relative to origin translate([(interStageLength),0,0]) roundRect(spacing,base_y-2*base_width,thickness,2); } module InternalLateralSpacing(){ // Placing the lateral space between the case and the intermediate stage of the flexures relative to origin center_correction = base_y-spacing*2;// To initialize the translation of the side of the spacing to keep the base width lengthIS = 100; // Length of the spacing to make sure to cut the links to the next stage regardless of the base width or spacing translate([(interStageLength-spacing-beam_width),-(base_width*2)-lengthIS/2,0]) roundRect(spacing,center_correction+lengthIS,thickness,2); } module FlexuresSpacings(){ // Bottom spacing between the base and the intermediate stage translate([0,base_y/2-base_width-spacing/2,0]) roundRect(base_x-2*base_width,spacing,thickness,2); //Central spacing between Intermediate and center stage translate([0,-(base_width+spacing)/2,0]) roundRect(base_x-2*base_width-spacing*4-4*beam_width,base_y-base_width*3-spacing,thickness,2); //Lateral Spacings X positive ExternalLateralSpacing(); InternalLateralSpacing(); mirror([1,0,0]){ ExternalLateralSpacing(); InternalLateralSpacing(); } } module FlexureBase(){ difference(){ // Create the base shape of the flexure roundRect(base_x,base_y,thickness,2); // Create all flexures spacings FlexuresSpacings(); } // Link to center stage central_Link_width = base_x-2*(base_width-2*spacing-beam_width); *translate([0,-(base_y/2+spacing),0]) cube([base_x-2*(base_width-2*spacing-beam_width),2*spacing,thickness], center=true); } // //projection(cut){ //difference(){ //cube([case_size, case_size, thickness]); difference(){ union(){ //Central stage rotate(45, [0,0,10]) roundRect(platform_size, platform_size, thickness, 2); //Flexures and base for (i=[0:1:3]){ rotate(a = -90*i, v = [0, 0, 10]) { //Create the intermediate flexures translate([0,base_y+10,0]){ FlexureBase(); //Parallel Bar translate([0,(base_y/2+2*spacing),0]) cube([base_x+4*spacing,2*spacing,thickness], center=true); } rotate(-90, [0,0,10]) { translate([-base_x-10,base_y+2*spacing,0]) { difference(){ // Create the base for the corner flexures //roundRect(base_x,base_y,thickness,2); cube([base_x,base_y,thickness],center=true); // Create all flexures spacings FlexuresSpacings(); } // Link to Intermediate flexures translate([0,-(base_y/2+spacing),0]) cube([base_x-2*base_width-spacing*4-2*beam_width,2*spacing,thickness], center=true); // translate([-spacing,(base_y/2+spacing*3/2),0]) cube([base_x+spacing*2,3*spacing,thickness], center=true); translate([-(base_x/2+spacing*3/2),spacing*3/2,0]) cube([3*spacing,base_y+spacing*3,thickness], center=true); } } } } } //Making the holes union(){ for (i=[0:1:3]){ rotate(a = -90*i, v = [0, 0, 10]) { //Making the corner holes translate([82.5,82.5,0]) cylinder(thickness,screw_size, screw_size, center=true); //Making the central holes translate([18,0,0]) cylinder(thickness,screw_size, screw_size, center=true); } } } } //}