Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Signed Distance Field with MeshToImplicitSurface_FMM #11

Hi Prof. Hauser,

I would like to use the MeshToImplicitSurface_FMM function provided in KrisLibrary to compute signed distance fields of uneven terrains. However, this computation always fails due to mesh.triNeighbors.empty() error. The failure output is

log4cxx: Could not open file [./log4cxx.xml].
KrisLibrary::logger(): configured as default
FMM starting with 101215 surface, 77401 interior, 125957 exterior cells 
MyApp: /home/shihao/Klampt/Cpp/Dependencies/KrisLibrary/meshing/Voxelize.cpp:1522: void Meshing::TriangleClosestPointData::Calculate(const Meshing::TriMeshWithTopology&, const Meshing::TrimeshFeature&, const Math3D::Vector3&): Assertion `!mesh.triNeighbors.empty()' failed.

My code is

void SDFwithFMM(const RobotWorld& WorldObj, const int GridsNo)
  // This function is used to generate the sighed distance field with FastMarchingMethod

  const int NumberOfTerrains = WorldObj.terrains.size();
  Meshing::TriMesh EnviTriMesh  = WorldObj.terrains[0]->geometry->AsTriangleMesh();

  //     MergeWith
  for (int i = 0; i < NumberOfTerrains-1; i++)
    Meshing::TriMesh EnviTriMesh_i  = WorldObj.terrains[i+1]->geometry->AsTriangleMesh();
  // FastMarchingMethod(EnviTriMesh, distance, gradient, bb, surfaceCells);
  Meshing::VolumeGrid grid;

  CollisionMesh EnviTriMeshTopology(EnviTriMesh);
  double resolution = 0.1;
  MeshToImplicitSurface_FMM(EnviTriMeshTopology, grid, resolution);

Does it mean that I should initialize sth first before give the mesh file into MeshToImplicitSurface_FMM?

  • replies 1
  • views 33
  • likes 0

Try using EnviTriMeshTopology.CalcTriNeighbors() before calling MeshToImplicitSurface_FMM