PyGGB (test): #truchet patchwork

# truchet patchwork 10/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]#vert rgb(70, 144, 118)[br]#rosef rgb(212, 98, 157)[br]#rosec rgb(237, 160, 203)[br]#bleu rgb(94, 111, 166)[br]#orange rgb(171, 61, 40)[br]#jaune rgb(207, 154, 68)[br]#vert 2 rgb(211, 194, 150)[br][br]lcol=[[70/255, 144/255, 118/255],[212/255, 98/255, 157/255],[237/255, 160/255, 203/255],[94/255, 111/255, 166/255],[171/255, 61/255, 40/255],[207/255, 154/255, 68/255],[211/255, 194/255, 150/255],[0,0,0],[0,0,0]][br][br]def motif(n,m):[br] for i in range(n):[br] for j in range(m):[br] r=random()[br] col=choice(lcol)[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] col=choice(lcol)[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] col=choice(lcol)[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] col=choice(lcol)[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] 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] col=choice(lcol)[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] col=choice(lcol)[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] col=choice(lcol)[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] 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] col=choice(lcol)[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] col=choice(lcol)[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] col=choice(lcol)[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] 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] col=choice(lcol)[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] col=choice(lcol)[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] col=choice(lcol)[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] time.sleep(0.001)[br] [br]motif(10,7)
[size=150][b][url=https://geogebra.org/python?name=&code=eJzNV8Fu4jAQvfsrLPWS7BqwA0mg2hzaw573jlAVggFDiJETuurf79hxYFm2TkWhkCi2Nc8znvHM0ygPuFK7bMkrvE2rbPlbqjVmtEeHvYAGfTRXcoNVWsxgEputVNU3VM%2B4EhuO0AOeptl6oeSumD2ip%2BSXFEXldRilxAxYlC%2BvohTTnCc%2F07zkPnq2m1x7DkZhc%2F62kIX3RJ7JgMhtmonqLWEkk7lUyZgReCc%2Benjl4JRaTL0YLLLBAAY2BLmSJZ8bIGABwaMhAGFsgawG%2BjEII9ALaB8QcGRngJGxwjQYgVzCTSy4QVgM0gi%2BAQVgle6KWh5QbSoEvUgfbpwK7OnajrEYgg7KIYBkPI5pLwhD47FdMLj7MJyQMfhbi0ZGYvxuoL5ZGa%2FrBXhusdHeEGv2RBYCr2tRZOeB0dYGaWMwtOrRwY3Gzt5y2KhRAu9%2BniA0g7veyErMvYJs%2FEeE4ZlLhQUWhS6kBfcKK26g1QFqNJpHJXXtef6RWN9ctpQi456%2BxWNQQLJ%2F0G4Q4mNb%2BoELr2tPkBU5qTpise%2BsDYXvBJ%2BcnFbuaze31QrjXxWci4K%2FVEuRrQtelgkUxb8WnIEeBdRxRdTRXvsf2HB%2FcQnSceeiDfYgKP%2FeooJsOfy22fjAji8KjueWVOdz6v%2B15WbczXPkSIA7oPcJd89sereeWuh28zy5mNIalYNtV%2BNR7CbSeQ3ITbUbJ%2BkzHaiFczem1Pk9qJV3d5Gz89tQOwUvT7CSX69DXan4ML5tl7pebj4V2QV61X3S6kL96svSpn%2F0u2XO%2BdajXUrZcWyo%2FttjlMT%2BHzFYrDA%3D&autorun=false]Lien[/url][/b][/size]

Information: PyGGB (test): #truchet patchwork