Is this an display bug?

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!
Post Reply
mschop
Posts: 1
Joined: Mon Apr 17, 2017 11:09 am

Is this an display bug?

Post by mschop »

Hi,

Version: 0.16 / 0.17 dev
OS: Windows 10 x64

I've attached a file. To reproduce the bug, first change to top view. Then try changing to left view. The part disappears.

When changing first to right view and then to left view it's working properly.

Have I did something wrong or is this a bug in FreeCad?

Best Regards
mschop
Attachments
bug2.FCStd
(5.82 KiB) Downloaded 24 times
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Is this an display bug?

Post by wmayer »

I can confirm the behaviour. To see what happens to the camera node it is helpful to get its settings with

Code: Select all

Gui.ActiveDocument.ActiveView.getCamera()
After loading the file you will get this:
'#Inventor V2.1 ascii\n\n\nOrthographicCamera {\n viewportMapping ADJUST_CAMERA\n position 14027.157 5589.6367 87.000023\n orientation 0 0 1 0\n nearDistance -2210.7871\n farDistance 87.087029\n aspectRatio 1\n focalDistance 87\n height 21300.313\n\n}\n'
After switching to the right side you get this:
'#Inventor V2.1 ascii\n\n\nOrthographicCamera {\n viewportMapping ADJUST_CAMERA\n position 14114.157 5589.6367 2.2888184e-005\n orientation 0.57735026 0.57735026 0.57735026 2.0943952\n nearDistance 6637.5132\n farDistance 14128.272\n aspectRatio 1\n focalDistance 87\n height 21300.313\n\n}\n'
And after switching to the left side you get this:
'#Inventor V2.1 ascii\n\n\nOrthographicCamera {\n viewportMapping ADJUST_CAMERA\n position 13940.157 5589.6367 2.2888184e-005\n orientation -0.57735026 0.57735026 0.57735026 4.1887903\n nearDistance -12498.251\n farDistance 755.66608\n aspectRatio 1\n focalDistance 87\n height 21300.313\n\n}\n'
Important so far is that near and far distance is automatically adjusted by the viewer when animation is enabled.

If you load the file and directly switch to the left view you get this:
'#Inventor V2.1 ascii\n\n\nOrthographicCamera {\n viewportMapping ADJUST_CAMERA\n position 13940.157 5589.6367 2.2888184e-005\n orientation -0.57735026 0.57735026 0.57735026 4.1887903\n nearDistance -2210.7871\n farDistance 87.087029\n aspectRatio 1\n focalDistance 87\n height 21300.313\n\n}\n'
Note that compared to the above only the values of the near and far distance are different which in this case means the object is outside the view frustum. And also note that the far and near distance are the same as after loading the file. I assume that while the camera moves to its new position the object is always outside the frustum so that the far and near distance won't change.

Now you can also switch off the animated movement with

Code: Select all

Gui.ActiveDocument.ActiveView.setAnimationEnabled(False)
When doing so the camera directly jumps to the new destination and in this case the object also lies outside the frustum when switching to the right side first and then to the left side.

To get an object back after it disappeared you have to additionally click the "Fit all" button.
chrisb
Veteran
Posts: 53943
Joined: Tue Mar 17, 2015 9:14 am

Re: Is this an display bug?

Post by chrisb »

When you click the "Fit all" first, all subsequent viewport changes behave as expected: The object is in the center and you change only the direction from which you look at it.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply