-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python wrapper #100
Comments
Thank you for your interest. At the moment there is no Python wrapper. It shouldn't be too hard to build a wrapper with PyO3. Personally, I don't have much experience with, yet. So I'm not able to provide a wrapper in the very near future (we have other research priorities in our group at the moment) but it would certainly be a nice feature to have. We don't have a publication to recommend at the moment, especially considering the exact formulation of the level-set function used in this implementation. Note that we don't specifically detect surface particles but just use an SPH based formulation of the indicator function (i.e, 1 inside of the fluid and 0 outside) to define a level-set function that is reconstructed using marching cubes. To summarize briefly: we use the level-set function
where EDIT: Removed part of the answer as I made a mistake. |
Thanks for the information |
Hi Fabian, In SPH method, we must obtain the neighours of each particle to compute density, volume, etc. So, we only work with particles positions. Suppose I have N * N * N voxelized space. Then for computing following term:
Do I need to find nearest particles of each voxel's corner? In this case, it's tricky as we usually use an array to save voxels' coordinates and a Particle class to save all information of each particle such as their positions. If I mix voxels coordinates and particles poistion in one array to make Kdtree (or any other nearest neighbor algorithm), then I cannot identify which one is particle and which one is voxel's coordinate. So, I'm wondering how do you find nearest particles to each voxel's corner? |
Yes, this is at least the most obvious way to do it. Something similar is currently used to compute the surface normals in a post-processing step (build an R-star tree as acceleration structure of all the particles and then for each surface mesh vertex find all neighbor particles using the tree and compute the normal with them). But this is a bit hacky. There is a more efficient way. We are not looping over the vertices of the marching cubes voxel grid to directly compute the value at each vertex. What we are usually doing in our group and also in this project is that we loop over all particles and then for each particle add-assign its contribution to every marching cubes vertex in the particle's compact support. Because the marching cubes grid is completely regular it's trivial for a particle to identify all vertices that it influences. The other way around is more difficult as you observed. |
Hi,
I'm wondering it there any python wrapper for this library?
Also, do you have any reference regarding mathematical model you have used fot surface reconstruction? (specifically the function for finding surface level of particles).
The text was updated successfully, but these errors were encountered: