Laser raster and vector in one plugin for inkscape?

129 views
Skip to first unread message

mjol...@gmail.com

unread,
Feb 9, 2015, 3:33:37 AM2/9/15
to lansing-mak...@googlegroups.com

Having got the raster working correctly I would like to combine the imagetogcode.py and the thlaser.py.

I made some changes to both of these files:
imagetogcode:
Add M649 command,    f.write("M649 S100.0 L60000 P20 B2 D0\nG28\nG0 X130 Y10 F1500\n");
Use "$" instead of "N" for the direction setting,  f.write("\nG7 $1 ")

thlaser:
Put ";" at the start of all comments so that the version of Pronterface that works with the raster Gcode also works with the vector Gcode
Pass the layer name as laser intensity (0 to 100)
Use PPM and feed (can't remember if I changed that or not)

Layer name now has to be (for example) 20 [ppm=40,feed=300] meaning 20% laser power, 40 pulses per mm, 300 mm per minute.

At the moment thlaser gives an error if it meets a bitmap and no vectors and ignores layers that have a bitmap and no vectors. What needs to happen is that it calls the imagetogcode.py if a layer has a bitmap in. Layer name can still pass laser power as this is required for the raster image. 

If this is done then it will be possible (for example) to raster an image, add some vector text then cut the piece out all from one Inkscape drawing.

I had a look at both scripts but can't even work out how the imagetogcode gets the data from the bitmap, nor can I work out how to make the layer with bitmap pass the info to the imagetogcode script inside the thlaser.

I don't mind blundering about in the dark trying until I manage but I am sure that there are people on here a lot better qualified to do this than I am.

Anyone care to give me a few pointers?


thlaser.py
imagetogcode.py

Tim Schmidt

unread,
Feb 9, 2015, 3:24:02 PM2/9/15
to Lansing Makers Network
I haven't looked into inkscape plugins much. So I can't be quite as
helpful as usual :-/

--tim

mjol...@gmail.com

unread,
Feb 9, 2015, 5:27:01 PM2/9/15
to lansing-mak...@googlegroups.com
It's not the Inkscape bit, it's the Python bit. :)

I was also thinking that the raster needs to be positive or negative selectable. As it is the script chooses inverse ie black (burnt) where it was black in the picture (low pixel value). Sometimes you need it the other way if, for example you are removing die from a coloured card.


 


 

Leon

unread,
Feb 12, 2015, 12:06:59 AM2/12/15
to lansing-mak...@googlegroups.com
If no one has a go at getting this going I'll give it a shot once I have my machine back online and working at the point that you've got yours to. I'll post in here once I make a start.

mjol...@gmail.com

unread,
Feb 12, 2015, 2:14:19 AM2/12/15
to lansing-mak...@googlegroups.com
I think it just needs the Invert statement taking out of the script but mine is in bits now so I can't try it, I bought a load of cutters (12), returns from a Chinese ebay  seller and I am overflowing with them right now going through and making workers to sell on ebay and other places. :)

I keep looking at the two scripts but am not making any progress on making the imagetogcode call a layer from an Inkscape drawing.
Reply all
Reply to author
Forward
0 new messages