discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Visual glitch

NH
nop head
Mon, Jul 25, 2022 8:46 AM

Fred, I don't think 0.128 is a round number in floating point. I use eps =
1/128 which is  0.0000001 in binary.

Roger, yes you need to avoid any negative surfaces clashing in the
entire design. I always wrap any differences with render() to ensure that
is the case with complex assemblies. It also speeds up rendering greatly
because OpenCSG just draws polygons. Union is free but difference is
relatively slow.

On Mon, 25 Jul 2022 at 09:35, Julien Jacquet jacquetjulien@gmail.com
wrote:

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


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

Fred, I don't think 0.128 is a round number in floating point. I use eps = 1/128 which is 0.0000001 in binary. Roger, yes you need to avoid any negative surfaces clashing in the entire design. I always wrap any differences with render() to ensure that is the case with complex assemblies. It also speeds up rendering greatly because OpenCSG just draws polygons. Union is free but difference is relatively slow. On Mon, 25 Jul 2022 at 09:35, Julien Jacquet <jacquetjulien@gmail.com> wrote: > 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 >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
JB
Jordan Brown
Mon, Jul 25, 2022 5:06 PM

On 7/24/2022 4:41 PM, tjhowse wrote:

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.

Normally you only apply it to faces where dimensions don't matter.  For
a difference, you apply it so as to make the subtracted-out object
clearly protrude from the subtracted-from object.  For an intersection,
you apply it so as to move the coincident face out of the model.  In
either event the remaining object is unchanged.

I started out using "epsilon" defined to be 0.01 or so, but I eventually
realized that there was no need for the fraction, and little need for
the name.  These days I just slap on a "+1" (or in some cases +2 or +3),
and idiomatically I know that that's for Z-fighting.  (There's few other
reasons that I would add a small integer to a dimension.)

Another trick, if you want to drill a hole all the way through
something, is to create a cylinder that's three times the thickness of
the thing you're drilling through, and center it vertically.  No matter
where you position that cylinder - one side, the other, or the center -
it will drill all the way through with room to spare.

On 7/24/2022 4:41 PM, tjhowse wrote: > 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. Normally you only apply it to faces where dimensions don't matter.  For a difference, you apply it so as to make the subtracted-out object clearly protrude from the subtracted-from object.  For an intersection, you apply it so as to move the coincident face out of the model.  In either event the remaining object is unchanged. I started out using "epsilon" defined to be 0.01 or so, but I eventually realized that there was no need for the fraction, and little need for the name.  These days I just slap on a "+1" (or in some cases +2 or +3), and idiomatically I know that that's for Z-fighting.  (There's few other reasons that I would add a small integer to a dimension.) Another trick, if you want to drill a hole all the way through something, is to create a cylinder that's three times the thickness of the thing you're drilling through, and center it vertically.  No matter where you position that cylinder - one side, the other, or the center - it will drill all the way through with room to spare.
NH
nop head
Mon, Jul 25, 2022 5:22 PM

Yes but if you use long cylinders to drill holes it preview breaks when you
zoom in, so it is better to make them fractionally too long.

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

On 7/24/2022 4:41 PM, tjhowse wrote:

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.

Normally you only apply it to faces where dimensions don't matter.  For a
difference, you apply it so as to make the subtracted-out object clearly
protrude from the subtracted-from object.  For an intersection, you apply
it so as to move the coincident face out of the model.  In either event the
remaining object is unchanged.

I started out using "epsilon" defined to be 0.01 or so, but I eventually
realized that there was no need for the fraction, and little need for the
name.  These days I just slap on a "+1" (or in some cases +2 or +3), and
idiomatically I know that that's for Z-fighting.  (There's few other
reasons that I would add a small integer to a dimension.)

Another trick, if you want to drill a hole all the way through something,
is to create a cylinder that's three times the thickness of the thing
you're drilling through, and center it vertically.  No matter where you
position that cylinder - one side, the other, or the center - it will drill
all the way through with room to spare.


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

