mkazhdan / PoissonRecon

Poisson Surface Reconstruction
MIT License
1.58k stars 427 forks source link

Issue about coefficients #229

Open Chickers opened 2 years ago

Chickers commented 2 years ago

Hi professor. In the mesh extraction step (FEMTree.IsoSurface.specialized.inl, Extract), coarseCoefficients are copied from coefficients and upsampled from depth 1 to depth tree._maxDepth-1. Is it poissible to upsample coefficients from depth 1 to depth tree._maxDepth instead of defining the coarseCoefficients? And If there is only one node whose coefficients equals to 1 at depth d and others equal to 0, it seems that all of the coefficients of the nodes at depth d+1 do not change after the _upSample step at depth d+1.

mkazhdan commented 2 years ago

Unfortunately, that won't work.

Because we are using an octree, rather than a regular grid, we cannot up-sample "coefficients". That is, there would be situations in we would like to up-sample the coefficients to a depth d, but the associated node at depth d does not exist.

In particular, as the solution is represented as the linear combination of coefficients from the different levels of the tree, in principal the evaluation of the implicit function at a point (e.g. corner) would require taking the sum of the values of the functions defined at the different levels of the tree. As a result, the evaluation at a point would have complexity proportional to the depth of the tree.

However, by carefully adapting the octree and up-sampling, we can get the value of the implicit function by taking the sum of the evaluation of the function at the current depth plus the evaluation of the up-sampled function at one level coarser. This is what coarseCoefficients stores, and why it only needs to be set to tree._maxDepth-1, not tree._maxDepth. In this case, the complexity of evaluating the implicit function at a point is constant, regardless of the depth of tree. (The cost of up-sampling is linear in the size of the tree, so that does not add a computational overhead.)