Slic3r playing up - putting non-existent layers in
 
Notifications
Clear all

Slic3r playing up - putting non-existent layers in  

  RSS
MrMik
(@mrmik)
Honorable Member
Slic3r playing up - putting non-existent layers in

Hi,

I have designed a fan shroud in OpenScad and when I render it in Slic3r V2.2.0+linux-x64 , it adds in solid layers where there should be none in the big empty space in the middle.

 

Any hints for how to fix this would be much appreciated!

Best Answer by MrMik:

Thank you, Neophyl!

I already solved the problem by upgrading to Slic3r v2.5.0.

If it ain't broke, don't fix it! Eventually I had to run into a problem and have to upgrade. 🤣 

Posted : 29/10/2022 7:18 am
Neophyl
(@neophyl)
Illustrious Member
RE: Slic3r playing up - putting non-existent layers in

Openscad is notorious for generating non valid geo, while PS copes with a certain amount of that it doesn’t do the job as well as say Cura does. 

If you post either your stl, or better yet in case it is a slicer config issue a Prusa slicer project (file >save project as) then take the resulting 3mf file and zip it up and attach we can take a look. It MUST be zipped or the forum will just not attach it when you post. 
3mf is best as we can slice it with the exact same settings and the project also contains the model so we get everything. 

Posted : 29/10/2022 10:33 am
MrMik liked
MrMik
(@mrmik)
Honorable Member
Topic starter answered:
RE: Slic3r playing up - putting non-existent layers in

Thank you, Neophyl!

I already solved the problem by upgrading to Slic3r v2.5.0.

If it ain't broke, don't fix it! Eventually I had to run into a problem and have to upgrade. 🤣 

Posted : 29/10/2022 12:02 pm
FoxRun3D
(@foxrun3d)
Famed Member
RE: Slic3r playing up - putting non-existent layers in

As neophyl said, OpenSCAD is notorious for generating invalid STLs. One simple trick that addresses most issues is to add a small amount (e.g., _min = 0.01) to intersecting body, to make sure two surfaces are not in the same plane and create STL errors.

From the OpenSCAD manual for union():

Note: It is mandatory for all unions, explicit or implicit, that external faces to be merged not be coincident. Failure to follow this rule results in a design with undefined behavior, and can result in a render which is not manifold (with zero volume portions, or portions inside out), which typically leads to a warning and sometimes removal of a portion of the design from the rendered output. (This can also result in flickering effects during the preview.) This requirement is not a bug, but an intrinsic property of floating point comparisons and the fundamental inability to exactly represent irrational numbers such as those resulting from most rotations. As an example, this is an invalid OpenSCAD program, and will at least lead to a warning on most platforms

And for difference():

Note: It is mandatory that surfaces that are to be removed by a difference operation have an overlap, and that the negative piece being removed extends fully outside of the volume it is removing that surface from. Failure to follow this rule can cause preview artifacts and can result in non-manifold render warnings or the removal of pieces from the render output. See the description above in union for why this is required and an example of how to do this by this using a small epsilon value.

Formerly known on this forum as @fuchsr -- until all hell broke loose with the forum software...

Posted : 29/10/2022 12:54 pm
MrMik
(@mrmik)
Honorable Member
Topic starter answered:
RE:

I don't know it OpenScad is causing the issue.

The older Slic3r version fills the hollow space in 2 separate sections. The latest Slic3r version slices it properly.

The code for the part of the object is this:

translate([54.25,54.5,-50])
difference(){// Fan Connector Shroud - to be hollowed

union(){// Outer of shroud and connecting pins
cylinder(h=50, r1=60, r2=54.5);// outer of shroud

union(){// Connector pins
rotate([0,0,20])
translate([55,0,32.5])
cylinder(h=20, r=1);

rotate([0,0,-20])
translate([55,0,32.5])
cylinder(h=20, r=1);

rotate([0,0,70])
translate([55,0,32.5])
cylinder(h=20, r=1);

rotate([0,0,110])
translate([55,0,32.5])
cylinder(h=20, r=1);

rotate([0,0,160])
translate([55,0,32.5])
cylinder(h=20, r=1);

rotate([0,0,200])
translate([55,0,32.5])
cylinder(h=20, r=1);

rotate([0,0,250])
translate([55,0,32.5])
cylinder(h=20, r=1);

rotate([0,0,290])
translate([55,0,32.5])
cylinder(h=20, r=1);

}
// End union of connector pins

}
// End union outer of shroud and conneting pins

cylinder(h=50, r1=58.8, r2=53.3);// Inner of shroud

}
// End difference for hollowing fan connector shroud
This post was modified 2 years ago by MrMik
Posted : 29/10/2022 1:28 pm
Neophyl
(@neophyl)
Illustrious Member
RE: Slic3r playing up - putting non-existent layers in

