Problem with the scale of views made with the draftview command
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 255
- Joined: Mon May 19, 2014 1:14 pm
- Location: Vouzela - Portugal
Problem with the scale of views made with the draftview command
Hello,
There is a problem with the scale of views made with the draftview command. The views are 10 times bigger than they should have been.
From what I was able to test only happens with the views made with the draftview and Archview commands, the views made with the DrawViewPart command are in the right scale.
greetings,
Renato Rebelo
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10802 (Git)
Build type: None
Branch: master
Hash: 10ce910c03347a90712327a7cc7be2bcdee13afc
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
There is a problem with the scale of views made with the draftview command. The views are 10 times bigger than they should have been.
From what I was able to test only happens with the views made with the draftview and Archview commands, the views made with the DrawViewPart command are in the right scale.
greetings,
Renato Rebelo
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10802 (Git)
Build type: None
Branch: master
Hash: 10ce910c03347a90712327a7cc7be2bcdee13afc
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
my native language is not English, please excuse me any incorrectness, I apologize for any inconvenience caused, thank you
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Problem with the scale of views made with the draftview command
There is a default scale value HintScale=10.0 in the page object
set this back to 1 should work
set this back to 1 should work
- Attachments
-
- bp_460.png (11.39 KiB) Viewed 3070 times
Re: Problem with the scale of views made with the draftview command
Indeed, I see the problem too, that's strange... The transform (position, rotation, scaling) is done by techdraw itself, not sure what has changed there... rotation and positionning still work correctly. But I couldn't really find where that 10x scaling happens.
Any idea @wandererfan? Could it be something to do with DPI stuff? There is this note in QGIViewSymbol.cpp
But it doesn't seem to be used anywhere...
Any idea @wandererfan? Could it be something to do with DPI stuff? There is this note in QGIViewSymbol.cpp
Code: Select all
//note: svg's are overscaled by (72 pixels(pts actually) /in)*(1 in/25.4 mm) = 2.834645669 (could be 96/25.4(CSS)? 110/25.4?)
//due to 1 sceneUnit (1mm) = 1 pixel for some QtSvg functions
- wandererfan
- Veteran
- Posts: 6324
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Problem with the scale of views made with the draftview command
January update: https://www.forum.freecadweb.org/viewto ... =9&t=20385
You can turn HiRez off, but that will bring it's own problems - poor quality imported images and wrong size SVG exports among others.High Resolution - the resolution of drawings has been increased, in some cases as much as 10x. This will impact users of DrawViewImage, providing much higher quality results.
It will also affect users of DrawViewDraft and DrawViewArch. The higher resolution will mean that scales and perhaps positions will need to be modified. Existing drawings may need views repositioned.
Re: Problem with the scale of views made with the draftview command
Too much info on this forum, you always loose something
We could counter the problem by embedding the svg code in a transform node in Draft and Arch views, and therefore add an extra scaling, that's easy.
Is there a way to know how much extra scaling I should add?
We could counter the problem by embedding the svg code in a transform node in Draft and Arch views, and therefore add an extra scaling, that's easy.
Is there a way to know how much extra scaling I should add?
- wandererfan
- Veteran
- Posts: 6324
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Problem with the scale of views made with the draftview command
#include <Mod/TechDraw/Gui/Rez.h>yorik wrote:Is there a way to know how much extra scaling I should add?
...
double factor = Rez::getRezFactor();
double guisize = Rez::guiX(someAppNumber); //mm to QGraphicsScene units
double appsize = Rez::appX(someGuiNumber); //QGraphicsScene units to mm
Overloads for Base::Vector3d, Base::Vector2d, QPointF, QSize, QRectF.
No Python version yet.
Re: Problem with the scale of views made with the draftview command
Okay that should do it, I can use that inside the cpp code of ArchView and DraftView.wandererfan wrote:#include <Mod/TechDraw/Gui/Rez.h>
...
double factor = Rez::getRezFactor();
double guisize = Rez::guiX(someAppNumber); //mm to QGraphicsScene units
double appsize = Rez::appX(someGuiNumber); //QGraphicsScene units to mm
Overloads for Base::Vector3d, Base::Vector2d, QPointF, QSize, QRectF.
No Python version yet.
Thanks!
*EDIT*
double factor = Rez::getRezFactor(); doesn't seem to work when called from an App object (besides it is probably wrong to use Gui stuff in App)... Any idea of a workaround? Or maybe it is in the Gui side that the extra scaling should happen? In QGIViewSymbol::drawSvg() maybe?
**EDIT 2** Done in git commit 17b597fb6
- wandererfan
- Veteran
- Posts: 6324
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Problem with the scale of views made with the draftview command
Or maybe it is in the Gui side that the extra scaling should happen? In QGIViewSymbol::drawSvg() maybe?yorik wrote:
**EDIT 2** Done in git commit 17b597fb6[/quote]
Great thanks!. The scaling is only done on the Gui side since it is basically a hack to get some QGraphicsScene functions to behave as if they understand floating point numbers.
-
- Posts: 255
- Joined: Mon May 19, 2014 1:14 pm
- Location: Vouzela - Portugal
Re: Problem with the scale of views made with the draftview command
It's OK now
Thank you both,
Renato Rebelo
Thank you both,
Renato Rebelo
my native language is not English, please excuse me any incorrectness, I apologize for any inconvenience caused, thank you
Re: Problem with the scale of views made with the draftview command
Is it possible to switch the factor 10 scale off when exporting. This would resolve this prob:
https://forum.freecadweb.org/viewtopic. ... 7&start=30
Quickly tested it on the following system and still see a factor x10 in the view(-box) in Inkscape:
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10909 (Git)
Build type: None
Branch: master
Hash: eb5c56b50297a03b275846c7bb064ad4aae094da
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
BR,
HoWil
https://forum.freecadweb.org/viewtopic. ... 7&start=30
Quickly tested it on the following system and still see a factor x10 in the view(-box) in Inkscape:
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10909 (Git)
Build type: None
Branch: master
Hash: eb5c56b50297a03b275846c7bb064ad4aae094da
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
BR,
HoWil