discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Visual glitch

JJ
Julien Jacquet
Sun, Jul 24, 2022 9:44 PM

Hello,
A question please...
What's the explanation of the visual glitch below?
Are these two surfaces (in the preview) a problem?
Thank you![image: surf.png]
[image: surf2.png]

Hello, A question please... What's the explanation of the visual glitch below? Are these two surfaces (in the preview) a problem? Thank you![image: surf.png] [image: surf2.png]
T
trygve@totallytrygve.com
Sun, Jul 24, 2022 9:53 PM

Hi!

Openscad has problems deciding if the planes exist or not since you're subtracting a cylinder of the same height from the original one.

Change the translate to ([25,0,-1])
and the subtracted cylinder to (r=30, h=14)

Now the render will have no issues.

It'll render faster, too...

Trygve

Den 24. juli 2022 kl. 23.44.22 +02.00 skrev Julien Jacquet jacquetjulien@gmail.com:

Hello,
A question please...
What's the explanation of the visual glitch below?
Are these two surfaces (in the preview) a problem?
Thank you!surf.png
surf2.png


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Hi! Openscad has problems deciding if the planes exist or not since you're subtracting a cylinder of the same height from the original one. Change the translate to ([25,0,-1]) and the subtracted cylinder to (r=30, h=14) Now the render will have no issues. It'll render faster, too... Trygve Den 24. juli 2022 kl. 23.44.22 +02.00 skrev Julien Jacquet <jacquetjulien@gmail.com>: > Hello, > A question please... > What's the explanation of the visual glitch below? > Are these two surfaces (in the preview) a problem? > Thank you!surf.png > surf2.png > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to <discuss-leave@lists.openscad.org> >
JB
Jordan Brown
Sun, Jul 24, 2022 9:58 PM
Here's the documentation: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#What_are_those_strange_flickering_artifacts_in_the_preview?
JJ
Julien Jacquet
Sun, Jul 24, 2022 10:13 PM

Ok the problem is the floating point values, thanks

Le dim. 24 juil. 2022 à 23:59, Jordan Brown openscad@jordan.maileater.net
a écrit :

Ok the problem is the floating point values, thanks Le dim. 24 juil. 2022 à 23:59, Jordan Brown <openscad@jordan.maileater.net> a écrit : > Here's the documentation: > > https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#What_are_those_strange_flickering_artifacts_in_the_preview > ? > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
J
jon
Sun, Jul 24, 2022 10:32 PM

Julien:

It is not that simple.  The two surfaces are in the exact same place,
floating point or not.  And in the case of OpenSCAD, I believe that
coordinates are not stored as floating point

Jon

On 7/24/2022 6:13 PM, Julien Jacquet wrote:

Ok the problem is the floating point values, thanks

Le dim. 24 juil. 2022 à 23:59, Jordan Brown
openscad@jordan.maileater.net a écrit :

 Here's the documentation:
 https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#What_are_those_strange_flickering_artifacts_in_the_preview?

 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org

OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org

Julien: It is not that simple.  The two surfaces are in the exact same place, floating point or not.  And in the case of OpenSCAD, I believe that coordinates are not stored as floating point Jon On 7/24/2022 6:13 PM, Julien Jacquet wrote: > Ok the problem is the floating point values, thanks > > Le dim. 24 juil. 2022 à 23:59, Jordan Brown > <openscad@jordan.maileater.net> a écrit : > > Here's the documentation: > https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#What_are_those_strange_flickering_artifacts_in_the_preview? > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
JB
Jordan Brown
Sun, Jul 24, 2022 10:34 PM

On 7/24/2022 3:13 PM, Julien Jacquet wrote:

Ok the problem is the floating point values, thanks

Eh, not really.

You'll see this behavior with simple integer cases.

difference() {
    cube(2);
    cube(1);
}

The problem is not unique to OpenSCAD.  See
https://en.wikipedia.org/wiki/Z-fighting for a generic discussion.

