Good morning everyone !
Thank you very much for participating on this forum, it’s always a pleasure to share stuffs here !
Today I’m struggling with one more thing on grasshopper. I’m currently working on row houses for my studies, and I would like to be able to to create a script where I could decide how many houses i want next to each other, and being able to change their width according to the position of my point. For the moment, I managed to create a kind of visual domain where I can move a point and getting the distances between all my rectangles and this point, and using those informations to scale proportionnaly the rectangle according to their distance with the point. Unfortunately I’m stuck now.
I would love to be able to decide a precise potentiel size (like 200, 400 or 600 for exemple for the width of the houses) but for th emoment it looks like it’s totaly random and my rectangle are dancing haha. I think it’s pretty hard to explain so I’ll join you the file and a little drawing to explain what I would love to do.
I anyone has a tips how to get that it would be wonderful to validate my semester hahah !
Thank you very much for your help !
HOUSE_01.gh (24.1 KB)
let’s talk about the logics first. As I understand it:
- You have a given “domain” (piece of land to build on), set by height and width
- You want to fit in more or less houses on a row, with a given size: 400; 600; 900.
- Depending on your point of view, the bigger ones are closer to you, and the smaller ones further away.
- If it is a “fitting” question, then what should happen with space not used: Because your “domain” could be more wider/narrow? With 400, 600 and 900 you can build like with blocks: 400; 600; 400+ 400; 900; 400+600; => etcetera.
Smallest step is 100 (not always) or 200. So what to do with the rest?
Leave it open? Scale all a bit to make it fitting? Scale just 1 ?
- Do you have “rules” for how many of a kind you want? 1 of 900; 2 of 600 and others 400. Or bigger ones as much as possible, then smalller?
- You can move your point also in the “height” direction. Why is that? What functionality is in your mind. When higher => more bigger ones, when closer something else?
Depending on the answers, break it down in steps;
- My advice would be to work in one dimension at first : (width). you have a given line and have to divide it in chunks.
- Decide more precisely on what rules this division. The distance to the point? The distance to the closest point to your point on the line? or what else
-etcetera
Regards, Eef