title: Transfer Greedy Projection Triangulation in Point Cloud Library to MATLAB
body: <p>I want to know how the<code>GreedyProjectionTriangulation</code> <code>gp3.h</code> and <code>gp3.hpp</code> work in  <code>Point Cloud Library</code> (which can be found in pcl/surface/include/pcl/surface/),then I can start transfer it into MATLAB(for research use).I've no one to discuss so I post here......Maybe some picture can help me.</p>
  <ul>
  <li>I can't understand the function &quot;isVisible in gp3.h&quot; means &quot;in geometry&quot;.
  <a href="https://pointclouds.org/documentation/group__surface.html#ga9dde43ef7735e68f5c69f25501557611" rel="nofollow noreferrer">https://pointclouds.org/documentation/group__surface.html#ga9dde43ef7735e68f5c69f25501557611</a></li>
  <li>I can't understand the variable &quot;ffn_&quot; in gp3.h means. &quot;List of fringe neighbors in one direction.&quot; What is this one direction(conterclock?)
  <a href="http://docs.ros.org/en/hydro/api/pcl/html/classpcl_1_1GreedyProjectionTriangulation.html#aeabf5d78ffb52aeb95b0923985bad52d" rel="nofollow noreferrer">http://docs.ros.org/en/hydro/api/pcl/html/classpcl_1_1GreedyProjectionTriangulation.html#aeabf5d78ffb52aeb95b0923985bad52d</a></li>
  <li>I can't understand the variable &quot;source_&quot;in gp3.h means.
  <a href="http://docs.ros.org/en/hydro/api/pcl/html/classpcl_1_1GreedyProjectionTriangulation.html#af35e77a56a050ddd404ff853a94a31c2" rel="nofollow noreferrer">http://docs.ros.org/en/hydro/api/pcl/html/classpcl_1_1GreedyProjectionTriangulation.html#af35e77a56a050ddd404ff853a94a31c2</a></li>
  </ul>
  <p>↓ It's so hard to transfer code to geometry!!</p>
  <pre><code> /** \brief Returns if a point X is visible from point R (or the origin)
      * when taking into account the segment between the points S1 and S2
      * \param X 2D coordinate of the point
      * \param S1 2D coordinate of the segment's first point
      * \param S2 2D coordinate of the segment's second point
      * \param R 2D coordinate of the reference point (defaults to 0,0)
      * \ingroup surface
      */
    inline bool 
    isVisible (const Eigen::Vector2f &amp;X, const Eigen::Vector2f &amp;S1, const Eigen::Vector2f &amp;S2, 
               const Eigen::Vector2f &amp;R = Eigen::Vector2f::Zero ())
    {
      double a0 = S1[1] - S2[1];
      double b0 = S2[0] - S1[0];
      double c0 = S1[0]*S2[1] - S2[0]*S1[1];
      double a1 = -X[1];
      double b1 = X[0];
      double c1 = 0;
      if (R != Eigen::Vector2f::Zero())
      {
        a1 += R[1];
        b1 -= R[0];
        c1 = R[0]*X[1] - X[0]*R[1];
      }
      double div = a0*b1 - b0*a1;
      double x = (b0*c1 - b1*c0) / div;
      double y = (a1*c0 - a0*c1) / div;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Tw1sy.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>I think these two paper are the most relative:</p>
  <p>2009 from ZC. Marton: <a href="https://pointclouds.org/documentation/tutorials/greedy_projection.html" rel="nofollow noreferrer">https://pointclouds.org/documentation/tutorials/greedy_projection.html</a></p>
  <p>2000 from M.Gopi: <a href="https://www.researchgate.net/publication/3998414_A_Fast_and_Efficient_Projection-Based_Approach_for_Surface_Reconstruction" rel="nofollow noreferrer">https://www.researchgate.net/publication/3998414_A_Fast_and_Efficient_Projection-Based_Approach_for_Surface_Reconstruction</a>
  I'm very confuse the word &quot;occlude&quot; in this paper</p>