This relates to https://bugs.launchpad.net/inkscape/+bug/247463 and comment 37 in particular.
I would like to be able to attach information to objects that are needed for high quality digitization. This includes stitch length and stitch direction. I am thinking of displaying the direction as gradient, although direction may be very complex. I am just learning about SVG so, I do not know if there are smart ways of doing this. (For example, think of a leaf, where you may have 20 different direction changes.) I also do not know XML very well (creating schema, etc).
So, is there a standard way to extend SVG or embed such codes in SVG for a given object? How would I go about attaching buttons, etc. in the GUI? Can I have Inkscape view the direction code as a gradient for display (if an option is set)? Or, show the fill as lines going in that direction? (Again, this wouldn't be done in printing/export/etc., only in viewing with an option set.)
I would like to do this in SVG and Inkscape since I believe both are scriptable and both can be used for print as well. (This is a project for both print and embroidery.)
Additional request for information: Is it possible to define a custom color table? Embroidery machines usually have a fixed color table (which can be converted to various thread vendor product/color numbers).
Is it possible to turn an outline on for an object and give it a different color than the object, or easily create an outline?
Finally, is there a way to do "Ungroup repeatedly until there are no groups left, and convert objects to paths." as part of an extension (http://www.jonh.net/~jonh/inkscape-embroidery/) without modifying the original (as part of an export, etc.)?
Thank you, Trever
On 13-01-12 19:10, Trever L. Adams wrote:
This relates to https://bugs.launchpad.net/inkscape/+bug/247463 and comment 37 in particular.
I would like to be able to attach information to objects that are needed for high quality digitization. This includes stitch length and stitch direction. I am thinking of displaying the direction as gradient, although direction may be very complex. I am just learning about SVG so, I do not know if there are smart ways of doing this. (For example, think of a leaf, where you may have 20 different direction changes.) I also do not know XML very well (creating schema, etc).
So basically you want to embed information needed to convert a drawing to something that can be embroidered? And you want this information to be visible and manipulable in Inkscape's interface?
So, is there a standard way to extend SVG or embed such codes in SVG for a given object?
Extending SVG is in principle very easy, just define a namespace that hasn't been taken yet (and preferably as specific as possible) and use elements/attributes from that namespace. Ideally you would also create a schema to define which elements/attributes are in that namespace and so on, but I wouldn't necessarily start out that way (although it's obviously a good idea to think about a formal definition if you want this to be used by others as well, and/or save yourself some trouble in the future).
The idea is that viewers/editors will ignore anything they don't recognize. The extent to which this is true in practice varies a bit, and it's definitely not a given that an editor (Inkscape) will preserve the tags, but in principle it should "work" (in the sense that nothing will suddenly go wrong).
How would I go about attaching buttons, etc. in the GUI? Can I have Inkscape view the direction code as a gradient for display (if an option is set)? Or, show the fill as lines going in that direction? (Again, this wouldn't be done in printing/export/etc., only in viewing with an option set.)
That's trickier. The easiest option is probably to write some python extensions (like those that live in the extensions menu) that add the extra information and render "hints" as SVG.
I would like to do this in SVG and Inkscape since I believe both are scriptable and both can be used for print as well. (This is a project for both print and embroidery.)
Inkscape itself is not really scriptable. What you can do is write a python extension that essentially gets a piece of SVG to transform. But this is fairly flexible. Also, if you know C/C++ you might be able to write something like an LPE to help out.
Additional request for information: Is it possible to define a custom color table? Embroidery machines usually have a fixed color table (which can be converted to various thread vendor product/color numbers).
Not sure, but I think there is at least some support for color management. Perhaps someone else knows more about this?
Is it possible to turn an outline on for an object and give it a different color than the object, or easily create an outline?
You mean outline as in stroke? If so, that's trivial in SVG, every object intrinsically has a fill and a stroke.
Finally, is there a way to do "Ungroup repeatedly until there are no groups left, and convert objects to paths." as part of an extension (http://www.jonh.net/~jonh/inkscape-embroidery/) without modifying the original (as part of an export, etc.)?
I think it's possible to create extensions for output as well, so conceivably this would be possible. In any case, you might want to have a look at this extension:
https://gitorious.org/various-small-stuff/inkscape-ungroup-deep/
participants (2)
-
Jasper van de Gronde
-
Trever L. Adams