options(repr.plot.width=3.5, repr.plot.height=3.5) options(warn=-1) # turns off warnings, to turn on: "options(warn=0)" library(Matrix) library(geometry) library(imager) library(akima) library(plot3D) library(network) # Importing the libraries for (f in list.files(path="nt_toolbox/toolbox_general/", pattern="*.R")) { source(paste("nt_toolbox/toolbox_general/", f, sep="")) } for (f in list.files(path="nt_toolbox/toolbox_signal/", pattern="*.R")) { source(paste("nt_toolbox/toolbox_signal/", f, sep="")) } X0 = read_mesh("nt_toolbox/data/elephant-50kv.off")$X0 F = read_mesh("nt_toolbox/data/elephant-50kv.off")$F0 n = dim(X0)[2] m = dim(F)[2] options(repr.plot.width=3.5, repr.plot.height=3.5) plot_mesh(X0, F, "grey") rho = 0.015 N = compute_normal(X0, F) X = X0 + t(cbind(rho*replicate(1, rnorm(n)),rho*replicate(1, rnorm(n)),rho*replicate(1, rnorm(n))))*N plot_mesh(X, F, "grey") E = cbind(F[1:2,],F[2:3,],rbind(F[3,],F[1,])) E = unique_columns(cbind(E,rbind(E[2,],E[1,]))) E0 = E[,E[1,]