adjust stud group naming

This commit is contained in:
josch 2014-09-11 16:27:47 +02:00
parent 3661b41aeb
commit 45bc48788a
2 changed files with 24 additions and 24 deletions

View file

@ -126,11 +126,11 @@ adc9e9e2ad66af09ee414549e76987d850f9dcb85ced494b58ade3d3cd22626d2557d3947f97b3d2
4f9be83e1b338b9b44efa990ea5e6a81e901e2e7167e21f997355d75addf3d60563e58e86a3105607c53e10d5d4d1e24ba29c96f99c1b3d8cc0be4c080ea756c normalized/92438.dat
35d2fcd5eecbbdcd9d92fd914d580ec654395a3eda1aac8fa9a439def667aedf4471f4fb26f029646db67efe2fcbaf80115b4ef8d3de6b052f8480e53d69d035 normalized/962.dat
2f78671b8e7c7e559309e92bbcd0857d774c79f6351db16976a71988b2417b0c1593fde8d85fa5aece60bdb9e3b4863ba70eedeb8c7a16cc92fb4c61355fd78f normalized/99301.dat
87283de187b204dd610a105b3798cfc5e88c801ebc0fd0675cbb683c234d298b92632147969680eebb02a16aadadf3cbc5d237d9670e3fe0f593fda8d6196fc3 normalized/box.dat
49ae31267dac990546ce5ad3090b02bd4ebd3bb4a9a850b2c358c1331bfc3e66f0ff0a82a6ded96d0776542c02019b0dcc3c32125f5b387f6655e0f2cdb86ec1 normalized/openbox.dat
b6b9d0d0984bb70260375c932a948778ea7b81283cc9fe7e148ba739de91cc19b2dd1a9227063a3aa7b78a5b4bf70544ada7031ac18db65868d9b8aa67e764bc normalized/stud16.dat
bc750a58029944024a8d4a275255ecc3e5a2b0bc7ea234c5e69bcb1cdba43c339aee519b9406d31b9ec3f5a44b9a05cda3cd5047e5b2af60918d22a6b714f978 normalized/stud1.dat
e20a11f57af57490ff94cfac1fcfd85d672b56f423e9fb0979d75566e5c90899bc4dab638d48122c1b3ed62e5539260228c2085a8a13b6948b7d143b646bb71a normalized/stud2.dat
85779608804965ec13dd1be245abaecff5af9d578248930630b0fd3115200b56fa030d9c56d859f93a9e17e2c46a2ccbbef729fe682bf71513d0eb2484e28e60 normalized/stud32.dat
bfa9eb76cb6790cb1d37e73a05e95c921886000867df39f8f91e48cad740547dc8826ab2bfc88878c27bbe43970c2efe5f16d388bcbff425ba84176970fa7e07 normalized/stud4.dat
bff6f39b6c50f4c9a5e1a31c1920fa7bfcd295881bc6e91c39015b4bbe45abba4c56b7921b8d80329b6c0e304658027b7b1431cda85b1f28517de53a45db971a normalized/stud8.dat
87283de187b204dd610a105b3798cfc5e88c801ebc0fd0675cbb683c234d298b92632147969680eebb02a16aadadf3cbc5d237d9670e3fe0f593fda8d6196fc3 normalized/lpg_box.dat
49ae31267dac990546ce5ad3090b02bd4ebd3bb4a9a850b2c358c1331bfc3e66f0ff0a82a6ded96d0776542c02019b0dcc3c32125f5b387f6655e0f2cdb86ec1 normalized/lpg_openbox.dat
b6b9d0d0984bb70260375c932a948778ea7b81283cc9fe7e148ba739de91cc19b2dd1a9227063a3aa7b78a5b4bf70544ada7031ac18db65868d9b8aa67e764bc normalized/stug-16x16.dat
bc750a58029944024a8d4a275255ecc3e5a2b0bc7ea234c5e69bcb1cdba43c339aee519b9406d31b9ec3f5a44b9a05cda3cd5047e5b2af60918d22a6b714f978 normalized/stug-1x1.dat
e20a11f57af57490ff94cfac1fcfd85d672b56f423e9fb0979d75566e5c90899bc4dab638d48122c1b3ed62e5539260228c2085a8a13b6948b7d143b646bb71a normalized/stug-2x2.dat
85779608804965ec13dd1be245abaecff5af9d578248930630b0fd3115200b56fa030d9c56d859f93a9e17e2c46a2ccbbef729fe682bf71513d0eb2484e28e60 normalized/stug-32x32.dat
bfa9eb76cb6790cb1d37e73a05e95c921886000867df39f8f91e48cad740547dc8826ab2bfc88878c27bbe43970c2efe5f16d388bcbff425ba84176970fa7e07 normalized/stug-4x4.dat
bff6f39b6c50f4c9a5e1a31c1920fa7bfcd295881bc6e91c39015b4bbe45abba4c56b7921b8d80329b6c0e304658027b7b1431cda85b1f28517de53a45db971a normalized/stug-8x8.dat

View file

