SVG import function - maintaining line data.

This forum is a place where people can cast their vote for feature requests to be implemented from a selection of the top favorites submitted to the 'Bug tracker':
http://www.ribbonsoft.com/bugtracker/.

Moderators: andrew, Husky, J-J

Post Reply
davecoventry
Newbie Member
Posts: 9
Joined: Thu Mar 01, 2018 8:43 am

SVG import function - maintaining line data.

Post by davecoventry » Thu Jan 20, 2022 9:09 pm

If I export a 2D render of a FreeCAD model, I can specify that hidden lines can be presented in a specific colour so that they may be passed to a HIDDEN layer which I can specify the line type as dotted (HIDDEN) and the line colour as grey.

The Import SVG function in QCAD is a great facility, but it does not preserve this information in the imported file.

It would be great if this could be addressed.

Many thanks,

Dave

davecoventry
Newbie Member
Posts: 9
Joined: Thu Mar 01, 2018 8:43 am

Re: SVG import function - maintaining line data.

Post by davecoventry » Wed Feb 02, 2022 5:12 am

If anybody else is looking for the same feature, it does already exist.

If one imports an SVG file which defines the line colour by using the xml description stroke="#ff00ff", for example, this is ignored as I have found previously.

However, if one uses the xml description style="stroke:#ff00ff", then the colour information is maintained and the line is rendered as magenta.

In linux, running the following command will set up the svg file for you:

sed -i 's/stroke=\"#ff00ff\"/style=\"stroke:#ff00ff\"/g' FreeCAD.svg

CVH
Premier Member
Posts: 1784
Joined: Wed Sep 27, 2017 4:17 pm

Re: SVG import function - maintaining line data.

Post by CVH » Fri Feb 04, 2022 8:42 am

Nice catch.
davecoventry wrote:
Thu Jan 20, 2022 9:09 pm
...
this is ignored as I have found previously.
...
but it does not preserve this information in the imported file.
It would be great if this could be addressed.
Remark that the technology of dxf and svg is quite different.
One shouldn't expect a one-on-one conversion.

"Ignored" is a big word, properties are also inherited.
http://www.w3.org/TR/SVG/painting.html#StrokeProperty
Here stroke="#ff00ff" is a property.
From CAD point of view it inherits the Layer Properties.

style="stroke:#ff00ff" is an inline style.
From CAD point of view that is a specific property.

Regards,
CVH

Post Reply

Return to “QCAD Voting Corner”