thanks! I got the VB script to work. Would still be nice if the default behavior of Rhino regarding volume were built in as a switch or as an extra output of the Volume tool (Combined Centroid or something)
Eric On Jan 24, 1:02 pm, visose <[email protected]> wrote: > You could also do it without scripting using the "mass addition" > component. But you've got to separate the points into their individual > x,y,z values for the mass addition. You could reduce the number of > components when multiplying the individual centroids with its > respective volume by treating the point as a vector. > > On Jan 24, 7:47 pm, visose <[email protected]> wrote: > > > You could use a scripting component. Create a vb.net scripting > > component and rename x and y inputs to v and c (volume and centroid). > > Set both as list, v as a double and c as a 3dpoint. Use the following > > code: > > > Dim point As on3dpoint = New on3dpoint > > Dim totvol As Double > > For i As Integer = 0 To v.count - 1 > > point = point + c(i) * v(i) > > totvol = totvol + v(i) > > Next > > a = point / totvol > > > Then connect the v and c outputs of the volume component to the v and > > c inputs you just created. > > > On Jan 24, 6:54 pm, postal256 <[email protected]> wrote: > > > > In Rhino, if you select multiple objects and do volume centroid, it > > > puts a point at the center of gravity of the all the objects > > > combined. In grasshopper, the Volume function puts a centroid for > > > each individual object. > > > > any way to have it show the combined centroid for multiple objects?
