Perspective Viewport Properties

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
mcolinp
Posts: 1
Joined: Sun Oct 23, 2011 5:08 pm

Perspective Viewport Properties

Post by mcolinp »

Am I missing something or is there no way to adjust the Perspective Camera Properties. Most CAD programs have a way to adjust the Lens properties which make more or less skew in relation to say a wide angle lens or a normal say 50mm lens. I find the default perspective to be way to wide angle and blown out. Would like to be able to change this.
wmayer
Founder
Posts: 20298
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Perspective Viewport Properties

Post by wmayer »

Check out the documentation for the class SoPerspectiveCamera
With our python interface you're able to change some settings there. As start point you can use this line:

Code: Select all

from pivy import coin
camera=Gui.ActiveDocument.ActiveView.getCameraNode()
camera.heightAngle.setValue(...)
But make sure that you have switch to perspective mode before.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Perspective Viewport Properties

Post by HoWil »

Hi,
Looks like the option heightAngle is no more accessible. Is there in the meantime something easier to change the viewangle directly in Freecad?
lg
HoWil
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Perspective Viewport Properties

Post by DeepSOIC »

HoWil wrote:Looks like the option heightAngle is no more accessible.
Works here:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10665 (Git)
Build type: Release
Branch: master
Hash: 47847513a85ff6615774ef628230f79e37471daf
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0

Note:
* camera.heightAngle attribute is not listed in autocompleter, you have to type it in manually. This isn't the only place where it happens btw, but attributes of coin nodes are especially well hidden. They don't appear in dir(camera) and camera.__dict__.
* angle is in radians.
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Perspective Viewport Properties

Post by HoWil »

DeepSOIC wrote: Note:
* camera.heightAngle attribute is not listed in autocompleter, you have to type it in manually. This isn't the only place where it happens btw, but attributes of coin nodes are especially well hidden. They don't appear in dir(camera) and camera.__dict__.
* angle is in radians.
THX. All I needed to know :D !
atererus
Posts: 32
Joined: Thu Mar 11, 2021 2:28 pm
Location: the Netherlands
Contact:

Re: Perspective Viewport Properties

Post by atererus »

After all these years does somebody know if there is a GUI for camera properties, __including__ these lens properties? If not, would it be a welcome thing to have? If yes, is there some module/marcro/source code known that comes most close as a starting point? Did someone already dig into such project?

EDIT: created feature request https://forum.freecadweb.org/viewtopic.php?f=8&t=56554
Read my profile in order to get more detail about my tools and preferences.
run_the_race
Posts: 161
Joined: Mon Feb 01, 2021 7:22 pm

Re: Perspective Viewport Properties

Post by run_the_race »

atererus wrote: Thu Mar 11, 2021 2:39 pm After all these years does somebody know if there is a GUI for camera properties, __including__ these lens properties? If not, would it be a welcome thing to have? If yes, is there some module/marcro/source code known that comes most close as a starting point? Did someone already dig into such project?

EDIT: created feature request https://forum.freecadweb.org/viewtopic.php?f=8&t=56554
I agree, most of the responses to this feature request are answers about moving the camera, which is not the same as the camera focal length. Being able to set the focal length of the perspective camera is a must have feature for rendering small parts.
User avatar
onekk
Veteran
Posts: 6199
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Perspective Viewport Properties

Post by onekk »

Try searching the web for pivy that are python library that expose coin3d methods.

Probably necrobumping after 1 year a post already necrobumped after 3 years or so is not a way to obtain an answer.

Or trying to see what was answered to the feature request.

Regards

Carlo D
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
atererus
Posts: 32
Joined: Thu Mar 11, 2021 2:28 pm
Location: the Netherlands
Contact:

Re: Perspective Viewport Properties

Post by atererus »

Please provide me with links to *FreeCad* articles about all kind camera parameters. Position, focal length distortion etc ... I while ago I started working on scripts, but stumbled on not having enough information. Internet is quite slow here (30 Kb/s downto 5 Kb/s) and it is not fun searching that way, so please do the search for me, and I'll restart, ans continue working on a camera GUI.
Read my profile in order to get more detail about my tools and preferences.
Post Reply