3D display artefacts

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
perot
Posts: 146
Joined: Wed Aug 30, 2017 5:40 pm

3D display artefacts

Post by perot »

Hi,

I have a problem with the 3D display of my model in the main window.

I have a frame, consisting of 8 ribs, for a vessel with rotational symmetry. The ribs are a polar array of the defining rib, rotated about the z-axis. One section of the rib outline is a straight but tilted line, which therefore defines a cone outline of the vessel in that area.

The skin in that area ("cover") is to be a thin sheet. So I created a sketch. I tried to directly use external geometry from the defining rib, but this seems not possible ("belongs to another object, can't link"). I believe the proper way is a shape binder of the defining rib (Is that right?). With that, I have the external geometry and can create the crosssection of the cover as a rectangle in the sketch:

prob1.png
prob1.png (128.71 KiB) Viewed 1623 times

When I rotate this sketch about the z-axis, I believe I get a cover that just about touches the rib at the symmetry plane of the rib, at the edges there will be an intersection of a few micrometers, because of the curvature of the cover. I was surprised to find that the edges of the ribs actually seem to protrude completely through the cover (i.e. an intersection of a millimeter), which is incomprehensible to me:

prob2.png
prob2.png (108.08 KiB) Viewed 1623 times

When I look at the place of the intersection from below, I find I can actually see the edge as a line:

prob3.png
prob3.png (141.96 KiB) Viewed 1623 times

However, when I zoom in, the line disappears:

prob4.png
prob4.png (118.24 KiB) Viewed 1623 times

This is what might have been expected form the beginning, after all, there should be an intersection visible. However, when I increate the cover's z coordinate to resolve the intersection, I need to do that by many tenths of a millimeter, which is absurd.

What's going on here? Is that an artefakt of the cone-shaped cover being approximated by polygonal surfaces? This appears not to be the case, as at the position of the sketch I find an edge of the cone polygons, so at least there the display should be correct, but it isn't.

How can I control these artefacts? Whether the artefacts show up depends on the view direction and the zoom level.

Cheers Peter
Attachments
problem.FCStd
(48.57 KiB) Downloaded 20 times
User avatar
papyblaise
Veteran
Posts: 8011
Joined: Thu Jun 13, 2019 4:28 pm
Location: France

Re: 3D display artefacts

Post by papyblaise »

it's just a visual problem, a very thin "skin" does not seem to cover the support below, only at a large zoom,
if we zoom as closely as possible, the transparency disappears
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: 3D display artefacts

Post by chrisb »

I don't think that there is a real problem, it is only a visual thing: The seams are not zoomed, they have a certain pixel thickness. If you zoom out, they can well shine through, but the surface still remains intact.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
perot
Posts: 146
Joined: Wed Aug 30, 2017 5:40 pm

Re: 3D display artefacts

Post by perot »

chrisb wrote: Sun Nov 21, 2021 6:06 pm The seams are not zoomed, they have a certain pixel thickness.
I would accept this as the explanation for the view issue arising when looking from below, but
If you zoom out, they can well shine through, but the surface still remains intact.
for the view from above it does not make sense. Any properly implemented hidden-object algorithm had to find that these lines are hidden, and therefore are not to be displayed. Now, a z-buffer type algorithm has a limited resolution, given by the number of bits alotted for each pixel. If z-buffer is indeed used for hidden-line removal, is the number of bits used that low?? If so, is there a way to increase it?

Cheers Peter

PS.: I know there is no problem with these artefacts within FreeCAD. However, I like to use screenshots for presenting models, so much more convenient than rendering/raytracing each time. Screenshots with these artefacts from above are useless for that.
perot
Posts: 146
Joined: Wed Aug 30, 2017 5:40 pm

Re: 3D display artefacts

Post by perot »

Seems these artefacts are unrelated to the peculiarities of my model. I created an extremely simple situation where they occur.

