Grasshopper

algorithmic modeling for Rhino

Hi everyone!

I have the following surface, it's something like grass meadows on a park:

What i want to do, is that when the surface approaches the streets and existing buildings, it's height becomes 0.

I tried doing it using curve cp, and projecting the points closer to the curves to de base plane, and I get this:

how can I change the definition so i get a smoother transition? What i mean is, i want points directly on top of the attractor curves to move to the ground, but points farther away from it should move less and less.

Thanks a lot!

Views: 3922

Attachments:

Replies to This Discussion

Hello Alejandro,

You can create a similar sequence with the one you did for the waves and multiply the 2 values together before moving the points on Z:

Changing the bezier curve in the graph mapper, controls the transition from flat to wavy.

Cheers,

Nikos

Attachments:

That's perfect nikos, thank you!

I had the idea of using another graph maper, but I was trying to put it directly after the other.

I used 'Crv CP' to find the distance from each point to the nearest edge, with a threshold slider to attenuate the Z movement near the edges - and ignored a lot of your code...

Attachments:

This is kinda cool.  I belatedly noticed your requirement to flatten the terrain around buildings:

when the surface approaches the streets and existing buildings, it's height becomes 0.

So I created a couple of rectangles around your buildings and trimmed the surface with them, internalized as "perimeter", then used its edges instead of the full untrimmed surface for my attenuation code.  And 'Point in Curve (InCurve)' to set all the grid points outside that perimeter to zero.

This is perfect!?  Well, maybe not quite...  The perimeter around the buildings could be made tighter (smaller).

Attachments:

Hi Joseph, thanks for your input!

Actually, if you look at nikos example, you are missing the two inner streets :)

I tried changing your "perimeter" with the 3 surfaces instead of just one, but for some reason only the middle one works:

Also, if you don't mind, can you explain the code a little? why do you do the Sort-Item-Shift part?

thank you very much!

Attachments:

Oh.  I looked at nikos' code but don't quite understand it - I don't see any reference in it to the two inner streets?

The Sort-Item returns the smallest distance between each point and all of the edges; the 'PShift (Shift Paths)' re-aligns the data stream after the graft 'P' on 'Crv CP'.  You have to look at the data/lists every step of the way.

You didn't internalize '3 perimeters' but the problem is likely due to using three instead of one.

I'm busy for awhile but will get back to this when I can.

P.S.  If you connect your '3 perimeters' with narrow "bridges" so they become a single surface, it might work fine?

P.P.S.  Ah, I see now that nikos also used '3 perimeters' as input to his second 'Pull' component.

This is hasty - the drop off at the two inner streets is steeper than the outer edges; will look into fixing that later.  Had to use 'InCurves' (plural) instead of 'InCurve' (singular).

Ack!  Forget it, I lost the flat areas around the buildings - too distracted now, will get to it later.

Attachments:

How about this?  I created notches for the buildings in two of the three perimeters (internalized).

Attachments:

Hello guys,

Joseph I just wanted to notice that the series of components you have in your definition ([Edges]-[Crv CP]-[Sort]-[Item]-[PShift]) does the same thing as the [Pull Point] component (set to "closest only").

 

Also, [Pull Point] accepts any kind of geometry, not just curves. So for the buildings you can just throw the breps in there (slow) or their outlines (faster):

Cheers,

Nikos

Wow, thanks.  I was planning to study your code more closely anyway, this explanation helps a lot.

Yes, that works great!

I'll now abuse your good intentions and keep on asking:

This method works because the surface is being generated with a graph mapper, so you just modify it's output.

How can you get this same effect with any kind of surface?

For instance, I have this one generated with a revolve on Rhino:

How can I get the same effect (on the ground near streets and buildings and a smooth transition as you go away)?

This is the moethod I'm using now, but there has to be a better way:

Attachments:

There are usually multiple ways to get the same result.

The most obvious "problem" with your solution is that the rippled disk is not trimmed by the perimeter boundaries.  But you don't need to start with that disk either, you could use the ripple curve to calculate a height for each point in the surrounding rectangular grid we used earlier.

Also, from your earlier code, I still don't know what's going on with those spheroid shapes you pulled points to?  I haven't had a chance yet to really study that part of the code or Nikos' solution but I don't see anything in there that looks like GH "attractors"?

Not that I really know anything about GH attractor components either...  But I've been playing with ripple patterns for nearly forty years(!), going back to the days of using ASCII characters as output (primitive, I know) - so I do understand how to combine multiple inputs to affect amplitude:

To be continued...

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service