Anonymous

Guides/Inkscape for Laser Cutting: Difference between revisions

From London Hackspace Wiki
m
Updated white space and line returns and capitalised all occurrences of 'Inkscape'
m (Giac0m0 moved page Guides/InkscapeForLaserCutting to Guides/Inkscape for Laser Cutting: Renaming to follow consitent naming convention for other guides)
m (Updated white space and line returns and capitalised all occurrences of 'Inkscape')
 
Line 1: Line 1:
==TL;DR==
==TL;DR==


How to deal with problem inkscape files
How to deal with problem Inkscape files:


Per layer:
* Per layer:
* Select all
** Select all
* Path-> objects to paths
** Path-> objects to paths
* Object -> Fill and Stroke -> Set fill to None
** Object -> Fill and Stroke -> Set fill to None
* Path -> Combine
** Path -> Combine


Note that for complicated paths, it may also be necessary to use the "Unite curves" feature of the laser cutter software. Some engraving may not work at all unless this is used.
Note that for complicated paths, it may also be necessary to use the "Unite curves" feature of the laser cutter software. Some engraving may not work at all unless this is used.


See also the [[#Alternative_method|alternative method]].
See also the [[#Alternative_method|alternative method]].
Line 15: Line 15:
==Some laser cutter basics==
==Some laser cutter basics==


===Engrave vs cut===
===Engrave vs cut===


Engrave involves filling in the shapes. It is non trivial to decide if a point is inside or outside a shape and should be engraved or not.
Engrave involves filling in the shapes. It is non trivial to decide if a point is inside or outside a shape and should be engraved or not.


In the laser cutter software it does it by taking a vertical line and and then seeing where it intersects with your shapes lines. The first line it comes to it switches the laser on, when it comes to another line it switches off.
In the laser cutter software it does it by taking a vertical line and and then seeing where it intersects with your shapes lines. The first line it comes to it switches the laser on, when it comes to another line it switches off.


This allows for unengraved things inside engraved sections. It also means that if you overlap two objects on the same engrave layer then it will not engrave twice but stop engraving.
This allows for unengraved things inside engraved sections. It also means that if you overlap two objects on the same engrave layer then it will not engrave twice but stop engraving.


This is also why the software complains if the sections that you are engraving aren't continous, it might find a section that is open and engrave for ever.
This is also why the software complains if the sections that you are engraving aren't continous, it might find a section that is open and engrave for ever.


Cut is straightforward. It just follows the lines you have made. Joining the lines helps somewhat the crazy cut order it makes.
Cut is straightforward. It just follows the lines you have made. Joining the lines helps somewhat the crazy cut order it makes.


==Inkscape basics==
==Inkscape basics==


===Why use inkscape?===
===Why use Inkscape?===


It can intersect and do path operations on curves and can trace bitmaps, which I haven't been able to do on qcad.
It can intersect and do path operations on curves and can trace bitmaps, which I haven't been able to do on qcad.
Line 54: Line 52:
Curves are specified by 3,4 points. There are two end points (which can be diamonds,squares or large circles) and 1-2 control points (small circles with lines connecting them to the end points). The control points tug at the curve, the further away they are from the straight line the more the curvy the curve becomes.
Curves are specified by 3,4 points. There are two end points (which can be diamonds,squares or large circles) and 1-2 control points (small circles with lines connecting them to the end points). The control points tug at the curve, the further away they are from the straight line the more the curvy the curve becomes.


There are lots of useful tools in the tool bar. The first two are add and remove points (which are very useful for adding detail or clearing up a scan). To add a point select two (or more) connected end points and press the first button (+ with a square and line through it), deletion just requires the selection of an end point.
There are lots of useful tools in the tool bar. The first two are add and remove points (which are very useful for adding detail or clearing up a scan). To add a point select two (or more) connected end points and press the first button (+ with a square and line through it), deletion just requires the selection of an end point.


There are a few different types of end points. You can change the type by pressing the 7-10th buttons.
There are a few different types of end points. You can change the type by pressing the 7-10th buttons.


7th button: diamonds are corners: The control points for the curves are unconnected. So ou can have crazy angles.
7th button: diamonds are corners: The control points for the curves are unconnected. So ou can have crazy angles.
8th button: The first square (smooth). The control points are 180 degrees away from each other.
8th button: The first square (smooth). The control points are 180 degrees away from each other.
9th button: The second square (symmetric). The control points are 180 degrees away from each other and they are the same distance away.
9th button: The second square (symmetric). The control points are 180 degrees away from each other and they are the same distance away.
Line 71: Line 69:
===Changing objects into paths===
===Changing objects into paths===


DXF files do not have some of the primitives in svg like text or the curvy edged boxes that inkscape generates. This means you need to convert these objects into things the DXF format understands.
DXF files do not have some of the primitives in svg like text or the curvy edged boxes that Inkscape generates. This means you need to convert these objects into things the DXF format understands.


This can be done with object to path.
This can be done with object to path.
Line 83: Line 81:
Object -> fill and stroke  
Object -> fill and stroke  


This allows you to change the appearance of the object. Fill is the colour inside the line. Stroke is what colour the line is (and a various other things that aren't useful for laser cutting).
This allows you to change the appearance of the object. Fill is the colour inside the line. Stroke is what colour the line is (and a various other things that aren't useful for laser cutting).


=== Custom Palette for making cut lines appear as layers in LaserCut v5.3 ===
=== Custom Palette for making cut lines appear as layers in LaserCut v5.3 ===
Line 122: Line 120:
===Layers and Ordering===
===Layers and Ordering===


Layers are ways of separating out objects in Inkscape. However these are not supported exporting to dxf and importing into the Lasercut software. Colours are supported, if the same pallette of colours are used that the LaserCut software uses. Black (0,0,0), Red (255,0,0), Blue (0,0,255) and Green (0,255,0) correspond to automatically creating layers in LaserCut, allowing you to select which coloured layer is a cut or an engrave and reducing setup time.
Layers are ways of separating out objects in Inkscape. However these are not supported exporting to dxf and importing into the Lasercut software. Colours are supported, if the same pallette of colours are used that the LaserCut software uses. Black (0,0,0), Red (255,0,0), Blue (0,0,255) and Green (0,255,0) correspond to automatically creating layers in LaserCut, allowing you to select which coloured layer is a cut or an engrave and reducing setup time.


Hiding layers also seems to be unsupported, with hidden layers being saved into the dfx. Better to prepare a duplicate (copy, new, paste) of your design with nothing but the design in (no empty layers or guides) before an export.
Hiding layers also seems to be unsupported, with hidden layers being saved into the dfx. Better to prepare a duplicate (copy, new, paste) of your design with nothing but the design in (no empty layers or guides) before an export.


Once imported into the Laser software menu:
Once imported into the Laser software menu:
Line 149: Line 147:
They can mainly be found here. I'll cover the laser cutting view of things.
They can mainly be found here. I'll cover the laser cutting view of things.


http://kalaalog.com/2007/11/01/inkscape-path-operations-basic-tutorial/
http://kalaalog.com/2007/11/01/Inkscape-path-operations-basic-tutorial/


Path -> Union
Path -> Union
Line 157: Line 155:
Path -> Difference
Path -> Difference


Removes the higher one from the lower one (in layer terms). This is good for cutting out shapes, like a bite from an apple.  
Removes the higher one from the lower one (in layer terms). This is good for cutting out shapes, like a bite from an apple.  


Path -> Cut Path
Path -> Cut Path
Line 171: Line 169:
According to [http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_2D_formats the OpenSCAD manual], you can get sensible DXFs from SVGs by doing this on the command line:
According to [http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_2D_formats the OpenSCAD manual], you can get sensible DXFs from SVGs by doing this on the command line:


  inkscape -E somefile.eps somefile.svg
  Inkscape -E somefile.eps somefile.svg
  pstoedit -dt -f dxf:-polyaslines somefile.eps somefile.dxf
  pstoedit -dt -f dxf:-polyaslines somefile.eps somefile.dxf


Or in a single line:
Or in a single line:


  inkscape -E /dev/stdout somefile.svg | pstoedit -dt -f dxf:-polyaslines - somefile.dxf
Inkscape -E /dev/stdout somefile.svg | pstoedit -dt -f dxf:-polyaslines - somefile.dxf


This is tested and working. Colours from the original SVG file persist through the conversion process, so this can be an easy way to set up layers for the laser cutter software.
This is tested and working. Colours from the original SVG file persist through the conversion process, so this can be an easy way to set up layers for the laser cutter software.
Line 184: Line 182:
The imported DXF will end up being tiny (something like 1/10 of its Inkscape size), and will also be positioned a long way off the left and bottom of the on-screen laser bed. The size *might* be fixable by using the <code>-mm</code> argument:
The imported DXF will end up being tiny (something like 1/10 of its Inkscape size), and will also be positioned a long way off the left and bottom of the on-screen laser bed. The size *might* be fixable by using the <code>-mm</code> argument:


  pstoedit -dt -f 'dxf:-polyaslines -mm' somefile.eps somefile.dxf
pstoedit -dt -f 'dxf:-polyaslines -mm' somefile.eps somefile.dxf


this is tested and works well. There are also arguments for rotating, translating, and scaling the output of <code>pstoedit</code>, but those need further experimentation.
this is tested and works well. There are also arguments for rotating, translating, and scaling the output of <code>pstoedit</code>, but those need further experimentation.


==Useful Plugins==
==Useful Plugins==
===Vector Fonts===
===Vector Fonts===
[http://www.evilmadscientist.com/2011/hershey-text-an-inkscape-extension-for-engraving-fonts/ Hershey Text] renders text as a vector line. This allows for a faster "cut" than engraving our outlining a raster font.
[http://www.evilmadscientist.com/2011/hershey-text-an-Inkscape-extension-for-engraving-fonts/ Hershey Text] renders text as a vector line. This allows for a faster "cut" than engraving our outlining a raster font.


==More information==
==More information==
57

edits