Look Marc', there were many attempts for this problem for solution to be found, but all up to now, they were just attempts... I believe that you can get your example solved with my previously posted code and picked smaller rectangle... But that's all... When there are more rectangles that vary in sizes, the task complicate enourmously... I was able to write 2 more algorithms that were similar, but not for nesting - they are for packing in 2d and 3d... I can only say that when you code for this, you must not apply both 2d entities along with 3d ones - they have their geometry specific properties and although you can have 3d algorithm - it does not mean it can be applicable for all... There were some attempts in history called "guilotine cutting" - meaning that when you cut, you can make knife go only straight until piece is choped... Also there were some called non-guilotine where you can position pieces differently than straight, but this thing also complicates tasks... There is online solution finder for big outiline where you can put integer up to 1000 units in both directions and search for all equal smaller pieces where largest piece size is smaller integer than smaller size of outline... Algorithm is probably the best you can use, but the code is hidden from public... For testing here is the link :
http://lagrange.ime.usp.br/~lobato/packing/run/index.phpYou may also want to read about nesting problems more - there are some articles on www, but I didn't find an ALISP example(s)... So, if you have a time and you are interested in this problem, you can dedicate your time and code for solutions... But be informed that task although may look simple and easy, actually involves deeper understanding of basic geometry and high math skills... So good luck (what can I say different...)...