Grasshopper

algorithmic modeling for Rhino

Hey guyz,

do you know how to write a code for extracting the centroid of brep/surface?


due not having this piece of script, I'm forced to use the AREA component, that generates also the "center". But the cost of this process is enormous - the calculation time of both area and "center" in AREA component takes up 99% of all script time consumption.


I'm begging for a help.. not knowing is killing me!

xSVENx

Views: 942

Replies to This Discussion

to calculate the exact centroid involves an integration over the whole surface or volume. This will give you the Area/Volume purely as a by-product.

You can find an approximation by averaging the corner vertices or edge curves. This is how the PolygonCenter works. Imagine two NURBS surfaces with the same trim curve. You can see that this approach will not actually give you the centroid. Away from the edges, the surfaces might deviate from each other in any way you like.

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