On 7/24/2022 3:13 PM, Julien Jacquet wrote: > Ok the problem is the floating point values, thanks Eh, not really. You'll see this behavior with simple integer cases. difference() { cube(2); cube(1); } The problem is not unique to OpenSCAD.  See https://en.wikipedia.org/wiki/Z-fighting for a generic discussion.
T
tjhowse
Sun, Jul 24, 2022 11:41 PM

I fix this by including a "zff = 0.001;", for "Z-Fight Fudge", constant at
the top of my files. When the z-fighting in the previous is particularly
troublesome I can use zff to make something slightly taller, or shorter, or
moved slightly, to eliminate the ambiguity of which face is closer to the
camera. The value is too small to cause any dimensional problems for the
things I work on, but it can be set back to 0 for exporting if you're
paranoid.

On Mon, 25 Jul 2022 at 08:35, Jordan Brown openscad@jordan.maileater.net
wrote:

On 7/24/2022 3:13 PM, Julien Jacquet wrote:

Ok the problem is the floating point values, thanks

Eh, not really.

You'll see this behavior with simple integer cases.

difference() {
cube(2);
cube(1);
}

The problem is not unique to OpenSCAD.  See
https://en.wikipedia.org/wiki/Z-fighting for a generic discussion.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I fix this by including a "zff = 0.001;", for "Z-Fight Fudge", constant at the top of my files. When the z-fighting in the previous is particularly troublesome I can use zff to make something slightly taller, or shorter, or moved slightly, to eliminate the ambiguity of which face is closer to the camera. The value is too small to cause any dimensional problems for the things I work on, but it can be set back to 0 for exporting if you're paranoid. On Mon, 25 Jul 2022 at 08:35, Jordan Brown <openscad@jordan.maileater.net> wrote: > On 7/24/2022 3:13 PM, Julien Jacquet wrote: > > Ok the problem is the floating point values, thanks > > > Eh, not really. > > You'll see this behavior with simple integer cases. > > difference() { > cube(2); > cube(1); > } > > The problem is not unique to OpenSCAD. See > https://en.wikipedia.org/wiki/Z-fighting for a generic discussion. > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
F
fred
Sun, Jul 24, 2022 11:47 PM

I'd read somewhere that OpenSCAD likes binary numbers. To that end, my "addabit" is 0.128 or 0.0128 for correcting this type of problem. A specific primitive being subtracted is sized with " + addabit" and translated with " - addabit / 2" with good (fast) results.

On Sunday, July 24, 2022 at 07:42:59 PM EDT, tjhowse <tjhowse@gmail.com> wrote:  

I fix this by including a "zff = 0.001;", for "Z-Fight Fudge", constant at the top of my files. When the z-fighting in the previous is particularly troublesome I can use zff to make something slightly taller, or shorter, or moved slightly, to eliminate the ambiguity of which face is closer to the camera. The value is too small to cause any dimensional problems for the things I work on, but it can be set back to 0 for exporting if you're paranoid.

On Mon, 25 Jul 2022 at 08:35, Jordan Brown openscad@jordan.maileater.net wrote:

On 7/24/2022 3:13 PM, Julien Jacquet wrote:

Ok the problem is the floating point values, thanks

Eh, not really.

You'll see this behavior with simple integer cases.

difference() {
cube(2);
cube(1);
}

