Close



Results 1 to 10 of 16

Threaded View

  1. #11
    Technician
    Join Date
    Mar 2021
    Posts
    63
    "Your homework - make the box parametric :-)"


    Code:
    $fn=50;
    // Defining the box
    ExteriorL=100;  // Exterior cube, length
    ExteriorW=40; // Exterior cube, width
    ExteriorH=30; // Exterior cube, height
    
    InteriorL=96; // Interior cube, length
    InteriorW=36; // Interior cube, width
    InteriorH=30; // Interior cube, height
    
    // Hole making
    SphereDiam=5;
    CylDiam=10.4;
    CylHeight=3.25;
    
    difference(){
    union(){
    difference(){
    cube([ExteriorL,ExteriorW,ExteriorH],true);
    translate([0,0,2])cube([InteriorL,InteriorW,InteriorH],true);
    } // end diff
    
    translate([40,18,0]) resize([14,8,14])sphere(d=SphereDiam);
    translate([-40,18,0]) resize([14,8,14])sphere(d=SphereDiam);
    } // end union
    
    translate([40,20,0]) rotate([90,0,0]) cylinder(d=CylDiam, h=CylHeight);
    translate([-40,20,0]) rotate([90,0,0]) cylinder(d=CylDiam, h=CylHeight);
    translate([0,30,0]) cube([100,20,30],true);
    } // end diff
    The only parameters I didn't define were those for what I think of as your 'third cube'. That's your homework! ;-)

    11-CA-MagnetsInBox-Param.jpg

    (This web site has possibly the most buggy formatting/rendering I've ever seen!)
    Last edited by terrypin; 04-07-2021 at 12:47 PM. Reason: To gripe about the site rendering

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •