// Only one Item!!
if (exp.Items.size() == 1 && exp.Items.get(0).isNumber) {
// Item
GExpressionItem item = exp.Items.get(0); // Bsp: "100m:70m:Lots:30%"
// Random value 0 or 1 (width or depth)
java.util.Random rnd = new java.util.Random ();
int whichDirection = rnd.nextInt(2); // 0 to 1
if (tmpWhichDirection != -1)
whichDirection = tmpWhichDirection;
int mirror = rnd.nextInt(2); // 0 to 1
// Which direction?
float factorX = 1;
float factorY = 1;
if (whichDirection == 0) // width
factorX = Math.abs(mirror - (item.Parts.get(3).Number / 100)); // bsp 30% direction X
else // depth
factorY = Math.abs(mirror - (item.Parts.get(3).Number / 100)); // bsp 30% direction Y
// Create 2 new rects (only geometry first)
float x = (oRect.p2.x - oRect.p1.x) * factorX + oRect.p1.x;
float y = (oRect.p2.y - oRect.p1.y) * factorY + oRect.p1.y;
float x2 = (oRect.p2.x - oRect.p1.x) * factorX + oRect.p1.x;
float y2 = (oRect.p2.y - oRect.p1.y) * factorY + oRect.p1.y;
if (whichDirection == 1) x2 = oRect.p1.x; else y2 = oRect.p1.y;
rect rec1 = new rect (oRect.p1.x, oRect.p1.y, x, y, oRect.z);
rect rec2 = new rect (x2, y2, oRect.p2.x, oRect.p2.y, oRect.z);
// Create object and call this class recursive
// - if min with and min height not to small
// - no recursive function in else case if tmpWhichDirection != -1
if ( item.getNumber(0, 0) < rec1.width && item.Parts.get(1).getNumber(0, 0) < rec1.depth &&
item.getNumber(0, 0) < rec2.width && item.Parts.get(1).getNumber(0, 0) < rec2.depth ) {
PRect obj1 = new PRect (core, item.getString(), rec1, src); // Create Rect 1
(new DivideArea ()).PerformRule(core, obj1, exp, -1);
PRect obj2 = new PRect (core, item.getString(), rec2, src); // Create Rect 2
(new DivideArea ()).PerformRule(core, obj2, exp, -1);
src.Delete();
} else {