PR #1469 Qt5 compatible NaviCube

Merged, abandoned or rejected pull requests are moved here to clear the main Pull Requests forum.
wmayer
Site Admin
Posts: 14479
Joined: Thu Feb 19, 2009 10:32 am

Re: PR #1469 Qt5 compatible NaviCube

Post by wmayer » Sun Oct 07, 2018 8:39 pm


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

Re: PR #1469 Qt5 compatible NaviCube

Post by NormandC » Sun Oct 07, 2018 8:46 pm

Thanks :D

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

Re: PR #1469 Qt5 compatible NaviCube

Post by NormandC » Tue Oct 09, 2018 5:26 am

Hello, I found something weird, not a function issue, just erroneous terminology in the code.

/src/Gui/NaviCube.cpp#L1266

Code: Select all

DEF_3DV_CMD(ViewOrthographicCmd)
ViewOrthographicCmd::ViewOrthographicCmd()
  : Command("ViewDimetric")
{
    sGroup        = QT_TR_NOOP("");
    sMenuText     = QT_TR_NOOP("Orthographic");
    sToolTipText  = QT_TR_NOOP("Set View to Orthographic mode");
    sWhatsThis    = "";
    sStatusTip    = sToolTipText;
    sPixmap       = "";
    sAccel        = "";
eType = Alter3DView;
/src/Gui/NaviCube.cpp#L1288

Code: Select all

ViewPerspectiveCmd::ViewPerspectiveCmd()
  : Command("ViewTrimetric")
{
    sGroup        = QT_TR_NOOP("");
    sMenuText     = QT_TR_NOOP("Perspective");
    sToolTipText  = QT_TR_NOOP("Set View to Perspective mode");
    sWhatsThis    = "";
    sStatusTip    = sToolTipText;
    sPixmap       = "";
    sAccel        = "";
    eType         = Alter3DView;
}
Dimetric is *not* synonymous with orthographic. Trimetric is *not* synonymous with perspective. Both dimetric and trimetric are types of axonometric projections. The current Std_ViewAxo command (View --> Standard views --> Axonometric) is specifically an isometric projection.

https://en.wikipedia.org/wiki/Axonometr ... hree_types

Since it would be nice at some point to get both Dimetric and Trimetric as additional views in the View --> Standard views menu (Axonometric may need to be renamed Isometric), may I suggest these commands be reworded?

Thanks.

wmayer
Site Admin
Posts: 14479
Joined: Thu Feb 19, 2009 10:32 am

Re: PR #1469 Qt5 compatible NaviCube

Post by wmayer » Wed Jan 09, 2019 2:40 pm

NormandC wrote:
Tue Oct 09, 2018 5:26 am
Hello, I found something weird, not a function issue, just erroneous terminology in the code.
...
Since it would be nice at some point to get both Dimetric and Trimetric as additional views in the View --> Standard views menu (Axonometric may need to be renamed Isometric), may I suggest these commands be reworded?

Thanks.
In git commit 896aaf57 I fixed the incorrect usage of dimetric and trimetric.

Now you want to suggest to relabel what at the moment we call Axonometric to be Isometric. But according to the WP article our axonometric view is not isometric because it only fulfills the 1st criterion that the factor is the same for all axes, but the 2nd criterion that the angle is 120 deg between them is not true.

Now I wonder how your CAD package labels this function. Does it also call it Axonometric or does it call it Isometric?
And does your CAD package have the functions Dimetric and Trimetric? If yes you can you show an example how it looks there?

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

Re: PR #1469 Qt5 compatible NaviCube

Post by NormandC » Thu Jan 10, 2019 2:47 am

wmayer wrote:
Wed Jan 09, 2019 2:40 pm
In git commit 896aaf57 I fixed the incorrect usage of dimetric and trimetric.
Thanks for looking into this.

wmayer wrote:
Wed Jan 09, 2019 2:40 pm
Now you want to suggest to relabel what at the moment we call Axonometric to be Isometric. But according to the WP article our axonometric view is not isometric because it only fulfills the 1st criterion that the factor is the same for all axes, but the 2nd criterion that the angle is 120 deg between them is not true.
How are you coming to this conclusion? FreeCAD's axonometric view actually does fulfill both criteria. Please do the following: create a default Part Box with three equal lengths (10x10x10), set the display style to wireframe, then set the view to axonometric. This is what you will see (sorry for the large size of the screenshots, I made them quickly during my lunch break at work):

FreeCAD-axo-view-wireframe.jpg
FreeCAD-axo-view-wireframe.jpg (21.06 KiB) Viewed 787 times

You can see that all edges of the cube converge in the exact centre. The only way this can happen is if all 3 edges joined by a vertex in the middle (foreground or background) are 120 degrees apart, when projected flat. This is the definition of an isometric view, just like in this image: https://en.wikipedia.org/wiki/Axonometr ... arison.png

wmayer wrote:
Wed Jan 09, 2019 2:40 pm
Now I wonder how your CAD package labels this function. Does it also call it Axonometric or does it call it Isometric?
FreeCAD is the only CAD program I know of that uses the term "axonometric" in its GUI. In all the other programs, it's always labelled as "isometric".

Here's an isometric view of a cube in Solid Edge (the proprietary CAD I use at work), which looks exactly like FreeCAD's axonometric view:
SE-ISO-view-wireframe.jpg
SE-ISO-view-wireframe.jpg (32.89 KiB) Viewed 787 times

So my reasoning is, since FreeCAD's axonometric view is clearly an isometric view, we might as well label it as such.

wmayer wrote:
Wed Jan 09, 2019 2:40 pm
And does your CAD package have the functions Dimetric and Trimetric? If yes you can you show an example how it looks there?
Solid Edge does have these views, and so does Solidworks through a view toolbar: http://help.solidworks.com/2016/English ... 621387#Pg0

Dimetric and trimetric views orientation can vary, the Wikipedia page shows these types of views in Solidworks: https://en.wikipedia.org/wiki/Axonometr ... ctions.png

Below is how they appear in Solid Edge.

Dimetric:
SE-dimetric-view.jpg
SE-dimetric-view.jpg (26.49 KiB) Viewed 787 times

Trimetric:
SE-trimetric-view.jpg
SE-trimetric-view.jpg (27.96 KiB) Viewed 787 times

A few months ago, there was a discussion started by freedman about adding more view modes in FreeCAD and TheMarkster made some code for it, including giving the end user the possibility of customizing a view. I'll try to find the topic and post the link.

wmayer
Site Admin
Posts: 14479
Joined: Thu Feb 19, 2009 10:32 am

Re: PR #1469 Qt5 compatible NaviCube

Post by wmayer » Thu Jan 10, 2019 10:21 am

How are you coming to this conclusion?
Look at the axis cross. The angle between the projected Z and Y or X and Y is only 60 deg instead of 120 deg. The angles between Z or X and -Y would be the requested 120 deg. That's why I was not sure if this can be considered a valid isometric.

So, thanks for clarification.

In the menu we can keep the menu item Axonometric and there add the sub-menu with Isometric, Dimetric, Trimetric.
FreeCAD is the only CAD program I know of that uses the term "axonometric" in its GUI. In all the other programs, it's always labelled as "isometric".
The reason is because OCCT uses this term in its code samples.
A few months ago, there was a discussion started by freedman about adding more view modes in FreeCAD and TheMarkster made some code for it, including giving the end user the possibility of customizing a view. I'll try to find the topic and post the link.
There is still a pending PR which I want to integrate. However, there are some implementation details that I don't like and that I have to rework a bit.

wmayer
Site Admin
Posts: 14479
Joined: Thu Feb 19, 2009 10:32 am

Re: PR #1469 Qt5 compatible NaviCube

Post by wmayer » Thu Jan 10, 2019 2:13 pm

Some test code to verify isometric view:

Code: Select all


from math import sqrt, degrees, asin
p1=App.Rotation(App.Vector(1,0,0),90)
p2=App.Rotation(App.Vector(0,0,1),45)
p3=App.Rotation(App.Vector(1,1,0),degrees(asin(-sqrt(1.0/3.0))))
p4=p3.multiply(p2).multiply(p1)

from pivy import coin
c=Gui.ActiveDocument.ActiveView.getCameraNode()
c.orientation.setValue(*p4.Q)

Code: Select all

from pivy import coin
c=Gui.ActiveDocument.ActiveView.getCameraNode()


vo=App.Vector(c.getViewVolume().getMatrix().multVecMatrix(coin.SbVec3f(0,0,0)).getValue())
vx=App.Vector(c.getViewVolume().getMatrix().multVecMatrix(coin.SbVec3f(10,0,0)).getValue())
vy=App.Vector(c.getViewVolume().getMatrix().multVecMatrix(coin.SbVec3f(0,10,0)).getValue())
vz=App.Vector(c.getViewVolume().getMatrix().multVecMatrix(coin.SbVec3f(0,0,10)).getValue())

(vx-vo).Length
(vy-vo).Length
(vz-vo).Length

# Projection
vo.z=0
vx.z=0
vy.z=0
vz.z=0

(vx-vo).Length
(vy-vo).Length
(vz-vo).Length

wmayer
Site Admin
Posts: 14479
Joined: Thu Feb 19, 2009 10:32 am

Re: PR #1469 Qt5 compatible NaviCube

Post by wmayer » Thu Jan 10, 2019 5:32 pm


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

Re: PR #1469 Qt5 compatible NaviCube

Post by NormandC » Fri Jan 11, 2019 5:00 am

Cool! Thanks! I already assigned keyboard shortcuts to them. :)

Now Yorik needs to make another round of Crowdin upload. :D

User avatar
yorik
Site Admin
Posts: 11400
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: PR #1469 Qt5 compatible NaviCube

Post by yorik » Fri Jan 11, 2019 6:05 pm

NormandC wrote:
Fri Jan 11, 2019 5:00 am
Now Yorik needs to make another round of Crowdin upload. :D
Said and done!

Post Reply