Aug 15, 2015 at 4:04 PM
Edited Aug 15, 2015 at 8:51 PM

So I'm not sure that will work because I need the voronoi diagram to extend all the way and fill my boundary. The use case for this is I am generating voronoi diagrams within voronoi cells, but I don't want the cell vertices to be necessarily included
in the voronoi diagram. Further the cells will be slightly modified so they will be concave, which led me to the following workflow:
1) Generate the point cloud inside my border polygon
2) Generate the delaunay triangulation on the point cloud only
3) cull the resulting mesh, removing all segments and corresponding triangles that intersect with my boundary edges (O(n^2)) I know I won't have to remove any vertices, but edges may have to be removed because of concavity.
4) pass the new mesh to a standard voronoi
5) cull the voronoi to the boundary edges, closing faces as necessary
I am currently working on step 3 and it requires a bit of manipulation to the mesh class, would love guidance on how to remove an edge and corresponding triangles from the mesh. I don't need the whole mesh to necessarily be triangulated after each step either,
as I believe it is guaranteed to be triangulated after the end of step 3. As long as it is in a "stable" state by step 4 I should be okay.
Perhaps there is more merit in the idea that I generate the voronoi diagraam, take out the boundary faces, and then extend the remaining faces to fill out the polygon, but I am not really sure how I would go about doing that.
Update:
So I got step 3 to work by using the ToMesh in the converter class, removing triangles without having to much with the mesh source code.. However I am no longer certain this is the path to proceed. I am willing to generate a bounded voronoi diagram which includes
the specified edge points, I just don't want any additional boundary points. I found this disscussion:
https://triangle.codeplex.com/discussions/550397 but when I specify conforming delauanay = true and Segment Splitting = 1, my bounded voronoi is not actually bounded to the boundary..
Picture: (EDIT: Not sure why it didn't link correctly)
SplittingSegments = 1
SplittingSegments = 0
Code:
var poly = new Polygon();
// add the bounds
poly.AddContour(bounds.Select(x => new Vertex(x.x, x.y)), 2, false, true);
// add point cloud
foreach (var p in points) { poly.Add(p); }
// Triangulate the mesh
var constraints = new ConstraintOptions() { ConformingDelaunay = true, SegmentSplitting = 1};
mesh = (TriangleNet.Mesh)poly.Triangulate(constraints, new QualityOptions(), new SweepLine());
voronoi = new TriangleNet.Voronoi.BoundedVoronoi(mesh);
VoronoiVertices = voronoi.Vertices.Select(x => new Vector2f(x.X, x.Y)).ToList();
VoronoiEdges = voronoi.Edges.Select(x => new LineSegment(VoronoiVertices[x.P0], VoronoiVertices[x.P1])).ToList();
