Algorithm to compute a 3D voronoi diagram for a cube - voronoi

I want to compute a 3D voronoi diagram for a cube. Which algorithms can I use to compute it?

Related

Find the polygon area on a sphere bounded by points

I am trying to find the area of a polygon on a sphere. I have the azimuth and elevation angles (lat/lon). Is there an algorithm that will do this. If it were on a flat plane, I could approximate using a convex hull, but these points are occupying a significant portion of the sphere.

How to create a non-intersecting polygon in 3D containing n given points on a sphere?

I have the coordinates of n points on a sphere and I know they are all coplanar. How can I find the edges of the polygon which has the vertex the n given points?
OK, your problem is weird ordering.
Project all points onto any convenient plane - the simplest approach is using OXY, OXZ or OYZ plane (choose one that is not perpendicular to your plane) - in this case you just use (P[i].X. P[i].Y, 0) for P[i] point and sort projected 2D points by angle against the first point - it works because points on sphere arc form convex polygon. Then use this ordering as polygon vertex indexes.

Finding the centroid of a polygon with weighted vertices

Based on Finding the centroid of a polygon? (P. Bourke), I would like to compute a weighted centroid (i.e. each vertex has an associated weight). There is a formula given in Find the centroid of a polygon with weighted vertices but I think it is not valid (if weights are all the same, you don't get the centroid (see https://math.stackexchange.com/questions/3177/why-doesnt-a-simple-mean-give-the-position-of-a-centroid-in-a-polygon).
You cannot compare centroid for polygon with masses in vertices only (imagine iron balls connected with cocktail tubes) and centroid for polygon with mass distributed over the area (imagine polygon carved from steel sheet).
In the first case use formula from Find the centroid of a polygon with weighted vertices, in the second- the last link given

Mapping a Coplanar Set of 3D points to Their Planar 2D Coordinates

I have a set of 3D points of a mesh and normals at each point. Points lie on the same plane which are obtained from cutting a 3d model along an arbitrary plane.
The problem is - I need to map these 3D points to their planar 2d coordinates (u,v), that can be used to form Delaunay triangulation of the mesh. So I need a transformation matrix that transforms these 3d coplanar points to their planar 2D coordinates.
The simple solution would be to define a plane perpendicular at all points to your normal vectors. In that case, you simply let the Z component of each vector to the point on your surface equal 0 giving you a two-dimensional representation of your surface on the defined plane. Your transformation (or properly rotation) matrix is then defined with respect to the plane.
The details of the approach are given at plane (Geometry) and the nuts and bolts of how to do it are shown at Defining a plane in R3 with a point and normal vector.

Subdividing a general polygon in a number of small convex polygons

I have a polygon P made of N vertices. I need an algorithm that, given P, subdivide it in a certain number of convex polygons each using at most M vertices.
Ps.
P is a 2D polygon. Furthermore, i can use a polygon triangulation, but i am interested in algorithms that subdivide P into convex polygons having more than 3 vertices (and, as said above, at most M).
Quadtree methods would be my recommendation. Check those out.

Resources