Testing the Drawing Module

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
mrlukeparry
Posts: 655
Joined: Fri Jul 22, 2011 8:37 pm
Contact:

Re: Testing the Drawing Module

Post by mrlukeparry »

ulrich1a wrote:
mrlukeparry wrote:A well deserved beer time me thinks!
Be sure, we have enough work for you for many more well deserved beer times. ;)
Here is the next one: In a drawing of the standard cone from the Part Workbench at viewing from the side, you can not select any line. So there is no possibility to add any dimension to this part in this view.

Ulrich
There's nothing I can do about this and is a limitation of my algorithm sadly - atleast for the time being. There may be instances of getting around this, let me try to explain.

The Hidden Line Removal in OpenCascade generates the projected edges. I process these and cross-reference to edges within the original geometry 'if' they exist. Sometimes they don't such as tangent edges or curved surfaces usually.

It's possible to add an additional check that iterates through all edges in a part and compare these but last time I tried I had no success.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Testing the Drawing Module

Post by ulrich1a »

mrlukeparry wrote:The Hidden Line Removal in OpenCascade generates the projected edges. I process these and cross-reference to edges within the original geometry 'if' they exist. Sometimes they don't such as tangent edges or curved surfaces usually.
One possible solution to this: Is there a problem to use the projected lines instead for making the dimension? If the projection is choosen right, those lines are used in traditional drafting as references also. Or is it possible to find the surface, to which these lines belong? With this information it should be in principle possible, to make an associative dimension. It may need some vector calculation.
On the other side, the top lines of the cone exists in the shape. They are the circles seen from the side.

Can you point to the code, where those lines are processed?

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

Re: Testing the Drawing Module

Post by NormandC »

mrlukeparry wrote:
normandc wrote:Currently the blue is too dark for my eyes. It's OK for edges, but it's really hard to see for points. A lighter color might be more visible: light green, or even red (although for color-blind people that may be a problem). I wonder if you could simply use the same colors as FreeCAD's preselection/selection colors for the general GUI? (Found in Prefs/Display/Colors)
Would these work on a white background? I'm abit sceptical but I agree the blue is too dark and my LCD monitor doesn't have good colour reproduction.

If someone can do a mock in inkscape with a few options and we can maybe judge the best default?
Okay, I spent (way too much) time on producing a workable mockup in Inkscape. I wish I was as proficient in Inkscape as in FreeCAD! :D

You're right, the default colors don't work well on a white background, at least where vertices are concerned.
Preselected and selected vertices are barely visible.
Preselected and selected vertices are barely visible.
Drawing_Page_Mockup_points1.png (49.56 KiB) Viewed 3093 times
It looks better on edges.
Edges are more visible.
Edges are more visible.
Drawing_Page_Mockup_edges1.png (49.62 KiB) Viewed 3093 times
I can't spend any more time on this ATM, I'm attaching the mockup in svg format so others can play with it.
Attachments
Drawing_Page_Mockup_normandc1.svg
(128.74 KiB) Downloaded 177 times
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Testing the Drawing Module

Post by NormandC »

Here's an idea: would it be possible NOT to display the vertices by default, but make them visible and a lot bigger (at least two times what they look like right now) only for preselection and selection?

Like this. Preselected color is red, selected is green.
Attachments
Vertices appear only when preselected and selected.
Vertices appear only when preselected and selected.
Drawing_Page_Mockup_points2.png (9.58 KiB) Viewed 3091 times
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Testing the Drawing Module

Post by jmaustpc »

Hi guys
Luke I noticed I get this build error...it still compiles

Code: Select all

Linking CXX shared library ../../../../Mod/Sketcher/SketcherGui.so
[ 86%] Building CXX object src/Mod/Drawing/App/CMakeFiles/Drawing.dir/FeatureSVGTemplate.cpp.o
/home/user/Downloads/cad/FreeCAD/lukeperry/FreeCAD_sf_master/src/Mod/Drawing/App/FeatureSVGTemplate.cpp: In member function ‘virtual App::DocumentObjectExecReturn* Drawing::FeatureSVGTemplate::execute()’:
/home/user/Downloads/cad/FreeCAD/lukeperry/FreeCAD_sf_master/src/Mod/Drawing/App/FeatureSVGTemplate.cpp:169:79: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘double*’ [-Wformat=]
             sscanf(line.c_str(), "%*s %*s %*s %d %d %d %d", &t0, &t1, &t2, &t3);    //eg "    <!-- Working space 10 10 410 287 -->"
                                                                               ^
