Surface mesh generator base code