QCAD - 2D CAD System.

Click here for a documentation of the DokuWiki formatting syntax that can be used in reports

Please search for existing tasks (also closed ones) before opening a new task.

Please make sure that you are using the latest Version of QCAD before posting a bug (menu Help > Check for Updates)


FS#138 - SVG Export entity properties "By Layer" and "By Block"

Attached to Project: QCAD
Opened by Peter (hungerburg) - Friday, 08 July 2011, 17:08 GMT+1
Last edited by Andrew (andrew) - Sunday, 10 July 2011, 15:33 GMT+1
Task Type Refactoring
Category QCAD (main)
Status Closed
Assigned To Andrew (andrew)
Operating System All
Severity Low
Priority Normal
Reported Version Development
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


If I understand correctly, SVG export uses svg groups to keep QCAD block entities. This in itself is very useful. There is no way to correctly keep layer information, as QCAD blocks can contain elements on different layers, while SVG only knows about groups. That is a deficiency of SVG.

To save on file size, there was some potential to get rid of ever repeating same attributes on entities, eg: style=”stroke:#000000;stroke-width:0.25;stroke-dasharray:2.16,1.08”

To optimize “By Block” is easy: just set the attribute on the SVG group, and omit on below entities styled “By Block”.

To optimize “By Layer” is a little more involved, but might be solved by using css:
- Create a class by the name of the Layer
- add the class attribute to elements styled “By Layer”

Then only individually styled entities would get a style attribute, and filesize of SVG could be halved in most cases.

This just an idea :) Having written this, I now realize, that QCAD can style weight, pattern, color each extra, so the optimazition could only be applied to entities, where everything is “By Layer” or “By Block”. But that should be the case most of the time.

This task depends upon

Closed by  Andrew (andrew)
Sunday, 10 July 2011, 15:33 GMT+1
Reason for closing:  Won't implement
Comment by Andrew (andrew) - Friday, 08 July 2011, 17:17 GMT+1

I've noticed that minimal file size seems to be very important for your use case. Out of curiosity and to better understand the problem, may I ask where this requirement is coming from? It seems somewhat exotic in the day and age of Terabyte disks and broadband Internet.