← All bug reports

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

Type
Refactoring
Status
Closed
Resolution
Won't implement
Category
QCAD (main)
Severity
Low
Priority
Low
Reported version
Development
Operating system
All
Reported
2011-07-08 by hungerburg
Closed
2011-07-10 by andrew

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.

Comments (1)

andrew 2011-07-08

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.