Close



Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1

    OpenSCAD - Solid parts not solid...

    Newbie here. I am messing around with OpenSCAD and a Flashforge Creater Pro and have run into an interesting problem:

    I am printing a tube with reinforcing fins inside to increase stiffness. When the fins are at o and 90 degrees, all is well, but when a fin is oriented at 45 degrees, the resulting structure is hollow(!). I have confirmed that the 45 degree orientation is the problem by successively commenting out the fins. The 0 and 90 degree ones print well and are solid. The 45 degree one results in both the fins and the surrounding tube being hollow.

    In all cases, the slicing was performed in the same fashion.

    Any thoughts?


    module tube (od, thickness, length){
    // od = outer diameter
    // thickness = wall thickness
    // length = length
    difference(){
    cylinder(h=length, d=od);
    translate([0,0,length-.5]);
    cylinder(h=length+1, d=od-2*thickness);
    }
    }
    //--------------------------------------------------------------------------------------------------------------
    module tube_with_reinforcement (od, thickness, length, web_thickness){
    // od = outer diameter
    // thickness = wall thickness
    // length = length
    // web_thickness= reinforcement web thickness
    union(){
    tube(od, thickness,length);
    translate ([-od/2,-web_thickness/2,0]) cube([od, web_thickness, length]);
    rotate([0,0,90]) translate ([-od/2,-web_thickness/2,0]) cube([od, web_thickness, length]);
    rotate([0,0,45]) translate ([-od/2,-web_thickness/2,0]) cube([od, web_thickness, length]); <== THIS ONE CAUSES A PROBLEM!
    }
    }

  2. #2
    Super Moderator curious aardvark's Avatar
    Join Date
    Jul 2014
    Posts
    8,818
    what numbers are you using ?
    Also you are using variables but I can't see anywhere to set them ?

    What slicing software are you using ? If rep-g try makerware. never had any infill issues with that.

    Definitely sounds like a slicer issue. Openscad doesn't do anything but solid.

  3. #3
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    A couple of suggestions....

    First, you need a 'top level' to the OpenScad program. You need a tube_with_reinforcement(); in order to instantiate the modules you have written. I also instantiated a tube(); at (x,y,z) of (25,25,0). You can't see that in the pictures.

    Also, it is nice to add defaults. I put the sizes in the top level tube_with_reinforcement(); but decided to move them to the module declarations so there are always meaningful values there.

    Here is what your current code does with my changes so it can instantiate an object:


    pict.jpg

    Is that what you want it to look like?

    Here is the code to do that:
    Code:
    translate([25,25,0]) tube();
    tube_with_reinforcement();
    
    
    module tube (od=10, thickness=1, length=10){
    // od = outer diameter
    // thickness = wall thickness
    // length = length
    difference(){
    cylinder(h=length, d=od);
    translate([0,0,length-.5]);
    cylinder(h=length+1, d=od-2*thickness);
    }
    }
    //--------------------------------------------------------------------------------------------------------------
    module tube_with_reinforcement (od=10, thickness=1, length=10, web_thickness=.5){
    // od = outer diameter
    // thickness = wall thickness
    // length = length
    // web_thickness= reinforcement web thickness
    union(){
    tube(od, thickness,length);
    translate ([-od/2,-web_thickness/2,0]) cube([od, web_thickness, length]);
    rotate([0,0,90]) translate ([-od/2,-web_thickness/2,0]) cube([od, web_thickness, length]);
    rotate([0,0,45]) translate ([-od/2,-web_thickness/2,0]) cube([od, web_thickness, length]); //<== THIS ONE CAUSES A PROBLEM!
    } 
    }
    You can make the tube smoother (at the cost of increasing the computational time) if you add the $fn=75 to the definition for tube():

    pict11.jpg
    Last edited by Roxy; 04-19-2015 at 10:39 AM.

  4. #4
    Super Moderator curious aardvark's Avatar
    Join Date
    Jul 2014
    Posts
    8,818
    that's all it does ?

    Bloody hell lol
    I could do that in about 10 lines and no modules and make it parametric. I guess there are some advantages to keeping it simple after all :-)

    And if that's the model - then yep - it's your slicer that's causing the issues. that's a pretty basic model and can't see openscad having any problems with that.

  5. #5
    Quote Originally Posted by curious aardvark View Post
    that's all it does ?

    Bloody hell lol
    I could do that in about 10 lines and no modules and make it parametric. I guess there are some advantages to keeping it simple after all :-)

    And if that's the model - then yep - it's your slicer that's causing the issues. that's a pretty basic model and can't see openscad having any problems with that.

    I would appreciate any education that you can give me Yes, that is all it does - gotta start somewhere ;-)

    I think I have it nailed down to the slicer. When I set "Number of shells" to 0, the model prints properly. When "number of shells" is set to 1, I get the (to me) unexpected behavior that I described.

    So now I have kicked the can down the road. The model is fine, but the slicer settings are not understood by me.

    BTW - this was all part of a minor effort on my part to make a bit of reusable code for my own use.

  6. #6
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    What Slicer are you using? Are you using Slic3r ? If so... It won't be hard to get it setup to slice this correctly. I thought you were having a problem getting OpenScad to render it correctly. If you are using Cura, somebody else will have to jump in.

  7. #7
    Sorry I was not clear on the source of the problem. Since I had luck printing some objects, I leapt to the conclusion that OpenSCAD was the issue.

    I am using ReplicatorG. I have (just now) successfully pronted the design, but I had to set the number of shells to 0 - guess I am not understanding that part. Is Slic3r the "go to" program for slicing? Seems like there are a zillion programs available - not sure I have any idea how to choose between them.

  8. #8
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    I don't know what setting the number of shells to 0 does in Replicator-G. My guess is that tells Replicator-G to do what ever it thinks makes sense. In Slic3r (if I understand what a 'shell' is in Replicator-G) the equivalent term would be perimeter. You can set how many layers the perimeter has.

    For people that use OpenScad, Slic3r is the usual slicer. But it depends a lot on where your head is at. I don't use it, but the people I interact with feel Replicator-G has fallen behind. The last release was over 2 years ago. If you are willing to switch to Slic3r and PronterFace, I think you will find more people to help you in the forums and probably, you won't need much help because both of those tools are pretty good.

  9. #9
    Super Moderator Roxy's Avatar
    Join Date
    Apr 2014
    Location
    Lone Star State
    Posts
    2,182
    Quote Originally Posted by curious aardvark View Post
    that's all it does ?

    Bloody hell lol
    I could do that in about 10 lines and no modules and make it parametric. I guess there are some advantages to keeping it simple after all :-)

    And if that's the model - then yep - it's your slicer that's causing the issues. that's a pretty basic model and can't see openscad having any problems with that.
    Just for kicks.... Without deleting white space... 4 Lines !

    difference() {
    cylinder(r=10, h=10);
    cylinder(r=8,h=10); }
    for(i=[1:1:8]) rotate([0,0,i*45]) cube([9,.5,10]);


    4lines.jpg
    Last edited by Roxy; 04-19-2015 at 12:34 PM.

  10. #10
    Hmmm. Aren't your reinforcing fins offset from one another? And in my defense - the original code does not have that many more active lines, but I clearly can reduce the number a bit. Sure I will get better as I learn more. Off to go look at Slic3r...

Page 1 of 2 12 LastLast

Posting Permissions

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