Issue #6900 - Importing SVG: missing colors

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!
xadox
Posts: 14
Joined: Wed Mar 09, 2022 12:30 pm

Issue #6900 - Importing SVG: missing colors

Post by xadox »

Hello, I have svg with colored lines. But Freecad render coloured lines as black lines. For example
FreeCad view
issueFreeCad.png
issueFreeCad.png (13.43 KiB) Viewed 1533 times
Firefox view
issueFirefox.png
issueFirefox.png (47.01 KiB) Viewed 1533 times
My freecad settings for svg
issueSettings.png
issueSettings.png (35.8 KiB) Viewed 1533 times
FreeCad Version:

Code: Select all

OS: Windows 10 Version 2009
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +99 (Git)
Build type: Release
Branch: Branch_0.19.3
Hash: 6530e364184ce05ccff39501e175cf2237e6ee4b
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: English/United States (en_US)
What I do wrong? Thanx
Attachments
image.svg
(357.43 KiB) Downloaded 122 times
Last edited by Kunda1 on Mon May 30, 2022 11:44 am, edited 1 time in total.
Reason: Added GH issue to title
chrisb
Veteran
Posts: 53939
Joined: Tue Mar 17, 2015 9:14 am

Re: Importing SVG: missing colors

Post by chrisb »

There may be something wrong with the svg. I can confirm the missing colors when importing your file, but they are present if I import a newly made colored SVG from Inkscape.
Changing colors in your file with Inkscape didn't help. I could set a fill color in Inkscape, but without any effect.
Perhaps the mere size is a problem, the object has a height of several hundred meters.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
xadox
Posts: 14
Joined: Wed Mar 09, 2022 12:30 pm

Re: Importing SVG: missing colors

Post by xadox »

I know that object are very big, but colours should not depend on object size.
chrisb
Veteran
Posts: 53939
Joined: Tue Mar 17, 2015 9:14 am

Re: Importing SVG: missing colors

Post by chrisb »

xadox wrote: Mon Mar 14, 2022 8:37 am I know that object are very big, but colours should not depend on object size.
That's of course right, but perhaps FreeCAD doesn't know this yet. Some other things have similar limits, such as pocket through all, which doesn't really go through all on big objects.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
kisolre
Veteran
Posts: 4164
Joined: Wed Nov 21, 2018 1:13 pm

Re: Importing SVG: missing colors

Post by kisolre »

chrisb wrote: Mon Mar 14, 2022 10:45 am which doesn't really go through all on big objects.
I think that this was fixed and now it is based on the previous feature bounding box/size. Just tried pocketing 1000 km long 40mm diameter cylinder along that 1000km and it works. Of course tessellation is wrong but CheckGeometry is Ok.
xadox
Posts: 14
Joined: Wed Mar 09, 2022 12:30 pm

Re: Importing SVG: missing colors

Post by xadox »

Is there any fix available or not? Can I patch freecad by myself maybe?
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Importing SVG: missing colors

Post by adrianinsaval »

xadox wrote: Wed Mar 16, 2022 10:06 am Is there any fix available or not? Can I patch freecad by myself maybe?
for your issue I don't think there's a patch available. If you are able to fix it please submit a PR. kisolre was talking about the pocket issue chrisb mentioned.
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Importing SVG: missing colors

Post by TheMarkster »

Maybe you can scale it down in inkscape, then scale back up after the import?
xadox
Posts: 14
Joined: Wed Mar 09, 2022 12:30 pm

Re: Importing SVG: missing colors

Post by xadox »

TheMarkster wrote: Thu Mar 17, 2022 3:21 am Maybe you can scale it down in inkscape, then scale back up after the import?
No, I cannot) I couldnt find any svg-viewer supports such svgs out-of-the-box. FreeCad is my only solution.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Importing SVG: missing colors

Post by yorik »

The issue here is that the color info is not done directly on geometry, but on groups that contain them. I've never seen that before. What app was used to produce it?
BTW it doesn't show anything for me when opening it in inkscape... Firefox displays the colors properly, though.

In any case, FreeCAD is indeed not able to get and handle colors from groups. This could be implemented, but I'd like to make sure this is officially supported, and not something wrongly done by the application that produced the SVG...
Post Reply