Draft Workbench - how do I set camera position?

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
rhombus
Posts: 25
Joined: Fri Sep 20, 2019 7:05 pm

Draft Workbench - how do I set camera position?

Post by rhombus »

I'm building a floor plan in Draft Workbench. I intend to pad the walls in 3D.

I have some faces which will be lintels for doors. The faces are at different heights. When I set the working plane to XY, only some of the faces are visible. I'm assuming this is because the camera is at a certain height and some of the faces are behind it. When I rotate the view, the faces appear:

Here's the camera view with XY set as the working plane:
camera1.png
camera1.png (152.43 KiB) Viewed 1586 times

And here's the camera view when I rotate the camera a little:
camera2.png
camera2.png (237.3 KiB) Viewed 1586 times
You can see that the face which becomes visible is at z = 2.6 m. (The other face that is always visible is at z = 2.3 m, so I'm guessing that the camera plane is at z = 2.5 m.)

How can I explicitly position the camera when using standard working planes? (Note that this question is not about changing the working plane, I know how to do that.)

OS: Gentoo/Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.Unknown
Build type: Release
Python version: 3.6.5
Qt version: 5.12.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
chrisb
Veteran
Posts: 54193
Joined: Tue Mar 17, 2015 9:14 am

Re: Draft Workbench - how do I set camera position?

Post by chrisb »

Try macro FCCamera from the Addon manager.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Roy_043
Veteran
Posts: 8549
Joined: Thu Dec 27, 2018 12:28 pm

Re: Draft Workbench - how do I set camera position?

Post by Roy_043 »

In my test using Std ViewFitAll is effective.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft Workbench - how do I set camera position?

Post by vocx »

rhombus wrote: Thu Oct 17, 2019 6:41 pm ...
You can see that the face which becomes visible is at z = 2.6 m. (The other face that is always visible is at z = 2.3 m, so I'm guessing that the camera plane is at z = 2.5 m.)...
The camera is not at 2.5 m. Simply put, this is a rendering issue with the 3D view (or Qt or Coin3D or OpenGL or your graphics card or something). It's a "bug", if you will, but it's hard to really know how to solve it because there are many libraries involved.

The easiest thing you can do is to ignore it, and yes, do rotate the view around to see the different shapes. With 0.19 there are better selection tools, so when you pick objects in the tree view they are highlighted in the 3D view; this will improve things like these, making it easier to recognize where your objects are.
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.
rhombus
Posts: 25
Joined: Fri Sep 20, 2019 7:05 pm

Re: Draft Workbench - how do I set camera position?

Post by rhombus »

vocx wrote: Thu Oct 17, 2019 8:44 pm
rhombus wrote: Thu Oct 17, 2019 6:41 pm ...
You can see that the face which becomes visible is at z = 2.6 m. (The other face that is always visible is at z = 2.3 m, so I'm guessing that the camera plane is at z = 2.5 m.)...
The camera is not at 2.5 m. Simply put, this is a rendering issue with the 3D view (or Qt or Coin3D or OpenGL or your graphics card or something). It's a "bug", if you will, but it's hard to really know how to solve it because there are many libraries involved.

The easiest thing you can do is to ignore it, and yes, do rotate the view around to see the different shapes. With 0.19 there are better selection tools, so when you pick objects in the tree view they are highlighted in the 3D view; this will improve things like these, making it easier to recognize where your objects are.
When I made a face identical to the left face but placed at z = 2.2 m, it displayed correctly, hence my suspicion that the viewing plane was at z= 2.5 m.

But for some reason, now the face on the left is visible even with XY working plane and Top view. Why it is suddenly working, I have no idea. That would seem to confirm your suspicion of a rendering problem.

Perhaps this possible cause is also what's behind this issue with hatching and dotted/dashed lines? https://forum.freecadweb.org/viewtopic.php?f=3&t=40104

I've seen this kind of thing happen with other visualization libraries, in the past it's been an issue with z-buffering, but I don't know if that's the cause here.

I'm using Gentoo, which builds packages from source. Moreover, FreeCAD isn't in the main tree, so I am using a "custom" package from an overlay. I'm using Coin 4.0.0a_pre20181221. Is there a more current version? Or should I be looking for the problem elsewhere? It does make work more challenging, so I would like to solve it if possible.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Draft Workbench - how do I set camera position?

Post by DeepSOIC »

As a workaround, adding a wireframe box with a size to accommodate all your design with a bit of margin may help.
Also it sometimes helps to switch camera to perspective, zoom out/fit all, and switch back.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft Workbench - how do I set camera position?

Post by vocx »

rhombus wrote: Thu Oct 17, 2019 10:23 pm ...
I've seen this kind of thing happen with other visualization libraries, in the past it's been an issue with z-buffering, but I don't know if that's the cause here.

I'm using Gentoo, which builds packages from source. Moreover, FreeCAD isn't in the main tree, so I am using a "custom" package from an overlay. I'm using Coin 4.0.0a_pre20181221. Is there a more current version? ...
Yes, this is all Coin's fault (probably). You won't find a newer version of Coin, because the project basically is frozen. It isn't exactly in constant development. As a matter of fact, the last version that Coin developers launched was something like 3.1.3. As FreeCAD needed Python 3 support, some FreeCAD developers ported it to Python 3. This new version became Coin 4.0.0alpha, which was not officially released by Coin3D developers, but in many cases became the de-facto most up to date version. Basically, you have the latest code already.

There are plans to migrate Coin3D to GitHub, so maybe the project is a bit more active nowadays. See Coin3D - FreeCAD Delegation to help move Coin3D forward.
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.
Post Reply