On 2013-05-07 11:42 +0100, Sebastian Götte wrote:
Hi, I'm currently working on a GSoC proposal to add PCB layout and schematics editing capabilities to Inkscape (it's not as hard as it sounds). In a PCB layout, you have a number of (physically stacked) layers (one copper layer on each side of the board, possibly multiple copper layers *inside* the board, green solder mask on both sides on top of the copper layers and white print on top of the solder mask for markings etc.). I'm currently unsure on how to map these layers to SVG.
It appears obvious to map these to Inkscape layers/SVG groups. This does not work too well however, since all components on the board span multiple layers (pads for the pins on the copper layer, cut-outs for the pads on the solder mask and a package outline and part id/number on the silkscreen). If a component is moved, all parts of it (on any layers) need to be moved simultaneously, and in fact, normally it does not make sense to even select the parts of a component individually.
My problem is that this would essentially require cross-group groups, i.e. groups whose elements can be elements of other groups not part of the group, which clashes with XML's tree structure.
Currently, I have two and a half ideas on how to address this issue:
- I implement PCB layers as something different to Inkscape's layers that is just denoted by an object property (I don't like this). This attribute would be pretty similar to the z-order attribute that will be include in SVG 2.
- I find some way of "linking" multiple groups on multiple layers (I don't like this either, it's easier but more "hackish").
I'm currently leaning towards the second option since I can imagine the first will require a *lot* of work (though I will still look into that further).
Perhaps you have some ideas on how this could be implemented in pre-2.0 SVG.
Maybe worth-while a closer look (even though the fork will no longer be maintained or enhanced anymore [1]):
The 'ponyscape' fork of Inkscape implemented a tagging system in v0.4 which allows to tag objects, and a selection method based on the tag (across layers and across groups) i.e. it adds a concept of selection sets (for editing, exporting etc.). It does not treat objects with the same tag as a 'pseudo'-group though (which would for example apply an auto-transform (e.g. translate) to all objects with the same tag):
<quote> Tagging system!!
This system allows you to assign any number of tags to objects (paths, groups, etc.). If you select a tag within the dialog (ctrl-t), it will select all items which have that tag. To use the dialog, you must first create a tag using the + button. You can rename tags by double clicking on their name, and you can drag and drop tags to reorder or nest them. To assign a tag to an object, select the object and then click the + button next to the tag name in the list. To remove a tag from the list, select it under the "Items" node and press the delete key. This is especially useful for shading as you can tag all of your shading objects and in 2 clicks make them visible or hidden. (...) </quote> http://ponyscape-vectors.deviantart.com/journal/Ponyscape-v0-4-351369830
Sample screenshot: http://fc04.deviantart.net/fs71/f/2013/028/7/a/4_by_flutterguy317-d5t3tuv.png
[1] project is currently on hiatus: http://ponyscape-vectors.deviantart.com/journal/Ponyscape-Status-and-Update-369944236