Grasshopper

algorithmic modeling for Rhino

How to stop growing extruded blocks when they intersect a rectangle (as street)

Hej all,

I am a very beginner in C# and trying for hours now to solve this problem:

I have a growing block of extruded rectangles in C# that stop growing when they intersect and now I want to put a street and define that the blocks as well stop growing when they intersect the street.

I draw a rectangle in Rhino and plugged it into c# as Curve and I am trying since hours to figure out how to change the if/then intersection code in C#.

I am glad for any suggestions.

I attached the script below. 

Views: 764

Attachments:

Replies to This Discussion

And here the gh. file

I would be really happy for any help or ideas.

Attachments:

Hi 

If i may ask why you didn't define your streets first, then generate your blocks by taking those empty spaces surrounded by your streets? 

Well  ... Helena,

Added some lines of code in a 2nd C# (the first was made long time ago) and here we are :

Cities for numbers (forget people: outdated concept) that is.

Disable the 2nd C# in order to get the gist of the fractal rectangle creation logic (and what the options mean).

BTW: makeRoads (i.e. split a BrepFace N times) is traditionally VERY slow. Have the triple espresso ready.

best

Attachments:

Hmm .. some fractal output was pointing to Planet Utopia: use this instead.

PS: If you want to dig in deep into madness > the ultimate case: urban planning for planet Zorg (far more complex since these Zorgians are ... hmm ... tough animals).

Attachments:

AMAZING! That's exactly what I wanted to do, thanks Peter!

I will try again and dive in how you did it.

Notify if you decide to deal with the ultimate challenge:

Urban stuff for Planets Zorg, Utopia, Pink ... just name a planet (any planet).

Here's a recent pic of mine doing business at Zorg (they pay good tax-free money, mind but they can't tolerate mistakes [blame some divisions by zero in the first C#]) :

BTW: Here's the ultimate challenge for you (and a "good" opportunity to "learn" C# - but should girls care about these freaky coding things? > abandon ship > before it's too late, he he).

1. This is a real-life urban design thingy for planets LimeGreenAntN66 (flat like Earth) and N667 (spherical like a pizza). Towers twist according the contemporary (nonsense) trend. Towers are all the same (ants they don't care so why bother?).

2. Gradually replace ALL the spaghetti with C# code (the Facet component is the most challenging, he he). 

3. Make some roads and (optionally) parks - although ants they don't care about things like these.

May the Force (the Lime Green option) be with you

best, Lord of Darkness

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service