The problem is not unique to OpenSCAD.  See https://en.wikipedia.org/wiki/Z-fighting for a generic discussion.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I'd read somewhere that OpenSCAD likes binary numbers. To that end, my "addabit" is 0.128 or 0.0128 for correcting this type of problem. A specific primitive being subtracted is sized with " + addabit" and translated with " - addabit / 2" with good (fast) results. On Sunday, July 24, 2022 at 07:42:59 PM EDT, tjhowse <tjhowse@gmail.com> wrote: I fix this by including a "zff = 0.001;", for "Z-Fight Fudge", constant at the top of my files. When the z-fighting in the previous is particularly troublesome I can use zff to make something slightly taller, or shorter, or moved slightly, to eliminate the ambiguity of which face is closer to the camera. The value is too small to cause any dimensional problems for the things I work on, but it can be set back to 0 for exporting if you're paranoid. On Mon, 25 Jul 2022 at 08:35, Jordan Brown <openscad@jordan.maileater.net> wrote: On 7/24/2022 3:13 PM, Julien Jacquet wrote: Ok the problem is the floating point values, thanks Eh, not really. You'll see this behavior with simple integer cases. difference() { cube(2); cube(1); } The problem is not unique to OpenSCAD.  See https://en.wikipedia.org/wiki/Z-fighting for a generic discussion. _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org
RW
Rogier Wolff
Mon, Jul 25, 2022 4:53 AM

On Sun, Jul 24, 2022 at 03:34:58PM -0700, Jordan Brown wrote:

The problem is not unique to OpenSCAD.  See
https://en.wikipedia.org/wiki/Z-fighting for a generic discussion.

What /is/ unique to openscad is that it happens with stuff that is
invisble.

Hmm. My example now doesn't do it:

cube (10);

difference () {
cube ([20,9,8]);
translate ([-5,5,5]) cube ([30,5,5]);
}

In more complex cases I see it happening when the object that is
subtracted from something else conincides with a plane of something
visible.

Roger. 

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Sun, Jul 24, 2022 at 03:34:58PM -0700, Jordan Brown wrote: > The problem is not unique to OpenSCAD.  See > https://en.wikipedia.org/wiki/Z-fighting for a generic discussion. What /is/ unique to openscad is that it happens with stuff that is invisble. Hmm. My example now doesn't do it: cube (10); difference () { cube ([20,9,8]); translate ([-5,5,5]) cube ([30,5,5]); } In more complex cases I see it happening when the object that is subtracted from something else conincides with a plane of something visible. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
JJ
Julien Jacquet
Mon, Jul 25, 2022 8:34 AM

Ok, thank you to all the people who responded, all your input was helpful.
I like the idea of the variable at the beginning of the program with a
small epsilon
Julien

Le lun. 25 juil. 2022 à 06:54, Rogier Wolff R.E.Wolff@bitwizard.nl a
écrit :

On Sun, Jul 24, 2022 at 03:34:58PM -0700, Jordan Brown wrote:

The problem is not unique to OpenSCAD.  See
https://en.wikipedia.org/wiki/Z-fighting for a generic discussion.

What /is/ unique to openscad is that it happens with stuff that is
invisble.

Hmm. My example now doesn't do it:

cube (10);

difference () {
cube ([20,9,8]);
translate ([-5,5,5]) cube ([30,5,5]);
}

In more complex cases I see it happening when the object that is
subtracted from something else conincides with a plane of something
visible.

     Roger.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Ok, thank you to all the people who responded, all your input was helpful. I like the idea of the variable at the beginning of the program with a small epsilon Julien Le lun. 25 juil. 2022 à 06:54, Rogier Wolff <R.E.Wolff@bitwizard.nl> a écrit : > On Sun, Jul 24, 2022 at 03:34:58PM -0700, Jordan Brown wrote: > > The problem is not unique to OpenSCAD. See > > https://en.wikipedia.org/wiki/Z-fighting for a generic discussion. > > What /is/ unique to openscad is that it happens with stuff that is > invisble. > > Hmm. My example now doesn't do it: > > > cube (10); > > difference () { > cube ([20,9,8]); > translate ([-5,5,5]) cube ([30,5,5]); > } > > In more complex cases I see it happening when the object that is > subtracted from something else conincides with a plane of something > visible. > > Roger. > > -- > ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 > ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > f equals m times a. When your f is steady, and your m is going down > your a is going up. -- Chris Hadfield about flying up the space shuttle. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >