Created
April 25, 2018 11:32
-
-
Save GPSalachs/42a18857ea11804e9bb311218b9bce37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Brick Dimensions | |
brick = brick3D('brick', lx, ly, lz) # lx,ly,lz come input | |
halfbrick = brick3D('brick', lx / 2, ly, lz) | |
bricky = brick3D('halfbrick', ly, lx, lz) | |
# --------------------------------------------# | |
# ------------------FACE 1--------------------# | |
# --------------------------------------------# | |
brick1 = brick | |
brick2 = halfbrick | |
z1 = 0.5 * brick.lz | |
first_blue=[] | |
first_red=[] | |
last_blue = [] | |
last_red = [] | |
for j1 in range(0, Height): | |
y1 = 0 | |
if j1 % 2 == 0: | |
color = 'BLUEx' | |
x1 = 0 | |
# Plain Bricks | |
for i1 in range(0, Base): | |
x1 += 0.5 * brick1.lx | |
body = brick1.rigidBrick(center=[x1, y1, z1], model=mod, material=mat, color=color) | |
bodies += body | |
first_blue.append(body) | |
last_blue.append(body) | |
x1 += 0.5 * brick1.lx + e_joint | |
first_brick = first_blue[-Base] | |
last_brick = last_blue[-2] | |
#point1.append(last_brick) | |
# Half Bricks | |
x1 += 0.5 * bricky.lx | |
body = bricky.rigidBrick(center=[x1, y1 + 0.5 * bricky.ly - 0.5 * brick.ly, z1], model=mod, material=mat,color=color) | |
bodies += body | |
x1 += 0.5 * brick2.lx + e_joint | |
if j1 % 2 != 0: | |
color = 'REDxx' | |
x1 = 0 | |
# Half Bricks | |
x1 += 0.5 * bricky.lx | |
body = bricky.rigidBrick(center=[x1, y1 + 0.5 * bricky.ly - 0.5 * brick.ly, z1], model=mod, material=mat,color=color) | |
bodies += body | |
x1 += 0.5 * bricky.lx + e_joint | |
# Plain Bricks | |
for i1 in range(0, Base): | |
x1 += 0.5 * brick1.lx | |
body = brick1.rigidBrick(center=[x1, y1, z1], model=mod, material=mat, color=color) | |
bodies += body | |
first_red.append(body) | |
last_red.append(body) | |
x1 += 0.5 * brick1.lx + e_joint | |
first_brick = first_red[-Base] | |
last_brick = last_red[-2] | |
#point1.append(last_brick) | |
z1 += brick1.lz + e_joint | |
point1.append(first_brick) | |
point1.append(last_brick) | |
X = x1 - 0.5 * brick.ly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment