lib/geom/ear_trim.rb in floorplanner-fml-0.2 vs lib/geom/ear_trim.rb in floorplanner-fml-0.2.1

- old
+ new

@@ -1,6 +1,6 @@ -# +# # Implements "Ear trimming" triangulation algorithm # module Geom class EarTrim def self.triangulate(poly) @@ -19,10 +19,10 @@ while num > 2 return nil if count > num*2 # overflow count += 1 i = 0 - while i < num + while i < num j = (i+num-1) % num k = (i+1) % num if is_ear(points,j,i,k) # save triangle