3

I need to use Marching Cubes based on Radial Basis Function so I looked up this algorithm implemented in PCL. Actually I'm using PCL v1.6 so the function is:

    pcl::MarchingCubesRBF

The problem is that it doesn't work, that is it doesn't create any triangles: sometimes the output is '0 triangles created', at times running blocks my machine. Anyway my implementation is:

    pcl::MarchingCubesRBF<pcl::PointNormal> mc;
    pcl::PolygonMesh::Ptr triangles(new pcl::PolygonMesh);
    mc.setInputCloud (cloud_with_normals);
    mc.setSearchMethod (tree);
    mc.reconstruct (*triangles);

I tried with different files like input but neither of them works. One of it is https://github.com/FabiApfelkern/cloudfinish/blob/master/cat.pcd

I found there was a bug about the implementation in pcl: http://dev.pointclouds.org/issues/768 However I don't understand if it is solved in pcl v1.6. Let me know how could I solve if it is possible.

I'm using C++ with VS2010

SPS
  • 465
  • 9
  • 23
  • Does no one knows news about this algorithm? – SPS Sep 08 '14 at 14:19
  • I worked to improve the code, adding the followings: `mc.setGridResolution(1,1,1); mc.setIsoLevel(0.5); //between 0 and 1 mc.setPercentageExtendGrid(5);` Running this code with this settings I get a **Debug Assertion Failed** by VS2010, that is: _vector subscript out of range_ . Could someone provide any suggestion? – SPS Oct 03 '14 at 14:45
  • I have the exact same problem. I tried it Marching Cubes on v1.7 and the error persists. – TheGame Nov 07 '14 at 18:51
  • Maybe [this issue](https://github.com/PointCloudLibrary/pcl/issues/3961) I created has some relevance for you too – LorenzBung Apr 23 '20 at 10:27

1 Answers1

0

I had the same problem and I fixed it setting the grid resolution:

mc.setGridResolution (100, 100, 100);
mc.reconstruct (*triangles);

The grid resolution is the amount of voxels used in x, y and z directions. So if you set it to 1, 1, 1, there will be only one voxel - and thus not a very good representation of your point cloud. The higher the resolution, the more expensive it will be, but it also improves the quality of the resulting mesh.

LorenzBung
  • 404
  • 1
  • 5
  • 15