Yes but if you use long cylinders to drill holes it preview breaks when you zoom in, so it is better to make them fractionally too long. On Mon, 25 Jul 2022 at 18:07, Jordan Brown <openscad@jordan.maileater.net> wrote: > On 7/24/2022 4:41 PM, tjhowse wrote: > > 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. > > > Normally you only apply it to faces where dimensions don't matter. For a > difference, you apply it so as to make the subtracted-out object clearly > protrude from the subtracted-from object. For an intersection, you apply > it so as to move the coincident face out of the model. In either event the > remaining object is unchanged. > > I started out using "epsilon" defined to be 0.01 or so, but I eventually > realized that there was no need for the fraction, and little need for the > name. These days I just slap on a "+1" (or in some cases +2 or +3), and > idiomatically I know that that's for Z-fighting. (There's few other > reasons that I would add a small integer to a dimension.) > > Another trick, if you want to drill a hole all the way through something, > is to create a cylinder that's three times the thickness of the thing > you're drilling through, and center it vertically. No matter where you > position that cylinder - one side, the other, or the center - it will drill > all the way through with room to spare. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
PW
Philip White
Fri, Jul 29, 2022 6:39 PM

I’ve experienced this issue myself in preview and understand the root cause. But I am wondering, is the issue only visual, or does it /ever/ have practical consequences on the final product?

If it’s only visual, then maybe I’d prefer to accept it rather than add minor complexity to my models with epsilons.


Philip

On Jul 24, 2022, at 14:44, Julien Jacquet jacquetjulien@gmail.com wrote:

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

I’ve experienced this issue myself in preview and understand the root cause. But I am wondering, is the issue only visual, or does it /ever/ have practical consequences on the final product? If it’s only visual, then maybe I’d prefer to accept it rather than add minor complexity to my models with epsilons. — Philip > On Jul 24, 2022, at 14:44, Julien Jacquet <jacquetjulien@gmail.com> wrote: > > 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
JJ
Julien Jacquet
Fri, Jul 29, 2022 7:07 PM

Sometimes this has consequences.
If I tilt the cylinder in the example by a rotation along the X axis then,
this time because of the precision in the numbers I think, it sticks.

Le ven. 29 juil. 2022 à 20:48, Philip White philip@mailworks.org a écrit :

I’ve experienced this issue myself in preview and understand the root
cause. But I am wondering, is the issue only visual, or does it /ever/ have
practical consequences on the final product?

If it’s only visual, then maybe I’d prefer to accept it rather than add
minor complexity to my models with epsilons.


Philip

On Jul 24, 2022, at 14:44, Julien Jacquet jacquetjulien@gmail.com

wrote:

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


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

Sometimes this has consequences. If I tilt the cylinder in the example by a rotation along the X axis then, this time because of the precision in the numbers I think, it sticks. Le ven. 29 juil. 2022 à 20:48, Philip White <philip@mailworks.org> a écrit : > I’ve experienced this issue myself in preview and understand the root > cause. But I am wondering, is the issue only visual, or does it /ever/ have > practical consequences on the final product? > > If it’s only visual, then maybe I’d prefer to accept it rather than add > minor complexity to my models with epsilons. > > — > Philip > > > On Jul 24, 2022, at 14:44, Julien Jacquet <jacquetjulien@gmail.com> > wrote: > > > > 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 > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
MM
Michael Marx
Sat, Jul 30, 2022 12:10 AM

In simple geometry, like parallel faces aligned with an axis, it can usually have no consequences.

But co-incident faces will bite you on the arse eventually.

Avoid them, else suffer the CGAL Error...


From: Julien Jacquet [mailto:jacquetjulien@gmail.com]
Sent: Sat, 30 Jul 2022 05:08
To: OpenSCAD general discussion
Subject: [OpenSCAD] Re: Visual glitch

Sometimes this has consequences.

If I tilt the cylinder in the example by a rotation along the X axis then, this time because of the precision in the numbers I think, it sticks.

Le ven. 29 juil. 2022 à 20:48, Philip White philip@mailworks.org a écrit :

I’ve experienced this issue myself in preview and understand the root cause. But I am wondering, is the issue only visual, or does it /ever/ have practical consequences on the final product?

If it’s only visual, then maybe I’d prefer to accept it rather than add minor complexity to my models with epsilons.


Philip

On Jul 24, 2022, at 14:44, Julien Jacquet jacquetjulien@gmail.com wrote:

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


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

--
This email has been checked for viruses by AVG.
https://www.avg.com

In simple geometry, like parallel faces aligned with an axis, it can usually have no consequences. But co-incident faces will bite you on the arse eventually. Avoid them, else suffer the CGAL Error... _____ From: Julien Jacquet [mailto:jacquetjulien@gmail.com] Sent: Sat, 30 Jul 2022 05:08 To: OpenSCAD general discussion Subject: [OpenSCAD] Re: Visual glitch Sometimes this has consequences. If I tilt the cylinder in the example by a rotation along the X axis then, this time because of the precision in the numbers I think, it sticks. Le ven. 29 juil. 2022 à 20:48, Philip White <philip@mailworks.org> a écrit : I’ve experienced this issue myself in preview and understand the root cause. But I am wondering, is the issue only visual, or does it /ever/ have practical consequences on the final product? If it’s only visual, then maybe I’d prefer to accept it rather than add minor complexity to my models with epsilons. — Philip > On Jul 24, 2022, at 14:44, Julien Jacquet <jacquetjulien@gmail.com> wrote: > > 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 _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org -- This email has been checked for viruses by AVG. https://www.avg.com
M
mikeonenine@web.de
Sat, Jul 30, 2022 1:18 AM

#1 The glitch can be avoided by using circles instead of cylinders, then linear_extruding the difference.

#2 If you still want to use cylinders, make both center=true and make the one to be subtracted a tiny bit higher/longer than the other.

#3 Center=true is also useful for two differences that do not go all the way through as with the cutouts on either side of a connecting rod. Then you can use + and - the same offset on each side of the middle and don’t have to take into account the thickness.

\#1 The glitch can be avoided by using circles instead of cylinders, then linear_extruding the difference. \#2 If you still want to use cylinders, make both center=true and make the one to be subtracted a tiny bit higher/longer than the other. \#3 Center=true is also useful for two differences that do not go all the way through as with the cutouts on either side of a connecting rod. Then you can use + and - the same offset on each side of the middle and don’t have to take into account the thickness.
JJ
Julien Jacquet
Sun, Aug 7, 2022 12:38 PM

Great !

Le sam. 30 juil. 2022 à 03:20, mikeonenine@web.de a écrit :

#1 The glitch can be avoided by using circles instead of cylinders, then
linear_extruding the difference.

#2 If you still want to use cylinders, make both center=true and make the
one to be subtracted a tiny bit higher/longer than the other.

#3 Center=true is also useful for two differences that do not go all the
way through as with the cutouts on either side of a connecting rod. Then
you can use + and - the same offset on each side of the middle and don’t
have to take into account the thickness.


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

Great ! Le sam. 30 juil. 2022 à 03:20, <mikeonenine@web.de> a écrit : > #1 The glitch can be avoided by using circles instead of cylinders, then > linear_extruding the difference. > > #2 If you still want to use cylinders, make both center=true and make the > one to be subtracted a tiny bit higher/longer than the other. > > #3 Center=true is also useful for two differences that do not go all the > way through as with the cutouts on either side of a connecting rod. Then > you can use + and - the same offset on each side of the middle and don’t > have to take into account the thickness. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >