massive graphics bug | curve display differs in wireframe / shaded mode

Today I wasted quite some time due to a particular trecherous bug.
A bunch of edges showed up entirely different in shaded mode than in wireframe mode.
It is correct in wireframe mode, and false in

The fact that one is looking at the wrong data is just a *HUGE* error.
Its a very uncomfortable idea that you might be doing the right thing but seeing another.

Correct ( wireframe ):
http://jelleferinga.com/files/wireframe.png
False ( shaded ):
http://jelleferinga.com/files/shaded.png

OCC, please look into this! I'm really surprised that this bug hasn't surfaced earlier...
Frankly I'm *really* dissapointed about this. The kind of bug that makes you consider giving up on OCC.

-jelle

Pawel's picture

Hi jelle,

just an observation: I guess in the wireframe mode the 3D curves of the model are used and the shaded mode uses the surface in parametric space in order to generate triangulations. So I wonder how your model was created. Maybe there is an explanation for the discrepancy between the shaded and the wireframe modes...

Pawel

Andrey Betenev's picture

Hello Jelle,

In fact, your pictures do not look like different display of the same curves, but more resemble display of two different curves, perhaps built on the same points (e.g. with interpolation using different degree of BSpline).

I would suggest you to double check your data and possibly share your shape with others, so that other people could check this problem.
Trying to reproduce it in one of OCCT samples could be also good idea.

Andrey

jelle's picture

Hi Andrey, Pavel,

The following snippet introduces the difference in rendering in wireframe/shaded mode:

======= difference between wireframe/shaded mode =======

if debug:
display.DisplayColoredShape(make_edge(hp.GetHandle()), "YELLOW")
display.DisplayColoredShape(make_edge(hp_offset.GetHandle()), "GREEN")

hp.SetWeight(2, weight_apex)
hp_offset.SetWeight(2, weight_apex)

======= difference between wireframe/shaded mode =======

======= NO difference between wireframe/shaded mode =======

hp.SetWeight(2, weight_apex)
hp_offset.SetWeight(2, weight_apex)

if debug:
display.DisplayColoredShape(make_edge(hp.GetHandle()), "YELLOW")
display.DisplayColoredShape(make_edge(hp_offset.GetHandle()), "GREEN")

======= NO difference between wireframe/shaded mode =======

Where hp/hp_offset is a Geom_Bezier of 3 poles.

So, it seems to me that wireframe mode does show the bezier's correctly after their weights were updated, where shaded mode does not.
This is pretty inconsistent, though not as dramatic as I thought, since I was altering the curves after sending the edges to the display ( 'duh ).
Nevertheless, it might be interesting for you to know that this does introduce an inconsistent display of the curves.

Cheers,

-jelle