Test request: quarter based viewer

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
looo
Posts: 2744
Joined: Mon Nov 11, 2013 5:29 pm

Re: Test request: quarter based viewer

Postby looo » Thu Nov 06, 2014 5:32 pm

thanks!
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Test request: quarter based viewer

Postby NormandC » Wed Dec 31, 2014 10:56 pm

Guys,

Lately I've been having display problems and I suspect the quarter-based viewer. It happens when I open multiple files. At some point one of the files won't display in Flat lines mode anymore, and sketches will disappear.

It just happened again. I had two files opened, here's how the remaining file was suddenly showing after I closed the other one.
FC_display_bug_01.png
FC_display_bug_01.png (20.01 KiB) Viewed 809 times
I should add that the sketches completely disappeared, only when I selected them in the tree did they show again, but they are completely garbled.

After closing and opening FreeCAD again and loading the file, here's how it should look like:
FC_Display_bug_02.png
File displayed properly after restart of FreeCAD.
FC_Display_bug_02.png (17.78 KiB) Viewed 809 times
I have no idea how to troubleshoot this effectively as I cannot reliably reproduce this problem. Should I run FreeCAD through gdb from now on and wait for such issues to manifest again?

Using the Daily Builds PPA, details below. I also have MSAA 8x enabled.
OS: Ubuntu 14.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4356 (Git)
Branch: master
Hash: 7aa91ecee36a293d0b075346039b0584188acc14
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.1
wmayer
Site Admin
Posts: 14640
Joined: Thu Feb 19, 2009 10:32 am

Re: Test request: quarter based viewer

Postby wmayer » Thu Jan 01, 2015 10:05 am

Lately I've been having display problems and I suspect the quarter-based viewer. It happens when I open multiple files. At some point one of the files won't display in Flat lines mode anymore, and sketches will disappear.
So, then it's not only me. I have seen this already a few times but thought that it might be the graphic driver because it's another computer I am currently working with.
I have no idea how to troubleshoot this effectively as I cannot reliably reproduce this problem. Should I run FreeCAD through gdb from now on and wait for such issues to manifest again?
The debugger doesn't help. The problem is not that it crashes but it shows a strange behaviour. So, my guess is that it might be related to the marriage of Quarter and Qt's QGraphicsView and its resulting changes. I assume that somewhere in the code we have to set or reset an OpenGL state. This e.g. was also the problem we once had when opening an image and the 3d view and the image disappeared completely.
ickby
Posts: 2914
Joined: Wed Oct 05, 2011 7:36 am

Re: Test request: quarter based viewer

Postby ickby » Thu Jan 01, 2015 10:39 am

Strange, I did never encounter that behaviour. But in my current development branch I integrated the coin rendering way better into qt's render process, hopefully that will help solving that issue.
wmayer
Site Admin
Posts: 14640
Joined: Thu Feb 19, 2009 10:32 am

Re: Test request: quarter based viewer

Postby wmayer » Thu Jan 01, 2015 11:12 am

There is a workaround that always "fixed" the problem for me.
When the issue appears go to View > Create new view. This creates a further view of this document and everything goes back to normal. You then can safely close the first view.
wmayer
Site Admin
Posts: 14640
Joined: Thu Feb 19, 2009 10:32 am

Re: Test request: quarter based viewer

Postby wmayer » Thu Jan 01, 2015 11:30 am

OK, here is a way to reproduce the problem reliably:
* create a document and add a box to it
* switch to Drawing workbench, add a drawing and insert the box into it
* while the SVG view is active you can close the 3d view
* go to View > Create new view and from now on the rendering is broken

In this case even the above workaround doesn't work any more. And if you create a further 3d view and switch between the tabs then FreeCAD may even crash (somewhere deep inside the graphic driver).
ickby
Posts: 2914
Joined: Wed Oct 05, 2011 7:36 am

Re: Test request: quarter based viewer

Postby ickby » Thu Jan 01, 2015 11:52 am

I can reproduce it both with current master and my development branch. somehow the default lines are not displayed, only preselected and selected ones...
wmayer
Site Admin
Posts: 14640
Joined: Thu Feb 19, 2009 10:32 am

Re: Test request: quarter based viewer

Postby wmayer » Thu Jan 01, 2015 11:55 am

One further observation:

I repeated this procedure on Ubuntu 12.04 (on virtual box) and I have a very similar effect. But the difference is that on Linux the edges disappear completely while on Windows there are edges but totally displaced and of wrong lengths.
But in both cases when I hover the area where the edges should be they appear normally.

However, when I create a new box then it is rendered normally. So, my conclusion is that it's not the viewer that is broken but the Inventor model. The shape node which handles the rendering of edges is the self-written node SoBrepEdgeSet and maybe there is a bug which didn't occur with the old but now does with the new viewer.
jmaustpc
Posts: 9558
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Test request: quarter based viewer

Postby jmaustpc » Thu Jan 01, 2015 12:05 pm

hi Guys
I see from your posts while I was testing that Werner has found much the same on 12.04 as I did on Kubuntu 14.04.
wmayer wrote:OK, here is a way to reproduce the problem reliably:
* create a document and add a box to it
* switch to Drawing workbench, add a drawing and insert the box into it
* while the SVG view is active you can close the 3d view
* go to View > Create new view and from now on the rendering is broken

In this case even the above workaround doesn't work any more. And if you create a further 3d view and switch between the tabs then FreeCAD may even crash (somewhere deep inside the graphic driver).
When I try the above, the cube in effect goes into shaded mode, i.e. the edges disappear. If I go to wireframe mode the cube disappears.

However if you create a new Part primitive, e.g. a Part Cylinder or another Part Cube, ....the new primitive does display correctly...although the first cube remains incorrectly displayed.

OS: Ubuntu 14.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.15.4368 (Git)
Branch: master
Hash: 845849fa91c47e849b567f499c3e99f4be845373
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.7.1.oce-0.17-dev
User avatar
tanderson69
Posts: 1495
Joined: Thu Feb 18, 2010 1:07 am

Re: Test request: quarter based viewer

Postby tanderson69 » Thu Jan 01, 2015 1:12 pm

Here I don't need to create the drawing. I can just:

1) file/new
2) cube
3) view/create new view

at this point, the new view shows up with invisible edges. With a crash in the graphics driver to follow shortly.