uploaded it as a resource on inkscape.org, https://inkscape.org/~simarilius/%E2%98%85inkscape-exportxy-master (no idea why its put a star in the url) have also chucked it on github https://github.com/jwcliff/Inkscape_Exportxy
Cheers
John
On Sun, Nov 3, 2019 at 10:18 PM Maren Hachmann maren@goos-habermann.de wrote:
Am 03.11.19 um 18:57 schrieb Jens Lallensack:
Hi Maren, John,
many thanks again!
@Maren: I now tested using the latest development version, and the "selected_nodes" extension now works for me. However, I found that the coordinates are not returned in sequential order (the order that defines the path), which is crucial for my purpose, but in some random order. The order is even slightly different with Inkscape 0.91 compared to the development version. I would therefore, for now, stick with the ExportXY plugin, which, thanks to John, can now be published under the GPL.
- Mmh. Yes, it looks like the extension goes by selection order.
Probably you're using Ctrl+A or click+drag to select the nodes, and that function of Inkscape seems to create some kind of random order in the node list that Inkscape hands on to the extension.
Good that the other extension does what you need! (I think it wasn't possible yet at the time to get the selected nodes list, so that extension doesn't know about the node list from Inkscape, and can't be confused by its ordering).
Maybe one of the persons involved could put the extension into a repository at gitlab or another code hosting site? That way, it's not going to get lost again :)
Maren
Thank you very much for the hint with the document scale setting – that completely solved the issue that the x values were off.
@John: Thousand thanks, this is perfect!
The extension stopped working with Inkscape 1.0 though, which I was able to fix to some extent. I changed "self.selected.iteritems()" to "self.selected.items()" and now get the values again, together with a number of deprecation warnings. I was unable to resolve these warnings for now (any help welcome, of course), but I included an ugly hack that turns these warnings off, so that at least the output is clear.
A very pleasant surprise was that with Inkscape 1.0, both x and y values returned by the script fully match those displayed in Inkscape (without the y axis being inverted or similar).
I attached the modified code to this email.
Best wishes, and thanks again, Jens
Am 03/11/2019 um 10:32 schrieb John Cliff:
Hi Jens,
Heard back from Neon22, hes very happy for it to be released under GPL. If you can add this to the top of the code you put in the paper:
# # curve xy co-ordinate export # Authors: # Jean Moreno <jean.moreno.fr@gmail.com mailto:jean.moreno.fr@gmail.com> # John Cliff <john.cliff@gmail.com mailto:john.cliff@gmail.com> # Neon22 https://github.com/Neon22?tab=repositories # # Copyright (C) 2011 Jean Moreno # Copyright (C) 2011 John Cliff # Copyright (C) 2011 Neon22 # # Released under GNU GPL v3, see https://www.gnu.org/licenses/gpl-3.0.en.html for details. #
obviously add your name to those lists since you've modified it.
Thanks
John
On Sat, Nov 2, 2019 at 3:21 PM Jens Lallensack <jens.lallensack@gmail.com mailto:jens.lallensack@gmail.com> wrote:
Hi John, wow, I certainly asked at the right place! Thank you so much for
your
efforts, it would be wonderful if it can be released under GPL. Best, Jens Am 02/11/2019 um 14:42 schrieb John Cliff: > Thought it looked familiar. I'm Simarilius in that thread, I supplied > the dodgy original version that Neon22 improved. > I'm happy for the code to be published, I based it off a blog post from > a now dead blog (wayback link is here: >
http://web.archive.org/web/20141216062123/http://jumpnslide.tumblr.com/post/... )
> I have an email from that blog author Jean Moreno confirming he
was > happy for the code to be modified/ released under GPL which I can > forward to you if you wish. > Neon22 that modified it doesn't appear to have been active on the forum > since 2013, but appears to have been active on Github and Inkscape.org > recently. I've just tried emailing them via the openscad forum, will let > you know if they reply. > > Cheers > > John > > On Sat, Nov 2, 2019 at 12:52 PM Jens Lallensack > <jens.lallensack@gmail.com mailto:jens.lallensack@gmail.com <mailto:jens.lallensack@gmail.com mailto:jens.lallensack@gmail.com>> wrote: > > > Hi John, > > thanks! > > This is the forum post with the improved version of the script: > http://www.inkscapeforum.com/viewtopic.php?t=8826#p32088 > > And here is the original version (same forum topic): > http://www.inkscapeforum.com/viewtopic.php?t=8826#p31912 > > Best wishes, > Jens > > > > > Am 02/11/2019 um 13:29 schrieb John Cliff: > > Whats the correct link for the forum post? you seem to
have
> linked the > > paper twice. > > > > Cheers > > > > John > > > > On Fri, Nov 1, 2019 at 2:38 PM Jens Lallensack > > <jens.lallensack@gmail.com <mailto:jens.lallensack@gmail.com> <mailto:
jens.lallensack@gmail.com
<mailto:jens.lallensack@gmail.com>> > <mailto:jens.lallensack@gmail.com <mailto:jens.lallensack@gmail.com> > <mailto:jens.lallensack@gmail.com <mailto:jens.lallensack@gmail.com>>>> wrote: > > > > > > Dear all, > > > > I am palaeontologist at the University of Bonn,
Germany, > focusing on > > fossil dinosaur footprints and trackways. I regularly use > Inkscape for > > my research (for measuring, data extration, and drawing of > interpretive > > outlines), and have cited this software in several of my papers. > > > > I am currently working on a methodological paper on how to > analyze > > fossil footprints based on 3D models. The approach I will > present in > > this paper includes Inkscape as an important component. The > idea is to > > import raster images into Inkscape (different graphical 2D > > representations of the 3D model), align them into an image > stack, and > > draw interpretive outlines on a separate layer. I use the > Bezier curves > > tool to collect a number of landmark coordinates from the > separate > > footprints, which I then export to automatically calculate a > large > > number of measurements for statistical analysis. The paper is > to be > > published in a peer-revied journal (currently, I have the > Journal of > > Palaeontological Techniques in mind, > > https://www.jpaleontologicaltechniques.org/). > > > > I already used this method in a recent paper > > > (https://www.tandfonline.com/doi/abs/10.1080/02724634.2018.1512501) to > > rapidly collect measurements of a larger number of trackways. The > > aim of > > the new methodological paper is to improve this method and to > make it > > available to our comunity of footprint researchers. However, > there are > > two open issues/questions regarding Inkscape. I was wondering > if you > > could give me some advice here. > > > > Export of path node coordinates is, unfortunately, currently > possible > > only via a plugin, which adds an additional hitch (but I > understand > > that > > research is not the focus of Inkscape). Such a plugin was > posted on the > > Inkscape Forum in 2011, with improvements added by different > members > > > (https://www.tandfonline.com/doi/abs/10.1080/02724634.2018.1512501). I > > simplified the code so that it returns node coordinates only > (and not > > those of the handles), see code below. > > > > Now to my questions: > > > > 1) I need to cite the modified coord export script in my > paper, and > > make > > sure that it stays available. I assume that code published in > the forum > > is not automatically released under a free licence, and that > I cannot > > simply distribute the script together with the paper.
A
> possibility > > might be to post the modified script to the forum and provide > the link > > in the paper. This is only an option if the link
remains > available > > for a > > longer time (I cannot modify the paper once published). What > would be > > the optimal way? > > > > 2) The coordinates given by the script need to be mirrored and > > translated to match the coordinates displayed within Inkscape > itself. I > > would need to improve the script so that this is done > automatically. > > I'm > > not into python scripting, but would try to figure this out. Any > > help/hints with this would be much appreciated. > > > > Thank you very much in advance. > > > > Kind regards, > > Jens Lallensack > > > > > > > > ----- xyexport.py ------- > > > > #!/usr/bin/env python > > > > import inkex > > import sys > > import simpletransform > > import cubicsuperpath > > > > class TemplateEffect(inkex.Effect): > > def __init__(self): > > inkex.Effect.__init__(self) > > def effect(self): > > for node in self.selected.iteritems(): > > output_all = output_nodes = "" > > for id, node in self.selected.iteritems(): > > if node.tag == inkex.addNS('path','svg'): > > output_all += "" > > output_nodes += "" > > simpletransform.fuseTransform(node) > > d = node.get('d') > > p = cubicsuperpath.parsePath(d) > > for subpath in p: > > for csp in subpath: > > output_nodes += str(csp[1][0]) > + "\t" + > > str(csp[1][1]) + "\n" > > sys.stderr.write(output_nodes) > > effect = TemplateEffect() > > effect.affect() > > _______________________________________________ > > Inkscape Devel mailing list -- > inkscape-devel@lists.inkscape.org mailto:inkscape-devel@lists.inkscape.org > <mailto:inkscape-devel@lists.inkscape.org mailto:inkscape-devel@lists.inkscape.org> > > <mailto:inkscape-devel@lists.inkscape.org mailto:inkscape-devel@lists.inkscape.org > <mailto:inkscape-devel@lists.inkscape.org mailto:inkscape-devel@lists.inkscape.org>> > > To unsubscribe send an email to > > inkscape-devel-leave@lists.inkscape.org mailto:inkscape-devel-leave@lists.inkscape.org > <mailto:inkscape-devel-leave@lists.inkscape.org mailto:inkscape-devel-leave@lists.inkscape.org> > > <mailto:inkscape-devel-leave@lists.inkscape.org mailto:inkscape-devel-leave@lists.inkscape.org > <mailto:inkscape-devel-leave@lists.inkscape.org mailto:inkscape-devel-leave@lists.inkscape.org>> > > >
Inkscape Devel mailing list -- inkscape-devel@lists.inkscape.org To unsubscribe send an email to inkscape-devel-leave@lists.inkscape.org
Inkscape Devel mailing list -- inkscape-devel@lists.inkscape.org To unsubscribe send an email to inkscape-devel-leave@lists.inkscape.org