set view normal to working plane

A forum dedicated to the Draft, Arch and BIM workbenches development.
User avatar
bernd
Posts: 8465
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

set view normal to working plane

Postby bernd » Tue Jul 09, 2019 6:30 am

Is it possible to set the view normal to the current working plane?
chrisb
Posts: 19460
Joined: Tue Mar 17, 2015 9:14 am

Re: set view normal to working plane

Postby chrisb » Tue Jul 09, 2019 8:33 am

Mario's macro FCCamera can do this, but it is currently not working. I get the error

Code: Select all

Besides that you should decide whether you want to model in Part or in PartDesign. Mixing is not recommended. You see the reason in your file, if you look at the dependency graph: You have Links go out of allowed scope (red arrows). If you ever use something from PartDesign in a Part boolean function you must use the whole body, and not only a feature.
Mario wrote:ping
chrisb
Posts: 19460
Joined: Tue Mar 17, 2015 9:14 am

Re: set view normal to working plane

Postby chrisb » Tue Jul 09, 2019 8:37 am

Meanwhile there is the following rather cumbersome workaround:

- uncheck Preferences->Sketcher->Restore camera position after editing
- create a sketch on the face -> this will reorient the camera normal to the face
- close the sketch: position remains as it was
- delete the sketch
wmayer
Site Admin
Posts: 14981
Joined: Thu Feb 19, 2009 10:32 am

Re: set view normal to working plane

Postby wmayer » Tue Jul 09, 2019 8:44 am

Code: Select all

from pivy import coin

normal=coin.SbVec3f(1,1,1)
rot=coin.SbRotation()
rot.setValue(coin.SbVec3f(0,0,1), normal)
Gui.ActiveDocument.ActiveView.getCameraNode().orientation.setValue(rot)
User avatar
bernd
Posts: 8465
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: set view normal to working plane

Postby bernd » Tue Jul 09, 2019 10:01 am

Not as easy as I thought when I wrote the question ... I thought I just missed the button, but it seams the button does not exist ATM :o

the only possibility to get the direction of the working plane is to create a WPProxy from the current working plane by Draft --> Utilities --> create working plane proxy. A new object with a placement is created. From this placement the direction could be extracted. Eventually it needs to be transfered in the code presented by Werner.

We should make a small tool which does all in one click ...
chrisb
Posts: 19460
Joined: Tue Mar 17, 2015 9:14 am

Re: set view normal to working plane

Postby chrisb » Tue Jul 09, 2019 12:29 pm

bernd wrote:
Tue Jul 09, 2019 10:01 am
We should make a small tool which does all in one click ...
+1
User avatar
yorik
Site Admin
Posts: 11570
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: set view normal to working plane

Postby yorik » Tue Jul 09, 2019 3:17 pm

There is this macro https://www.freecadweb.org/wiki/Macro_A ... king_Plane
Maybe we could add it as a button under the working plane task panel?
Screenshot from 2019-07-09 12-16-06.png
Screenshot from 2019-07-09 12-16-06.png (73.82 KiB) Viewed 196 times
*EDIT* Done git commit 7c53cbf92
Screenshot from 2019-07-09 12-28-44.png
Screenshot from 2019-07-09 12-28-44.png (176.34 KiB) Viewed 193 times
User avatar
bernd
Posts: 8465
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: set view normal to working plane

Postby bernd » Wed Jul 10, 2019 5:26 am

yorik wrote:
Tue Jul 09, 2019 3:17 pm
*EDIT* Done git commit 7c53cbf92
works great :D