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();
EnviTriMesh.MergeWith(EnviTriMesh_i);
}
// FastMarchingMethod(EnviTriMesh, distance, gradient, bb, surfaceCells);
Meshing::VolumeGrid grid;
CollisionMesh EnviTriMeshTopology(EnviTriMesh);
EnviTriMeshTopology.InitCollisions();
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
?