kulits commited on
Commit
feecb33
·
verified ·
1 Parent(s): c7f9487

Add BrickWright

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. README.md +1 -0
  2. brickwright/alt/alt-001/build.py +99 -0
  3. brickwright/alt/alt-001/hero-1024.avif +0 -0
  4. brickwright/alt/alt-001/model.mpd +74 -0
  5. brickwright/alt/alt-001/thumb-512.avif +0 -0
  6. brickwright/alt/alt-001/trace.jsonl.gz +3 -0
  7. brickwright/alt/alt-001/view-0.avif +0 -0
  8. brickwright/alt/alt-001/view-1.avif +0 -0
  9. brickwright/alt/alt-001/view-2.avif +0 -0
  10. brickwright/alt/alt-001/view-3.avif +0 -0
  11. brickwright/alt/alt-001/view-4.avif +0 -0
  12. brickwright/alt/alt-001/view-5.avif +0 -0
  13. brickwright/alt/alt-001/view-6.avif +0 -0
  14. brickwright/alt/alt-001/view-7.avif +0 -0
  15. brickwright/alt/alt-002/build.py +97 -0
  16. brickwright/alt/alt-002/hero-1024.avif +0 -0
  17. brickwright/alt/alt-002/model.mpd +105 -0
  18. brickwright/alt/alt-002/thumb-512.avif +0 -0
  19. brickwright/alt/alt-002/trace.jsonl.gz +3 -0
  20. brickwright/alt/alt-002/view-0.avif +0 -0
  21. brickwright/alt/alt-002/view-1.avif +0 -0
  22. brickwright/alt/alt-002/view-2.avif +0 -0
  23. brickwright/alt/alt-002/view-3.avif +0 -0
  24. brickwright/alt/alt-002/view-4.avif +0 -0
  25. brickwright/alt/alt-002/view-5.avif +0 -0
  26. brickwright/alt/alt-002/view-6.avif +0 -0
  27. brickwright/alt/alt-002/view-7.avif +0 -0
  28. brickwright/alt/alt-003/build.py +108 -0
  29. brickwright/alt/alt-003/hero-1024.avif +0 -0
  30. brickwright/alt/alt-003/model.mpd +99 -0
  31. brickwright/alt/alt-003/thumb-512.avif +0 -0
  32. brickwright/alt/alt-003/trace.jsonl.gz +3 -0
  33. brickwright/alt/alt-003/view-0.avif +0 -0
  34. brickwright/alt/alt-003/view-1.avif +0 -0
  35. brickwright/alt/alt-003/view-2.avif +0 -0
  36. brickwright/alt/alt-003/view-3.avif +0 -0
  37. brickwright/alt/alt-003/view-4.avif +0 -0
  38. brickwright/alt/alt-003/view-5.avif +0 -0
  39. brickwright/alt/alt-003/view-6.avif +0 -0
  40. brickwright/alt/alt-003/view-7.avif +0 -0
  41. brickwright/alt/alt-004/build.py +84 -0
  42. brickwright/alt/alt-004/hero-1024.avif +0 -0
  43. brickwright/alt/alt-004/model.mpd +73 -0
  44. brickwright/alt/alt-004/thumb-512.avif +0 -0
  45. brickwright/alt/alt-004/trace.jsonl.gz +3 -0
  46. brickwright/alt/alt-004/view-0.avif +0 -0
  47. brickwright/alt/alt-004/view-1.avif +0 -0
  48. brickwright/alt/alt-004/view-2.avif +0 -0
  49. brickwright/alt/alt-004/view-3.avif +0 -0
  50. brickwright/alt/alt-004/view-4.avif +0 -0
README.md CHANGED
@@ -48,6 +48,7 @@ samples.parquet one row per build: model, split, task, verdi
48
  | `glm` | GLM 5.3 Flash |
49
  | `bricknet` | BrickNet-14B |
50
  | `brickgpt` | BrickGPT |
 
51
 
52
  ## Citation
53
  ```bibtex
 
48
  | `glm` | GLM 5.3 Flash |
49
  | `bricknet` | BrickNet-14B |
50
  | `brickgpt` | BrickGPT |
51
+ | `brickwright` | BrickWright (GPT-6 Astra) |
52
 
53
  ## Citation
54
  ```bibtex