/home/user/Downloads/cad/FreeCAD/lukeperry/FreeCAD_sf_master/src/Mod/Drawing/App/FeatureSVGTemplate.cpp:169:79: warning: format ‘%d’ expects argument of type ‘int*’, but argument 4 has type ‘double*’ [-Wformat=]
/home/user/Downloads/cad/FreeCAD/lukeperry/FreeCAD_sf_master/src/Mod/Drawing/App/FeatureSVGTemplate.cpp:169:79: warning: format ‘%d’ expects argument of type ‘int*’, but argument 5 has type ‘double*’ [-Wformat=]
/home/user/Downloads/cad/FreeCAD/lukeperry/FreeCAD_sf_master/src/Mod/Drawing/App/FeatureSVGTemplate.cpp:169:79: warning: format ‘%d’ expects argument of type ‘int*’, but argument 6 has type ‘double*’ [-Wformat=]
[ 87%] [ 88%] Built target SketcherGui
Building CXX object src/Mod/Drawing/App/CMakeFiles/Drawing.dir/FeatureViewDimension.cpp.o
Linking CXX shared library ../../../../Mod/Robot/RobotGui.so
Linking CXX shared library ../../../../Mod/Drawing/Drawing.so
[ 90%] Built target Drawing
Linking CXX shared library ../../../../Mod/ReverseEngineering/ReverseEngineeringGui.so
OS: Ubuntu 14.04 LTS
Platform: 64-bit
Version: 0.14.3202 (Git)
Branch: drawing
Hash: 97624532706a7e4a8c377214ec44c13e116a746f
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
SoQt version: 1.6.0a
OCC version: 6.7.0
mrlukeparry
Posts: 655
Joined: Fri Jul 22, 2011 8:37 pm
Contact:

Re: Testing the Drawing Module

Post by mrlukeparry »

normandc wrote:Here's an idea: would it be possible NOT to display the vertices by default, but make them visible and a lot bigger (at least two times what they look like right now) only for preselection and selection?

Like this. Preselected color is red, selected is green.
If people are happy with this I can change it?

The nice thing about QGraphicsView is that it's much easier to change things like this compared to the Inventor stuff.

I can change the colour for now, but I think it still needs more input from everyone :)
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Testing the Drawing Module

Post by jmaustpc »

Hi Luke

Page size and line thickness on exported svg.

The A3 and A4 templates, if opened in Inkscape are correct A3 and A4 sizes (210mm x 297mm for A4)

However if I place some items in the picture in drawing WB , then right click on the drawing and select "Export svg" and save the document ..... then open the exported svg in inkscape ...the page size is now much smaller
e.g A4 becomes 104.78 by 74.08
A3 becomes 148.17 by 104.78

The lines of the object become too thick as well but that might be due to the page size change.

Jim

here is a full size screen shot
screenshotthicklines.png
screenshotthicklines.png (165.52 KiB) Viewed 3065 times
mrlukeparry
Posts: 655
Joined: Fri Jul 22, 2011 8:37 pm
Contact:

Re: Testing the Drawing Module

Post by mrlukeparry »

Okay everyone, I've push a lot of changes through that I've worked on the past week. I will write up a blog article today to highlight the changes.
jmaustpc wrote:Hi Luke

Page size and line thickness on exported svg.

The A3 and A4 templates, if opened in Inkscape are correct A3 and A4 sizes (210mm x 297mm for A4)

However if I place some items in the picture in drawing WB , then right click on the drawing and select "Export svg" and save the document ..... then open the exported svg in inkscape ...the page size is now much smaller
e.g A4 becomes 104.78 by 74.08
A3 becomes 148.17 by 104.78

The lines of the object become too thick as well but that might be due to the page size change.

Jim

here is a full size screen shot
Yep I've only noticed this now. I've looked at this and I've tried playing with the resolution which is the only parameter you can change, but I get really unsatisfactory results. I use QGraphicsSVGGenerator which is really not great at all...

What I suggest if people want the best output is using the Print to PDF. I've checked and it keeps faithful to the pages dimensions and it looks 'exactly' as it does in the Drawing Work bench.

Until I write my own exporters we won't get satisfactory svg output straight out of the box. I am tempted to remove the export svg option as I don't think it's a good solution and is just going to lower people's expectations.

HOWEVER, if you open the resultant pdf in inkscape it's perfect. So it's not a disaster!
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Testing the Drawing Module

Post by jmaustpc »

Hi Luke
mrlukeparry wrote:Okay everyone, I've push a lot of changes through that I've worked on the past week.
Lots of improvements, but I have some new bugs now :)

distance, horizontal and vertical all don't display the arrows and lines in the correct place,
diameter seems to work properly but radius does not. Radius forgets the placement of the text, i.e. after each move it goes back to its default location.

Jim

P.s. here is a picture showing the display problems with the dimensions
screenshotdistance arrows wrong.png
screenshotdistance arrows wrong.png (22.23 KiB) Viewed 3052 times
mrlukeparry
Posts: 655
Joined: Fri Jul 22, 2011 8:37 pm
Contact:

Re: Testing the Drawing Module

Post by mrlukeparry »

jmaustpc wrote:Hi Luke
mrlukeparry wrote:Okay everyone, I've push a lot of changes through that I've worked on the past week.
Lots of improvements, but I have some new bugs now :)

distance, horizontal and vertical all don't display the arrows and lines in the correct place,
diameter seems to work properly but radius does not. Radius forgets the placement of the text, i.e. after each move it goes back to its default location.

Jim

P.s. here is a picture showing the display problems with the dimensions
screenshotdistance arrows wrong.png
Okay, I'll take a look. There's been countless changes so I'm hoping this is somethign small i've overlooked. I only just had chance to write about all this on my blog, so hopefully I get this fixed first and I can finally publish what I've done :)
Post Reply