[Fixed] 0.19pre, Bottom command uses wrong direction
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[Fixed] 0.19pre, Bottom command uses wrong direction
version: FreeCAD_0.19.20052-Win-Conda_vc14.x-x86_64.7z
os: win10 x64
(same as FC 0.18.4)
Summary:
Menu command "View >Standard Views >Bottom", shows "Bottom" face of NaviCube upside-down. Which is inconsistent with other method.
While, below methods show "Bottom" face of NaviCube upside-up.
1. Left mouse click "Bottom" face of NaviCube,
2. New Sketch, choose orientation as "XY-Plane Reverse",
These means inconsistent Bottom behavior with different methods.
Analysis:
Bottom command uses direction of "rotation=180, X=0, Y=1, Z=0" from top view.
While other 2 methods use direction of "rotation=180, X=1, Y=0, Z=0" from top view.
os: win10 x64
(same as FC 0.18.4)
Summary:
Menu command "View >Standard Views >Bottom", shows "Bottom" face of NaviCube upside-down. Which is inconsistent with other method.
While, below methods show "Bottom" face of NaviCube upside-up.
1. Left mouse click "Bottom" face of NaviCube,
2. New Sketch, choose orientation as "XY-Plane Reverse",
These means inconsistent Bottom behavior with different methods.
Analysis:
Bottom command uses direction of "rotation=180, X=0, Y=1, Z=0" from top view.
While other 2 methods use direction of "rotation=180, X=1, Y=0, Z=0" from top view.
Last edited by fc_tofu on Thu May 14, 2020 2:13 pm, edited 9 times in total.
Re: [Inconsistent] 0.19pre, Bottom command uses wrong direction
I thought this issue is quite obvious, but haven't been confirmed so long.
- adrianinsaval
- Veteran
- Posts: 5553
- Joined: Thu Apr 05, 2018 5:15 pm
Re: [Inconsistent] 0.19pre, Bottom command uses wrong direction
Is there a ticket in the bugtracker?
This is inconsistent but something to discuss is which of these should be really used, I think the one from the NaviCube makes more sense.
Did you get this from the source code? If so, why not make a PR or indicate where this is .
This is inconsistent but something to discuss is which of these should be really used, I think the one from the NaviCube makes more sense.
Re: [Inconsistent] 0.19pre, Bottom command uses wrong direction
From my observation, not from source code. I donnot know coding.
Before bug report, we need confirmation in forum, we need to exclude it from designed behavior first.
No one confirmed this so long.
Re: [Inconsistent] 0.19pre, Bottom command uses wrong direction
I guess they don't have to be consistent, but likely we can assume on how one can expect them to be. Therefore the first question i guess is what is the preferred choice. For me it looks like the NaviCube does the expected thing, and not the commad?
- adrianinsaval
- Veteran
- Posts: 5553
- Joined: Thu Apr 05, 2018 5:15 pm
Re: [Inconsistent] 0.19pre, Bottom command uses wrong direction
I think navicube's behavior is better and should be used in bottom view command. It would be this behavior:
I think that is reasonable to expect from the bottom view command. It currently works like this: I don't see any reason to keep that.
I think that is reasonable to expect from the bottom view command. It currently works like this: I don't see any reason to keep that.
Re: [Inconsistent] 0.19pre, Bottom command uses wrong direction
Your image just remide me that there is a "Bottom" view in TechDraw "Insert Projection Group" command.
By test, I find "Bottom" view in TechDraw "Insert Projection Group" (when using Front view as initial) is also consistent with NaviCube "Bottom".
Re: [Inconsistent] 0.19pre, Bottom command uses wrong direction
At least, we can get better understanding of geometries from consistent veiw operations within FreeCAD.
I checked Blender and Rhino3D, which view operations same as FC's NaviCube command.
Also in online doc, MicroStation's ortho views same as FC's NaviCube.
https://docs.bentley.com/LiveContent/we ... 8C344.html
Code: Select all
3D Orthogonal Views
In 3D, since you can rotate views about three axes, rather than just one, there are six orthogonal orientations, each of which corresponds to a standard orthogonal view: Top, Bottom, Left, Right, Front, or Back. The name of the view describes also the position from which the model is viewed.
The faces of this cube correspond to the 3D orthogonal views. The cube is displayed here in an Isometric view.
A Top view displays the model from the top:
the xy plane is parallel to your screen (as in a 2D model).
x is positive from left to right (horizontally).
y is positive from bottom to top (vertically).
z is positive toward you, perpendicular to the screen.
While, for a Bottom view:
y is positive from top to bottom (vertically).
z is positive away from you, perpendicular to the screen.
A Front view displays the model from the front:
the xz plane is parallel to your screen.
x is positive from left to right (horizontally).
z is positive from bottom to top (vertically).
y is positive away from you, perpendicular to the screen.
While, for a Back view:
x is positive from right to left (horizontally).
y is positive towards you, perpendicular to the screen.
A Right view, displays the model from the right:
the yz plane is parallel to your screen.
y is positive from left to right (horizontally).
z is positive from bottom to top (vertically).
x is positive toward you, perpendicular to the screen.
While, for a Left view:
y is positive from right to left (horizontally).
x is positive away from you, perpendicular to the screen.
- adrianinsaval
- Veteran
- Posts: 5553
- Joined: Thu Apr 05, 2018 5:15 pm
Re: [Inconsistent] 0.19pre, Bottom command uses wrong direction
NaviCube does it this way:
https://github.com/FreeCAD/FreeCAD/blob ... .cpp#L1229
While Std Bottom seems to be doing:
https://github.com/FreeCAD/FreeCAD/blob ... r.cpp#L605
or maybe:
https://github.com/FreeCAD/FreeCAD/blob ... r.cpp#L314
I don't understand quite well which is used when...
Can some dev weight in? Would it be acceptable to change these to (0,180) as NaviCube?
Code: Select all
void NaviCubeImplementation::setView(float rotZ,float rotX) {
SbRotation rz, rx, t;
rz.setValue(SbVec3f(0, 0, 1), rotZ * M_PI / 180);
rx.setValue(SbVec3f(1, 0, 0), rotX * M_PI / 180);
m_View3DInventorViewer->setCameraOrientation(rx * rz);
}
Code: Select all
case TEX_BOTTOM:
setView(0,180);
While Std Bottom seems to be doing:
Code: Select all
else if(strcmp("ViewBottom",pMsg) == 0 ) {
_viewer->setCameraOrientation(Camera::rotation(Camera::Bottom));
_viewer->viewAll();
return true;
or maybe:
Code: Select all
else if (strcmp("ViewBottom",pMsg) == 0) {
SbRotation rot(Camera::rotation(Camera::Bottom));
for (std::vector<View3DInventorViewer*>::iterator it = _viewer.begin(); it != _viewer.end(); ++it) {
SoCamera* cam = (*it)->getSoRenderManager()->getCamera();
cam->orientation.setValue(rot);
(*it)->viewAll();
}
return true;
}
I don't understand quite well which is used when...
Can some dev weight in? Would it be acceptable to change these to (0,180) as NaviCube?
- adrianinsaval
- Veteran
- Posts: 5553
- Joined: Thu Apr 05, 2018 5:15 pm
Re: [Inconsistent] 0.19pre, Bottom command uses wrong direction
So I tried i out in python:
gives the view we want. I edited the files I mentioned earlier: https://github.com/adrianinsaval/FreeCA ... 72cfbebfa7
I will try to compile and test later so I can make a PR, anyone else who wants to try would be welcomed
Code: Select all
from pivy import coin
cam = Gui.ActiveDocument.ActiveView.getCameraNode()
rot = coin.SbRotation(1,0,0,0)
cam.orientation.setValue(rot)
I will try to compile and test later so I can make a PR, anyone else who wants to try would be welcomed