Grasshopper

algorithmic modeling for Rhino

Extrude Building Outlines to z Point Heights from GIS

I've put together a simple GH file that extrudes planar building outlines up to the z height defined by the closest elevation point to each outline's centroid out of a field of elevation points. These points started as text objects from GIS data. I converted the text objects to 3d pts using the rhinoscript that Simon Kallioinen posted in another thread. (That script is here http://www.rhinoscript.org/rhinoscript/44) Thanks Simon!

My problem is that the closest point sorting is often wrong for tall buildings, because for a tall building, the next door neighbor's roof height may be closer in a direct line to the tower's centroid than the tower's actual roof height. So the component chooses the neighbor's roof point height instead of the the one I want it to choose.

Can anyone suggest a way to sort the points closest to my buildings' centroids but ignore the z values of those points during that sorting?

Sorry if this is so wordy, or has been solved before, I've been looking for a similar discussion on extruding building outlines from GIS data but haven't found one.

info attached.

Thanks!

Views: 3282

Attachments:

Replies to This Discussion

You need to find the closest points ignoring the z coordinate. CPs returns not only the closest point but also its index in the list. You can now use this index to select the point from the original list of points with non-zero z.

Attachments:

Thanks Hannes

Opening your gh file gave me a pop up event log message "Object reference not set to an instance of an object", and then fails to open. I'm using 0.9.0006.  Is there something I need to do to open this?

Meanwhile, I'll try to replicate using your description above.  Thanks very much for the response.

Mike

I haven't opened the files because I'm not in my working computer, so I'll try and explain it.

From what I have read, can't you just project the point which has the z-value (height of the building) and the points that have the centroid of the building onto the same plane, then used the Find Closest Points (this component, not the other one), use as the cloud points the centroids projected, and as the point the elevation projected, and then use the index number of the closest point as a place-holder to use in the extrude component.

Sorry that I can't post a definition right now. Maybe what I wrote is what Hannes did...

Thanks, that's a pretty clear explanation. I think I'm missing something obvious about sorting lists.  I've gotten as far as getting the non-z pts on the same xy plane as the centroids, and found the closest pairings using the component you suggest above.  Where I'm confused now is how I use the index number out of this component to sort the original z points for the extrude component.  Screenshot attached.

Attachments:

I think you have to set the N to 2 and then cull the first value. 

Also shouldn't the graphed lists go in "P" and the non graphed list go on "C"?

This is as close as I can get without opening your gh file.  I may be on the wrong track.  I use the PlaneCP(CP) component to find the closest pairings ignoring the z value of the original points.  Now I have the correct pairings of centroids to zero z value height points.  Now I can't figure out how to relate this index of zero-z pts back to the original list of non-zero z pts.   argh.  What you're saying sounds so clear.

 

Attachments:

I got a version to work, thank you both for the input.  I find it hard still to visualize and work with lists.  Jesus, for some reason I can only make it work with the 'other' CP component (the one without the 'n' value.  But anyway this works.  I've added two lines to help visualize the pairings (first non-z and then actual-z).

I hope this can help somebody else who is trying to mass extrude buildings on a GIS derived site plan.  Also would be really curious if there's a cleaner way to do it.

Thanks again,

Mike

Attachments:

This is pretty much what I did. My version just sets the z coordinates to 0 by exploding the points and rebuilding them without the z. This might produce slightly less overhead than projecting the points to a surface.

I'm using 0.9.0014 so this might explain the file problem. Here's a screenshot.

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