@@ -26,16 +26,16 @@ def main():
2626 bunny_filename = os .path .join (os .path .dirname (os .path .realpath (__file__ )), '../../../resources/bunny.obj' )
2727 bunny_mesh = TriangleMesh3 ()
2828 bunny_mesh .readObj (bunny_filename )
29- bunny_sdf = ImplicitTriangleMesh3 (mesh = bunny_mesh , resolutionX = 64 , margin = 0 )
29+ bunny_sdf = ImplicitTriangleMesh3 (mesh = bunny_mesh , resolutionX = 64 , margin = 0.2 )
3030 emitter = VolumeParticleEmitter3 (implicitSurface = bunny_sdf , spacing = 1.0 / (2 * resX ), isOneShot = False )
3131 solver .particleEmitter = emitter
3232
3333 # Convert to surface
3434 grid_size = 1.0 / resX
35- grid = CellCenteredScalarGrid3 ((resX , resX , resX ), (grid_size , grid_size , grid_size ))
35+ grid = VertexCenteredScalarGrid3 ((resX , resX , resX ), (grid_size , grid_size , grid_size ))
3636
3737 def write_surface (frame_cnt , pos ):
38- converter = SphPointsToImplicit3 (2.0 * grid_size , 0.5 )
38+ converter = SphPointsToImplicit3 (1.5 * grid_size , 0.5 )
3939 converter .convert (pos .tolist (), grid )
4040 surface_mesh = marchingCubes (grid , (grid_size , grid_size , grid_size ), (0 , 0 , 0 ), 0.0 , DIRECTION_ALL )
4141 surface_mesh .writeObj ('frame_{:06d}.obj' .format (frame_cnt ))
0 commit comments