Login : Register

I am DAILY cutting vinyl with Inkscape

View: New views
6 Messages — Rating Filter:   Alert me  

I am DAILY cutting vinyl with Inkscape

Click to flag this post

by Bruce Westfall Sep 25, 2008; 04:44pm :: Rate this Message: - Use ratings to moderate (?)

Reply | Reply to Author | Print | View Threaded | Show Only this Message

I've posted this before, but here goes again -

What I am currently doing is organizing a cut page with Inkscape,
saving that single color file as

/home/bruce/hpgl/newplot.ps

I then click a script called 'cut newplot.ps' which changes to the
correct directory, generates a view using evince ( just to make sure
I'm going to cut the right thing ) and then activates another script
based on the one found at:

http://pldaniels.com/hpgl-distiller/
( I changed a few things and am more than happy to share everything
with anyone. )

Once I close the preview, the plotter does it's thing.

-----------------------------

I would like to create a menu item in Inkscape, but haven't figured
that out yet.

Any links on how to make a custom menu item??

--
Bruce Westfall
740-767-3636
740-707-7038

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: I am DAILY cutting vinyl with Inkscape

Click to flag this post

by Terry Brown-2 Sep 25, 2008; 05:45pm :: Rate this Message: - Use ratings to moderate (?)

Reply | Reply to Author | Print | View Threaded | Show Only this Message

On Thu, 25 Sep 2008 10:44:01 -0400
"bruce westfall" <brucewestfall@...> wrote:

> I've posted this before, but here goes again -
>
> What I am currently doing is organizing a cut page with Inkscape,
> saving that single color file as
>
> /home/bruce/hpgl/newplot.ps

This file you're saving, are you just saving the whole current inkscape
file to this .ps file?

If so it probably wouldn't be too hard to make an inkscape python
"Effect" which doesn't actually do anything to the inkscape document,
but instead saves it (as above) and then runs the steps below.

I could make an example effect it you want.

Cheers -Terry

> I then click a script called 'cut newplot.ps' which changes to the
> correct directory, generates a view using evince ( just to make sure
> I'm going to cut the right thing ) and then activates another script
> based on the one found at:
>
> http://pldaniels.com/hpgl-distiller/
> ( I changed a few things and am more than happy to share everything
> with anyone. )
>
> Once I close the preview, the plotter does it's thing.
>
> -----------------------------
>
> I would like to create a menu item in Inkscape, but haven't figured
> that out yet.
>
> Any links on how to make a custom menu item??
>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: I am DAILY cutting vinyl with Inkscape

Click to flag this post

by Terry Brown-2 Sep 30, 2008; 05:51pm :: Rate this Message: - Use ratings to moderate (?)

Reply | Reply to Author | Print | View Threaded | Show Only this Message

On Thu, 25 Sep 2008 10:44:01 -0400
"bruce westfall" <brucewestfall@...> wrote:

> I would like to create a menu item in Inkscape, but haven't figured
> that out yet.

I've attached two files, cutvinyl.inx and cutvinyl.py, which when
placed in the ~/.inkscape/extensions directory at an Output menu to the
Effects menu, which has one item, Cut Vinyl.

I ran into what I believe to be a bug:

https://bugs.launchpad.net/inkscape/+bug/276382

   inkscape --without-gui --export-ps=del.ps del.svg

as a script command does not create postscript output, so the new menu
item doesn't actually work for me, although it might work for you as I'm
sure --export-ps has worked in the past.

Anyway, all the script does at present is save the document to a
temporary .svg file, attempt (this is the bit that fails) to invoke a
second instance of inkscape to convert it to PS, and then views it with
the PS viewer 'gv'.

I suspect that you'll be able to follow the pattern to add the behavior
you want, but if not let me know and I'll flesh it out a bit more.

Cheers -Terry


[cutvinyl.py]

#!/usr/bin/env python
'''
Copyright (C) 2007

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
'''
import sys
import os
import subprocess
import tempfile

sys.path.append(os.path.dirname(sys.argv[0]))  #?

import inkex

class CutVinyl(inkex.Effect):
    def __init__(self):
        inkex.Effect.__init__(self)
    #     opts = [('-m', '--mode', 'string', 'mode', 'Lines',
    #              'Join paths with lines or polygons'),
    #             ]
    #     for o in opts:
    #         self.OptionParser.add_option(o[0], o[1], action="store",
    #             type=o[2], dest=o[3], default=o[4], help=o[5])

    def effect(self):

        # write the document to a file
        output, outputName = tempfile.mkstemp('.svg')
        os.close(output)
        self.document.write(file(outputName, 'w'))

        # invoke inkscape to convert to ps
        output, outputNamePS = tempfile.mkstemp('.ps')
        os.close(output)
        proc = subprocess.Popen(['inkscape', '--without-gui',
            '--export-ps='+outputNamePS, outputName])
        proc.wait()

        # view with gv
        proc = subprocess.Popen(['gv', outputNamePS])
        proc.wait()

        # clean up
        os.remove(outputName)
        os.remove(outputNamePS)
        return

e = CutVinyl()
e.affect()


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

cutvinyl.inx (970 bytes) Download Attachment

Re: I am DAILY cutting vinyl with Inkscape

Click to flag this post

by Terry Brown-2 Oct 04, 2008; 11:51pm :: Rate this Message: - Use ratings to moderate (?)

Reply | Reply to Author | Print | View Threaded | Show Only this Message

Hmm, seems to me that msg. took four days to appear on the list?

Cheers -Terry

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

Re: I am DAILY cutting vinyl with Inkscape

Click to flag this post

by Alvin Penner Oct 05, 2008; 01:54am :: Rate this Message: - Use ratings to moderate (?)

Reply | Reply to Author | Print | View Threaded | Show Only this Message

Terry Brown-2 wrote:
I ran into what I believe to be a bug:

https://bugs.launchpad.net/inkscape/+bug/276382

   inkscape --without-gui --export-ps=del.ps del.svg

as a script command does not create postscript output
it looks like this may work better on more recent development versions,
https://bugs.launchpad.net/inkscape/+bug/276382/comments/1

hth,
Alvin

Re: I am DAILY cutting vinyl with Inkscape

Click to flag this post

by Terry Brown-2 Oct 06, 2008; 07:39pm :: Rate this Message: - Use ratings to moderate (?)

Reply | Reply to Author | Print | View Threaded | Show Only this Message

On Sat, 4 Oct 2008 16:54:42 -0700 (PDT)
Alvin Penner <penner@...> wrote:

> it looks like this may work better on more recent development
> versions, https://bugs.launchpad.net/inkscape/+bug/276382/comments/1

You're right, this seems to be ok in the current dev. build apart from
the warning output, which could be suppressed.

So let me know if the script's enough to get you where you want or if
you'd like a more specific version.

Cheers -Terry

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...
https://lists.sourceforge.net/lists/listinfo/inkscape-devel

« Search Nabble for "inkscape vinyl cutting"