Close



Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 32

Hybrid View

  1. #1
    Super Moderator curious aardvark's Avatar
    Join Date
    Jul 2014
    Posts
    8,816
    $fn=60; // set 50 facets to give us nice round holes that rendet fairly fast
    module box(){

    difference(){
    translate([0,0,25])cube([100,100,50],center=true); // start with a block of wood - because it is centred in all 3 axis, we'll lift it 25mm with translate so that's at 0 on the z axis.
    cylinder(d=20,h=55); // cylinders are always centred on 0,0,0 before youmove them. so we drill a 30mm hole through the centre of the block
    // we'll cut another couple of holes
    translate([35,30,-5]) cylinder(d=3,h=10);
    translate([35,-30,-5]) cylinder(d=3,h=10);

    translate([0,0,27]) cube([92,92,50],center=true); // we remove a chunk from center of the the box to leave a 2mm floor and 4mm walls all around.
    translate([2,0,46.5]) cube([96,96,2.5],center=true); // creates a 2.5mm groove in three sides.
    translate([48,0,51]) cube([10,92,10],center=true); // we then remove the excess wood to make it easier to print
    } // end diff
    } // end module
    Now when you press f5 or f6, absolutely nothing happens - OH NO !
    Ah but wait, we have isolated the script - but we haven't told openscad what to do with it.
    so the generate the module box()

    we need to tell openscad that's what we want to do:

    $fn=60; // set 50 facets to give us nice round holes that rendet fairly fast
    module box(){

    difference(){
    translate([0,0,25])cube([100,100,50],center=true); // start with a block of wood - because it is centred in all 3 axis, we'll lift it 25mm with translate so that's at 0 on the z axis.
    cylinder(d=20,h=55); // cylinders are always centred on 0,0,0 before youmove them. so we drill a 30mm hole through the centre of the block
    // we'll cut another couple of holes
    translate([35,30,-5]) cylinder(d=3,h=10);
    translate([35,-30,-5]) cylinder(d=3,h=10);

    translate([0,0,27]) cube([92,92,50],center=true); // we remove a chunk from center of the the box to leave a 2mm floor and 4mm walls all around.
    translate([2,0,46.5]) cube([96,96,2.5],center=true); // creates a 2.5mm groove in three sides.
    translate([48,0,51]) cube([10,92,10],center=true); // we then remove the excess wood to make it easier to print
    } // end diff
    } // end module

    box();
    Now the f5 and f6 work again.

    Now we need to make our sliding box lid. Essentiall just a basic cube.
    We know how large the cube was that crated the groove - so we make the lid a little smaller in width and thickness so it slides in and out easily.
    we create module lid() and comment out module box() - so that when we press f5 or f6 - we only generate the part we want to export as an stl file.

    $fn=60; // set 50 facets to give us nice round holes that rendet fairly fast
    module box(){

    difference(){
    translate([0,0,25])cube([100,100,50],center=true); // start with a block of wood - because it is centred in all 3 axis, we'll lift it 25mm with translate so that's at 0 on the z axis.
    cylinder(d=20,h=55); // cylinders are always centred on 0,0,0 before youmove them. so we drill a 30mm hole through the centre of the block
    // we'll cut another couple of holes
    translate([35,30,-5]) cylinder(d=3,h=10);
    translate([35,-30,-5]) cylinder(d=3,h=10);

    translate([0,0,27]) cube([92,92,50],center=true); // we remove a chunk from center of the the box to leave a 2mm floor and 4mm walls all around.
    translate([2,0,46.5]) cube([96,96,2.5],center=true); // creates a 2.5mm groove in three sides.
    translate([48,0,51]) cube([10,92,10],center=true); // we then remove the excess wood to make it easier to print
    } // end diff
    } // end module

    module lid(){
    cube([95.5,96,2]);

    } // end mod

    //box();
    lid();
    And there you have a small bird box. With screw holes and a sliding lid.

    Although on reflection it would be a total bastard to print. I was concentrating more on the openscad tutorial side than the actual box I'm afraid.

    But yeah, thinking like a wood worker is how i tend to do it.
    You are either removing bits of a shape or sticking other bits to it.

    I'll have some lunch and make a better bird box lol

    Finally the basic script - without all the waffle:
    $fn=60;
    module box(){

    difference(){
    translate([0,0,25])cube([100,100,50],center=true); axis.
    cylinder(d=20,h=55);
    // we'll cut another couple of holes
    translate([35,30,-5]) cylinder(d=3,h=10);
    translate([35,-30,-5]) cylinder(d=3,h=10);

    translate([0,0,27]) cube([92,92,50],center=true);
    translate([2,0,46.5]) cube([96,96,2.5],center=true); // creates a 2.5mm groove in three sides.
    translate([48,0,51]) cube([10,92,10],center=true);
    } // end diff
    } // end module

    module lid(){
    cube([95.5,96,2]);

    } // end mod

    //box();
    lid();

  2. #2
    Technician
    Join Date
    Mar 2021
    Posts
    63
    Excellent, thanks a bunch, really appreciate your putting so much time and effort into that.

    It's going to take me a while to step through it methodically, but it's already clear that your help will greatly accelerate my crawl up the learning curve!

  3. #3
    Staff Engineer
    Join Date
    Jun 2014
    Posts
    885
    @terrypin, I've used both OpenSCAD and Fusion360 and like both of them for what little I can do in either program. I've learned that some people take well to OpenSCAD and others run away. FreeCAD is now on my machine, but I'll probably put off the hours of YouTube tutorials, especially if I can get the job done with F360 or OpenSCAD.

    If you can build your code from square one using parameters and relationships, you'll have a good start. I like to test my code by changing a value, to see if the other settings follow. Sometimes the hole you thought would adjust to the new figure ends up in outer space and you debug to find the failed relationship. That's part of the fun (sometimes).

  4. #4
    Technician
    Join Date
    Mar 2021
    Posts
    63
    Thanks Fred. Sounds like we share a similar practical attitude to this stuff.

  5. #5
    Super Moderator curious aardvark's Avatar
    Join Date
    Jul 2014
    Posts
    8,816
    Tinkercad used to be useful.
    But as you can't seem to either import or export anymore, seems to have gone downhill since the last update.

    Yet another argument against cloud software.
    At least with normal programs you can get hold of the older versions that actually work ????

  6. #6
    Staff Engineer
    Join Date
    Jun 2014
    Posts
    885
    I'd forgotten about Tinkercad, although a friend uses it exclusively. I just signed in and found that download and export (.obj, .stl) work, as does import. Something amiss?

  7. #7
    Engineer-in-Training
    Join Date
    Aug 2020
    Location
    United Kingdom
    Posts
    249
    Hi I am sorry to here you have had trouble getting Fusion360. as Fred-u-dot says it has a completely different approach to OpensCad. I have used both but having come up through AutoDesk prodects since AcadV13 in 1982 I am more comfortable in their approach.

  8. #8
    Technician
    Join Date
    Mar 2021
    Posts
    63
    Thanks printbus. I'm stepping through examples here and in several tutorials, so making progress.

    But patience isn't one of my strong points, so it's good to have others' models and code to build on. When working on that first box I changed only its dimensions so felt on reasonbly safe ground.

  9. #9
    Super Moderator curious aardvark's Avatar
    Join Date
    Jul 2014
    Posts
    8,816
    here's some homework then.

    take the 'birdbox'.
    remove the end where the lid slides in.
    Then create a seperate piece that glues there (two cubes one on top of the other would do it).

    That way you can orient the box on the bed with the grooves vertical for easy printing and print the lid and side flat and seperately.

    That's what I was going to do - but I got sidetracked, I frequently get sidetracked for days, sometimes years...

  10. #10
    Technician
    Join Date
    Mar 2021
    Posts
    63
    Thanks, a fascinating possible exercise. But I'm in the same boat: in fact I'm currently in a sub-sidetrack of a sidetrack!

Page 2 of 4 FirstFirst 1234 LastLast

Tags for this Thread

Posting Permissions

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