Oh it will almost certainly be the openscad model. If you post it I’ll load it into blender and take a look at the raw geo created.  I don’t use it so the code isn’t any use for me, the stl or whatever you generate from it would be though for analysis. 

There were so many open issues on GitHub related to openscad created models doing just what yours did that they pretty much had to add extra stuff to handle the most common problems just to reduce the issue load. 
When we say notorious we aren’t kidding. 

Posted : 29/10/2022 1:46 pm
MrMik liked
FoxRun3D
(@foxrun3d)
Famed Member
RE:

I mean, it's exactly what I wrote before. In your code, the surfaces of the intersecting object are co-planar with the surfaces of the outer object.  Change the code by adding:

_min = 0.1;

at the beginning and then change the final piece of code to

translate([0,0,-_min])cylinder(h=50+2*_min, r1=58.8, r2=53.3);// Inner of shroud

so the inner object fully penetrates the outer objects. This should create a fully manifold object that is sliced properly.

I wouldn't rely on the slicer to sort out issues with the STL.

Formerly known on this forum as @fuchsr -- until all hell broke loose with the forum software...

Posted : 29/10/2022 2:01 pm
Diem
 Diem
(@diem)
Illustrious Member

Make sure you are using the latest version of OpenSCAD (2021 or later), for some reason a very out of date version is widely distributed.  This issue is not completely resolved but it is greatly reduced.

Cheerio,

Posted : 29/10/2022 2:59 pm
MrMik
(@mrmik)
Honorable Member
Topic starter answered:
RE: Slic3r playing up - putting non-existent layers in

 

Posted by: @fuchsr

I mean, it's exactly what I wrote before. In your code, the surfaces of the intersecting object are co-planar with the surfaces of the outer object.  Change the code by adding:

_min = 0.1;

at the beginning and then change the final piece of code to

translate([0,0,-_min])cylinder(h=50+2*_min, r1=58.8, r2=53.3);// Inner of shroud

so the inner object fully penetrates the outer objects. This should create a fully manifold object that is sliced properly.

I wouldn't rely on the slicer to sort out issues with the STL.

Thank you for the explanation, that worked.

I did not use the _min = 0.1 command, not sure how that works and where to put it.

I just added translate([0,0,-0.2]) and changed the inner shroud length by 0.2mm, it achieves the same as your command does.

Most likely I have avoided this issue on most of my designs by choosing a very large size for the parts to be differenced. Makes it easier to 'find' where they are and only very rough maths required to translate the part to the desired position. 

Hope I remember this next time it happens.

Posted : 30/10/2022 12:23 am
MrMik
(@mrmik)
Honorable Member
Topic starter answered:
RE: Slic3r playing up - putting non-existent layers in

 

Posted by: @diem

Make sure you are using the latest version of OpenSCAD (2021 or later), for some reason a very out of date version is widely distributed.  This issue is not completely resolved but it is greatly reduced.

Cheerio,

Thanks, I was indeed using the 2019 version for some reason.

But I tried it with the 2021 version and the same thing happens (until I use slightly different sizes for differenced parts).

However, the latest Prusa Slic3r fixes all this mess automatically. Had I updated earlier, I would never have known that I have some problem with my manifold and still don't really know what it is. 🤣 

Posted : 30/10/2022 12:26 am
FoxRun3D
(@foxrun3d)
Famed Member
RE: Slic3r playing up - putting non-existent layers in

I did not use the _min = 0.1 command, not sure how that works and where to put it.

It's not a command. It just declares a variable (_min) and initializes it to 0.1.  

Of course you don't have to use a variable and instead use the numbers directly like you did. But if you have more than one place in your code that requires the use of that small increment it's just best practice to use a variable instead. 

Formerly known on this forum as @fuchsr -- until all hell broke loose with the forum software...

Posted : 30/10/2022 12:41 am
MrMik
(@mrmik)
Honorable Member
Topic starter answered:
RE: Slic3r playing up - putting non-existent layers in

 

Posted by: @fuchsr

Of course you don't have to use a variable and instead use the numbers directly like you did. But if you have more than one place in your code that requires the use of that small increment it's just best practice to use a variable instead. 

So I can just start each program with

$fn=150;

_min = 0.01;

as standard and then use 

translate([-_min,0,0]) or something like it to make it clear why the small numbers are being used?

Posted : 30/10/2022 1:06 am
FoxRun3D
(@foxrun3d)
Famed Member
RE: Slic3r playing up - putting non-existent layers in

👍🏻

Formerly known on this forum as @fuchsr -- until all hell broke loose with the forum software...

Posted : 30/10/2022 1:10 am
Share: