Rectification des fichiers et de la version pour le CTAN
[delaunay.git] / luamesh-polygon.lua
index 2c14268..fd8a228 100644 (file)
@@ -55,7 +55,13 @@ function doIntersect(p1,q1,p2,q2)
 end
 
 -- Returns true if the point p lies inside the polygon[] with n vertices
-function isInside(listPoints,p)
+function isInside(listPoints,p,h)
+   -- if the point is to close to a point of the polygon
+   for i=1,#listPoints do
+      if(math.sqrt(math.pow(p.x-listPoints[i].x,2) + math.pow(p.y-listPoints[i].y,2))<0.4*h) then
+         return false
+      end
+   end
    -- There must be at least 3 vertices in polygon[]
    if (#listPoints <= 3)  then return false end
    -- Create a point for line segment from p to infinite

Licence Creative Commons Les fichiers de Syracuse sont mis à disposition (sauf mention contraire) selon les termes de la
Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International.