diff --git a/chunkie/+chnk/+smoother/get_pseudo_normals.m b/chunkie/+chnk/+smoother/get_pseudo_normals.m new file mode 100644 index 0000000..e1110d6 --- /dev/null +++ b/chunkie/+chnk/+smoother/get_pseudo_normals.m @@ -0,0 +1,6 @@ +function pseudo_normals = get_pseudo_normals(verts) + [~, nv] = size(verts); + verts_ext = [verts, verts(:,1)]; + d = verts_ext(:,2:end) - verts_ext(:,1:nv); + +end \ No newline at end of file diff --git a/chunkie/+chnk/+smoother/smooth_curve.m b/chunkie/+chnk/+smoother/smooth_curve.m new file mode 100644 index 0000000..0582738 --- /dev/null +++ b/chunkie/+chnk/+smoother/smooth_curve.m @@ -0,0 +1,12 @@ +nv = 10; +z = exp(1j*2*pi*(1:nv-1)/nv); +verts = [real(z); imag(z)]; +nchs = randi([1,10], 1, nv); + +umesh = []; +umesh.verts = verts; +umesh.pseudo_normals = get_pseudo_normal(verts); + +qmesh = []; +qmesh +dmesh = [];