Discussion:
[OpenSCAD] adding a difference causes 2-manifold error?
John Lussmyer
2018-10-27 15:29:34 UTC
Permalink
I'm modifying a file from ThingVerse, and have run into an odd problem.
I added a couple more shapes to a long difference() (chopping a couple edges sloped instead of vertical)

and now I get the "WARNING: Object may not be a valid 2-manifold and may need repair!" message.

File is at http://casadelgato.com/work/v2.scad
(yes, it's messy...)


--
Worlds only All Electric F-250 truck! http://john.casadelgato.com/Electric-Vehicles/1995-Ford-F-250
Michael Frey
2018-10-27 17:30:32 UTC
Permalink
Hi John,

/(Note: I send some more screenshoots to John directly - those are too
big for the mailing list.)/

Let us start bit the difference with the two "bits".

When I add the # modifier, I see Z-Fighting.

Z-Fighting occurs when faces are coincident - OpenSCAD does not like
that as it is not clear whether the surface belongs to the model or not.

Please move the second bit down and make it a longer:

---------


adding the # modifier to if (cover > 0) {

that looks unclean:

so, let us move this cube up a bit:

and also the other cube, but the other cube has to be translated down a bit.

---------

adding the modifier # to if (spx<0) {

again, Z-Fighting:

so, move it down a bit:


With kind regards,

Michael Frey
stonysmith
2018-10-27 19:24:06 UTC
Permalink
Your hexagonal shapes sit directly upon the base. If you lower them by a very
tiny bit, even .001, then they will not be co-planar and will no longer
cause the error.



--
Sent from: http://forum.openscad.org/
John Lussmyer
2018-10-28 02:33:53 UTC
Permalink
Post by Michael Frey
Let us start bit the difference with the two "bits".
When I add the # modifier, I see Z-Fighting.
Z-Fighting occurs when faces are coincident - OpenSCAD does not like
that as it is not clear whether the surface belongs to the model or not.
Interesting, the bit defintions were in the original code, and I hadn't changed them.
I fixed them, even though they weren't actually causing the problem.
Post by Michael Frey
adding the # modifier to if (cover > 0) {
and also the other cube, but the other cube has to be translated down a bit.
Yup. That's the stuff I added, and hadn't figured out that I aligned things too closely.
(I've only used OpenSCAD a couple time previously)
Post by Michael Frey
adding the modifier # to if (spx<0) {
Again, old code, but I did fix it.

Thanks!! I also hadn't noticed the "#" modifier before. That REALLY helps!


--

Try my Sensible Email package! https://sourceforge.net/projects/sensibleemail/
Michael Frey
2018-10-28 07:51:36 UTC
Permalink
Hi John
Post by John Lussmyer
Interesting, the bit defintions were in the original code, and I hadn't changed them.
I fixed them, even though they weren't actually causing the problem.
Not all Z-Fighting causes problems down the line.

It can, so it is always good to look out for it.

You never know for sure when Z-Fighting is an issue or not, so fixing
any you see is good practice.
Post by John Lussmyer
Thanks!! I also hadn't noticed the "#" modifier before. That REALLY helps!
Awesome.

With kind regards,

Michael Frey

Loading...