Nodebundle for playing with nodes

 From:  James (JFH)
7777.1441 In reply to 7777.1439 
Hi Brian,

>> centroid also applies to a closed planar polygon with a circular hole in it <<.

I think, for the sake of simplicity, we need only concern ourselves with planar, closed polygons.
We can disregard for now compound surfaces and even ellipses for that matter.

>> A faceted surface, (possibly 3D), would be broken down into Faces, inside or outside of the node, and each face tested to see if a centroid applies. <<.

Again for simplicity, we need only concern ourselves with faces i.e. "broken down ....outside of the node"

In this way node need only be limited to Michael's second case steps
http://moi3d.com/forum/index.php?webtag=MOI&msg=7777.1433

>> You'd do something like look at .isClosed and .isPlanar and if both of those are true get the curve segments by crv.getSubObjects() then go through all segments testing .isLine on each one, <<

So we now know that all faces are indeed polygons, then

>> if all are lines go through them and add together all the segment start point coordinates and divide by the number of points to get the centroid. <<

>>I do not think that a node multiprocess sub function is required, (?), just sequential processing of the input objects, with For loops.<<.

If a for loop satisfies the requirement of determining the centroid of multiple faces, all the better.

Thanks for looking at this
Have a great weekend
James