I want to triangulate the surface of intersection of a sphere with edges of a cube(image below). When number of intersection points > 3, the points are non-coplanar and the triangulations are non-unique. As of now I am planning to calculate the centroid of the intersection points and triangulate them with the centroid as the common vertex. (I am open to other triangulation choices).For this the pre-requisite is that the points are arranged in C.C.W. order.
I tried fitting a plane to the non-coplanar points, project the 3D points onto the plane and sort the points on the plane. This process is slow because a least square plane has to be fit to the points. Also when some intercepts are close to each-other, the plane normal is biased and I end up getting wrong order sometimes. There are also situations where an edge has more than one intercept, where this triangulation fails to work
Is there a simple and fool proof way to do this.
thanks
