forked from thunil/mantaflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
z.txt
103 lines (86 loc) · 4.85 KB
/
z.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
- utils
- filter_log.py
- fixed_volume
- base code
- there's exit(0) that doesn't let the script finish
- Hang bug: the app hangs after sol.step(). Attaching the debugger and going to the qt thread using the threads window reveals updateQtGui(), gMainThread->sendAndWait().
- LockedObjPainter::nextObject()
- I patched it to view only named objects
- python
- expose a class member var
PYTHON(name=timestep) Real mDt;
- explicit typedef is needed for python
PYTHON() alias Grid<Real> RealGrid
- I wanted to return vector<double>, but it was tricky, so I returned vector<float> which was already supported.
- mesh transparency level is set in isoAlpha in meshpainter.cpp
- print_cam(): print camera
- I excluded build/pp from resharper
- The python script is run from c++ using
PyRun_SimpleString(buf);
- glClearColor( c, c, c, 1.0f ); // zl background color
- There are painters for different types.
- The painters order is determined by their insertion order into mPainter in MainWnd::MainWnd().
- grid color: in painter.cpp, GridPainter<int>::paint()
glColor3f( 0, 0.3, 1 ); // light blue
- GridPainter<Real>::paint()
- GridPainter<Vec3>::paint()
- MeshPainter::paint()
- particle color: in particlepainter.cpp, ParticlePainter::paintBasicSys()
if(!bp->isActive(i) ) {
glColor3f(1.0, 0., 0.); // deleted, red
- There's glPointSize in that code area after
if(!drewPoints)
- The drawing is done in GridPainter<int|Real|Vec3>::paint()
- color and vector modes
- enum RealDisplayModes { RealDispOff=0, RealDispStd, RealDispLevelset, RealDispShadeVol, RealDispShadeSurf, NumRealDispModes };
- GridPainter<T>::setDispMode(int dm)
- Gui::nextRealGrid()
- enum VecDisplayModes { VecDispOff=0, VecDispCentered, VecDispStaggered, VecDispUv, NumVecDispModes };
- GridPainter<Vec3>::paint(), paint velocity vectors
- A vector of painters is created in MainWnd::MainWnd().
- The paintEvent signal is connected to them.
- I added the event EventSetRealGridDisplay and method Gui::setRealGridDisplay()
- keys
- mainwindow.cpp
- if ( e->key() == Qt::Key_Escape ) {
- glwidget.cpp
- if ( key == Qt::Key_C && ctrl )
- A grid is created in FluidSolver::getGridPointer().
- A MAC is defined as usual.
- The i index in a kernel refers to x-axis or columns. j refers to y-axis (pointing up) or rows, which start from the bottom (flipped).
- interpolMAC() in the center of a cell is equal to getCentered(). A 2x2 grid defines one cell. Cell (i,j) interpolates with the walls shared with the next cells (i+1, j) and (i, j+1).
- See test_MAC() in zflip.py
- knMapLinearVec3ToMACGrid() has a kernel macro in the definition. This macro has a variadic param, and it's executed for every point.
- setInterpolMAC() interpolates MAC from particles. The four grid points are ref[0], ref[X], ref[Y], ref[X+Y].
- The output precision (also 2D/3D) is set in Vector3D<S>::toString() in vectorbase.h.
- snprintf, "[%+4.2f,%+4.2f]", "[%d,%d]"
- Vector3D<int>::toString() in vectorbase.cpp
- The source code in build/pp is generated by prep for the python extension. It's for debugging only, and I locked it for editing. It processes new keywards such as PYTHON and KERNEL.
- Incorrect FLIP · Issue #7 · thunil/mantaflow · GitHub
https://github.com/thunil/mantaflow/issues/7
- see update_particles() in fluid2d_sph.m
- Needs env var
set PYTHONHOME=c:\Python37\
- run
bin\manta c:\prj\fluid\_others3\mantaflow-master\scenes\flip01_simple.py
- see batch files in scenes/
- How to Create a Mantaflow Fluid Simulation in Blender (2.82) - YouTube
https://www.youtube.com/watch?v=YdUWqkqcxzw&ab_channel=BlenderMadeEasy
- cmake
- there's an option DEBUG_PYTHON_WITH_RELEASE for the linked lib
- I currently set DEBUG=1, which e.g. affects TBB. I don't think the cmake was written for multi-version, and it needs to be changed for release.
- To replay generated scenes:
flip03_gen.py
- maya plugins
- bobjloader is fast and simple and works with a compact format. The extracted surface is decent--I'm scaling by 2 the resolution of the grid for the extraction. Better than working with openvdb.
- I created a cmake
- densityloader expects grid density not particles (see the 4-byte header).
- maya
- Use bifrost graph editor to create an object from openvdb.
- Sample data in
c:\prj-external-libs\mantaflow\out\
- Sample maya scenes: manta*.ma, tornado.ma
- Change the file path of the read_openVDB node in bifrost editor
- ui
- clicking a grid cell gives info
- +/- move slice plane