Line width <0.5mm not exported to SVG in TechDraw Workbench

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
maxagaz
Posts: 30
Joined: Mon Apr 30, 2018 11:05 am
Location: Paris

Line width <0.5mm not exported to SVG in TechDraw Workbench

Post by maxagaz »

In the TechDraw Workbench, I have imported a single Line made in the Sketcher, but it's not displayed nor exportable to SVG if its width is smaller than 0.50mm. It's working for other polylines also imported from the Sketcher.

In attachement is a basic test file I made with FreeCAD 0.17 and 0.18 on macOS.
Test.FCStd
(20.06 KiB) Downloaded 34 times
Is it a bug or did I make a bad manipulation somewhere ?
Screen Shot 2018-05-02 at 17.02.55.png
Screen Shot 2018-05-02 at 17.02.55.png (377.75 KiB) Viewed 857 times
Screen Shot 2018-05-02 at 17.07.51.png
Screen Shot 2018-05-02 at 17.07.51.png (456.99 KiB) Viewed 857 times
Screen Shot 2018-05-02 at 17.08.12.png
Screen Shot 2018-05-02 at 17.08.12.png (487.88 KiB) Viewed 857 times
OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.13651 (Git)
Build type: Release
Branch: (HEAD detached at 4604bd9)
Hash: 4604bd9456688e6108b1b5f1a0dcc7f8d205555f
Python version: 2.7.14
Qt version: 5.10.1
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
chrisb
Veteran
Posts: 54288
Joined: Tue Mar 17, 2015 9:14 am

Re: Line width <0.5mm not exported to SVG in TechDraw Workbench

Post by chrisb »

I can scale down to 0.1mm. Did you try enlarging the page view?
Bildschirmfoto 2018-05-02 um 13.04.09.png
Bildschirmfoto 2018-05-02 um 13.04.09.png (43.96 KiB) Viewed 848 times
OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.13651 (Git)
Build type: Release
Branch: (HEAD detached at 4604bd9)
Hash: 4604bd9456688e6108b1b5f1a0dcc7f8d205555f
Python version: 2.7.14
Qt version: 5.10.1
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: German/Germany (de_DE)
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
wandererfan
Veteran
Posts: 6325
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Line width <0.5mm not exported to SVG in TechDraw Workbench

Post by wandererfan »

maxagaz wrote: Wed May 02, 2018 9:34 am In the TechDraw Workbench, I have imported a single Line made in the Sketcher, but it's not displayed nor exportable to SVG if its width is smaller than 0.50mm. It's working for other polylines also imported from the Sketcher.
You're using a DraftView to display a Sketch. I'm surprised it worked at all. Sketches are not Draft objects.

If you use regular TD View you can make the line any width you want.

There does seem to be something odd about the line width for a DraftView. Maybe the conversion to pixels in Draft??
User avatar
wandererfan
Veteran
Posts: 6325
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Line width <0.5mm not exported to SVG in TechDraw Workbench

Post by wandererfan »

wandererfan wrote: Wed May 02, 2018 12:55 pm Maybe the conversion to pixels in Draft??
This is the issue. Draft.getSVG scales the LineWidth (LineWidth = LineWidth/Scale) then uses the result as a Svg stroke-width in pixels. So your 0.5 mm LineWidth gets converted to 0.5px before display.

The line is in the exported Svg file even with a width < 0.5.

Stoke width = 0 is never drawn by Svg, but I don't know what the rules are for displaying a line < 1/2 px in width.
Post Reply