Automatic true shape nesting in Inkscape?

General discussions about Inkscape.
Przemas
Posts: 4
Joined: Thu Nov 19, 2015 1:40 am

Automatic true shape nesting in Inkscape?

Postby Przemas » Thu Nov 19, 2015 1:48 am

I wonder if there's a plugin/extension (or existing functionality) inside Inkscape that would allow automatic nesting and arrange of objects.
I need to arrange a number of shapes on the page in a way they would use the available space as efficiently as possible. Because number of those shapes is quite high making this "by hand" won't work in long term - so I'm looking for an automatic (or semi auto) solution. So far found some extensions for Corel, but nothing that would work on Linux.

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: Automatic true shape nesting in Inkscape?

Postby hulf2012 » Thu Nov 19, 2015 2:59 am

Hello

Short answer: NO, AFAIK it doesn't have.

At first you talk about nesting, but later you seems to talk about arranging many objects in the canvas.

For Inkscape, I haven't seen the term "nesting" related with it. I think you are talking about putting shapes in layers, or in groups. SVG format doesn't mention layers in their papers and standards. However, Inkscape can support that feature, employing the "grouping" functionality of SVG format.
- Groups can be nested.
- SVG can be manipulated by program languages, like Javascript, or Python
- Inkscape have extensions to manipulate SVG files, but I think there isn't any related with what you want. You will have to do it by yourself

About arranging objects in the canvas. Inkscape in 0.91 version have a command for arrange a selection of objects. But the user have to select the required objects.

It will clarify more, If you could put more samples of what you want.
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

User avatar
brynn
Posts: 9962
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Automatic true shape nesting in Inkscape?

Postby brynn » Thu Nov 19, 2015 4:45 am

I think there might be. It seems like I just came across an extension.... I'm working on a project to get all (or as many as p ossible) extensions listed in one place. But I'm have a bit of a flu/fever at the moment, and my brain isn't working. Give me a few minutes, and I'll try and remember and find it.

Although, before I go on an ill-fated mission, let me ask. The title of your message is about nesting, which I think means one inside another. But in your description, it sounds like you're asking to have many objects lined up next to each other, like on a grid, or to save space -- which is the very opposite of nesting.

Are you talking about something like a sheet of labels? Or placing clothing patterns on fabric for cutting? Or fitting jigsaw puzzle pieces together? Or do you want objects stacked up on top of each other?

Przemas
Posts: 4
Joined: Thu Nov 19, 2015 1:40 am

Re: Automatic true shape nesting in Inkscape?

Postby Przemas » Thu Nov 19, 2015 7:29 am

hulf2012 wrote:Hello

At first you talk about nesting, but later you seems to talk about arranging many objects in the canvas.


That's the common problem with names - quite often the same term is used to describe different things.
In manufacturing world (printing, lasercutting, 3d printing) nesting is used to describe a process during which several pieces are arranged on a sheet / build plate in a way that saves as much space possible (as efficient as possible). This way you can get more pieces from a single sheet - thus you lower your costs. But so you could see what I mean, here's a video showing plugins for Corel that do the trick:

https://www.youtube.com/watch?v=Oa147vOqPYg

... and also to illustrate this term is being used in 3d world too a video of plugin for Rhino3d:
https://www.youtube.com/watch?v=_YP7OMNijvc

- interesting mostly because it seems to use projected 2d outlines of the objects to do the nesting.

@Brynn: wow, that would be totally awesome , I have my fingers crossed.
BTW - hope you get well fast. This part of the year can be demanding at times.

User avatar
brynn
Posts: 9962
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Automatic true shape nesting in Inkscape?

Postby brynn » Thu Nov 19, 2015 9:06 am

This might be close. I don't clearly understand what it does, but it sounds close. There's not very much info that I can find about it.
viewtopic.php?f=31&t=19207

Or maybe this one?? https://github.com/lifelike/countersheetsextension More info: https://boardgamegeek.com/thread/299033 ... evelopment

This one is for laying out clothing pattern pieces, like on fabric for cutting. Essentially it's what you describe, but I don't know anything about how it actually works. So might or might not help. However, I know seamstresses are crafters and such are always trying to save space and conserve materials. so maybe.... http://www.taumeta.org/?page_id=247

I have not tried any of these. But maybe one will help.

Oh, and there's always the Extension Repository, where I'll leave it up to you to search, since I'm not feeling well. http://wiki.inkscape.org/wiki/index.php ... Repository I don't think there are any like what you want. But I could be wrong. We do get this question from time to time here.....I've just never heard the nesting terminology. It seems like there's a solution, but I can't remember what it is. It could be "nesting" in the title may be misleading those who have the answer.

Well, in Inkscape Object menu > Align and Distribute and in the Rearrange section, the last button on the right might help (Unclump - equalize edge-to-edge distances). Maybe that's the best answer?? Or maybe something else in that dialog?

