function [r,ru,rv,normal,cf,h,mu,uh,vh] = compute_lh(face,vertex,corner)
% compute conformal factor and mean curvature from surface conformal
% parameterization

% A = laplace_beltrami(face,vertex);
% MESH = makeMesh(vertex,face);
% uv = embedSCP(MESH,'generalized',A*2);
% z0 = uv(:,1)+uv(:,2)*1i;
% [z,height] = conformal_map(face,z0,corner);

uv = rect_harmonic_map(face,vertex,corner);
mu = bc_metric(uv', face', vertex', 3);
z = linear_beltrami_solver_rect(face,uv(:,1)+1i*uv(:,2),mu,corner,[],[]);
height = max(imag(z));

% uv = [real(z),imag(z)];
% mu = mu_calculation(face',vertex',[real(z),imag(z),ones(size(z))]');
% hist(abs(mu),0:0.001:max(abs(mu)))
%%
N = 201;
M = round(N*height);
[r,uh,vh] = tri2surf(face,vertex,z,M,N);
[rz,rz2,normal,cf,h,mu] = surface_to_geometry(r,uh,vh);
ru =  rz+rz2;
rv = -rz+rz2;
cf([1:9,end-8:end],:) = NaN;
cf(:,[1:9,end-8:end]) = NaN;
h([1:9,end-8:end],:) = NaN;
h(:,[1:9,end-8:end]) = NaN;
mu([1:9,end-8:end],:) = NaN;
mu(:,[1:9,end-8:end]) = NaN;