[fixed] hatch in cross section view get broken on SVG exporting

Discussions about the development of the TechDraw workbench
User avatar
uwestoehr
Posts: 1085
Joined: Sun Jan 27, 2019 3:21 am

[fixed] hatch in cross section view get broken on SVG exporting

Postby uwestoehr » Mon Dec 09, 2019 6:43 pm

- open this test file:
TD-test.FCStd
test file
(129.56 KiB) Downloaded 11 times
(Note, that despite both section views were created, only section A-A has a hatch
This is in my opinion also a bug.)

- export it as SVG
- open the SVG with Firefox or Inkscape (my result is attached)

result: the hatch is too large

Edit: when exporting to PDF, the hatch is correct

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18859 (Git)
Build type: Release
Branch: master
Hash: 42196ead3902cef974e2c3ed7810a7c69258ea89
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
Attachments
TD-test.svg
SVG result
(299.72 KiB) Downloaded 11 times
Last edited by uwestoehr on Mon Jan 13, 2020 10:01 pm, edited 2 times in total.
User avatar
wandererfan
Posts: 3483
Joined: Tue Nov 06, 2012 5:42 pm

Re: hatch in cross section view get broken on SVG exporting

Postby wandererfan » Tue Dec 10, 2019 12:01 am

uwestoehr wrote:
Mon Dec 09, 2019 6:43 pm
- export it as SVG
- open the SVG with Firefox or Inkscape (my result is attached)
"Note that SVG hatch patterns are not included when a drawing page is saved as an SVG file."
The export routine doesn't deal with hatches at all well. Had hoped that Qt5 would improve things, but apparently not. In the Svg file does the A-A hatch pattern extend beyond the figure? That is supposed to be turned off.
(Note, that despite both section views were created, only section A-A has a hatch
This is in my opinion also a bug.)
definitely something wrong with the B-B section face. Haven't seen this particular error before.
SectionFaceGeomErrors.png
SectionFaceGeomErrors.png (206.79 KiB) Viewed 366 times
User avatar
uwestoehr
Posts: 1085
Joined: Sun Jan 27, 2019 3:21 am

Re: hatch in cross section view get broken on SVG exporting

Postby uwestoehr » Tue Dec 10, 2019 12:24 am

wandererfan wrote:
Tue Dec 10, 2019 12:01 am
"Note that SVG hatch patterns are not included when a drawing page is saved as an SVG file."
In the Svg file does the A-A hatch pattern extend beyond the figure?
But the hatches are exported to SVG. They only extend beyond the view, see the SVG file in my initial comment.

wandererfan wrote:
Tue Dec 10, 2019 12:01 am
definitely something wrong with the B-B section face. Haven't seen this particular error before.
I can reproduce this on my Win 7 PC as well:
- take my example file
- delete the section view B-B
- select the view "Left"
- insert a section view to it
- in the appearing task dialog click on "looking left"

result: you get a section view without hatch
User avatar
wandererfan
Posts: 3483
Joined: Tue Nov 06, 2012 5:42 pm

Re: hatch in cross section view get broken on SVG exporting

Postby wandererfan » Tue Dec 10, 2019 11:58 am

uwestoehr wrote:
Tue Dec 10, 2019 12:24 am
But the hatches are exported to SVG. They only extend beyond the view, see the SVG file in my initial comment.
Hmmm. The hatches were hidden on Svg export for just this reason. The hatch pattern doesn't get clipped. Don't remember removing this code.
User avatar
wandererfan
Posts: 3483
Joined: Tue Nov 06, 2012 5:42 pm

Re: hatch in cross section view get broken on SVG exporting

Postby wandererfan » Tue Dec 17, 2019 1:45 pm

wandererfan wrote:
Tue Dec 10, 2019 11:58 am
Hmmm. The hatches were hidden on Svg export for just this reason. The hatch pattern doesn't get clipped. Don't remember removing this code.
Regression on Svg hatch export should be fixed by: git commit 57bfc2e380
User avatar
uwestoehr
Posts: 1085
Joined: Sun Jan 27, 2019 3:21 am

Re: hatch in cross section view get broken on SVG exporting

Postby uwestoehr » Wed Dec 18, 2019 11:40 am

wandererfan wrote:
Tue Dec 17, 2019 1:45 pm
Regression on Svg hatch export should be fixed by: git commit 57bfc2e380
Thank you!
I tested and unfortunately, this is not fixed. Here is the result:
TD-test.svg
SVG output
(299.72 KiB) Downloaded 8 times
I get with:
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18986 (Git)
Build type: Release
Branch: master
Hash: 537620aa32244287055d6ab312b0f8eaa5407fc9
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

regards Uwe
User avatar
wandererfan
Posts: 3483
Joined: Tue Nov 06, 2012 5:42 pm

Re: hatch in cross section view get broken on SVG exporting

Postby wandererfan » Wed Dec 18, 2019 12:17 pm

uwestoehr wrote:
Wed Dec 18, 2019 11:40 am
I tested and unfortunately, this is not fixed. Here is the result: TD-test.svg
Awww, #@#$%!!@$%. Forgot section faces. :oops:

Fixed for regular views. Sections to follow.
robin.jonsson.4276
Posts: 13
Joined: Thu Oct 17, 2019 9:26 pm

Re: hatch in cross section view get broken on SVG exporting

Postby robin.jonsson.4276 » Mon Jan 13, 2020 4:42 pm

wandererfan wrote:
Wed Dec 18, 2019 12:17 pm
uwestoehr wrote:
Wed Dec 18, 2019 11:40 am
I tested and unfortunately, this is not fixed. Here is the result: TD-test.svg
Awww, #@#$%!!@$%. Forgot section faces. :oops:

Fixed for regular views. Sections to follow.
Hi, Is section view hatch on the way?
Or could you mention a temporally work around?
(I'm exporting as pdf right know but that means lost of quality when I import it in LibreOffice writer.)
Thanks
User avatar
wandererfan
Posts: 3483
Joined: Tue Nov 06, 2012 5:42 pm

Re: hatch in cross section view get broken on SVG exporting

Postby wandererfan » Mon Jan 13, 2020 6:15 pm

robin.jonsson.4276 wrote:
Mon Jan 13, 2020 4:42 pm
Hi, Is section view hatch on the way?
Or could you mention a temporally work around?
Svg export of Svg hatch patterns will likely never be available as the problem is in code we don't own. Svg export of Pat hatch patterns (GeometricHatch) works fine.
exportSvgHatch.png
exportSvgHatch.png (8.92 KiB) Viewed 110 times
exportPatHatch.png
exportPatHatch.png (20.14 KiB) Viewed 110 times