Grasshopper

algorithmic modeling for Rhino

How do I extract the point (rectangle in red) so I can use this point to add more to the script?

Views: 7383

Attachments:

Replies to This Discussion

The quickest way to do this would be to use the "member index component", using the vertices output from the DeMesh component as the set and the defined point as the member to search for. You can then retrieve that item from the list of vertices using the List Item component. If you see any other point in the list, you can simply use the list item component and its corresponding index to retrieve it (in this case, the index of the desired point is 36). The benefit of retrieving it through the member index component is that no matter where the point is in the list, you will be able to retrieve it. The thing you want to look out for is having duplicate points (which you don't currently have) which may cause this to work improperly.

Attachments:

Hi Christen: thanks for your detailed explanation

I was simply confirming in my script that the co-ordinates of point X are indeed 0.0, 0.0, 10.0, I want to extract that value for the point 0.0, 0.0, 10.0 from the list. NOT input it.

Basically I think any geometry used in GH by default is inserted at 0,0.0....its Centroid. I'm looking for the apex vertex point, from the list.

Are you trying to remove the point and replace it with another one?

Here's a version which finds the highest of all of the points. Again, I'm not sure if this is what you mean, but it might be. I took the z value of all of the points, sorted them by increasing value. It then matches the highest z value to its corresponding point and then takes that point from the list (list item). You can use other components to remove or change that point through using "Cull Index", "Replace Items" or "Insert Items".

with a little more help from you, and more List learning on my part :)

I think I'm certain: the Apex co-ordinate of any Polyhedron, can be found: 

Looks like you've got it. Again, if you would like to know the location of the apex within a list of vertices, you can use the Member Index component, but I'm not sure if it would be useful.

I was not able to get any benefit from the Member Index component. :(
However your Z value of the "deconstruct point comp." was the key to, list sorting followed by, first/last list sorting. ... thanks again!

For example, lets say you want to hang any Polyhedron Bauble. You first need to construct the following GH code, which would typically be at the Apex of Polyhedron Bauble.

With "vanilla" GH you could put an index of -1 to get the last point of a list.

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