diff transformations/Rature.py @ 63:7949f46b03e0

Bug a propos de complexity=0 corrige
author SylvainPL <sylvain.pannetier.lebeuf@umontreal.ca>
date Tue, 09 Feb 2010 11:43:09 -0500
parents fd02fd7e6557
children 9e5463ebd044
line wrap: on
line diff
--- a/transformations/Rature.py	Tue Feb 09 11:41:17 2010 -0500
+++ b/transformations/Rature.py	Tue Feb 09 11:43:09 2010 -0500
@@ -45,10 +45,14 @@
             self.orientation=1
         else:
             self.orientation=2
-            
-        self.largeur=min(32,max(1,int(numpy.ceil(complexity*5)*numpy.random.normal(1,float(complexity)/2))))
-        self.clarte=min(1,max(0,complexity*numpy.random.normal(1,float(complexity)/2)))
-        self.faire=numpy.random.binomial(1,float(complexity))
+        if float(complexity) > 0:    
+            self.largeur=min(32,max(1,int(numpy.ceil(complexity*5)*numpy.random.normal(1,float(complexity)/2))))
+            self.clarte=min(1,max(0,complexity*numpy.random.normal(1,float(complexity)/2)))
+            self.faire=numpy.random.binomial(1,float(complexity))
+        else:
+            self.largeur=0
+            self.clarte=0
+            self.faire=0    #On ne fait rien !!!
         
         return self._get_current_parameters()