public static VoronoiGraph FilterVg(VoronoiGraph vg, double minLeftRightDist) { var vgErg = new VoronoiGraph(); foreach (var ve in vg.Edges.Where(ve => Math.Sqrt(Vector.Dist(ve.LeftData, ve.RightData)) >= minLeftRightDist)) { vgErg.Edges.Add(ve); } foreach (var ve in vgErg.Edges) { vgErg.Vertizes.Add(ve.VVertexA); vgErg.Vertizes.Add(ve.VVertexB); } return(vgErg); }
public static VoronoiGraph FilterVG(VoronoiGraph VG, double minLeftRightDist) { VoronoiGraph VGErg = new VoronoiGraph(); foreach (VoronoiEdge VE in VG.Edges) { if (Math.Sqrt(Vector.Dist(VE.LeftData, VE.RightData)) >= minLeftRightDist) { VGErg.Edges.Add(VE); } } foreach (VoronoiEdge VE in VGErg.Edges) { VGErg.Vertizes.Add(VE.VVertexA); VGErg.Vertizes.Add(VE.VVertexB); } return(VGErg); }