Comments (14)
Hi @uljadberdica1000! When running the simulation app, you should pass "--format pos" to export the binary files. By default it will use xyz ASCII format. You can pass -h option to see all the input parameters.
from fluid-engine-dev.
Hi @uljadberdica1000! The particles2obj
CLI tool assumes the input file is in a binary file format generated by other example apps such as hybrid_liquid_sim
or sph_sim
.
If you want to use your own app to generate compatible files, please take a look at main.cpp
file in hybrid_liquid_sim
example:
void saveParticleAsPos(const ParticleSystemData3Ptr& particles,
const std::string& rootDir, int frameCnt) {
Array1<Vector3D> positions(particles->numberOfParticles());
copyRange1(particles->positions(), particles->numberOfParticles(),
&positions);
char basename[256];
snprintf(basename, sizeof(basename), "frame_%06d.pos", frameCnt);
std::string filename = pystring::os::path::join(rootDir, basename);
std::ofstream file(filename.c_str(), std::ios::binary);
if (file) {
printf("Writing %s...\n", filename.c_str());
std::vector<uint8_t> buffer;
serialize(positions.constAccessor(), &buffer);
file.write(reinterpret_cast<char*>(buffer.data()), buffer.size());
file.close();
}
}
from fluid-engine-dev.
Thank you so much for your help and great work. Is there any way I can generate a partio file (or any particle information saving file format) and most importanly, use it to perform the Zhu-Bridson or the anisotropic algorithms on?
from fluid-engine-dev.
We currently do not support partio format, so you probably should right a converter which both links to Jet Framework and partio library.
from fluid-engine-dev.
tried running :
~/fluid-engine-dev/build/bin$ ./particles2obj -i hybrid_liquid_sim_output/frame_000001.xyz -o out.obj
and I got that there is segmentation error (core dumped). Could you give me an example of how to run the code?
from fluid-engine-dev.
Could you please provide me with an example? I keep getting the error of dumped cores. Do I red the entire folder of the hybrid output?
./particles2obj -i /home/uljad1b/fluid-engine-dev/build/bin/hybrid_liquid_sim_output -o out.obj gave me the following:
terminate called after throwing an instance of 'std::__ios_failure'
what(): basic_filebuf::underflow error reading the file: iostream error
Aborted (core dumped)
from fluid-engine-dev.
Sure, so here's an example. You can first run the hybrid_liquid_sim like this:
PS C:\Users\doyub\Codes\fluid-engine-dev> .\build\bin\Release\hybrid_liquid_sim.exe -h
usage:
hybrid_liquid_sim.exe options
where options are:
-r, --resx <resolutionX> grid resolution in x-axis (default is 50)
-f, --frames <numberOfFrames> total number of frames (default is 100)
-p, --fps <fps> frames per second (default is 60.0)
-e, --example <exampleNum> example number (between 1 and 6, default
is 1)
-l, --log <logFilename> log file name (default is
hybrid_liquid_sim.log)
-o, --output <outputDir> output directory name (default is
hybrid_liquid_sim_output)
-m, --format <format> particle output format (xyz or pos.
default is xyz)
PS C:\Users\doyub\Codes\fluid-engine-dev> .\build\bin\Release\hybrid_liquid_sim.exe -f 10 -m pos
Running example 1 (water-drop with FLIP)
Domain: [0.000000, 0.000000, 0.000000] x [1.000000, 2.000000, 1.000000]
Grid spacing: [0.020000, 0.020000, 0.020000]
Writing hybrid_liquid_sim_output\frame_000000.pos...
Writing hybrid_liquid_sim_output\frame_000001.pos...
Writing hybrid_liquid_sim_output\frame_000002.pos...
Writing hybrid_liquid_sim_output\frame_000003.pos...
Writing hybrid_liquid_sim_output\frame_000004.pos...
Writing hybrid_liquid_sim_output\frame_000005.pos...
Writing hybrid_liquid_sim_output\frame_000006.pos...
Writing hybrid_liquid_sim_output\frame_000007.pos...
Writing hybrid_liquid_sim_output\frame_000008.pos...
Writing hybrid_liquid_sim_output\frame_000009.pos...
Then, you can run the particle2obj like this:
PS C:\Users\doyub\Codes\fluid-engine-dev> .\build\bin\Release\particles2obj.exe -i .\hybrid_liquid_sim_output\frame_000000.pos -m zhu_bridson
particles2obj.exe options
where options are:
-?, -h, --help display usage information
-i, --input <inputFilename> input obj file name
-o, --output <outputFilename> output obj file name
-r, --resolution <resolution> grid resolution in CSV format (default
is 100,100,100)
-g, --grid_spacing <gridSpacing> grid spacing in CSV format (default is
0.01,0.01,0.01)
0,0,0)
-m, --method <method> spherical, sph, zhu_bridson, and
anisotropic followed by optional
method-dependent parameters (default is
anisotropic)
-k, --kernel <kernelRadius> interpolation kernel radius (default is
0.2)
PS C:\Users\doyub\Codes\fluid-engine-dev> .\build\bin\Release\particles2obj.exe -i .\hybrid_liquid_sim_output\frame_000000.pos -r 100,200,100 -g 0.01 -k 0.04 -m zhu_bridson -o .\hybrid_liquid_sim_output\frame_000000.obj
Resolution: 100 x 200 x 100
Domain: [0.000000, 0.000000, 0.000000] x [1.000000, 2.000000, 1.000000]
Grid spacing: [0.010000, 0.010000, 0.010000]
Number of particles: 534361
Reconstruction method: zhu_bridson
[INFO] 2020-07-14 01:35:59 [C:\Users\doyub\Codes\fluid-engine-dev\src\jet\point_parallel_hash_grid_searcher3.cpp:141 (build)] Average number of points per non-empty bucket: 428.861
[INFO] 2020-07-14 01:35:59 [C:\Users\doyub\Codes\fluid-engine-dev\src\jet\point_parallel_hash_grid_searcher3.cpp:144 (build)] Max number of points per bucket: 729
[INFO] 2020-07-14 01:35:59 [C:\Users\doyub\Codes\fluid-engine-dev\src\jet\particle_system_data3.cpp:220 (buildNeighborSearcher)] Building neighbor searcher took: 0.05554 seconds
Writing .\hybrid_liquid_sim_output\frame_000000.obj..
Then, you will get results something like:
from fluid-engine-dev.
I'm glad to see this issue. It would be better written the issue step in the README.
from fluid-engine-dev.
Is there any way I could use the xyz file for that? I want to use it as a plugin for something else and need to put the xyz from another simulation.
from fluid-engine-dev.
@uljadberdica1000: you mean you want to generate xyz files externally and use particles2obj to generate mesh, right? Adding xyz support shouldn't be too hard. Let me see what I can do.
from fluid-engine-dev.
Yes thank you so much! I just want to use your work since I will never be able to write a better one anyway! I want to be able to use xyz to generate the mesh with the particles2obj.
from fluid-engine-dev.
@uljadberdica1000: the requested feature is now up for PR. Feel free to test it from the branch (xyz
).
from fluid-engine-dev.
It worked great. Thank you so much. Do you have any literature you could suggest on the trade offs of using each method both computationally and geometrically. I cannot find a proper source! The xyz input works great!
from fluid-engine-dev.
Hi @uljadberdica1000 ,
I would definitely start from Yu and Turk paper (https://www.cc.gatech.edu/~turk/my_papers/particle_surfaces_tog.pdf). I don't know if there are any survey papers on that topic, but that paper should cover most of your questions. The computational cost is something could be reevaluated with modern hardwares including GPUs.
from fluid-engine-dev.
Related Issues (20)
- render manual tests root path HOT 4
- How do I run the examples and the animations?
- Compile error when compiling with Clang 10 HOT 1
- Promotion of projects/research using Jet Framework HOT 4
- How to implement the xyz to mesh generation to another code for fluid simulation? HOT 1
- How do I set up a fluid particles at rest and a fluid particles with initial velocity HOT 3
- Suggestion to replace Travis CI/Appveyor with GitHub Actions HOT 5
- Some unit tests failure on 32-bit system
- Fix Visual Studio 2017 build failure on GitHub Action
- Timer test code failure on MinGW system
- No known features for CXX compiler "Clang" HOT 5
- running the Python example show error HOT 8
- Replace Clara
- makeTranslationMatrix should be transposed HOT 8
- About the local method in the surface_to_implicit HOT 1
- GridSmokeSolver3::computeDiffusion is diffusing smokeDensity instead of temperature HOT 2
- Incorrect formula for collider boundary conditions (Equation 3.18 in the book)
- can't build cmake in win64 HOT 1
- bug in void Matrix<T, M, N>::invert() in "include/detail/matrix-inl.h" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluid-engine-dev.