QiujieDong / NeurCADRecon

NeurCADRecon: Neural Representation for Reconstructing CAD Surfaces by Enforcing Zero Gaussian Curvature
https://qiujiedong.github.io/publications/NeurCADRecon
MIT License
61 stars 6 forks source link

question about the double-trough function #6

Open marston2yu opened 3 weeks ago

marston2yu commented 3 weeks ago

Thank you for sharing your work. The code runs well for preserving sharp features, as exampled by the fandisk and the sculpt model in the attached figures. However, we failed to find the double-trough function described in the paper. I seems the orignal Gauss curvature loss (7) is used in the following code: `def gaussian_curvature(nonmnfld_hessian_term, morse_nonmnfld_grad): device = morse_nonmnfld_grad.device nonmnfld_hessian_term = torch.cat((nonmnfld_hessian_term, morse_nonmnfld_grad[:, :, :, None]), dim=-1) zero_grad = torch.zeros( (morse_nonmnfld_grad.shape[0], morse_nonmnfld_grad.shape[1], 1, 1), device=device) zero_grad = torch.cat((morse_nonmnfld_grad[:, :, None, :], zero_grad), dim=-1) nonmnfld_hessian_term = torch.cat((nonmnfld_hessian_term, zero_grad), dim=-2) morse_nonmnfld = (-1. / (morse_nonmnfld_grad.norm(dim=-1) * 2 + 1e-12)) torch.det( nonmnfld_hessian_term)

morse_nonmnfld = morse_nonmnfld.abs()

morse_loss = morse_nonmnfld.mean()

return morse_loss`

Could you kindly tell us whether we made a mistake in locating the double-trough function? Or the result could be further improved if the double-trough function is added? Thank you. 2 1

QiujieDong commented 3 weeks ago

Hi, @marston2yu,

Thanks for the heads up. Sorry, I forgot to add the double-trough function to the code. But, it's an easy operation to add the function.

Best regards, Qiujie