Fill page with patterns while minimizing wasted space
Fill page with patterns while minimizing wasted space
I have seen people use Inkscape to produce patterns for die cutting and CNC machines. I would like to do the same thing. Is there a way within Inkscape, or with an extension, to fill a page completely with different patterns? I want to minimize the amount of material wasted during the cutting. Some sort of algorithm that can flip and rotate groups leaving a minimum spacing between them would be nice. If this function does not exist, is there a site where I can request that functionality? I have seen it referred to as nesting shapes on the web. These shapes would differ from each other.
Last edited by babycody on Mon Nov 19, 2012 5:38 am, edited 1 time in total.
Re: Fill page with patterns while minimizing wasted space

Welcome to InkscapeForum!
It seems like I've heard of an extension that might do this. Here's the Extension Repository, although I don't know if that extension is listed there. http://wiki.inkscape.org/wiki/index.php ... Repository If it's not, maybe someone else will know where it is.
Launchpad (https://launchpad.net/inkscape) is where you will find any potentially existing feature request, and also where you should make new requests. If there's no existing request, you'd be welcome to submit one. (Search bugs and/or submit a bug report. New feature requests are made using bug reports (for some reason which I don't know)). If there is already an existing request, you can add your support ("this affects me too" button) (or something like that).
But before you do that, check out Inkscape's Tiled Clones (Edit menu > Clone). That's one way to get the same image repeated many times. In order to prevent wasted material, you'd have to be creative with the tile symmetry (Symmetry tab) and/or tile rotation (Rotation tab), depending on the shape of the object. However, it might not work for your purpose. I don't know if your machines will recognize an Inkscape clone. If they won't, then before you save and submit the file (to the machine) you'll need to break the clones' links to the original (Select All, then Unlink Clones button on command bar or Edit menu > Clones > Unlink clones).
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Fill page with patterns while minimizing wasted space
There isn't a feature that does this as efficiently as you have envisioned -rotate and flip?!..., but there is a remove overlaps section in the align dialog in upcoming or maybe already released versions of Inkscape. The same for a randamize centers feature - that one is newer. You can just stack everything and let Inkscape rearrange them so they are as close as possible without actually overlapping. You can even specify how much space there should be in between.
A packing algorithm (that's what you are describing) is quite difficult in terms of math. There are good solutions for circles and rectangles and i am sure someone is working on adapting them to objects of any shape. I believe as far as Inkscape is cocerned the best we can hope for is an efficient packing of bounding boxes. Incidentally, this whole class of computation is considered NP-Hard, or,
i guess what this boils down to in practical terms is that if you stack all your objects in one spot (by using align centers, vertically and horizontally) and then use the remove overlaps and still don't get what you want, the most efficient way to do it would be - manually. Using your own neuron based sugar powered analog computer.
A packing algorithm (that's what you are describing) is quite difficult in terms of math. There are good solutions for circles and rectangles and i am sure someone is working on adapting them to objects of any shape. I believe as far as Inkscape is cocerned the best we can hope for is an efficient packing of bounding boxes. Incidentally, this whole class of computation is considered NP-Hard, or,
Wikipedia wrote: ...The complexity class NP, on the other hand, contains many problems that people would like to solve efficiently, but for which no efficient algorithm is known...
i guess what this boils down to in practical terms is that if you stack all your objects in one spot (by using align centers, vertically and horizontally) and then use the remove overlaps and still don't get what you want, the most efficient way to do it would be - manually. Using your own neuron based sugar powered analog computer.

Your mind is what you think it is.
Re: Fill page with patterns while minimizing wasted space
Hello, This is my first post. I am learning Inkscape to design shapes to be exported and cut on a cnc plasma cutter. I too am interested in a nesting program that could be run in Inkscape to nest a variety of shapes or many of the same shape onto a sheet of metal (in my case). There is an add-on for Corel draw that is called Ecut that can do this and it seems to do it very well. I would post a link to the Ecut video on YouTube but i think its prohibited.
I was hoping that maybe someone in the vinyl sign business could point me towards a similar solution for InkScape.
I was hoping that maybe someone in the vinyl sign business could point me towards a similar solution for InkScape.
Re: Fill page with patterns while minimizing wasted space
You could try asking in http://www.inkscapecuttingdesign.com/index.php but I think you'll get the best results with manually placing your objects, and then saving the layout
You've made to re-use again.
You've made to re-use again.
Re: Fill page with patterns while minimizing wasted space
Welcome xalky,
We've had some requests for this in the past. To my knowledge, there isn't any way to do it automatically. But it would be a nice thing to have. Maybe someone will make an extension for this purpose?
Or you could submit a new feature request, if you like: viewtopic.php?f=28&t=286
We've had some requests for this in the past. To my knowledge, there isn't any way to do it automatically. But it would be a nice thing to have. Maybe someone will make an extension for this purpose?
Or you could submit a new feature request, if you like: viewtopic.php?f=28&t=286
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Fill page with patterns while minimizing wasted space
Hey folks!
I'm always forgetting about Inkscape's Rows and Columns feature (Objects menu near the bottom). If your objects are all the same width and/or height, or very close, then Rows and Columns will be better than nothing. You can set spacing to zero, if you want.
If you have different sizes/shapes, you could set up pairs of columns, where you have the left column aligned to the right side, and the right column aligned to the left side. Then you'd only have to "manually" align the 3 pairs of columns. (Or whatever reasonable scenario is needed for your situation.)
I am surprised about druban's comments as to the non-existence of an algorithm to perform such a task! While it may well be not possible (because I trust druban's knowledge about math and geometry) it seems like it shouldn't be so difficult (because my own common sense is usually pretty reliable). But having read druban's comments, and made my own, I do seem to recall someone asking if Inkscape has such a tool, because another popular graphics app does have one -- might have been Corel or Illustrator. I wish I could remember more, because I don't have enough to go on, to search out that topic. But some program does apparently have something like that
Edit -- From what I recall, it was a printing option, rather than a drawing option. Maybe that's the difference between what's possible and what's not?
I'm always forgetting about Inkscape's Rows and Columns feature (Objects menu near the bottom). If your objects are all the same width and/or height, or very close, then Rows and Columns will be better than nothing. You can set spacing to zero, if you want.
If you have different sizes/shapes, you could set up pairs of columns, where you have the left column aligned to the right side, and the right column aligned to the left side. Then you'd only have to "manually" align the 3 pairs of columns. (Or whatever reasonable scenario is needed for your situation.)
I am surprised about druban's comments as to the non-existence of an algorithm to perform such a task! While it may well be not possible (because I trust druban's knowledge about math and geometry) it seems like it shouldn't be so difficult (because my own common sense is usually pretty reliable). But having read druban's comments, and made my own, I do seem to recall someone asking if Inkscape has such a tool, because another popular graphics app does have one -- might have been Corel or Illustrator. I wish I could remember more, because I don't have enough to go on, to search out that topic. But some program does apparently have something like that

Edit -- From what I recall, it was a printing option, rather than a drawing option. Maybe that's the difference between what's possible and what's not?
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Fill page with patterns while minimizing wasted space
This problem has been solved for a long time, at least in other software. It is usually called "nesting" and has long been used for various CNC machines, such as waterjet, plasma, laser, and vinyl cutters. Those machines have specialized CAM software to do the nesting. It's probably expensive software--isn't everything for industry?
That said, I also would love to have an extension for Inkscape to implement nesting. Thanks!

That said, I also would love to have an extension for Inkscape to implement nesting. Thanks!