thank for your interest!
Actually the centroid function is provided in the "geom2d" library, available on the Fex as well. I try to minimise dependencies between both submissions, but apparently some are still remaining...
You can also replace the centroid call in the demo script by the following:
faceCenter = mean(vertices(faceVertices, :), 1);
This should work as well.
13 Oct 2013
Library to handle 3D geometric primitives: create, intersect, display, and make basic computations
Thank you for your code!
I have a small problem.
I am not able to compile the DrawSoccerBall.m demo function.
there's a parameter missing when calling centroid function since the definition of centroid function is function centroid = polyhedronCentroid(vertices, faces)
Error message when I compile:
Undefined function 'centroid' for input arguments of type 'double'.
Error in drawSoccerBall (line 56)
faceCenter = centroid(vertices(faceVertices, :));