Skip to content

Commit

Permalink
smoother
Browse files Browse the repository at this point in the history
  • Loading branch information
mrachh committed Oct 18, 2024
1 parent 57807af commit d0d16d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chunkie/+chnk/+smoother/get_pseudo_normals.m
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions chunkie/+chnk/+smoother/smooth_curve.m
Original file line number Diff line number Diff line change
@@ -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 = [];

0 comments on commit d0d16d2

Please sign in to comment.