Commit: be151d5ebd9e3edb149213363c9a3c6ee15ec4ee
Author: Sebastián Barschkis
Date:   Sat May 28 17:55:29 2016 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rBbe151d5ebd9e3edb149213363c9a3c6ee15ec4ee

mantaflow mesh smoothing functions

===================================================================

M       intern/mantaflow/intern/strings/liquid_script.h

===================================================================

diff --git a/intern/mantaflow/intern/strings/liquid_script.h 
b/intern/mantaflow/intern/strings/liquid_script.h
index 0ebcbf6..ad6f6fd 100644
--- a/intern/mantaflow/intern/strings/liquid_script.h
+++ b/intern/mantaflow/intern/strings/liquid_script.h
@@ -43,7 +43,10 @@ particleNumber = 2\n\
 \n\
 gravity = (0,0,-1)\n\
 step    = -1\n\
-maxVel  = 0\n";
+maxVel  = 0\n\
+\n\
+# triangle scale relative to cell size\n\
+scale = 0.5\n";
 
 //////////////////////////////////////////////////////////////////////
 // GRIDS & MESH & PARTICLESYSTEM
@@ -91,8 +94,10 @@ def manta_step(start_frame):\n\
         flags.updateFromLevelset(phi)\n\
         sampleLevelsetWithParticles( phi=phi, flags=flags, parts=pp, 
discretization=2, randomness=0.4 )\n\
         mapGridToPartsVec3(source=vel, parts=pp, target=pVel )\n\
+        phi.save('/Users/sbarschkis/Desktop/phi.uni')\n\
     \n\
-    phiTemp.printGrid(zSlice=23)\n\
+    #for i in range(int(gs.z)):\n\
+        #phiTemp.printGrid(zSlice=int(i))\n\
     while s.frame == last_frame:\n\
         global step\n\
         step = step + 1\n\
@@ -163,6 +168,12 @@ def liquid_step():\n\
     \n\
     if dim==3:\n\
         phi.createMesh(mesh)\n\
+        # beautify mesh, too slow right now!\n\
+        subdivideMesh(mesh=mesh, minAngle=0.01, minLength=scale, 
maxLength=3*scale, cutTubes=False)\n\
+        # perform smoothing\n\
+        for iters in range(10):\n\
+            smoothMesh(mesh=mesh, strength=1e-3, steps=10)\n\
+            subdivideMesh(mesh=mesh, minAngle=0.01, minLength=scale, 
maxLength=3*scale, cutTubes=True)\n\
         
mesh.save('/Users/sbarschkis/Desktop/surface/fluidsurface_final_%04d.bobj.gz' % 
step)\n\
     \n\
     # Resample particles\n\
@@ -203,6 +214,7 @@ if 'minParticles'     in globals() : del minParticles\n\
 if 'particleNumber'   in globals() : del particleNumber\n\
 if 'gravity'          in globals() : del gravity\n\
 if 'step'             in globals() : del step\n\
-if 'maxVel'           in globals() : del maxVel\n";
+if 'maxVel'           in globals() : del maxVel\n\
+if 'scale'            in globals() : del scale\n";

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to