public static Vector3[] LaplacianFilter(Vector3[] vertices, int[] triangles, int times){ var network = VertexConnection.BuildNetwork(triangles); for (var i = 0; i < times; i++) vertices = LaplacianFilter(network, vertices); return vertices; }
private static Vector3[] HcFilter(Vector3[] vertices, int[] triangles, int times, float alpha, float beta){ alpha = Mathf.Clamp01(alpha); beta = Mathf.Clamp01(beta); var network = VertexConnection.BuildNetwork(triangles); var origin = new Vector3[vertices.Length]; Array.Copy(vertices, origin, vertices.Length); for (var i = 0; i < times; i++) vertices = HcFilter(network, origin, vertices, triangles, alpha, beta); return vertices; }