OH!! This might be it. (Sorry for being so scattered) Object menu > Arrange I'll bet that's what you're looking for. Instructions can probably be found in the manual, which is Help menu > Inkscape manual. I've never used this feature, but I'll bet that's your answer.

Now, I need a nap and some aspirin....

hulf2012
Posts: 716
Joined: Sat Nov 24, 2012 12:37 pm

Re: Automatic true shape nesting in Inkscape?

Postby hulf2012 » Thu Nov 19, 2015 3:43 pm

mmm...
Short answer: No still means no :roll:
In Inkscape there are arrange and align commands, but after trying them, my opinion is they aren't close to what you want to do, as I see in your provided videos (thanks for them).
I've watched very quick Brynn's suggestion but again, I'm not convinced... sorry. But You have the final word.

In your video I see how the Coreldraw extension even is capable to rotate the shape to minimize the blank space with other shapes. Inkscape can minimise blank space between the bounding box of the objects, but It doesn't go so far to calculate the actual areas intersection.

Without knowing an algorithm (open source could help) to arrange and minimize space between shapes (or for intersecting them), I see difficult even develop an extension for this task. However, I want to be wrong.

Have you tried online services, or for other vector formats? like eps, dxf or plain svg?

Greetings
If you have problems:
1.- Post a sample (or samples) of your file please.
2.- Please check here:
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/index.html
3.- If you manage to solve your problem, please post here your solution.

Przemas
Posts: 4
Joined: Thu Nov 19, 2015 1:40 am

Re: Automatic true shape nesting in Inkscape?

Postby Przemas » Fri Nov 20, 2015 1:03 am

Thank you Hulf and Brynn.

hulf2012 wrote:mmm...
Have you tried online services, or for other vector formats? like eps, dxf or plain svg?


the idea is to be able to do all on my linux pc as I do most of the work on it. Sadly it looks I'll have to arrange a simple windows workstation with corel - it seems the easiest solution. Unless I find something that works on Linux (atm I'm talking with one developer who is willing to try compiling for linux).

I'll take a closer look at Brynn's suggestions but after quick look it does not spark a lot of enthusiasm in me.

I don't think algorithms for such feature are something secret as I know they are widely used. Not only in vector drawing apps - for example most major 3d apps have uv packing tools that do similar trick - arrange 2d shapes as efficiently as possible.
Also there are lots of papers concerning the subject - for example those:
http://cimar.mae.ufl.edu/CIMAR/pages/th ... A_CISE.pdf
http://www.isr.umd.edu/Labs/CIM/project ... tmetal.pdf
http://www.sfu.ca/~gwa5/pdf/2007_02.pdf

There are also posts about those things on various forums, communities - stackexchange for example:

http://gamedev.stackexchange.com/questi ... -algorithm

And lastly even the GDG Nest can be purchased with a source code.

So all in all it does not seem to be "exotic" or extremely tricky feature. But surely I can have a skewed perspective - I'm not a programmer .

User avatar
brynn
Posts: 9962
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Automatic true shape nesting in Inkscape?

Postby brynn » Fri Nov 20, 2015 11:54 am

It doesn't seem tricky to me either. Apparently no one with the needed skills has been interested enough to write an extension. Either that, or I just haven't tripped over an existing one yet. It's probably worth making a feature request, if there's not one already: https://launchpad.net/inkscape If there is one already, you could add your support to it.

Przemas
Posts: 4
Joined: Thu Nov 19, 2015 1:40 am

Re: Automatic true shape nesting in Inkscape?

Postby Przemas » Mon Nov 23, 2015 4:08 am

ok, it may sound trivial, but where do you post feature request on launchpad - it's one of those tools I've never get around with...

User avatar
brynn
Posts: 9962
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Automatic true shape nesting in Inkscape?

Postby brynn » Mon Nov 23, 2015 4:20 am

You just make a regular bug report, but write "feature request" in the message.

Charliedj
Posts: 2
Joined: Fri Nov 27, 2015 10:49 pm

Re: Automatic true shape nesting in Inkscape?

Postby Charliedj » Fri Nov 27, 2015 10:51 pm

Thanks for information

cleversomeday
Posts: 58
Joined: Tue Jan 19, 2010 6:52 am

Re: Automatic true shape nesting in Inkscape?

Postby cleversomeday » Thu Sep 08, 2016 2:01 am

Just ran across this free online tool, and its open source as well http://svgnest.com

User avatar
druban
Posts: 1638
Joined: Fri Nov 20, 2009 10:48 pm

Re: Automatic true shape nesting in Inkscape?

Postby druban » Fri Sep 09, 2016 11:01 am

That's a great resource, thanks for pointing it out. I wonder if the creator might consider making it an extension for Inkscape....
Your mind is what you think it is.


Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests