PyGGB : frises de "Truchet" par translation

[code]# truchet triangles frises translation 2 6/08/2023[br]from random import*[br]import time[br][br]# background:[br]#A=Point(-100,-100, is_visible=False)[br]#B=Point(100,-100, is_visible=False)[br]#background=Polygon(A,B,4,opacity=1,color=[1,1,1])[br][br]def motif(n,m,t,):[br] for i in range(n):[br] for j in range(m):[br] r=random()[br] col=[(i+j)/(2*n),(i+j)/(2*n)*r,r**2][br] if r<0.25 :[br] l=[Point(i,j,is_visible=False),Point(i+1,j,is_visible=False),Point(i+1,j+1,is_visible=False)][br] s=Polygon(l,color=col,opacity=1,line_thickness=0)[br] for k in range(1,t):[br] l=[Point(i+k*n,j,is_visible=False),Point(i+1+k*n,j,is_visible=False),Point(i+1+k*n,j+1,is_visible=False)][br] s=Polygon(l,color=col,opacity=1,line_thickness=0)[br] elif r<0.5 :[br] l=[Point(i,j,is_visible=False),Point(i,j+1,is_visible=False),Point(i+1,j,is_visible=False)][br] s=Polygon(l,color=col,opacity=1,line_thickness=0)[br] for k in range(1,t):[br] l=[Point(i+k*n,j,is_visible=False),Point(i+k*n,j+1,is_visible=False),Point(i+1+k*n,j,is_visible=False)][br] s=Polygon(l,color=col,opacity=1,line_thickness=0)[br] [br] elif r<0.75 :[br] l=[Point(i+1,j,is_visible=False),Point(i+1,j+1,is_visible=False),Point(i,j+1,is_visible=False)][br] s=Polygon(l,color=col,opacity=1,line_thickness=0)[br] for k in range(1,t):[br] l=[Point(i+1+k*n,j,is_visible=False),Point(i+1+k*n,j+1,is_visible=False),Point(i+k*n,j+1,is_visible=False)][br] s=Polygon(l,color=col,opacity=1,line_thickness=0)[br] [br] else:[br] l=[Point(i,j,is_visible=False),Point(i,j+1,is_visible=False),Point(i+1,j+1,is_visible=False)][br] s=Polygon(l,color=col,opacity=1,line_thickness=0)[br] for k in range(1,t):[br] l=[Point(i+k*n,j,is_visible=False),Point(i+k*n,j+1,is_visible=False),Point(i+1+k*n,j+1,is_visible=False)][br] s=Polygon(l,color=col,opacity=1,line_thickness=0)[br] [br] time.sleep(0.001)[br] [br]motif(5,7,4)[br][/code]
[url=https://geogebra.org/python/index.html?name=++%281%29&code=eJzNll1vgjAUhu%2F7K5p4A9hpYXMuZlzoxa53b4xBLHq0tKatS%2Fz3KwM%2FiIrGr3kIlPQ9lJ73yQnUsFHLeMqMHSESE840xokCbUejIqF5ZEAK%2FN6kH82ABq8oUTLFVhnbAdKFVMZD%2BYgNpAyhGh5F8Xyi5FKMO6jWDb8lCOO8%2BJSSvwsGPfwBDSPOwq%2BIa%2BaiWq%2FIqkzarmuz%2BWoihdMlPfJG5CKKwaxCn8SSSxX2fWKPgYvQmCU4lQYSR5CUGLeDsI1EKgwYRFbHhDmimF5Ls62U7khZqDAv3XFL0%2Fa1Yd%2BB%2BsxtOoEnXLJz7ymiPC8YlB6ABKtP2ghauLx%2BFnap3AwgM7JnAym0un9KteeeXt5FFnrjJS%2Fcs9cdRzkINjRTiOeCaR3ScuFry%2BZby%2FyNzccLq889Ub39czPOK%2FL6QhkvkF1O7PBmq3k%2BgNcNaB0lcZrnPVhlcRheu5reZT1Vzfc5CF7VT6c5P4iiZvfrvedld7Pu%2Bzdy2Y9BQ3PGFg5tUOqX01H%2BgW6RNnnLlV%2Fc83XM][b][size=150]Lien[/size][/b][/url]

Information: PyGGB : frises de "Truchet" par translation