extension get and edit svg path

General discussions about Inkscape.
costycnc
Posts: 7
Joined: Sun Jan 17, 2016 5:08 pm

extension get and edit svg path

Postby costycnc » Thu May 24, 2018 4:29 pm

How can get xml source svg from path in my inskape extension for edit?
Exactly as xml editor from Inskape ... but i want to get only this for edit and save as gcode:
M 66.523811,94.404755 H 139.09524 V 152.61309 H 66.523811 Z



I know that is possible have already exists a response at my question, but i search in this forum with my knowing words but i dont find anything, because i not have advanced knowledge about tecnical words.
I create this cnc https://www.youtube.com/watch?v=titu3T1fR_g ... is not big deal... but my clients is excited because is easy to programming!
So ... I modified potrace raster to svg from http://kilobtye.github.io/potrace/ to http://costycnc.it/img_nc/ ... and from path code i added some g01 text for create gcode file for my cnc... and working great!

Because is easy after to transform to gcode!

G01 X0 Y0
G01 X 66.523811
G01 X 66.523811 Y 94.404755
...
I know that this is a sample and primitive mode , but for me working and my clients that not have advanced knowledge about programming is excited!

Regards!
Attachments
forum.jpg
forum.jpg (213.71 KiB) Viewed 994 times

Moini
Posts: 2843
Joined: Mon Oct 05, 2015 10:44 am

Re: extension get and edit svg path

Postby Moini » Thu May 24, 2018 11:55 pm

Extensions development is explained here:
https://inkscape.org/en/develop/extensions/

Or you can also just open one of the extensions that come with Inkscape (any of the category that modifies a path would be suitable), and see how they do it.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

costycnc
Posts: 7
Joined: Sun Jan 17, 2016 5:08 pm

Re: extension get and edit svg path

Postby costycnc » Fri May 25, 2018 1:31 am

Already i open some files from inskape or downloaded from internet ... but is more code and not can understand where is lines that can make that or have to much parametrs , and put me in difficulty ...
I download tons of tutorials but i not find exactly that i want:
A sample example for edit self.svg , file that actually in inskape !
Thanks anyways!

Moini
Posts: 2843
Joined: Mon Oct 05, 2015 10:44 am

Re: extension get and edit svg path

Postby Moini » Fri May 25, 2018 6:58 am

Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

costycnc
Posts: 7
Joined: Sun Jan 17, 2016 5:08 pm

Re: extension get and edit svg path

Postby costycnc » Fri May 25, 2018 11:19 pm

I thing that i find in another topic exactly that i want!

Code: Select all

#The 'd' attribute is where the path data is stored as a string
                    pathData = node.get('d')



http://www.inkscapeforum.com/viewtopic.php?t=8826#p31912

Thanks anyway for your response!
Regards!
Attachments
ExportXY.zip
(1.38 KiB) Downloaded 31 times

Moini
Posts: 2843
Joined: Mon Oct 05, 2015 10:44 am

Re: extension get and edit svg path

Postby Moini » Sat May 26, 2018 2:47 am

... which is identical to what I linked to, two lines below... ;-)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

costycnc
Posts: 7
Joined: Sun Jan 17, 2016 5:08 pm

Re: extension get and edit svg path

Postby costycnc » Sat May 26, 2018 3:19 am

Yes... you are right!

Code: Select all

d = node.get('d')


but for me is a high diferrence when is explained!
Regards!

costycnc
Posts: 7
Joined: Sun Jan 17, 2016 5:08 pm

Re: extension get and edit svg path

Postby costycnc » Sat May 26, 2018 8:43 am

Now i begin study addnodes.py after i understand some things... thanks again!
I not understand what is mean [:]

Code: Select all

new[-1].append(next[:])

costycnc
Posts: 7
Joined: Sun Jan 17, 2016 5:08 pm

Re: extension get and edit svg path

Postby costycnc » Sat May 26, 2018 8:52 am


Moini
Posts: 2843
Joined: Mon Oct 05, 2015 10:44 am

Re: extension get and edit svg path

Postby Moini » Sat May 26, 2018 9:23 am

Append a copy of 'next' to the last item of 'new'.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)


Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests