Visualisation problem

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
jmmm
Posts: 4
Joined: Mon Sep 16, 2019 11:34 pm

Visualisation problem

Post by jmmm »

Hello everyone!

When I have two pieces in the same place and I try to select any of them, I have a problem with the visualisation of the selection. You'll probably see better in the picture. It's like a render problem.
Screenshot from 2019-09-17 01-48-42.png
Screenshot from 2019-09-17 01-48-42.png (168.84 KiB) Viewed 1504 times
How could I fix it?

Thanks ;)
chrisb
Veteran
Posts: 54286
Joined: Tue Mar 17, 2015 9:14 am

Re: Visualisation problem

Post by chrisb »

Hi and welcome to the forum!

There is nothing to be fixed, the effekt is known as z-fighting. If you want to make a single solid you could make Union of these two objects. But beware, usually it is not recommended to use booleans on coplanar faces.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Visualisation problem

Post by vocx »

jmmm wrote: Tue Sep 17, 2019 12:15 am ...
When I have two pieces in the same place and I try to select any of them, I have a problem with the visualisation of the selection. You'll probably see better in the picture. It's like a render problem.
...
I can't find the thread where one of the lead FreeCAD developers mentions this problem. It is known as Z-fighting, and it's not an easy to solve problem.

Z indicates the coordinate direction normal to the surface. So, it indicates that both surfaces fight to be on top. In your opinion, which surface should be on top? The two cubes are mathematically defined as having a face in exactly the same Z-coordinate, so how can you tell which should be on top? It's not as simple as saying this one or the other one.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Visualisation problem

Post by Joel_graff »

It might be useful to address one case regarding z-fighting (which is nicely illustrated here). That is, where two faces are coplanar, the selected face should always be rendered on top.

I realize this can't be maintained in more complex selection cases (i.e., where multiple coplanar faces are picked), but if it's not a terribly difficult thing to implement in a single select case or a multi-select where no selected faces are coplanar, maybe we should put it on the list.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
chrisb
Veteran
Posts: 54286
Joined: Tue Mar 17, 2015 9:14 am

Re: Visualisation problem

Post by chrisb »

Joel_graff wrote: Tue Sep 17, 2019 11:40 amThat is, where two faces are coplanar, the selected face should always be rendered on top.
I'm not sure about this. For me it is a valuable information to see z-fighting, because it usually is something I don't want. It is either a visibility issue or I have modeled something unwanted. So z-fighting bears soome information in its own.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Visualisation problem

Post by bitacovir »

chrisb wrote: Tue Sep 17, 2019 12:11 pm So z-fighting bears soome information in its own.
I agree. it is some kind of clash alert.
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

Canal Youtube Grupo Telegram de FreeCAD Español

My personal web site
My GitHub repository
Mini Airflow Tunnel Project
User avatar
Joel_graff
Veteran
Posts: 1949
Joined: Fri Apr 28, 2017 4:23 pm
Contact:

Re: Visualisation problem

Post by Joel_graff »

chrisb wrote: Tue Sep 17, 2019 12:11 pm I'm not sure about this. For me it is a valuable information to see z-fighting, because it usually is something I don't want. It is either a visibility issue or I have modeled something unwanted. So z-fighting bears soome information in its own.
A good point.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails

pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
jmmm
Posts: 4
Joined: Mon Sep 16, 2019 11:34 pm

Re: Visualisation problem

Post by jmmm »

bitacovir wrote: Tue Sep 17, 2019 12:37 pm
chrisb wrote: Tue Sep 17, 2019 12:11 pm So z-fighting bears soome information in its own.
I agree. it is some kind of clash alert.
Hello again!

Maybe we could create an optional z-fighting filter. Something like in the picture:
zproblem.png
zproblem.png (252.2 KiB) Viewed 1409 times
In this case, you could conserve much information, but also you can disable the filter.

The criteria to render could be the actual selection or the creation order in the tree list.

Thanks for the answers :D
chrisb
Veteran
Posts: 54286
Joined: Tue Mar 17, 2015 9:14 am

Re: Visualisation problem

Post by chrisb »

jmmm wrote: Tue Sep 17, 2019 3:52 pm Maybe we could create an optional z-fighting filter.
What's bad about seeing it? If it's about selecting one of the two faces it's a different issue, probably similar to selecting something which is not on top at all.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
jmmm
Posts: 4
Joined: Mon Sep 16, 2019 11:34 pm

Re: Visualisation problem

Post by jmmm »

chrisb wrote: Tue Sep 17, 2019 4:07 pm
jmmm wrote: Tue Sep 17, 2019 3:52 pm Maybe we could create an optional z-fighting filter.
What's bad about seeing it? If it's about selecting one of the two faces it's a different issue, probably similar to selecting something which is not on top at all.
Well, I think it's a graphic design question (but I'm not graphic designer :? ). In the visualisation, you want to show the most relevant information in a graphic simple way. With the z-fighting effect you are using a lot of random graphic dynamic effects only to say that you have two o more things in the same position. But an easy graphic solution is to show only one static uniform effect (a color, a patron, etc) to show the same relevant information. I think it could be less distracting, more predictable, more easy to remember and understand, and in general, more efficient (graphically speaking ;) ).
Post Reply