# Calculate high and low points on surfaces

I have two surfaces/landscapes that are lying in the same space, and I want to calculate which points that are above and which are below in a grid. In other words: which point of the grid is above and which is below. Is there a definition for that or maybe an example?

As you can see on the image there’s a grid on both surfaces, and I can easily make a contour line of the grids if it’s easier for the definition to work with curves.

1 Like

interesting problem!
I am not sure if when you say grid you mean a grid on the surface or on the xy plane. This is the first case but it should be easy to modify to the second.

over.gh (14.9 KB)

That’s amazing! That’s what I meant; points in a grid on the surfaces. The end goal is to calculate the volume that is subtracted (from the green on your image to the top surface) and the volume that is added (the yellow to the bottom layer). The way I figured that I could do it is by.

1: drawing lines between the two surfaces grids (listing the lengths of the added/subtracted would be handy).
2: making a rectangular pipe on the line (that I know how to do).
3: calculate the separate volumes.

It’s basically how much soil is added and how much is subtracted from two specific landscape surfaces.

There might be a better way, but that’s what I came up with…

Hi Fengal,

If you turn both surfaces into solid objects by projecting their edges down to a common horizontal plane anywhere below the lowest point on either surface, you can, provided the bottom faces are identical sizes, simply subtract the Rhino volume of one from the volume of the other to get the difference.

Sorry, but I am not at my Rhino computer so I can’t illustrate this.

Regards
Jeremy

I think that this is a totally different animal.
You just create volumes with boundaries the two surfaces and the boundary of the property (in this case I used a bbox but you can extrude the site boundary)
and add/ subtract them by checking if they’re over or under the old landscape.

volume.gh (16.7 KB)

EDIT:
Sorry!!! I mixed the area with the volume components in my hurry!!!
here is the correct way:
volume.gh (19.0 KB)

Wow, thank you, this is really helpful.

My classmate who works with the same project figured out another way to do it, however, we can’t figure out how to differentiate between subtracted and added volumes. Do you perhaps see a solution?AddSub.gh (56.1 KB)

Not unless you internalize your geometry! (right click on surface components —>internalize)
also: ctrl-shift-q takes an image of your canvas so you can share it easily

Ah, sorry. This should be itAddSub2.gh (51.2 KB)
:

Ok, somehow managed to do something similar but with the surfaces instead of solids. Will try solids. Thanks.

Ah, sorry. This should be itAddSub2.gh (51.2 KB)

Another trick is that Plane Closest Point will give you distance in positive if it is above or negative if it is below. Additionally, Pufferfish has a Point Surface Side component if you want to check that out also.

Point Surface Side.gh (12.0 KB)

That’s handy. Thanks. I will try to figure out how to use it to calculate the two volumes.

How did you edit the colors of your Grasshopper UI?

Now you’re asking the real questions!

1 Like

Yes or just simply change any of these fields in script editor component.
https://developer.rhino3d.com/wip/api/grasshopper/html/T_Grasshopper_GUI_Canvas_GH_Skin.htm

Or go to File>Special Folders > Settings Folder and open the file grasshopper_gui.xml in note pad, edit any of the color values and save.

1. Be brave.
2. Press ctrl-alt-defeat.
3. Open attached (talk and walk and this (and that)).

Tarrain_PriorAfter_Compare_V1.3dm (290.3 KB)
Tarrain_PriorAfter_Compare_V1.gh (127.6 KB)

It looks advanced but I can’t figure out how to use it.

Other than using code (rather ordinary these days) … it’s not advanced at all: one should operate with meshes instead of nurbs for some sort of acceptable response [“interactive” so to speak].

As it is:

1. If one of the input Breps is null … C# aborts.
2. You should use a suitable pair: terrain prior (OEM) and terrain after that have exactly the same projected inner and outer loops … meaning that the bool diff on these projected Breps (BrepFaces to be exact) is null. That’s the primitive test for “equality” used here. BTW: If the result is not null … C# stops playing ball (see info panel).
3. You should use valid Breps (with one BrepFace) that have no 2 (or more) points that share the same x.y coordinates. This means terrains with no negative slope.

Anyway - just for the record - post some test pairs of yours here. Avoid at any cost internalizing Breps (use a Rhino file).