Fluid: Enable new flood-fill helper function
The flood-fill helper serves as a sanity check for scenes with complex obstacles. Similarly to the holes filler function it ensures that there are no holes in obstacles. In addition, it ensures that there will be no holes resulting from multiple intersecting obstacles. In general, this commit should improve stability.
This commit is contained in:
parent
a0ebfab4f3
commit
55fd7f55bd
Notes:
blender-bot
2023-02-13 17:59:16 +01:00
Referenced by issue #90426, FLuid Manta Flow Bug
|
@ -186,14 +186,13 @@ def liquid_adaptive_step_$ID$(framenr):\n\
|
|||
\n\
|
||||
mantaMsg('Initializing obstacle levelset')\n\
|
||||
phiObsIn_s$ID$.join(phiObsSIn_s$ID$) # Join static obstacle map\n\
|
||||
phiObsIn_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=1)\n\
|
||||
phiObsIn_s$ID$.floodFill(boundaryWidth=1)\n\
|
||||
extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=6, inside=True)\n\
|
||||
extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=3, inside=False)\n\
|
||||
phiObs_s$ID$.join(phiObsIn_s$ID$)\n\
|
||||
\n\
|
||||
# Using boundaryWidth=2 to not search beginning from walls (just a performance optimization)\n\
|
||||
# Additional sanity check: fill holes in phiObs which can result after joining with phiObsIn\n\
|
||||
phiObs_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=2 if using_fractions_s$ID$ else 1)\n\
|
||||
phiObs_s$ID$.floodFill(boundaryWidth=2 if using_fractions_s$ID$ else 1)\n\
|
||||
extrapolateLsSimple(phi=phiObs_s$ID$, distance=6, inside=True)\n\
|
||||
extrapolateLsSimple(phi=phiObs_s$ID$, distance=3)\n\
|
||||
\n\
|
||||
|
|
|
@ -289,14 +289,13 @@ def smoke_adaptive_step_$ID$(framenr):\n\
|
|||
\n\
|
||||
mantaMsg('Initializing obstacle levelset')\n\
|
||||
phiObsIn_s$ID$.join(phiObsSIn_s$ID$) # Join static obstacle map\n\
|
||||
phiObsIn_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=1)\n\
|
||||
phiObsIn_s$ID$.floodFill(boundaryWidth=1)\n\
|
||||
extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=6, inside=True)\n\
|
||||
extrapolateLsSimple(phi=phiObsIn_s$ID$, distance=3, inside=False)\n\
|
||||
phiObs_s$ID$.join(phiObsIn_s$ID$)\n\
|
||||
\n\
|
||||
# Using boundaryWidth=2 to not search beginning from walls (just a performance optimization)\n\
|
||||
# Additional sanity check: fill holes in phiObs which can result after joining with phiObsIn\n\
|
||||
phiObs_s$ID$.fillHoles(maxDepth=int(res_s$ID$), boundaryWidth=1)\n\
|
||||
phiObs_s$ID$.floodFill(boundaryWidth=1)\n\
|
||||
extrapolateLsSimple(phi=phiObs_s$ID$, distance=6, inside=True)\n\
|
||||
extrapolateLsSimple(phi=phiObs_s$ID$, distance=3, inside=False)\n\
|
||||
\n\
|
||||
|
|
Loading…
Reference in New Issue