@ -327,14 +327,14 @@ def render_part(part):
if m.group('type') == 'Baseplate':
rects = subdivide((-studsx/2.0,-studsz/2.0,studsx,studsz))
for x,z,s in rects:
files.append(((x+s/2.0)*20, 0, (z+s/2.0)*20,1,0,0,0,1,0,0,0,1,"stud%d.dat"%s))
files.append((-studsx*10,0,-studsz*10,studsx*20,0,0,0,4,0,0,0,studsz*20,"box.dat"))
files.append(((x+s/2.0)*20, 0, (z+s/2.0)*20,1,0,0,0,1,0,0,0,1,"stug-%dx%d.dat"%(s,s)))
files.append((-studsx*10,0,-studsz*10,studsx*20,0,0,0,4,0,0,0,studsz*20,"lpg_box.dat"))
elif m.group('type') in ['Brick', 'Plate'] and m.group('corner'):
for z in [0,1]:
for x in [0,1]:
if z == 0 and x == 0:
continue
files.append((-x*studsx*10+studsx*5, 0, -studsz*z*10+studsz*5,1,0,0,0,1,0,0,0,1,"stud%d.dat"%(studsz/2)))
files.append((-x*studsx*10+studsx*5, 0, -studsz*z*10+studsz*5,1,0,0,0,1,0,0,0,1,"stug-%dx%d.dat"%(studsz/2,studsz/2)))
# create top, bottom, inner and outer rectangles
# draw an L
coords = [(0,0),(1,0),(1,-1),(-1,-1),(-1,1),(0,1)]
@ -371,15 +371,15 @@ def render_part(part):
elif m.group('type') in ['Brick', 'Plate', 'Tile']:
# draw studs
if m.group('centerstud'):
files.append((0,0,0,1,0,0,0,1,0,0,0,1,"stud1.dat"))
files.append((0,0,0,1,0,0,0,1,0,0,0,1,"stug-1x1.dat"))
elif m.group('type') not in ['Slope Brick 31', 'Tile']:
rects = subdivide((-studsx/2.0,-studsz/2.0,studsx,studsz))
for x,z,s in rects:
files.append(((x+s/2.0)*20, 0, (z+s/2.0)*20,1,0,0,0,1,0,0,0,1,"stud%d.dat"%s))
files.append(((x+s/2.0)*20, 0, (z+s/2.0)*20,1,0,0,0,1,0,0,0,1,"stug-%dx%d.dat"%(s,s)))
# outer box
files.append((-studsx*10,0,-studsz*10,studsx*20,0,0,0,height,0,0,0,studsz*20,"openbox.dat"))
files.append((-studsx*10,0,-studsz*10,studsx*20,0,0,0,height,0,0,0,studsz*20,"lpg_openbox.dat"))
# inner box
files.append((-studsx*10+4,4,-studsz*10+4,studsx*20-8,0,0,0,height-4,0,0,0,studsz*20-8,"openbox.dat"))
files.append((-studsx*10+4,4,-studsz*10+4,studsx*20-8,0,0,0,height-4,0,0,0,studsz*20-8,"lpg_openbox.dat"))
# write out bottom with trapezoids
coords = [(1,1),(1,-1),(-1,-1),(-1,1)]
outerbottomcoords = [(studsx*10*x, height, studsz*10*z) for x,z in coords]
@ -530,17 +530,17 @@ def render_part(part):
if m.group('slope') in ['Inverted', 'Inverted Double Convex']:
rects = subdivide((-studsx/2.0,-studsz/2.0,studsx,studsz))
for x,z,s in rects:
files.append(((x+s/2.0)*20, 0, (z+s/2.0)*20,1,0,0,0,1,0,0,0,1,"stud%d.dat"%s))
files.append(((x+s/2.0)*20, 0, (z+s/2.0)*20,1,0,0,0,1,0,0,0,1,"stug-%dx%d.dat"%(s,s)))
elif m.group('slope') == 'Double Convex':
files.append((-10*(studsx-1), 0, 10*(studsz-1),1,0,0,0,1,0,0,0,1,"stud1.dat"))
files.append((-10*(studsx-1), 0, 10*(studsz-1),1,0,0,0,1,0,0,0,1,"stug-1x1.dat"))
elif m.group('slope') == 'Double Concave':
for z in range(studsz):
for x in range(studsx):
if z == 0 or x == studsx-1:
files.append(((studsx/2.0 - x)*20 - 10, 0, (studsz/2.0 - z)*20 - 10,1,0,0,0,1,0,0,0,1,"stud1.dat"))
files.append(((studsx/2.0 - x)*20 - 10, 0, (studsz/2.0 - z)*20 - 10,1,0,0,0,1,0,0,0,1,"stug-1x1.dat"))
else:
for x in range(studsx):
files.append(((studsx/2.0 - x)*20 - 10, 0, 10*(studsz-1),1,0,0,0,1,0,0,0,1,"stud1.dat"))
files.append(((studsx/2.0 - x)*20 - 10, 0, 10*(studsz-1),1,0,0,0,1,0,0,0,1,"stug-1x1.dat"))
###################################################
# create top, bottom, inner and outer rectangles #
###################################################
@ -746,16 +746,16 @@ def render_part(part):
if __name__ == "__main__":
lines, triangles, quads = drawstud()
write_file("parts/stud1.dat", [], [], lines, triangles, quads)
write_file("parts/stug-1x1.dat", [], [], lines, triangles, quads)
for s in [2,4,8,16,32]:
files = list()
for z in range(2):
for x in range(2):
files.append((s*(5 - x*10), 0, s*(5 - z*10),1,0,0,0,1,0,0,0,1,"stud%d.dat"%(s/2)))
write_file("parts/stud%d.dat"%s, [], files, [], [], [])
files.append((s*(5 - x*10), 0, s*(5 - z*10),1,0,0,0,1,0,0,0,1,"stug-%dx%d.dat"%(s/2,s/2)))
write_file("parts/stug-%dx%d.dat"%(s,s), [], files, [], [], [])
lines, triangles, quads = drawbox()
write_file("parts/box.dat", [], [], lines, triangles, quads)
write_file("parts/lpg_box.dat", [], [], lines, triangles, quads)
lines, triangles, quads = drawopenbox()
write_file("parts/openbox.dat", [], [], lines, triangles, quads)
write_file("parts/lpg_openbox.dat", [], [], lines, triangles, quads)
for part in parts:
render_part(part)