From the Part workbench, I create two cubes. One I leave with default parameters, the other one's thickness (Height) I reduce to a Millimeter, then elevate it to z=10mm (i.e. on top and touching the unmodified cube). I also enlarge length and width a bit. Nothing spectacular happens. But when you zoom out enough, the unmodified cube becomes visible through the one on top:

Untitled.png
Untitled.png (3.85 KiB) Viewed 1462 times

Cheers Peter
Attachments
test.FCStd
(8.79 KiB) Downloaded 20 times
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: 3D display artefacts

Post by chrisb »

perot wrote: Tue Nov 23, 2021 2:09 pm Any properly implemented hidden-object algorithm had to find that these lines are hidden, and therefore are not to be displayed. Now, a z-buffer type algorithm has a limited resolution, given by the number of bits alotted for each pixel. If z-buffer is indeed used for hidden-line removal, is the number of bits used that low?? If so, is there a way to increase it?
It sounds as if you have good knowledge of such implementations. Care to help out to improve this?
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Shalmeneser
Veteran
Posts: 9580
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: 3D display artefacts

Post by Shalmeneser »

perot wrote: Sun Nov 21, 2021 5:51 pm However, I like to use screenshots for presenting models, so much more convenient than rendering/raytracing each time. Screenshots with these artefacts from above are useless for that.
Revolve001 : z-offset = 1 mm (just for visualization)
User avatar
Shalmeneser
Veteran
Posts: 9580
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: 3D display artefacts

Post by Shalmeneser »

Btw, your 1st sketch is overly-complex.
Attachments
Capture du 2021-11-23 22-30-07.png
Capture du 2021-11-23 22-30-07.png (1.93 KiB) Viewed 1388 times
problem_SHALM.FCStd
(86 KiB) Downloaded 16 times
perot
Posts: 146
Joined: Wed Aug 30, 2017 5:40 pm

Re: 3D display artefacts

Post by perot »

Shalmeneser wrote: Tue Nov 23, 2021 8:40 pm
perot wrote: Sun Nov 21, 2021 5:51 pm However, I like to use screenshots for presenting models, so much more convenient than rendering/raytracing each time. Screenshots with these artefacts from above are useless for that.
Revolve001 : z-offset = 1 mm (just for visualization)
That's absurd. How should that work? There are lots of other items (of course not included in the problem.FCStd) visible outside to which the positional relationship would be completely wrong, and in a good resolution screenshot this is not just visible but very obvious.

Btw, your 1st sketch is overly-complex.
Why? By what criteria? Who are you to stipulate what is overly-complex, and what not?
It works, that's what's important.

problem_SHALM.FCStd
I think I finally understand what you wanted to express here. I like the technique and may employ it next time I have a more complex sketch. Thanks for the hint.

What I do not like though are posts where the author has turned their statement into a riddle to be solved, and where at the end I can never be sure to have understood it correctly.
perot
Posts: 146
Joined: Wed Aug 30, 2017 5:40 pm

Re: 3D display artefacts

Post by perot »

chrisb wrote: Tue Nov 23, 2021 2:43 pm
perot wrote: Tue Nov 23, 2021 2:09 pm Any properly implemented hidden-object algorithm had to find that these lines are hidden, and therefore are not to be displayed. Now, a z-buffer type algorithm has a limited resolution, given by the number of bits alotted for each pixel. If z-buffer is indeed used for hidden-line removal, is the number of bits used that low?? If so, is there a way to increase it?
It sounds as if you have good knowledge of such implementations. Care to help out to improve this?
Unfortunately my knowledge is incomplete and probably outdated. I have dabbled in 3D graphics programming a fair bit in the 1980s and 90s, but I think even then my 3D graphics knowledge was far from comprehensive. I'm sure new techniques have been invented since. So even though I probably have a bit of a head start compared to most people in the forum, the learning curve would be steep for me too.

I may try anyway if it bugs me enough. ;)

Cheers Peter
Post Reply