brickwright/alt/alt-001/build.py ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ from collections import Counter
3
+ import bricklayer as bl
4
+ from brickwright import TestContext
5
+
6
+
7
+ def create_build():
8
+ b = bl.LegoBuild()
9
+ def add(pid, color, x,y,z, rot=bl.Rotation.DEG_0, name=None):
10
+ return b.add(bl.Element(pid,getattr(bl.Color,color)),(x,y,z),rotation=rot,name=name)
11
+ add('91405','BRIGHT_GREEN',0,0,0,name='grass')
12
+ # The long low foot and upturned tail of the snail.
13
+ add('3001','LIME',8,7,1/3)
14
+ add('3001','LIME',12,7,1/3)
15
+ add('3001','LIME',8,9,1/3)
16
+ add('3001','LIME',12,9,1/3)
17
+ add('3003','LIME',6,7,1/3)
18
+ add('3003','LIME',6,9,1/3)
19
+ add('3001','LIME',6,7,4/3,bl.Rotation.DEG_90,name='snail_head')
20
+ add('3001','LIME',6,7,7/3,bl.Rotation.DEG_90)
21
+ # A broad upright shell, with an uninterrupted dark-red square spiral.
22
+ rows = ['..OOOO..','.DDDDDD.','OOOOOODO','ODDDDODO','ODOODODO','.DDDDDD.','..OOOO..']
23
+ stock = {'O':Counter({4:2,2:4,1:12}), 'D':Counter({6:2,2:4,1:4})}
24
+ ids = {4:'3001',2:'3003',1:'3004',6:'2456'}
25
+ for row, line in enumerate(rows):
26
+ i=0
27
+ while i<8:
28
+ c=line[i]
29
+ if c=='.': i+=1; continue
30
+ end=i+1
31
+ while end<8 and line[end]==c: end+=1
32
+ while i<end:
33
+ widths=[w for w in stock[c] if w<=end-i and stock[c][w]>0]
34
+ if widths:
35
+ w=max(widths); stock[c][w]-=1
36
+ add(ids[w], 'ORANGE' if c=='O' else 'DARK_RED',8+i,8,4/3+row+(1/3 if row>=5 else 0),bl.Rotation.DEG_90 if w==1 else bl.Rotation.DEG_0,name=f'shell_{row}_{i}')
37
+ else:
38
+ w=1
39
+ for y in (8,9): add('3005','DARK_RED',8+i,y,4/3+row+(1/3 if row>=5 else 0),name=f'shell_{row}_{i}_{y}')
40
+ i+=w
41
+ # Two shell plates lock the narrow outer spiral to the overlying crown.
42
+ for x in (8,12): add('3020','TAN',x,8,19/3,name=f'shell_bridge_{x}')
43
+ # The two long raised eye stalks face the opponent, not the viewer.
44
+ for y in (7,10):
45
+ for h in range(4): add('3005','LIME',6,y,10/3+h,name=f'stalk_{y}_{h}')
46
+ eye=add('47905','BLACK',6,y,22/3,bl.Rotation.DEG_270,name=f'eye_mount_{y}')
47
+ tile=bl.Element('98138p07',bl.Color.WHITE)
48
+ b.connect(tile,'antistud',to=eye.find_connector('stud',facing=bl.Direction.RIGHT),name=f'eye_{y}')
49
+ # Knight is built in a local frame, facing forward, then turned toward snail.
50
+ k=bl.LegoBuild()
51
+ def ka(pid,color,x,y,z,name=None):
52
+ return k.add(bl.Element(pid,getattr(bl.Color,color)),(x,y,z),name=name)
53
+ k.add(bl.Element('3004',bl.Color.LIGHT_BLUISH_GRAY),(0,0,0),rotation=bl.Rotation.DEG_90,name='right_boot')
54
+ k.add(bl.Element('3004',bl.Color.LIGHT_BLUISH_GRAY),(2,0,0),rotation=bl.Rotation.DEG_90,name='left_boot')
55
+ ka('3002','BLUE',0,0,1,'cuirass')
56
+ arm=ka('30414','BLUE',-1,0,2,'shoulders')
57
+ ka('3005','LIGHT_BLUISH_GRAY',0,0,3,'helmet_side')
58
+ head=ka('47905','BLACK',1,0,3,'helmet_mount')
59
+ visor=bl.Element('3069b',bl.Color.WHITE)
60
+ k.connect(visor,visor.find_connector('antistud',toward=bl.Direction.LEFT),to=head.find_connector('stud',facing=bl.Direction.FRONT),name='visor')
61
+ # Lance in the outer hand, held horizontally toward the snail.
62
+ hand=k.add(bl.Element('61252',bl.Color.LIGHT_BLUISH_GRAY),(-1,0,3),rotation=bl.Rotation.DEG_270,name='lance_hand')
63
+ lance=bl.Element('3957b',bl.Color.LIGHT_BLUISH_GRAY)
64
+ k.connect(lance,'bar',to=hand.find_connector('clip'),target_rotation=bl.rotation_about(bl.Vec3(1,0,0),90),mounting=bl.Mounting(offset=1.5),name='lance')
65
+ # Vertical shield on the other arm, studded back with a raised round boss.
66
+ shield=bl.Element('11212',bl.Color.DARK_BLUISH_GRAY)
67
+ shieldp=k.connect(shield,shield.find_connector('antistud',toward=bl.Position(1,1,0)),to=arm.find_connector('stud',facing=bl.Direction.FRONT,toward=bl.Direction.LEFT),name='shield')
68
+ boss=bl.Element('14769',bl.Color.DARK_BLUISH_GRAY)
69
+ k.connect(boss,boss.find_connector('antistud',toward=bl.Direction.RIGHT),to=shieldp.find_connector('stud',toward=shieldp.center),name='shield_boss')
70
+ ka('3023b','DARK_AZURE',0,0,4,'helmet_crown')
71
+ b.add(k,(1,5,1/3),rotation=bl.Rotation.DEG_90,name='knight')
72
+ # Sparse tufts and little yellow flowers keep the central confrontation clear.
73
+ for i,(x,y) in enumerate([(2,2),(12,3),(3,12)]):
74
+ add('4727','BRIGHT_GREEN',x,y,1/3,name=f'leaves_{i}')
75
+ for x,y in [(1,12),(14,2)]:
76
+ add('98262','YELLOW',x,y,1/3)
77
+ for x,y in [(8,2),(11,12),(5,12),(0,9)]:
78
+ add('3039','GREEN',x,y,1/3)
79
+ return b
80
+
81
+
82
+ def run_tests():
83
+ b=create_build()
84
+ tests=TestContext(b)
85
+ tests.check_no_floating()
86
+ tests.check_no_collisions()
87
+ tests.check_connected(expected_components=1)
88
+ available=json.load(open('/inputs/parts.json'))
89
+ used=Counter((p.content.ldraw_id,p.content.color.name) for p in b.flattened_placements)
90
+ over=[(pid,c,n,available.get(pid,{}).get(c,0)) for (pid,c),n in used.items() if n>available.get(pid,{}).get(c,0)]
91
+ tests.check('Inventory quantities and colors',not over,str(over))
92
+ tests.check('Two raised eyes',all(f'eye_{y}' in b.names for y in (7,10)))
93
+ tests.check('Large spiral shell',sum(n for (pid,c),n in used.items() if c=='DARK_RED')>=10)
94
+ knight=b.named('knight')
95
+ snail_top=max(p.bounding_box[1].z for name,p in b.names.items() if name.startswith(('shell_','eye_')))
96
+ ratio=(snail_top-1/3)/knight.height
97
+ tests.check('Snail approximately twice knight height',1.8<=ratio<=2.2,f'Height ratio {ratio:.2f}')
98
+ tests.check('Shield and forward-pointing lance',all(n in knight.content.names for n in ('shield','shield_boss','lance')))
99
+ return tests.report()
brickwright/alt/alt-001/hero-1024.avif ADDED
brickwright/alt/alt-001/model.mpd ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 0 FILE main.ldr
2
+ 0 main
3
+ 0 Name: main
4
+ 1 10 160 -8 160 1 0 0 0 1 0 0 0 1 91405.dat
5
+ 1 27 200 -32 160 1 0 0 0 1 0 0 0 1 3001.dat
6
+ 1 27 280 -32 160 1 0 0 0 1 0 0 0 1 3001.dat
7
+ 1 27 200 -32 200 1 0 0 0 1 0 0 0 1 3001.dat
8
+ 1 27 280 -32 200 1 0 0 0 1 0 0 0 1 3001.dat
9
+ 1 27 140 -32 160 1 0 0 0 1 0 0 0 1 3003.dat
10
+ 1 27 140 -32 200 1 0 0 0 1 0 0 0 1 3003.dat
11
+ 1 27 140 -56 180 0 0 -1 0 1 0 1 0 0 3001.dat
12
+ 1 27 140 -80 180 0 0 -1 0 1 0 1 0 0 3001.dat
13
+ 1 25 240 -56 180 1 0 0 0 1 0 0 0 1 3001.dat
14
+ 1 320 240 -80 180 1 0 0 0 1 0 0 0 1 2456.dat
15
+ 1 25 200 -104 180 1 0 0 0 1 0 0 0 1 3001.dat
16
+ 1 25 260 -104 180 1 0 0 0 1 0 0 0 1 3003.dat
17
+ 1 320 290 -104 180 0 0 -1 0 1 0 1 0 0 3004.dat
18
+ 1 25 310 -104 180 0 0 -1 0 1 0 1 0 0 3004.dat
19
+ 1 25 170 -128 180 0 0 -1 0 1 0 1 0 0 3004.dat
20
+ 1 320 200 -128 180 1 0 0 0 1 0 0 0 1 3003.dat
21
+ 1 320 240 -128 180 1 0 0 0 1 0 0 0 1 3003.dat
22
+ 1 25 270 -128 180 0 0 -1 0 1 0 1 0 0 3004.dat
23
+ 1 320 290 -128 180 0 0 -1 0 1 0 1 0 0 3004.dat
24
+ 1 25 310 -128 180 0 0 -1 0 1 0 1 0 0 3004.dat
25
+ 1 25 170 -152 180 0 0 -1 0 1 0 1 0 0 3004.dat
26
+ 1 320 190 -152 180 0 0 -1 0 1 0 1 0 0 3004.dat
27
+ 1 25 220 -152 180 1 0 0 0 1 0 0 0 1 3003.dat
28
+ 1 320 250 -152 180 0 0 -1 0 1 0 1 0 0 3004.dat
29
+ 1 25 270 -152 180 0 0 -1 0 1 0 1 0 0 3004.dat
30
+ 1 320 290 -152 170 1 0 0 0 1 0 0 0 1 3005.dat
31
+ 1 320 290 -152 190 1 0 0 0 1 0 0 0 1 3005.dat
32
+ 1 25 310 -152 180 0 0 -1 0 1 0 1 0 0 3004.dat
33
+ 1 320 240 -184 180 1 0 0 0 1 0 0 0 1 2456.dat
34
+ 1 25 220 -208 180 1 0 0 0 1 0 0 0 1 3003.dat
35
+ 1 25 260 -208 180 1 0 0 0 1 0 0 0 1 3003.dat
36
+ 1 19 200 -160 180 1 0 0 0 1 0 0 0 1 3020.dat
37
+ 1 19 280 -160 180 1 0 0 0 1 0 0 0 1 3020.dat
38
+ 1 27 130 -104 150 1 0 0 0 1 0 0 0 1 3005.dat
39
+ 1 27 130 -128 150 1 0 0 0 1 0 0 0 1 3005.dat
40
+ 1 27 130 -152 150 1 0 0 0 1 0 0 0 1 3005.dat
41
+ 1 27 130 -176 150 1 0 0 0 1 0 0 0 1 3005.dat
42
+ 1 0 130 -200 150 0 0 1 0 1 0 -1 0 0 47905.dat
43
+ 1 15 112 -190 150 0 1 0 0 0 -1 -1 0 0 98138p07.dat
44
+ 1 27 130 -104 210 1 0 0 0 1 0 0 0 1 3005.dat
45
+ 1 27 130 -128 210 1 0 0 0 1 0 0 0 1 3005.dat
46
+ 1 27 130 -152 210 1 0 0 0 1 0 0 0 1 3005.dat
47
+ 1 27 130 -176 210 1 0 0 0 1 0 0 0 1 3005.dat
48
+ 1 0 130 -200 210 0 0 1 0 1 0 -1 0 0 47905.dat
49
+ 1 15 112 -190 210 0 1 0 0 0 -1 -1 0 0 98138p07.dat
50
+ 1 16 60 -8 120 0 0 -1 0 1 0 1 0 0 knight.ldr
51
+ 1 10 50 -32 50 1 0 0 0 1 0 0 0 1 4727.dat
52
+ 1 10 250 -32 70 1 0 0 0 1 0 0 0 1 4727.dat
53
+ 1 10 70 -32 250 1 0 0 0 1 0 0 0 1 4727.dat
54
+ 1 14 30 -32 250 1 0 0 0 1 0 0 0 1 98262.dat
55
+ 1 14 290 -32 50 1 0 0 0 1 0 0 0 1 98262.dat
56
+ 1 2 180 -32 70 1 0 0 0 1 0 0 0 1 3039.dat
57
+ 1 2 240 -32 270 1 0 0 0 1 0 0 0 1 3039.dat
58
+ 1 2 120 -32 270 1 0 0 0 1 0 0 0 1 3039.dat
59
+ 1 2 20 -32 210 1 0 0 0 1 0 0 0 1 3039.dat
60
+ 0 FILE knight.ldr
61
+ 0 knight
62
+ 0 Name: knight
63
+ 1 71 10 -24 20 0 0 -1 0 1 0 1 0 0 3004.dat
64
+ 1 71 50 -24 20 0 0 -1 0 1 0 1 0 0 3004.dat
65
+ 1 1 30 -48 20 1 0 0 0 1 0 0 0 1 3002.dat
66
+ 1 1 20 -72 10 1 0 0 0 1 0 0 0 1 30414.dat
67
+ 1 71 10 -96 10 1 0 0 0 1 0 0 0 1 3005.dat
68
+ 1 0 30 -96 10 1 0 0 0 1 0 0 0 1 47905.dat
69
+ 1 15 20 -86 -8 1 0 0 0 0 -1 0 1 0 3069b.dat
70
+ 1 71 -10 -80 10 0 0 1 0 1 0 -1 0 0 61252.dat
71
+ 1 71 -30 -78 25.5 1 0 0 0 0 -1 0 1 0 3957b.dat
72
+ 1 72 30 -42 -8 1 0 0 0 0 -1 0 1 0 11212.dat
73
+ 1 72 40 -52 -16 1 0 0 0 0 -1 0 1 0 14769.dat
74
+ 1 321 20 -104 10 1 0 0 0 1 0 0 0 1 3023b.dat
brickwright/alt/alt-001/thumb-512.avif ADDED
brickwright/alt/alt-001/trace.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99a7b42c21fcafa2f4872b756d81bd3902390590bbae0a139fa8664464c2fed2
3
+ size 8225
brickwright/alt/alt-001/view-0.avif ADDED
brickwright/alt/alt-001/view-1.avif ADDED
brickwright/alt/alt-001/view-2.avif ADDED
brickwright/alt/alt-001/view-3.avif ADDED
brickwright/alt/alt-001/view-4.avif ADDED
brickwright/alt/alt-001/view-5.avif ADDED
brickwright/alt/alt-001/view-6.avif ADDED
brickwright/alt/alt-001/view-7.avif ADDED
brickwright/alt/alt-002/build.py ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import bricklayer as bl
3
+ from brickwright import TestContext
4
+
5
+ COLORS = ['RED','YELLOW','LIME','MEDIUM_AZURE','BLUE','DARK_AZURE','DARK_PURPLE','BRIGHT_PINK']
6
+
7
+ def create_build():
8
+ b = bl.LegoBuild()
9
+ def add(pid,c,x,y,z,name=None,rot=bl.Rotation.DEG_0):
10
+ return b.add(bl.Element(pid,getattr(bl.Color,c)),(x,y,z),rotation=rot,name=name)
11
+ add('91405','BRIGHT_GREEN',0,0,0,'floor')
12
+ # Four substantial feet and a dark carved wooden bedstead.
13
+ for x in (3,11):
14
+ for y in (7,11):
15
+ add('3003','DARK_RED',x,y,1/3)
16
+ # Bed frame is ten studs long, six deep.
17
+ for y in (7,9,11):
18
+ add('3002','REDDISH_BROWN',3,y,4/3,rot=bl.Rotation.DEG_0)
19
+ add('3001','DARK_TAN',6,y,4/3)
20
+ add('3002','BLACK',10,y,4/3)
21
+ # A recessed open channel exposes the small green pea below the first mattress.
22
+ add('2456','DARK_RED',4,9,7/3)
23
+ add('2456','DARK_RED',6,11,7/3)
24
+ add('3003','MEDIUM_NOUGAT',4,11,7/3)
25
+ add('3004','DARK_RED',10,9,7/3)
26
+ add('33291','BRIGHT_GREEN',10,7,7/3,'pea')
27
+ add('3710','TAN',5,7,7/3,'frame_tie')
28
+ add('33291','BRIGHT_GREEN',10,7,8/3)
29
+ add('33291','BRIGHT_GREEN',10,7,3)
30
+ # Eight continuous, full-width mattresses; alternating bond locks the stack.
31
+ for level,c in enumerate(COLORS):
32
+ z=10/3+level
33
+ if level%2==0:
34
+ for x in (4,8):
35
+ for y in (7,9): add('3001',c,x,y,z,f'mattress_{level}_{x}_{y}')
36
+ else:
37
+ for x in (4,6,8,10):
38
+ add('3001',c,x,7,z,f'mattress_{level}_{x}',bl.Rotation.DEG_90)
39
+ # White spindle head and foot boards with yellow finials.
40
+ for x in (3,12):
41
+ add('15332','WHITE',x,8,7/3,rot=bl.Rotation.DEG_90)
42
+ for y in (7,12):
43
+ add('3005','WHITE',x,y,7/3)
44
+ add('3062b','DARK_ORANGE',x,y,10/3)
45
+ add('6141','REDDISH_BROWN',x,y,13/3) if y==7 else add('6141','DARK_PURPLE',x,y,13/3)
46
+ # Reclining princess: white pillow, golden hair, tan face, closed eyes,
47
+ # a pink gown and two small hands. Her crown is at the head of the bed.
48
+ add('3004','WHITE',9,8,34/3,'pillow')
49
+ add('3004','WHITE',9,9,34/3)
50
+ add('3004','WHITE',11,8,34/3,rot=bl.Rotation.DEG_90)
51
+ add('3003','YELLOW',9,8,37/3,'hair')
52
+ add('3022','TAN',9,8,40/3,'face')
53
+ add('98138p0c','WHITE',9,8,41/3,'closed_eye_1')
54
+ add('98138p0c','WHITE',9,9,41/3,'closed_eye_2')
55
+ add('3004','BRIGHT_LIGHT_YELLOW',11,8,37/3,'crown_band',bl.Rotation.DEG_90)
56
+ for y in (8,9): add('6141','TRANS_ORANGE',11,y,40/3)
57
+ add('3003','BRIGHT_PINK',7,8,34/3,'bodice')
58
+ add('3039','MAGENTA',4,7,34/3,'gown_front')
59
+ add('3040b','MAGENTA',6,7,34/3)
60
+ add('3039','MAGENTA',4,9,34/3,'gown_back',bl.Rotation.DEG_180)
61
+ add('3040b','MAGENTA',6,9,34/3,rot=bl.Rotation.DEG_180)
62
+ add('3004','TAN',7,7,34/3,'hand_front')
63
+ add('3004','TAN',7,10,34/3,'hand_back')
64
+ # Ladder: two continuous rails joined by six rungs, on a locked hinge.
65
+ ladder=bl.LegoBuild()
66
+ hinge=ladder.add(bl.Element('60471',bl.Color.BLACK),(1,0,0),name='hinge')
67
+ for y in (0,3,6,9,12):
68
+ color=bl.Color.BLUE if y<12 else bl.Color.TAN
69
+ ladder.add(bl.Element('3710',color),(0,y,1/3))
70
+ for x in (0,3):
71
+ ladder.add(bl.Element('3460',bl.Color.MEDIUM_AZURE),(x,0,2/3),rotation=bl.Rotation.DEG_90)
72
+ ladder.add(bl.Element('3666',bl.Color.MEDIUM_AZURE),(x,8,2/3),rotation=bl.Rotation.DEG_90)
73
+ ladder.add(bl.Element('3023b',bl.Color.DARK_AZURE),(x,7,1),rotation=bl.Rotation.DEG_90)
74
+ socket=add('92582','BLACK',5,1,1/3,'ladder_foot',bl.Rotation.DEG_90)
75
+ b.connect(ladder,hinge.find_connector('hinge_2_on'),to=socket.find_connector('hinge_2_in'),target_rotation=bl.rotation_about(bl.Vec3(1,0,0),72),name='leaning_ladder')
76
+ return b
77
+
78
+ def run_tests():
79
+ b=create_build()
80
+ t=TestContext(b)
81
+ t.check_no_floating()
82
+ t.check_no_collisions()
83
+ t.check_connected(expected_components=1)
84
+ stock=json.load(open('/inputs/parts.json'))
85
+ over=[]
86
+ for e,n in b.list_elements().items():
87
+ if n>stock.get(e.ldraw_id,{}).get(e.color.name,0): over.append((e.ldraw_id,e.color.name,n))
88
+ t.check('inventory limits',not over,str(over))
89
+ t.check('eight different mattress colors',len(COLORS)==8 and len(set(COLORS))==8,str(COLORS))
90
+ for i in range(8):
91
+ ps=[p for name,p in b.names.items() if name.startswith(f'mattress_{i}_')]
92
+ t.check(f'complete mattress {i+1}',len(ps)==4 and all(p.content.color==getattr(bl.Color,COLORS[i]) for p in ps),'Four 2 x 4 bricks form an 8 x 4 mattress')
93
+ t.check('visible green pea',b.named('pea').content.color==bl.Color.BRIGHT_GREEN and b.named('pea').center.x>9 and b.named('pea').center.z < b.named('mattress_0_8_7').center.z,'Pea exposed in a one-brick-high front recess, clear of the ladder')
94
+ ladder=b.named('leaning_ladder')
95
+ t.check('tall leaning ladder',ladder.height>10 and ladder.depth>3,'Hinged ladder with two rails and five rungs reaches the upper mattress')
96
+ t.check('sleeping princess atop mattresses',b.named('face').center.z>b.named('mattress_7_4').center.z,'Face with closed eyes above the eighth layer')
97
+ return t.report()
brickwright/alt/alt-002/hero-1024.avif ADDED
brickwright/alt/alt-002/model.mpd ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 0 FILE main.ldr
2
+ 0 main
3
+ 0 Name: main
4
+ 1 10 160 -8 160 1 0 0 0 1 0 0 0 1 91405.dat
5
+ 1 320 80 -32 160 1 0 0 0 1 0 0 0 1 3003.dat
6
+ 1 320 80 -32 240 1 0 0 0 1 0 0 0 1 3003.dat
7
+ 1 320 240 -32 160 1 0 0 0 1 0 0 0 1 3003.dat
8
+ 1 320 240 -32 240 1 0 0 0 1 0 0 0 1 3003.dat
9
+ 1 70 90 -56 160 1 0 0 0 1 0 0 0 1 3002.dat
10
+ 1 28 160 -56 160 1 0 0 0 1 0 0 0 1 3001.dat
11
+ 1 0 230 -56 160 1 0 0 0 1 0 0 0 1 3002.dat
12
+ 1 70 90 -56 200 1 0 0 0 1 0 0 0 1 3002.dat
13
+ 1 28 160 -56 200 1 0 0 0 1 0 0 0 1 3001.dat
14
+ 1 0 230 -56 200 1 0 0 0 1 0 0 0 1 3002.dat
15
+ 1 70 90 -56 240 1 0 0 0 1 0 0 0 1 3002.dat
16
+ 1 28 160 -56 240 1 0 0 0 1 0 0 0 1 3001.dat
17
+ 1 0 230 -56 240 1 0 0 0 1 0 0 0 1 3002.dat
18
+ 1 320 140 -80 200 1 0 0 0 1 0 0 0 1 2456.dat
19
+ 1 320 180 -80 240 1 0 0 0 1 0 0 0 1 2456.dat
20
+ 1 84 100 -80 240 1 0 0 0 1 0 0 0 1 3003.dat
21
+ 1 320 220 -80 190 1 0 0 0 1 0 0 0 1 3004.dat
22
+ 1 10 210 -64 150 1 0 0 0 1 0 0 0 1 33291.dat
23
+ 1 19 140 -64 150 1 0 0 0 1 0 0 0 1 3710.dat
24
+ 1 10 210 -72 150 1 0 0 0 1 0 0 0 1 33291.dat
25
+ 1 10 210 -80 150 1 0 0 0 1 0 0 0 1 33291.dat
26
+ 1 4 120 -104 160 1 0 0 0 1 0 0 0 1 3001.dat
27
+ 1 4 120 -104 200 1 0 0 0 1 0 0 0 1 3001.dat
28
+ 1 4 200 -104 160 1 0 0 0 1 0 0 0 1 3001.dat
29
+ 1 4 200 -104 200 1 0 0 0 1 0 0 0 1 3001.dat
30
+ 1 14 100 -128 180 0 0 -1 0 1 0 1 0 0 3001.dat
31
+ 1 14 140 -128 180 0 0 -1 0 1 0 1 0 0 3001.dat
32
+ 1 14 180 -128 180 0 0 -1 0 1 0 1 0 0 3001.dat
33
+ 1 14 220 -128 180 0 0 -1 0 1 0 1 0 0 3001.dat
34
+ 1 27 120 -152 160 1 0 0 0 1 0 0 0 1 3001.dat
35
+ 1 27 120 -152 200 1 0 0 0 1 0 0 0 1 3001.dat
36
+ 1 27 200 -152 160 1 0 0 0 1 0 0 0 1 3001.dat
37
+ 1 27 200 -152 200 1 0 0 0 1 0 0 0 1 3001.dat
38
+ 1 322 100 -176 180 0 0 -1 0 1 0 1 0 0 3001.dat
39
+ 1 322 140 -176 180 0 0 -1 0 1 0 1 0 0 3001.dat
40
+ 1 322 180 -176 180 0 0 -1 0 1 0 1 0 0 3001.dat
41
+ 1 322 220 -176 180 0 0 -1 0 1 0 1 0 0 3001.dat
42
+ 1 1 120 -200 160 1 0 0 0 1 0 0 0 1 3001.dat
43
+ 1 1 120 -200 200 1 0 0 0 1 0 0 0 1 3001.dat
44
+ 1 1 200 -200 160 1 0 0 0 1 0 0 0 1 3001.dat
45
+ 1 1 200 -200 200 1 0 0 0 1 0 0 0 1 3001.dat
46
+ 1 321 100 -224 180 0 0 -1 0 1 0 1 0 0 3001.dat
47
+ 1 321 140 -224 180 0 0 -1 0 1 0 1 0 0 3001.dat
48
+ 1 321 180 -224 180 0 0 -1 0 1 0 1 0 0 3001.dat
49
+ 1 321 220 -224 180 0 0 -1 0 1 0 1 0 0 3001.dat
50
+ 1 85 120 -248 160 1 0 0 0 1 0 0 0 1 3001.dat
51
+ 1 85 120 -248 200 1 0 0 0 1 0 0 0 1 3001.dat
52
+ 1 85 200 -248 160 1 0 0 0 1 0 0 0 1 3001.dat
53
+ 1 85 200 -248 200 1 0 0 0 1 0 0 0 1 3001.dat
54
+ 1 29 100 -272 180 0 0 -1 0 1 0 1 0 0 3001.dat
55
+ 1 29 140 -272 180 0 0 -1 0 1 0 1 0 0 3001.dat
56
+ 1 29 180 -272 180 0 0 -1 0 1 0 1 0 0 3001.dat
57
+ 1 29 220 -272 180 0 0 -1 0 1 0 1 0 0 3001.dat
58
+ 1 15 70 -104 200 0 0 -1 0 1 0 1 0 0 15332.dat
59
+ 1 15 70 -80 150 1 0 0 0 1 0 0 0 1 3005.dat
60
+ 1 484 70 -104 150 1 0 0 0 1 0 0 0 1 3062b.dat
61
+ 1 70 70 -112 150 1 0 0 0 1 0 0 0 1 6141.dat
62
+ 1 15 70 -80 250 1 0 0 0 1 0 0 0 1 3005.dat
63
+ 1 484 70 -104 250 1 0 0 0 1 0 0 0 1 3062b.dat
64
+ 1 85 70 -112 250 1 0 0 0 1 0 0 0 1 6141.dat
65
+ 1 15 250 -104 200 0 0 -1 0 1 0 1 0 0 15332.dat
66
+ 1 15 250 -80 150 1 0 0 0 1 0 0 0 1 3005.dat
67
+ 1 484 250 -104 150 1 0 0 0 1 0 0 0 1 3062b.dat
68
+ 1 70 250 -112 150 1 0 0 0 1 0 0 0 1 6141.dat
69
+ 1 15 250 -80 250 1 0 0 0 1 0 0 0 1 3005.dat
70
+ 1 484 250 -104 250 1 0 0 0 1 0 0 0 1 3062b.dat
71
+ 1 85 250 -112 250 1 0 0 0 1 0 0 0 1 6141.dat
72
+ 1 15 200 -296 170 1 0 0 0 1 0 0 0 1 3004.dat
73
+ 1 15 200 -296 190 1 0 0 0 1 0 0 0 1 3004.dat
74
+ 1 15 230 -296 180 0 0 -1 0 1 0 1 0 0 3004.dat
75
+ 1 14 200 -320 180 1 0 0 0 1 0 0 0 1 3003.dat
76
+ 1 19 200 -328 180 1 0 0 0 1 0 0 0 1 3022.dat
77
+ 1 15 190 -336 170 1 0 0 0 1 0 0 0 1 98138p0c.dat
78
+ 1 15 190 -336 190 1 0 0 0 1 0 0 0 1 98138p0c.dat
79
+ 1 226 230 -320 180 0 0 -1 0 1 0 1 0 0 3004.dat
80
+ 1 57 230 -328 170 1 0 0 0 1 0 0 0 1 6141.dat
81
+ 1 57 230 -328 190 1 0 0 0 1 0 0 0 1 6141.dat
82
+ 1 29 160 -296 180 1 0 0 0 1 0 0 0 1 3003.dat
83
+ 1 26 100 -296 170 1 0 0 0 1 0 0 0 1 3039.dat
84
+ 1 26 130 -296 170 1 0 0 0 1 0 0 0 1 3040b.dat
85
+ 1 26 100 -296 190 -1 0 0 0 1 0 0 0 -1 3039.dat
86
+ 1 26 130 -296 190 -1 0 0 0 1 0 0 0 -1 3040b.dat
87
+ 1 19 160 -296 150 1 0 0 0 1 0 0 0 1 3004.dat
88
+ 1 19 160 -296 210 1 0 0 0 1 0 0 0 1 3004.dat
89
+ 1 0 120 -16 40 0 0 -1 0 1 0 1 0 0 92582.dat
90
+ 1 16 80 -29.656463 58.796509 1 0 0 0 0.309017 -0.951057 0 0.951057 0.309017 leaning_ladder.ldr
91
+ 0 FILE leaning_ladder.ldr
92
+ 0 leaning_ladder
93
+ 0 Name: leaning_ladder
94
+ 1 0 40 -8 10 1 0 0 0 1 0 0 0 1 60471.dat
95
+ 1 1 40 -16 10 1 0 0 0 1 0 0 0 1 3710.dat
96
+ 1 1 40 -16 70 1 0 0 0 1 0 0 0 1 3710.dat
97
+ 1 1 40 -16 130 1 0 0 0 1 0 0 0 1 3710.dat
98
+ 1 1 40 -16 190 1 0 0 0 1 0 0 0 1 3710.dat
99
+ 1 19 40 -16 250 1 0 0 0 1 0 0 0 1 3710.dat
100
+ 1 322 10 -24 80 0 0 -1 0 1 0 1 0 0 3460.dat
101
+ 1 322 10 -24 220 0 0 -1 0 1 0 1 0 0 3666.dat
102
+ 1 321 10 -32 160 0 0 -1 0 1 0 1 0 0 3023b.dat
103
+ 1 322 70 -24 80 0 0 -1 0 1 0 1 0 0 3460.dat
104
+ 1 322 70 -24 220 0 0 -1 0 1 0 1 0 0 3666.dat
105
+ 1 321 70 -32 160 0 0 -1 0 1 0 1 0 0 3023b.dat
brickwright/alt/alt-002/thumb-512.avif ADDED
brickwright/alt/alt-002/trace.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40c45f343a71b0015be77c8266ca083b8d9cd34063aa55b0a5b0f614a5e7d217
3
+ size 7843
brickwright/alt/alt-002/view-0.avif ADDED
brickwright/alt/alt-002/view-1.avif ADDED
brickwright/alt/alt-002/view-2.avif ADDED
brickwright/alt/alt-002/view-3.avif ADDED
brickwright/alt/alt-002/view-4.avif ADDED
brickwright/alt/alt-002/view-5.avif ADDED
brickwright/alt/alt-002/view-6.avif ADDED
brickwright/alt/alt-002/view-7.avif ADDED
brickwright/alt/alt-003/build.py ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import bricklayer as bl
2
+ from brickwright import TestContext
3
+ import json
4
+
5
+
6
+ def create_build():
7
+ b = bl.LegoBuild()
8
+ C=bl.Color
9
+ def add(pid,c,x,y,z,r=0,name=None):
10
+ return b.add(bl.Element(pid,getattr(C,c)),(x,y,z),bl.Rotation(r),name=name)
11
+ def attach(pid,c,to,source=None,name=None):
12
+ e=bl.Element(pid,getattr(C,c))
13
+ return b.connect(e,source or e.find_connector('antistud',toward=bl.Direction.FRONT),to=to,name=name)
14
+ add('91405','BRIGHT_GREEN',0,0,0,name='meadow')
15
+ # Low stone approach and staggered, substantial gate piers.
16
+ add('3029','DARK_BLUISH_GRAY',2,7,1/3,name='gate_foundation')
17
+ for x in (3,10):
18
+ add('3001','LIGHT_BLUISH_GRAY',x,8,2/3)
19
+ add('3001','DARK_BLUISH_GRAY',x,8,5/3)
20
+ for yy in (8,9):
21
+ add('3245c','LIGHT_BLUISH_GRAY',x,yy,8/3)
22
+ add('3245c','LIGHT_BLUISH_GRAY',x+2,yy,8/3)
23
+ add('3001','LIGHT_BLUISH_GRAY',x,8,14/3)
24
+ for xx in (x,x+2):
25
+ add('3004','LIGHT_BLUISH_GRAY',xx,8,17/3)
26
+ add('3004','DARK_BLUISH_GRAY',xx,9,17/3)
27
+ # The arch spans the four-stud passage; tall enough for the hero's cap.
28
+ add('15254','LIGHT_BLUISH_GRAY',6,8,20/3,name='castle_arch')
29
+ for x in (3,12):
30
+ add('3010','LIGHT_BLUISH_GRAY',x,8,20/3,r=1)
31
+ # Tower caps and battlements.
32
+ for x in (3,12):
33
+ add('3005','LIGHT_BLUISH_GRAY',x,8,23/3)
34
+ add('3005','LIGHT_BLUISH_GRAY',x,10,23/3)
35
+ add('3034','LIGHT_BLUISH_GRAY',5,8,26/3,name='battlement_walk')
36
+ for x in (5,8,11):
37
+ add('3004','LIGHT_BLUISH_GRAY',x,8,9)
38
+ # Running hero: staggered boots, long split stride, and flared green tunic.
39
+ add('30136','DARK_ORANGE',7,3,1/3,r=1,name='leading_boot')
40
+ add('30136','DARK_ORANGE',9,5,1/3,r=1,name='trailing_boot')
41
+ add('3622','TAN',7,3,4/3,r=1,name='leading_leg')
42
+ add('3622','TAN',9,5,4/3,r=1,name='trailing_leg')
43
+ add('3001','GREEN',6,4,7/3,name='tunic_skirt')
44
+ add('3021','GREEN',5,4,10/3)
45
+ add('3021','GREEN',8,4,10/3)
46
+ add('3003','GREEN',6,4,11/3,name='tunic')
47
+ add('4070','GREEN',8,4,11/3)
48
+ add('3005','MEDIUM_NOUGAT',9,4,11/3)
49
+ add('4070','GREEN',9,5,11/3,r=2)
50
+ for x in (5,10):
51
+ arm=add('4070','GREEN',x,4,11/3,name='arm_'+str(x))
52
+ add('3040b','GREEN',x,5,11/3)
53
+ hand=attach('3005','YELLOW',arm.find_connector('stud',facing=bl.Direction.FRONT),name='hand_'+str(x))
54
+ if x==5:
55
+ hilt=attach('61252','LIGHT_BLUISH_GRAY',hand.find_connector('stud',facing=bl.Direction.FRONT),name='sword_guard')
56
+ blade=bl.Element('3957b',C.LIGHT_BLUISH_GRAY)
57
+ b.connect(blade,'bar',to=hilt.find_connector('clip'),target_rotation=bl.Mat3.IDENTITY,name='sword_blade')
58
+ # Blond hair surrounds a small, expressive face.
59
+ add('3004','TAN',7,4,14/3,name='face_lower')
60
+ add('3004','BRIGHT_LIGHT_YELLOW',7,5,14/3)
61
+ for x in (7,8):
62
+ eye=add('47905','BLACK',x,4,17/3)
63
+ attach('98138p07','WHITE',eye.find_connector('stud',facing=bl.Direction.FRONT),name='hero_eye_'+str(x))
64
+ add('3003','YELLOW',7,4,20/3,name='blond_hair')
65
+ add('3039','GREEN',7,4,23/3,name='cap_front')
66
+ add('3040b','GREEN',7,5,26/3,r=2,name='cap_tail_l')
67
+ add('3040b','GREEN',8,5,26/3,r=2,name='cap_tail_r')
68
+ # A stud-on-side backpack carries a blue kite-shaped shield.
69
+ mount=add('47905','BLACK',8,5,11/3,r=2,name='shield_mount')
70
+ # Bridged back into the tunic with a green finishing strip.
71
+ # The shield is coupled directly to the back stud of its carrier.
72
+ shield=bl.LegoBuild()
73
+ shield.add(bl.Element('3710',C.BLUE),(0,0,0),bl.Rotation.DEG_90)
74
+ shield.add(bl.Element('3710',C.BLUE),(1,0,0),bl.Rotation.DEG_90)
75
+ shield.add(bl.Element('3039',C.BLUE),(0,0,1/3))
76
+ shield.add(bl.Element('3003',C.BLUE),(0,2,1/3))
77
+ sc=shield.find_connector('antistud',toward=bl.Position(0.5,2.5,0))
78
+ b.connect(shield,sc,to=mount.find_connector('stud',facing=bl.Direction.BACK),target_rotation=bl.Mat3(((-1,0,0),(0,0,1),(0,1,0))),name='blue_shield')
79
+ # Three distinct pursuers, white rounded bodies, orange feet and red combs.
80
+ for i,(x,y) in enumerate(((1,5),(8,12),(13,5))):
81
+ add('3004','ORANGE',x,y+1,1/3,name=f'chicken_{i}_feet')
82
+ add('6215','WHITE',x,y,4/3,r=1,name=f'chicken_{i}_body')
83
+ add('3023b','ORANGE' if i<2 else 'TAN',x,y,7/3,name=f'chicken_{i}_beak')
84
+ head=add('47905','RED' if i<2 else 'BLACK',x,y,8/3,r=1,name=f'chicken_{i}_head')
85
+ attach('98138p07' if i<2 else '98138p0c','WHITE',head.find_connector('stud',facing=bl.Direction.RIGHT),name=f'chicken_{i}_eye')
86
+ if i<2:
87
+ attach('98138p0c','WHITE',head.find_connector('stud',facing=bl.Direction.LEFT))
88
+ add('54200','RED',x,y,11/3,name=f'chicken_{i}_comb')
89
+ add('3069b','WHITE',x,y+1,7/3,r=1,name=f'chicken_{i}_wing')
90
+ return b
91
+
92
+
93
+ def run_tests():
94
+ b=create_build()
95
+ tests=TestContext(b)
96
+ tests.check_no_floating()
97
+ tests.check_no_collisions()
98
+ tests.check_connected(expected_components=1)
99
+ stock=json.load(open('/inputs/parts.json'))
100
+ excess=[]
101
+ for e,n in b.list_elements().items():
102
+ allowed=stock.get(e.ldraw_id,{}).get(e.color.name,0)
103
+ if n>allowed: excess.append((e.ldraw_id,e.color.name,n,allowed))
104
+ tests.check('inventory limits',not excess,str(excess))
105
+ tests.check('three white chickens with red combs',all(b.named(f'chicken_{i}_body').content.color==bl.Color.WHITE and b.named(f'chicken_{i}_comb').content.color==bl.Color.RED for i in range(3)))
106
+ tests.check('hero has tunic, cap, blond hair, sword and blue shield',all(n in b.names for n in ['tunic','cap_front','blond_hair','sword_blade','blue_shield']))
107
+ tests.check('castle archway',b.named('castle_arch').content.ldraw_id=='15254')
108
+ return tests.report()
brickwright/alt/alt-003/hero-1024.avif ADDED
brickwright/alt/alt-003/model.mpd ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 0 FILE main.ldr
2
+ 0 main
3
+ 0 Name: main
4
+ 1 10 160 -8 160 1 0 0 0 1 0 0 0 1 91405.dat
5
+ 1 72 160 -16 180 1 0 0 0 1 0 0 0 1 3029.dat
6
+ 1 71 100 -40 180 1 0 0 0 1 0 0 0 1 3001.dat
7
+ 1 72 100 -64 180 1 0 0 0 1 0 0 0 1 3001.dat
8
+ 1 71 80 -112 170 1 0 0 0 1 0 0 0 1 3245c.dat
9
+ 1 71 120 -112 170 1 0 0 0 1 0 0 0 1 3245c.dat
10
+ 1 71 80 -112 190 1 0 0 0 1 0 0 0 1 3245c.dat
11
+ 1 71 120 -112 190 1 0 0 0 1 0 0 0 1 3245c.dat
12
+ 1 71 100 -136 180 1 0 0 0 1 0 0 0 1 3001.dat
13
+ 1 71 80 -160 170 1 0 0 0 1 0 0 0 1 3004.dat
14
+ 1 72 80 -160 190 1 0 0 0 1 0 0 0 1 3004.dat
15
+ 1 71 120 -160 170 1 0 0 0 1 0 0 0 1 3004.dat
16
+ 1 72 120 -160 190 1 0 0 0 1 0 0 0 1 3004.dat
17
+ 1 71 240 -40 180 1 0 0 0 1 0 0 0 1 3001.dat
18
+ 1 72 240 -64 180 1 0 0 0 1 0 0 0 1 3001.dat
19
+ 1 71 220 -112 170 1 0 0 0 1 0 0 0 1 3245c.dat
20
+ 1 71 260 -112 170 1 0 0 0 1 0 0 0 1 3245c.dat
21
+ 1 71 220 -112 190 1 0 0 0 1 0 0 0 1 3245c.dat
22
+ 1 71 260 -112 190 1 0 0 0 1 0 0 0 1 3245c.dat
23
+ 1 71 240 -136 180 1 0 0 0 1 0 0 0 1 3001.dat
24
+ 1 71 220 -160 170 1 0 0 0 1 0 0 0 1 3004.dat
25
+ 1 72 220 -160 190 1 0 0 0 1 0 0 0 1 3004.dat
26
+ 1 71 260 -160 170 1 0 0 0 1 0 0 0 1 3004.dat
27
+ 1 72 260 -160 190 1 0 0 0 1 0 0 0 1 3004.dat
28
+ 1 71 180 -208 170 1 0 0 0 1 0 0 0 1 15254.dat
29
+ 1 71 70 -184 200 0 0 -1 0 1 0 1 0 0 3010.dat
30
+ 1 71 250 -184 200 0 0 -1 0 1 0 1 0 0 3010.dat
31
+ 1 71 70 -208 170 1 0 0 0 1 0 0 0 1 3005.dat
32
+ 1 71 70 -208 210 1 0 0 0 1 0 0 0 1 3005.dat
33
+ 1 71 250 -208 170 1 0 0 0 1 0 0 0 1 3005.dat
34
+ 1 71 250 -208 210 1 0 0 0 1 0 0 0 1 3005.dat
35
+ 1 71 180 -216 180 1 0 0 0 1 0 0 0 1 3034.dat
36
+ 1 71 120 -240 170 1 0 0 0 1 0 0 0 1 3004.dat
37
+ 1 71 180 -240 170 1 0 0 0 1 0 0 0 1 3004.dat
38
+ 1 71 240 -240 170 1 0 0 0 1 0 0 0 1 3004.dat
39
+ 1 484 150 -32 80 0 0 -1 0 1 0 1 0 0 30136.dat
40
+ 1 484 190 -32 120 0 0 -1 0 1 0 1 0 0 30136.dat
41
+ 1 19 150 -56 90 0 0 -1 0 1 0 1 0 0 3622.dat
42
+ 1 19 190 -56 130 0 0 -1 0 1 0 1 0 0 3622.dat
43
+ 1 2 160 -80 100 1 0 0 0 1 0 0 0 1 3001.dat
44
+ 1 2 130 -88 100 1 0 0 0 1 0 0 0 1 3021.dat
45
+ 1 2 190 -88 100 1 0 0 0 1 0 0 0 1 3021.dat
46
+ 1 2 140 -112 100 1 0 0 0 1 0 0 0 1 3003.dat
47
+ 1 2 170 -112 90 1 0 0 0 1 0 0 0 1 4070.dat
48
+ 1 84 190 -112 90 1 0 0 0 1 0 0 0 1 3005.dat
49
+ 1 2 190 -112 110 -1 0 0 0 1 0 0 0 -1 4070.dat
50
+ 1 2 110 -112 90 1 0 0 0 1 0 0 0 1 4070.dat
51
+ 1 2 110 -112 130 1 0 0 0 1 0 0 0 1 3040b.dat
52
+ 1 14 110 -102 60 1 0 0 0 0 -1 0 1 0 3005.dat
53
+ 1 71 110 -102 52 1 0 0 0 0 -1 0 1 0 61252.dat
54
+ 1 71 155.5 -82 54 0 1 0 0 0 1 1 0 0 3957b.dat
55
+ 1 2 210 -112 90 1 0 0 0 1 0 0 0 1 4070.dat
56
+ 1 2 210 -112 130 1 0 0 0 1 0 0 0 1 3040b.dat
57
+ 1 14 210 -102 60 1 0 0 0 0 -1 0 1 0 3005.dat
58
+ 1 19 160 -136 90 1 0 0 0 1 0 0 0 1 3004.dat
59
+ 1 226 160 -136 110 1 0 0 0 1 0 0 0 1 3004.dat
60
+ 1 0 150 -160 90 1 0 0 0 1 0 0 0 1 47905.dat
61
+ 1 15 150 -150 72 1 0 0 0 0 -1 0 1 0 98138p07.dat
62
+ 1 0 170 -160 90 1 0 0 0 1 0 0 0 1 47905.dat
63
+ 1 15 170 -150 72 1 0 0 0 0 -1 0 1 0 98138p07.dat
64
+ 1 14 160 -184 100 1 0 0 0 1 0 0 0 1 3003.dat
65
+ 1 2 160 -208 110 1 0 0 0 1 0 0 0 1 3039.dat
66
+ 1 2 150 -232 110 -1 0 0 0 1 0 0 0 -1 3040b.dat
67
+ 1 2 170 -232 110 -1 0 0 0 1 0 0 0 -1 3040b.dat
68
+ 1 0 170 -112 110 -1 0 0 0 1 0 0 0 -1 47905.dat
69
+ 1 16 180 -52 120 -1 0 0 0 0 -1 0 -1 0 blue_shield.ldr
70
+ 1 25 40 -32 130 1 0 0 0 1 0 0 0 1 3004.dat
71
+ 1 15 40 -56 120 0 0 -1 0 1 0 1 0 0 6215.dat
72
+ 1 25 40 -64 110 1 0 0 0 1 0 0 0 1 3023b.dat
73
+ 1 4 30 -88 110 0 0 -1 0 1 0 1 0 0 47905.dat
74
+ 1 15 12 -78 110 0 1 0 0 0 1 1 0 0 98138p07.dat
75
+ 1 15 48 -78 110 0 -1 0 0 0 -1 1 0 0 98138p0c.dat
76
+ 1 4 30 -88 110 1 0 0 0 1 0 0 0 1 54200.dat
77
+ 1 15 30 -64 140 0 0 -1 0 1 0 1 0 0 3069b.dat
78
+ 1 25 180 -32 270 1 0 0 0 1 0 0 0 1 3004.dat
79
+ 1 15 180 -56 260 0 0 -1 0 1 0 1 0 0 6215.dat
80
+ 1 25 180 -64 250 1 0 0 0 1 0 0 0 1 3023b.dat
81
+ 1 4 170 -88 250 0 0 -1 0 1 0 1 0 0 47905.dat
82
+ 1 15 152 -78 250 0 1 0 0 0 1 1 0 0 98138p07.dat
83
+ 1 15 188 -78 250 0 -1 0 0 0 -1 1 0 0 98138p0c.dat
84
+ 1 4 170 -88 250 1 0 0 0 1 0 0 0 1 54200.dat
85
+ 1 15 170 -64 280 0 0 -1 0 1 0 1 0 0 3069b.dat
86
+ 1 25 280 -32 130 1 0 0 0 1 0 0 0 1 3004.dat
87
+ 1 15 280 -56 120 0 0 -1 0 1 0 1 0 0 6215.dat
88
+ 1 19 280 -64 110 1 0 0 0 1 0 0 0 1 3023b.dat
89
+ 1 0 270 -88 110 0 0 -1 0 1 0 1 0 0 47905.dat
90
+ 1 15 252 -78 110 0 1 0 0 0 1 1 0 0 98138p0c.dat
91
+ 1 4 270 -88 110 1 0 0 0 1 0 0 0 1 54200.dat
92
+ 1 15 270 -64 140 0 0 -1 0 1 0 1 0 0 3069b.dat
93
+ 0 FILE blue_shield.ldr
94
+ 0 blue_shield
95
+ 0 Name: blue_shield
96
+ 1 1 10 -8 40 0 0 -1 0 1 0 1 0 0 3710.dat
97
+ 1 1 30 -8 40 0 0 -1 0 1 0 1 0 0 3710.dat
98
+ 1 1 20 -32 30 1 0 0 0 1 0 0 0 1 3039.dat
99
+ 1 1 20 -32 60 1 0 0 0 1 0 0 0 1 3003.dat
brickwright/alt/alt-003/thumb-512.avif ADDED
brickwright/alt/alt-003/trace.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b708895dd83f0edcc40367bda7b34958cde1b4a393f2fc468cebe9963708b825
3
+ size 8354
brickwright/alt/alt-003/view-0.avif ADDED
brickwright/alt/alt-003/view-1.avif ADDED
brickwright/alt/alt-003/view-2.avif ADDED
brickwright/alt/alt-003/view-3.avif ADDED
brickwright/alt/alt-003/view-4.avif ADDED
brickwright/alt/alt-003/view-5.avif ADDED
brickwright/alt/alt-003/view-6.avif ADDED
brickwright/alt/alt-003/view-7.avif ADDED
brickwright/alt/alt-004/build.py ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ from collections import Counter
3
+ import bricklayer as bl
4
+ from brickwright import TestContext
5
+
6
+
7
+ def create_build():
8
+ b=bl.LegoBuild()
9
+ def add(pid,c,x,y,z,r=0,name=None):
10
+ return b.add(bl.Element(pid,getattr(bl.Color,c)),(x,y,z),bl.Rotation(r),name=name)
11
+ add('3028','BRIGHT_GREEN',0,0,0,name='ground')
12
+ for x in (2,8):
13
+ add('3039','GREEN',x,0,1/3)
14
+ add('3003','GREEN',x,2,1/3)
15
+ for x in (3,7):
16
+ add('3001','GREEN',x,2,4/3,1)
17
+ add('3660b','WHITE',x,2,7/3)
18
+ add('3660b','WHITE',x,4,7/3,2)
19
+ for y in (2,5): add('3004','WHITE',5,y,7/3)
20
+ add('3032','YELLOW',3,2,10/3,name='belt')
21
+ for y in (4,):
22
+ add('6215','WHITE',3,y,11/3,2)
23
+ add('6215','WHITE',6,y,11/3)
24
+ for x in (4,6): add('3004','WHITE',x,2,11/3)
25
+ for y in (2,5):
26
+ add('60481a','WHITE',3,y,14/3,3)
27
+ add('60481a','WHITE',7,y,14/3,1)
28
+ for z in (14/3,17/3): add('2877','WHITE',5,y,z)
29
+ for z in (14/3,17/3): add('3001','LIME',4,3,z)
30
+ # Staggered, broad green cloak suspended from the shoulder bridge.
31
+ for i in range(4):
32
+ z=8/3+i
33
+ x=3 if i%2==0 else 5
34
+ add('3001','DARK_GREEN',x,6,z)
35
+ ox=7 if i%2==0 else 3
36
+ for dx in (0,1): add('3004','DARK_GREEN',ox+dx,6,z,1)
37
+ add('3001','LIME',4,3,20/3)
38
+ add('3001','LIME',4,5,20/3,name='cape_bridge')
39
+ # Wide frog jaw, projecting muzzle and two separated, forward-facing eyes.
40
+ for x in (2,6): add('3001','GREEN',x,2,23/3)
41
+ add('2456','BRIGHT_GREEN',3,4,23/3)
42
+ for x in (3,6): add('3021','GREEN',x,1,26/3)
43
+ add('2431','GREEN',4,1,9)
44
+ add('2456','BRIGHT_GREEN',3,4,26/3)
45
+ for x in (3,8):
46
+ eye=add('4070','GREEN',x,2,9,name='eye_mount_'+str(x))
47
+ e=bl.Element('98138p07',bl.Color.WHITE)
48
+ b.connect(e,e.find_connector('antistud'),to=eye.find_connector('stud',facing=bl.Direction.FRONT),name='eye_'+str(x))
49
+ for x in (2,9): add('3040b','GREEN',x,2,26/3,0)
50
+ # Blue gauntlets converge on the shared sword grip.
51
+ for x in (2,8): add('3003','BLUE',x,1,11/3)
52
+ for x in (2,7): add('3002','BLUE',x,0,14/3)
53
+ hands=add('30414','BLUE',4,0,17/3,name='hands')
54
+ # Flat, broad blade; the long axis is turned upright by the hand's side stud.
55
+ s=bl.LegoBuild()
56
+ blade=s.add(bl.Element('3034',bl.Color.LIGHT_BLUISH_GRAY),(0,0,0),name='blade')
57
+ s.add(bl.Element('87079',bl.Color.LIGHT_BLUISH_GRAY),(0,0,1/3))
58
+ for y in (0,1):
59
+ s.add(bl.Element('3004',bl.Color.LIGHT_BLUISH_GRAY),(4,y,1/3))
60
+ s.add(bl.Element('3010',bl.Color.LIGHT_BLUISH_GRAY),(6,-1,1/3),bl.Rotation.DEG_90)
61
+ s.add(bl.Element('3004',bl.Color.DARK_BLUISH_GRAY),(7,0,1/3),bl.Rotation.DEG_90)
62
+ source=blade.find_connector('antistud',toward=(7.5,0.5,0))
63
+ target=hands.find_connector('stud',facing=bl.Direction.FRONT,toward=(6.5,0,6))
64
+ # Local blade starts at the tip: increasing x rises toward the hilt.
65
+ rot=bl.Mat3(((0,-1,0),(0,0,-1),(1,0,0)))
66
+ b.connect(s,source,to=target,target_rotation=rot,name='sword')
67
+ return b
68
+
69
+
70
+ def run_tests():
71
+ b=create_build()
72
+ tests=TestContext(b)
73
+ tests.check_no_floating()
74
+ tests.check_no_collisions()
75
+ tests.check_connected(expected_components=1)
76
+ inventory=json.load(open('/inputs/parts.json'))
77
+ used=Counter((p.content.ldraw_id,p.content.color.name) for p in b.flattened_placements)
78
+ bad={str(k):v for k,v in used.items() if v>inventory.get(k[0],{}).get(k[1],0)}
79
+ tests.check('Inventory limits',not bad,str(bad))
80
+ tests.check('Two frog eyes',sum(p.content.ldraw_id=='98138p07' for p in b.flattened_placements)==2)
81
+ tests.check('Yellow belt',b.named('belt').content.color==bl.Color.YELLOW)
82
+ tests.check('Broad gray sword',b.named('sword').height>5 and b.named('sword').width>=3)
83
+ tests.check('Green cape',sum(p.content.color==bl.Color.DARK_GREEN for p in b.flattened_placements)>=12)
84
+ return tests.report()
brickwright/alt/alt-004/hero-1024.avif ADDED
brickwright/alt/alt-004/model.mpd ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 0 FILE main.ldr
2
+ 0 main
3
+ 0 Name: main
4
+ 1 10 120 -8 60 1 0 0 0 1 0 0 0 1 3028.dat
5
+ 1 2 60 -32 30 1 0 0 0 1 0 0 0 1 3039.dat
6
+ 1 2 60 -32 60 1 0 0 0 1 0 0 0 1 3003.dat
7
+ 1 2 180 -32 30 1 0 0 0 1 0 0 0 1 3039.dat
8
+ 1 2 180 -32 60 1 0 0 0 1 0 0 0 1 3003.dat
9
+ 1 2 80 -56 80 0 0 -1 0 1 0 1 0 0 3001.dat
10
+ 1 15 80 -80 70 1 0 0 0 1 0 0 0 1 3660b.dat
11
+ 1 15 80 -80 90 -1 0 0 0 1 0 0 0 -1 3660b.dat
12
+ 1 2 160 -56 80 0 0 -1 0 1 0 1 0 0 3001.dat
13
+ 1 15 160 -80 70 1 0 0 0 1 0 0 0 1 3660b.dat
14
+ 1 15 160 -80 90 -1 0 0 0 1 0 0 0 -1 3660b.dat
15
+ 1 15 120 -80 50 1 0 0 0 1 0 0 0 1 3004.dat
16
+ 1 15 120 -80 110 1 0 0 0 1 0 0 0 1 3004.dat
17
+ 1 14 120 -88 80 1 0 0 0 1 0 0 0 1 3032.dat
18
+ 1 15 100 -112 100 -1 0 0 0 1 0 0 0 -1 6215.dat
19
+ 1 15 140 -112 100 1 0 0 0 1 0 0 0 1 6215.dat
20
+ 1 15 100 -112 50 1 0 0 0 1 0 0 0 1 3004.dat
21
+ 1 15 140 -112 50 1 0 0 0 1 0 0 0 1 3004.dat
22
+ 1 15 90 -160 50 0 0 1 0 1 0 -1 0 0 60481a.dat
23
+ 1 15 150 -160 50 0 0 -1 0 1 0 1 0 0 60481a.dat
24
+ 1 15 120 -136 50 1 0 0 0 1 0 0 0 1 2877.dat
25
+ 1 15 120 -160 50 1 0 0 0 1 0 0 0 1 2877.dat
26
+ 1 15 90 -160 110 0 0 1 0 1 0 -1 0 0 60481a.dat
27
+ 1 15 150 -160 110 0 0 -1 0 1 0 1 0 0 60481a.dat
28
+ 1 15 120 -136 110 1 0 0 0 1 0 0 0 1 2877.dat
29
+ 1 15 120 -160 110 1 0 0 0 1 0 0 0 1 2877.dat
30
+ 1 27 120 -136 80 1 0 0 0 1 0 0 0 1 3001.dat
31
+ 1 27 120 -160 80 1 0 0 0 1 0 0 0 1 3001.dat
32
+ 1 288 100 -88 140 1 0 0 0 1 0 0 0 1 3001.dat
33
+ 1 288 150 -88 140 0 0 -1 0 1 0 1 0 0 3004.dat
34
+ 1 288 170 -88 140 0 0 -1 0 1 0 1 0 0 3004.dat
35
+ 1 288 140 -112 140 1 0 0 0 1 0 0 0 1 3001.dat
36
+ 1 288 70 -112 140 0 0 -1 0 1 0 1 0 0 3004.dat
37
+ 1 288 90 -112 140 0 0 -1 0 1 0 1 0 0 3004.dat
38
+ 1 288 100 -136 140 1 0 0 0 1 0 0 0 1 3001.dat
39
+ 1 288 150 -136 140 0 0 -1 0 1 0 1 0 0 3004.dat
40
+ 1 288 170 -136 140 0 0 -1 0 1 0 1 0 0 3004.dat
41
+ 1 288 140 -160 140 1 0 0 0 1 0 0 0 1 3001.dat
42
+ 1 288 70 -160 140 0 0 -1 0 1 0 1 0 0 3004.dat
43
+ 1 288 90 -160 140 0 0 -1 0 1 0 1 0 0 3004.dat
44
+ 1 27 120 -184 80 1 0 0 0 1 0 0 0 1 3001.dat
45
+ 1 27 120 -184 120 1 0 0 0 1 0 0 0 1 3001.dat
46
+ 1 2 80 -208 60 1 0 0 0 1 0 0 0 1 3001.dat
47
+ 1 2 160 -208 60 1 0 0 0 1 0 0 0 1 3001.dat
48
+ 1 10 120 -208 100 1 0 0 0 1 0 0 0 1 2456.dat
49
+ 1 2 90 -216 40 1 0 0 0 1 0 0 0 1 3021.dat
50
+ 1 2 150 -216 40 1 0 0 0 1 0 0 0 1 3021.dat
51
+ 1 2 120 -224 30 1 0 0 0 1 0 0 0 1 2431.dat
52
+ 1 10 120 -232 100 1 0 0 0 1 0 0 0 1 2456.dat
53
+ 1 2 70 -240 50 1 0 0 0 1 0 0 0 1 4070.dat
54
+ 1 15 70 -230 36 1 0 0 0 0 -1 0 1 0 98138p07.dat
55
+ 1 2 170 -240 50 1 0 0 0 1 0 0 0 1 4070.dat
56
+ 1 15 170 -230 36 1 0 0 0 0 -1 0 1 0 98138p07.dat
57
+ 1 2 50 -232 70 1 0 0 0 1 0 0 0 1 3040b.dat
58
+ 1 2 190 -232 70 1 0 0 0 1 0 0 0 1 3040b.dat
59
+ 1 1 60 -112 40 1 0 0 0 1 0 0 0 1 3003.dat
60
+ 1 1 180 -112 40 1 0 0 0 1 0 0 0 1 3003.dat
61
+ 1 1 70 -136 20 1 0 0 0 1 0 0 0 1 3002.dat
62
+ 1 1 170 -136 20 1 0 0 0 1 0 0 0 1 3002.dat
63
+ 1 1 120 -160 10 1 0 0 0 1 0 0 0 1 30414.dat
64
+ 1 16 140 0 0 0 0 -1 -1 0 0 0 1 0 sword.ldr
65
+ 0 FILE sword.ldr
66
+ 0 sword
67
+ 0 Name: sword
68
+ 1 71 80 -8 20 1 0 0 0 1 0 0 0 1 3034.dat
69
+ 1 71 40 -16 20 1 0 0 0 1 0 0 0 1 87079.dat
70
+ 1 71 100 -32 10 1 0 0 0 1 0 0 0 1 3004.dat
71
+ 1 71 100 -32 30 1 0 0 0 1 0 0 0 1 3004.dat
72
+ 1 71 130 -32 20 0 0 -1 0 1 0 1 0 0 3010.dat
73
+ 1 72 150 -32 20 0 0 -1 0 1 0 1 0 0 3004.dat
brickwright/alt/alt-004/thumb-512.avif ADDED
brickwright/alt/alt-004/trace.jsonl.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34129d598689cc16aaa7421816332c87af68c46a53123952aad39426b304c895
3
+ size 7223
brickwright/alt/alt-004/view-0.avif ADDED
brickwright/alt/alt-004/view-1.avif ADDED
brickwright/alt/alt-004/view-2.avif ADDED
brickwright/alt/alt-004/view-3.avif ADDED
brickwright/alt/alt-004/view-4.avif ADDED