<p>openSCAD simply allows having surface solutions that result in a wall of 0 thickness. The walls appear to <em>clip</em> in those areas and can at times be seen from both sides, like in your example:</p>
<p><a href="https://i.sstatic.net/lIvMS.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lIvMS.png" alt="a 0 thickness wall clipping" /></a></p>
<p>A 0 thickness wall is also exportable into an STL as a set of triangles spun up by vertices that are in each other's plane but have inverted normal vectors for the two sides - which means that the construct <em>exists</em> for the computer - and I have used this in 3D designs for a hologram-effect, even if it does not result in a physically possible property set.</p>
<p>An example of that effect is this cube (made in blender), that has the back wall purple, all others are grey - and the internal wall is at the same X-value as the back wall. You see the grey wall clipping <em>despite</em> the normal of it pointing to +X while the normal of the purple wall is into -X.</p>
<p><a href="https://i.sstatic.net/3QLzZ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/3QLzZ.png" alt="enter image description here" /></a></p>
<p>By having your <em>cookie-cutter</em> extrude not just to but <em>through</em> the back wall, you force a solution that disallows the 0-surface solution and thus solves the problem of creating those <em>artifact</em> walls.</p>
<p>Note that the 0-surface wall persists in the slicer preview:</p>
<p><a href="https://i.sstatic.net/kkRNX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/kkRNX.png" alt="enter image description here" /></a>
<a href="https://i.sstatic.net/pBaSe.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pBaSe.png" alt="enter image description here" /></a></p>
<p>But rest assured: almost all slicers ignore walls that are too thin to be printed, and a 0 thickness wall especially is ignored:</p>
<p><a href="https://i.sstatic.net/7wdmX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7wdmX.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2021-03-18T16:57:37.383Z
2021-03-18T17:12:30.153Z
2021-03-18T17:12:30.153Z
Trish
<p>I'm trying to make a frame for a lithograph that I plan to 3D print for my wife for Mother's Day.  I typically will have my differences be exactly the right size (rather than oversizing it for the sake of the preview) because it gives me a good feel for how accurate my math is (particularly when I'm accounting for the horizontal margin created by the compressed filament coming out of the nozzle).</p>
<p>In this case, however, it came back to bite me.  I debugged this issue for quite a while assuming I had miscalculated something or that I had confused my order of rotations somehow.</p>
<p>Eventually, I oversized my cutout and sure enough, the holes appeared correctly.  After poking at it, I realized I only need <code>0.000005 mm</code> on either side of my cutout for it to render correctly!</p>
<p>I've created a minimal reproducible example of my issue here:</p>
<pre><code>outerRadius = 100;
height = 40;

wallWidth = 2;

innerRadius = outerRadius - wallWidth / sin(60);
apothem = innerRadius * cos(180 / 6);

// change this to 0 and see what happens!!
holeSizeCorrection = 0.00001;

module holes() {
    for (face = [0:5]) {
        rotate([0, 0, face * 60 + 30])
            translate([apothem - holeSizeCorrection / 2, 0, height / 2])
                rotate([0, 90, 0])
                    cylinder(h = wallWidth + holeSizeCorrection, r = height / 4, $fn = 4);
    }    
}

color(&quot;orange&quot;) difference() {
    $fn = 6;
    
    cylinder(h = height, r = outerRadius);
    
    translate([0, 0, -height/4]) // because if it's exactly right, you can't see inside
        cylinder(h = height * 2, r = innerRadius);

    color(&quot;blue&quot;) holes();
}
</code></pre>
<p>When the holes I'm trying to cut in the polygon are exactly the width of the wall, it renders the preview correctly but the rendered output is incorrect.  To verify that the shape was correct, I moved the holes out of the difference and it looks like this:
<a href="https://i.sstatic.net/PDbL4.png" rel="noreferrer"><img src="https://i.sstatic.net/PDbL4.png" alt="enter image description here" /></a></p>
<p>The preview (aside from the strange exact cut issue that usually happens) is correct as well.  But, when I render it, it looks like this:
<a href="https://i.sstatic.net/zyS0z.png" rel="noreferrer"><img src="https://i.sstatic.net/zyS0z.png" alt="enter image description here" /></a></p>
<p>But, if I have the hole shape stick out <code>0.000005 mm</code> on either side, it renders just fine!
<a href="https://i.sstatic.net/ljnVX.png" rel="noreferrer"><img src="https://i.sstatic.net/ljnVX.png" alt="enter image description here" /></a></p>
<p>Now that I know to look for this kind of thing, it'll probably save me debugging time in the future. :)  But, it would be nice to know if I've done something wrong as well.</p>

CC BY-SA 4.0
2021-03-18T15:16:25.590Z
We are not a general 3D design place. What makes this relevant to 3D printing?
Trish
CC BY-SA 4.0
2021-03-18T16:09:14.743Z
@Trish, I plan to 3D print this shape.  Also, I assumed there's an `openscad` tag for a reason (for better or worse).  I think OpenScad is a relatively popular CAD for folks interested in 3D printing.  When I searched for "stackexchange openscad", 3dprinting was the first 3 results.  This is all just to answer your question . . . not to argue that it belongs here . . . I think you have a valid meta question for a beta 3d printing stack exchange.  My personal belief is that this community will likely end up discussing modeling tools as much as slicing tools (if not more).
D. Patrick
CC BY-SA 4.0
2021-03-18T16:13:21.687Z
The tag is there for that reason, but the policy is also, that with questions about 3D design, [you should tell how or why your question relates to 3D printing and is not just a modeling question](https://3dprinting.meta.stackexchange.com/questions/501/cad-questions-review). We had to do that because people started to ask questions without relation to 3D printing and treating us as a general 3D modeling SE. Please [edit] your question to include that it is to be a printed project.
Trish
CC BY-SA 4.0
2021-03-18T16:50:41.660Z
@Trish, I added background information to the question so that it'll be more obvious how my issue (precision in my shapes) is associated to 3d printing (being confident that my calculations are correct with regard to nozzle size).
D. Patrick
CC BY-SA 4.0
2022-01-10T18:20:27.253Z
A related question: https://3dprinting.stackexchange.com/questions/9794
user31389
CC BY-SA 4.0
2023-11-06T16:50:43.617Z
This is the well known https://en.wikipedia.org/wiki/Z-fighting   To solve this problem in OpenSCAD I use an `eps=0.001` global variable and make my cutouts like `translate([0,0,-eps])cylinder(r=Radius,h=Height+2*eps)`.   I also use `eps` to create an overlap/interference if I have a problem with multiple surfaces.
Dave X
<openscad>
Why does OpenSCAD fail to cut holes in polygon sides that are exactly the width of the wall?
D. Patrick
# Why does OpenSCAD fail to cut holes in polygon sides that are exactly the width of the wall?

(Asked by: username_0 on 2021-03-18)

I'm trying to make a frame for a lithograph that I plan to 3D print for my wife for Mother's Day. I typically will have my differences be exactly the right size (rather than oversizing it for the sake of the preview) because it gives me a good feel for how accurate my math is (particularly when I'm accounting for the horizontal margin created by the compressed filament coming out of the nozzle).

In this case, however, it came back to bite me. I debugged this issue for quite a while assuming I had miscalculated something or that I had confused my order of rotations somehow.

Eventually, I oversized my cutout and sure enough, the holes appeared correctly. After poking at it, I realized I only need `0.000005 mm` on either side of my cutout for it to render correctly!

I've created a minimal reproducible example of my issue here:

```
outerRadius = 100;
height = 40;

wallWidth = 2;

innerRadius = outerRadius - wallWidth / sin(60);
apothem = innerRadius * cos(180 / 6);

// change this to 0 and see what happens!!
holeSizeCorrection = 0.00001;

module holes() {
    for (face = [0:5]) {
        rotate([0, 0, face * 60 + 30])
            translate([apothem - holeSizeCorrection / 2, 0, height / 2])
                rotate([0, 90, 0])
                    cylinder(h = wallWidth + holeSizeCorrection, r = height / 4, $fn = 4);
    }    
}

color("orange") difference() {
    $fn = 6;
    
    cylinder(h = height, r = outerRadius);
    
    translate([0, 0, -height/4]) // because if it's exactly right, you can't see inside
        cylinder(h = height * 2, r = innerRadius);

    color("blue") holes();
}

```

When the holes I'm trying to cut in the polygon are exactly the width of the wall, it renders the preview correctly but the rendered output is incorrect. To verify that the shape was correct, I moved the holes out of the difference and it looks like this:
[![enter image description here](https://i.sstatic.net/PDbL4.png)](https://i.sstatic.net/PDbL4.png)

The preview (aside from the strange exact cut issue that usually happens) is correct as well. But, when I render it, it looks like this:
[![enter image description here](https://i.sstatic.net/zyS0z.png)](https://i.sstatic.net/zyS0z.png)

But, if I have the hole shape stick out `0.000005 mm` on either side, it renders just fine!
[![enter image description here](https://i.sstatic.net/ljnVX.png)](https://i.sstatic.net/ljnVX.png)

Now that I know to look for this kind of thing, it'll probably save me debugging time in the future. :) But, it would be nice to know if I've done something wrong as well.

**Tags:** openscad

> **Comments:**
> **username_1**: We are not a general 3D design place. What makes this relevant to 3D printing?  
> **username_0**: @username_1, I plan to 3D print this shape.  Also, I assumed there's an `openscad` tag for a reason (for better or worse).  I think OpenScad is a relatively popular CAD for folks interested in 3D printing.  When I searched for "stackexchange openscad", 3dprinting was the first 3 results.  This is all just to answer your question . . . not to argue that it belongs here . . . I think you have a valid meta question for a beta 3d printing stack exchange.  My personal belief is that this community will likely end up discussing modeling tools as much as slicing tools (if not more).  
> **username_1**: The tag is there for that reason, but the policy is also, that with questions about 3D design, [you should tell how or why your question relates to 3D printing and is not just a modeling question](https://3dprinting.meta.stackexchange.com/questions/501/cad-questions-review). We had to do that because people started to ask questions without relation to 3D printing and treating us as a general 3D modeling SE. Please [edit] your question to include that it is to be a printed project.  
> **username_0**: @username_1, I added background information to the question so that it'll be more obvious how my issue (precision in my shapes) is associated to 3d printing (being confident that my calculations are correct with regard to nozzle size).  
> **username_2**: A related question: https://3dprinting.stackexchange.com/questions/9794  
> **username_3**: This is the well known https://en.wikipedia.org/wiki/Z-fighting   To solve this problem in OpenSCAD I use an `eps=0.001` global variable and make my cutouts like `translate([0,0,-eps])cylinder(r=Radius,h=Height+2*eps)`.   I also use `eps` to create an overlap/interference if I have a problem with multiple surfaces.  

---

## 1 answers

### Answer by username_1 on 2021-03-18. Score: 4 | Accepted answer

openSCAD simply allows having surface solutions that result in a wall of 0 thickness. The walls appear to *clip* in those areas and can at times be seen from both sides, like in your example:

[![a 0 thickness wall clipping](https://i.sstatic.net/lIvMS.png)](https://i.sstatic.net/lIvMS.png)

A 0 thickness wall is also exportable into an STL as a set of triangles spun up by vertices that are in each other's plane but have inverted normal vectors for the two sides - which means that the construct *exists* for the computer - and I have used this in 3D designs for a hologram-effect, even if it does not result in a physically possible property set.

An example of that effect is this cube (made in blender), that has the back wall purple, all others are grey - and the internal wall is at the same X-value as the back wall. You see the grey wall clipping *despite* the normal of it pointing to +X while the normal of the purple wall is into -X.

[![enter image description here](https://i.sstatic.net/3QLzZ.png)](https://i.sstatic.net/3QLzZ.png)

By having your *cookie-cutter* extrude not just to but *through* the back wall, you force a solution that disallows the 0-surface solution and thus solves the problem of creating those *artifact* walls.

Note that the 0-surface wall persists in the slicer preview:

[![enter image description here](https://i.sstatic.net/kkRNX.png)](https://i.sstatic.net/kkRNX.png)
[![enter image description here](https://i.sstatic.net/pBaSe.png)](https://i.sstatic.net/pBaSe.png)

But rest assured: almost all slicers ignore walls that are too thin to be printed, and a 0 thickness wall especially is ignored:

[![enter image description here](https://i.sstatic.net/7wdmX.png)](https://i.sstatic.net/7wdmX.png)


---

