title: PCL - GreedyProjectionTriangulation makes not enough faces
body: <p>I am trying to triangulate my point cloud in Point Cloud Library using <strong>pcl::GreedyProjectionTriangulation</strong> from this <a href="http://pointclouds.org/documentation/tutorials/greedy_projection.php#greedy-triangulation" rel="nofollow">tutorial</a></p>
  
  <p><strong>Problem</strong>:
  But as the result I got <strong>PolyMesh</strong> with a very few number of faces (see the image below):
  <a href="http://i.imgur.com/5pBfuJ3.jpg" rel="nofollow">Sorry, I can't publish images</a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>//Calculate normals
  pcl::NormalEstimation&lt;pcl::PointXYZ, pcl::Normal&gt; n;
  pcl::PointCloud&lt;pcl::Normal&gt;::Ptr normals(new pcl::PointCloud&lt;pcl::Normal&gt;);
  pcl::search::KdTree&lt;pcl::PointXYZ&gt;::Ptr tree(new pcl::search::KdTree&lt;pcl::PointXYZ&gt;);
  tree-&gt;setInputCloud(cloud);
  n.setInputCloud(cloud);
  n.setSearchMethod(tree);
  n.setKSearch(80);
  
  cout &lt;&lt; "Computing normals...\n";
  n.compute(*normals);
  
  // Concatenate the XYZ and normal fields*
  pcl::PointCloud&lt;pcl::PointNormal&gt;::Ptr cloud_with_normals(new pcl::PointCloud&lt;pcl::PointNormal&gt;);
  pcl::concatenateFields(*cloud, *normals, *cloud_with_normals);
  
  // Create search tree*
  pcl::search::KdTree&lt;pcl::PointNormal&gt;::Ptr tree2(new pcl::search::KdTree&lt;pcl::PointNormal&gt;);
  tree2-&gt;setInputCloud(cloud_with_normals);
  
  // Initialize objects
  pcl::GreedyProjectionTriangulation&lt;pcl::PointNormal&gt; gp3;
  pcl::PolygonMesh triangles;
  
  // Set the maximum distance between connected points (maximum edge length)
  gp3.setSearchRadius(0.1);
  
  // Set typical values for the parameters
  gp3.setMu(2.5);
  gp3.setMaximumNearestNeighbors(150);
  gp3.setMaximumSurfaceAngle(M_PI ); // 180 degrees
  gp3.setMinimumAngle(M_PI / 18);    // 10 degrees
  gp3.setMaximumAngle(2 * M_PI / 3); // 120 degrees
  gp3.setNormalConsistency(false);
  
  // Get result
  gp3.setInputCloud(cloud_with_normals);
  gp3.setSearchMethod(tree2);
  cout &lt;&lt; "reconstruct\n";
  gp3.reconstruct(triangles);
  </code></pre>
  
  <ul>
  <li><p>I tried to set bigger value (1 vs 0.1) of the <em>SearchRadius</em>  but got this warning during runtime:</p>
  
  <p><em>Not enough neighbors are considered: ffn or sfn out of range! Consider increasin
  g nnn_... Setting R=23433 to be BOUNDARY!
  Not enough neighbors are considered: source of R=23480 is out of range! Consider
  increasing nnn_...
  Number of neighborhood size increase requests for fringe neighbors: 24
  Number of neighborhood size increase requests for source: 68</em></p>
  
  <p>and number of polygons is steel low.</p></li>
  </ul>
  
  <p><strong>Question</strong>: So, what should I do to create good PolyMesh from the point cloud?</p>