Skip to content

Instantly share code, notes, and snippets.

@fox3000foxy
Last active October 7, 2022 08:00
Show Gist options
  • Save fox3000foxy/48a2d27fc65b65b9993600c4b46bffb6 to your computer and use it in GitHub Desktop.
Save fox3000foxy/48a2d27fc65b65b9993600c4b46bffb6 to your computer and use it in GitHub Desktop.
project
# This comment was added automatically to allow this file to save.
# You'll be able to remove it after adding text to the file.
from math import *
from kandinsky import *
from time import *
from kandinsky import fill_rect as fl
from kandinsky import draw_line as dl
p=[200,200,-100,-100,30,10]
def cube(x,y,a,b,z,z_,d=None):
if d==1:_z=[x+z,y-z_]
elif d==2:_z=[x-z,y-z_]
elif d==3:_z=[x-z,y+z_]
else: _z=[x+z,y+z_]
#carré
dl(x,y,x+a,y,(0,0,0))
dl(x,y,x,y+b,(0,0,0))
dl(x+a,y,x+a,y+b,(0,0,0))
dl(x,y+b,x+a,y+b,(0,0,0))
#z
dl(x,y,_z[0],_z[1],(0,0,0))
dl(x+a,y,_z[0]+a,_z[1],(0,0,0))
dl(x,y+b,_z[0],_z[1]+b,(0,0,0))
dl(x+a,y+b,_z[0]+a,_z[1]+b,(0,0,0))
#carré derrière
dl(_z[0],_z[1],_z[0],_z[1]+b,(0,0,0))
dl(_z[0],_z[1],_z[0]+a,_z[1],(0,0,0))
dl(_z[0]+a,_z[1],_z[0]+a,_z[1]+b,(0,0,0))
dl(_z[0],_z[1]+b,_z[0]+a,_z[1]+b,(0,0,0))
#print("x={} y={} a={} b={} z={} _z={}".format(x,y,a,b,z,_z))
cube(10,10,100,100,25,50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment