XYZfile/HDF5file to create a Floating_Body

Hi, I am trying to create a Floating body using XYZfile or HDF5file.
However, some trouble I have found.

The first one, in XYZReader.cc. In Line.71 the value npart have not been assignment. It should be npart =
getNPart();
and this may help you @brittlyd

The second one is how to create a Body. i.e., CHRONO Body.
I think first we should delete the overlapping fluid particles. However, a XYZFile with a complex Body can not be used to find that particles.
Moreover, In XYZReader, no function named CreateBody, as a result, I get this exception.
FATAL: Object::BodyCreate called but no obj file specified in constructor!
[Inferior 1 (process 22473) exited with code 01]

But, it can be done, absolutely. I am working… If someone have the solutions, please let me know

Sorry, i just know that a STLMesh file is also needed in this situation.

Hello @JoJo,

good spotting with the XYZFile issue (although I think the proper fix is to assign nparts from within getNParts()), and yes, you need to associate a mesh to the pointcloud when loading one if you want to use it with Chrono.

Thanks, but I still have a few questions want to ask.

  1. In my XYZfile, the points are not consistent with the vertex in STL file. But, geometry is the same. Is that OK?
  2. for CHRONO object, then how can I calculate the inertia and CGs.
  1. what type of mesh should I use. surface, body, or whatever.

and I failed getting the boundingbox in chrono…
chronobb

Hello @JoJo,

  1. the points being inconsistent with the STL file is not a problem, as long as the geometry is the same;
  2. you should be able to use setInertia(gid, i11, i22, i33) and setCenterOfGravity(gid, cg) to override the inertia and center of gravity (modulo bugs);
  3. my understanding is that the mesh should be a surface mesh.