Skip to content

Instantly share code, notes, and snippets.

@advorak
Created March 8, 2018 23:59
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 advorak/42243cd36e6ce5e07b6f79164c24b117 to your computer and use it in GitHub Desktop.
Save advorak/42243cd36e6ce5e07b6f79164c24b117 to your computer and use it in GitHub Desktop.
//I want the larger end of this object:
translate([-73,0,0]) rotate([0,90,0]) cylinder(h=73, d1=16, d2=0, center=false, $fn=100);
// to resemble the corresponding end of this object:
intersection() {
translate([-73+16/2,0,0]) {
difference() { cylinder(h=16, d1=16, d2=16); translate([0,-10,0]) cube(73,16,16); }
}
translate([-73,0,0]) rotate([0,90,0]) cylinder(h=73, d1=16, d2=0, center=false, $fn=100);
}
@jfcaron3
Copy link

jfcaron3 commented Mar 9, 2018

// Something like this?
//I want the larger end of this object:
union()
{
difference()
    {
    translate([-73,0,0])
    rotate([0,90,0])
    cylinder(h=73, d1=16, d2=0, center=false, $fn=100);
    
    translate([-50-73+8,0,0])
    cube([100,100,100],center=true);
    }
// to resemble the corresponding end of this object:
intersection() {
    translate([-73+16/2,0,0]) 
    {
        difference() 
        { 
            cylinder(h=16, d1=16, d2=16); 
            translate([0,-10,0]) 
            cube(73,16,16); 
        }
    }

    translate([-73,0,0]) 
    rotate([0,90,0]) 
    cylinder(h=73, d1=16, d2=0, center=false, $fn=100);
}
}

@advorak
Copy link
Author

advorak commented Mar 9, 2018

    difference() {
        rotate([0,90,0])
        translate([0,0,-shell_radius/2])
        cylinder(h=shell_radius, d1=cylinder_diameter, d2=0, center=true, $fn=1024);
        difference() {
            translate([-shell_radius-cylinder_radius,-cylinder_radius,0-cylinder_radius]) cube(cylinder_diameter);
            translate([-shell_radius+cylinder_radius,0,-cylinder_radius]) cylinder(cylinder_diameter,cylinder_radius,cylinder_radius);
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment