Skip to main content
. 2020 Sep 2;20(17):4976. doi: 10.3390/s20174976
Algorithm 2 Concave surface converting algorithm.
  • 1:

    Initialize line set L=∅, and put all strips into set Ω1 and R=1.

  • 2:

    for each Ωr do

  • 3:

     if |Ωr|>3 then

  • 4:

      The strips in Ωr are fitted into a line according to their horizontal locations with the fitted error εl.

  • 5:

      if εl<=εth then

  • 6:

       Put this line into L, and remove the corresponding strips in Ωr.

  • 7:

      else

  • 8:

       Split the strips at the maximum fitting error into ΩR+1 and ΩR+2; R=R+2.

  • 9:

      end if

  • 10:

     else ifSi−1Si→·Si+1Si→>0 and (Xi−1−Xi+1)2+(Zi−1−Zi+1)2<Ws then

  • 11:

      Delete Si; put the line composed of Si+1 and Si−1 into L.

  • 12:

    end if

  • 13:

     end for

  • 14:

    Merge collinear line segments in L.