Grasshopper

algorithmic modeling for Rhino

Randomly pick points with 3 variables and few constraints

Hi guys,

I am trying to add some balconies with random location, random length and random depth in a rectangle floor plate. (see sketch attached)

From now, I can finish the random location and random depth but not the random length.

I guess my script is not perfect/good for this case. Any suggestion?

Thank you very much

Views: 585

Attachments:

Replies to This Discussion

why don't you try the other way? produce random lengths that fit each side of the rectangle plus some (random) distance you want each balcony to have (from each other or the end of the sides). then aply these lenghts to random locations. 

Of cource there are other ways "more random" that include loops.

Sorry dimitris, i dont quiet understand what you mean by random lengths that fit each side of the rectangle? 

Also whats the others way of including loops option?

Thank you very much 

First of all check the reply below, by  Vongsawat Wongkijjalerd. He has a great solution.

By "the random lengths that fit each side" I mean instead of trying to solve your problem for the whole rectangle it would be easier to solve it for each side. But in this way you won't have the wrappings around the corners.

With the loops you could find a way to generate a random location and then check if there fits a random balcony with a random lenght. BUT this is much much more trickier. You could achieve it using hoopsnake, or writing some code.

e:woops, forgot to hit reply.

You need to define how you want to deal with corners, as that can change how you tackle this problem..

But here's a quick solution I put together that wraps around corners,
has a minimum gap between balconies,
and puts all the leftover space in to the space between balconies.

mind, this solution is pretty number heavy (converting to geometry right at the end) so its a bit of a pain to read.. but hopefully gives you some alternate ways to think about solutions.

but like I said, the solution changes a lot depending on how you want to deal with fringe problems (do balconies Not wrap around corners? How to fit balconies in to spaces and still retain randomness, if you even want that. etc.) Need more effort to define the problem space. (for instance, if balconies don't wrap, I'd probably think about this problem in a completely different way)

hope it helps anyways

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service