Grasshopper

algorithmic modeling for Rhino

Here's the problem:

I have points that share duplicate X,Y values, but not Z values.  I would like to be able to select a field of points, determine if the points share X,Y coordinates, and if they do, combine their Z values and create a point with these X,Y,Z values.  Any thoughts on best practices?  I have a start at some test files if interested.

Views: 1176

Replies to This Discussion

I've attached the files that I was working with - the grasshopper script is just the start, but I am not sure how to proceed from here.

Attachments:

This is one way to do it:

It creates all the lines between points, then removes the ones with 0 length (from one point to itself) and then keeps the vertical ones (projects them on xy plane and checks the projected lines' length).

Attachments:

Thanks Nikos.  But, say I have three points which share the same X,Y coordinates?  How can I compare the X,Y values, break them into branches, combine the Z and then create a new point with that Z value?

You are right, you never said it was only for two points, I wrongly assumed it from the rhino file...

This is a little more complex but it works:

I am not sure what you mean by "combine their Z value". This calculates the average point, but you could also add the z values or whatever... Also this definition ignores points if they don't have a matching point. If you don't want that you can connect [average] to the previous [cull] component.

Last but not least, this def checks for equality between float numbers which is not a good practice. If it doesn't work as intended you should replace the [equality] component with something like: absolute difference > 0.01 or something....

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service