Another Space Plan Generator/Space Layout question

I see there are several posts about the Space Plan Generator. I’m new to the forum, so apologies if I should only be adding to those threads instead of posting a new question. I am having trouble getting my departments to fill 100% of the given site outline. I’m using my building footprint as the site outline, so there doesn’t need to be any empty space. I can’t find an input that gives me the desired output. When I change the design seed on this node, it fills varying amounts of the site, but nothing that gets me to 100%. I have attached my graph and my sample excel file (will need to link into the file path in the beginning of the graph). You may also need to insert a file path for the SAT file that I am exporting from the dynamo rectangle (just create a test.sat file on the desktop).

FYI - I am using the “Space Layout” package for this, not the “SpacePlanning” Package.
SPG_TEST.dyn (39.2 KB)
bedTowerSKPU - LVL 2.xlsx (9.8 KB)
Since I am new to Dynamo, I’m having a hard time figuring out where in the code this value is coming from.
Any help is greatly appreciated!

Not much help here but this is not where I’d start my Dynamo journey.

@kristinaEB Not sure how this package works, but assuming areas of departments are multiples of the area of each cell, I suppose it might be difficult to achieve 100% coverage.

If your objective is just to obtain a graph, as mentioned at this post, see if the below definition helps instead
Besides, using the space layout to generate a graph might amount to overkill :slight_smile:

AreaGraph.dyn (4.6 KB)

sq01 = Math.Sqrt(Math.Sum(a));
sq02 = sq01 % Math.Floor(sq01);
sq03 = 1+sq02/Math.Floor(sq01);
sq04 = Rectangle.ByWidthLength(sq03,sq03);
sq05 = sq04.Translate(Vector.YAxis(),0..#Math.Floor(sq01)..sq03);
sq06 = sq05<1>.Translate(Vector.XAxis(),0..#Math.Floor(sq01)..sq03);
sq07 = List.TakeEveryNthItem(sq06,2,1);
sq08 = List.Reverse(List.TakeEveryNthItem(sq06,2,0)<1>);
sq09 = List.Clean(Flatten(List.Transpose({sq07,sq08})),false);
ct01 = Math.Pow(Math.Floor(sq01),2);
ct02 = Math.Round(a/(Math.Sum(a)/ct01));
ct03 = List.ReplaceItemAtIndex(ct02,-1,List.LastItem(ct02)+(ct01-Math.Sum(ct02)));
sq10 = PolySurface.ByJoinedSurfaces(List.Chop(sq09,ct03).Patch());
clr1 = List.Chop(Math.Floor(Math.RemapRange(Math.RandomList(List.Count(sq10)*3),10,255)),List.Count(sq10));
clr2 = Display.ByGeometryColor(sq10,Color.ByARGB(255,clr1[0],clr1[1],clr1[2]));
2 Likes

Hi Vikram,

Thank you for taking a look, and for putting this graph together! I agree, the space layout package was overkill for what I was originally planning to do, but my original plan was a result of knowing I wouldn’t be able to get much farther with my beginner skills. However, what I really wanted was exactly what the Space Layout Package is intended to do, so I was excited that someone pointed me in the right direction and I am somewhat determined (yet very limited in ability) to make it work. However, since I hit a roadblock with the “site coverage” and most likely won’t be able to figure it out myself, I’ve reverted back to the original, simple goal :slight_smile: .

What you have would be great for my original goal. However, when I plug my department numbers in, Dynamo crashes. I tried to recreate your graph with nodes (since that is what my beginner brain understands at this point), just to see if I could find where it hangs. Though it seems like I’m able to recreate your code with nodes (some I got stuck on, so just copied your code), it doesn’t produce the same result. The good news is that it doesn’t crash, but the bad news is it looks nothing like what you have shown. Any tips for getting my larger/actual area numbers plugged into this? Or, do you recognize off hand where I am missing the target?

Btw, the Space Layout package is almost identical to the Space Plan Generator, which I believe you are pretty familiar with. I noticed in other posts that you have tried to recreate SPG with DesignScript. Space Layout seems to be a continuation of the deprecated SPG package.

AreaGraph_TEST.dyn (39.9 KB)

1 Like

I agree, this is a bit complex, but I have successfully built a few other graphs with parametric department areas and building masses, and am learning A TON by starting out big. It’s been more exciting than frustrating, and with the help of others on this forum, I feel like I’m getting close to my goal. I’m so close, I don’t want to quit now :slight_smile:

Would help if you make the numbers smaller. Instead of 1000000 use 1000 (divide all values by 1000)
Shouldn’t make a difference, istead of sqmm, the values would be in sqm
Makes a difference as it would result in creation of fewer unit rectangles to generate similar results.

Won’t work even if you miss one node or connection, you missed a few :slight_smile:
See if this helps …
AreaGraph_20180223.dyn (40.4 KB)

Currently my focus is on retail space design with Design Script.
Not a cell based approach like the SPG, though.

1 Like

Vikram,

Any idea why I keep getting this error:

There have been a few changes in the language syntax since that post.
Below is an updated version


areaGraph.dyn (11.6 KB)

sq01 = Math.Sqrt(Math.Sum(a));
sq02 = sq01 % Math.Floor(sq01);
sq03 = 1+sq02/Math.Floor(sq01);
sq04 = Rectangle.ByWidthLength(sq03,sq03);
sq05 = sq04.Translate(Vector.YAxis(),0..#Math.Floor(sq01)..sq03);
sq06 = sq05<1>.Translate(Vector.XAxis(),0..#Math.Floor(sq01)..sq03);
sq07 = List.TakeEveryNthItem(sq06,2,1);
sq08 = List.Reverse(List.TakeEveryNthItem(sq06,2,0)<1>);
sq09 = List.Clean(Flatten(List.Transpose([sq07,sq08])),false);
ct01 = Math.Pow(Math.Floor(sq01),2);
ct02 = Math.Round(a/(Math.Sum(a)/ct01));
ct03 = List.ReplaceItemAtIndex(ct02,-1,List.LastItem(ct02)+(ct01-Math.Sum(ct02)));
sq10 = PolySurface.ByJoinedSurfaces(List.Chop(sq09,ct03).Patch());
clr1 = List.Chop(Math.Floor(Math.RemapRange(Math.RandomList(List.Count(sq10)*3),10,255)),List.Count(sq10));
clr2 = GeometryColor.ByGeometryColor(sq10,Color.ByARGB(255,clr1[0],clr1[1],clr1[2]));