Grasshopper

algorithmic modeling for Rhino

I'm doing some basic hull form analysis which requires finding the centroid of buoyant volumes. I am cutting slices out of the model which at times creates 2 separate volumes because of the irregular shape of a hull, but still need the centroid of the two volumes combined.

 

Rhino natively works with multiple volumes, finding their combined weighted centroids (same with area centroids). Analyze -> Mass properties -> Volume Centroid

 

I found this discussion with a VB script that seems dated. I don't understand VB, so can't trouble shoot much (tried a couple things to no avail). 

 

I could probably put together something that solves it, but it would be very nice if it was part of grasshopper. :D 

Views: 2660

Replies to This Discussion

I was the original person who asked that question.  I just tested it and it still works.  Make sure to use the "Legacy" dotNet VB script component and copy/paste that code directly into where it says "your code goes here".

You could do it by converting each "slice" into a mesh, joining the resulting mesh, and using "Mesh Volume" to get the centroid. 

 

You can also do it by grafting each slice and then taking a weighted average of the volumes in each branch. Multiply the individual centroids by their volumes; calculate the sum of this product and divide it by the sum of the volumes. 

 

Hi Will,

 

centroids for multiple volumes are also possible in the Rhino SDK, I just never implemented them as Components. I'll add them.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Did this get implemented somehow in 8.0050, and I'm just missing it?

Nope, I found they are still missing from the new SDK and then I somehow forgot about them.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Will you be able to include them on the next release?

I started, but we're having some trouble making all of it work right. Hopefully it will be fixed in a few days.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Is this still on the agenda?

Awesome guys. I'll be using the VB script for now, and eagerly awaiting the new component. I have a half dozen routines that will benefit from it.

 

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service