Q_ysato_150725

1520 days ago by takepwave

Y. Sato さま、添付して頂きましたソースをDataにアップし、以下の様に動作させてみたところ、 plot3d_cubieは動いているように思います。 Dataのソースを変更し、色を調整してみてください。

ソースの変更は、ワークシートの"Data"プルダウンメニューでcubegroup.pyを選択すると、 ソースが表示され、編集ができるようになります。

load(DATA + 'cubegroup.py') 
       
f = [(17,19,24,22),(18,21,23,20),(6,25,43,16),(7,28,42,13),(8,30,41,11)] b = [(33,35,40,38),(34,37,39,36),(3,9,46,32),(2,12,47,29),(1,14,48,27)] l = [(9,11,16,14),(10,13,15,12),(1,17,41,40),(4,20,44,37),(6,22,46,35)] r = [(25,27,32,30),(26,29,31,28),(3,38,43,19),(5,36,45,21),(8,33,48,24)] u = [(1,3,8,6),(2,5,7,4),(9,33,25,17),(10,34,26,18),(11,35,27,19)] d = [(41,43,48,46),(42,45,47,44),(14,22,30,38),(15,23,31,39),(16,24,32,40)] cube = PermutationGroup([f,b,l,r,u,d]) F,B,L,R,U,D = cube.gens() cube.order() 
       
43252003274489856000
43252003274489856000
F.order() 
       
4
4
from sage.groups.perm_gps.cubegroup import * 
       
index2singmaster(41) 
       
'dlf'
'dlf'
rubik = CubeGroup() 
       
rubik.move(""); 
       
((), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48])
((), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48])
rubik.faces("R*L") 
       
{'right': [[27, 29, 32], [26, 0, 31], [25, 28, 30]], 'up': [[17, 2, 38],
[20, 0, 36], [22, 7, 33]], 'back': [[48, 34, 6], [45, 0, 4], [43, 39,
1]], 'down': [[40, 42, 19], [37, 0, 21], [35, 47, 24]], 'front': [[41,
18, 3], [44, 0, 5], [46, 23, 8]], 'left': [[11, 13, 16], [10, 0, 15],
[9, 12, 14]]}
{'right': [[27, 29, 32], [26, 0, 31], [25, 28, 30]], 'up': [[17, 2, 38], [20, 0, 36], [22, 7, 33]], 'back': [[48, 34, 6], [45, 0, 4], [43, 39, 1]], 'down': [[40, 42, 19], [37, 0, 21], [35, 47, 24]], 'front': [[41, 18, 3], [44, 0, 5], [46, 23, 8]], 'left': [[11, 13, 16], [10, 0, 15], [9, 12, 14]]}
P = rubik.plot_cube("R^2*U^2*R^2*U^2*R^2*U^2") 
       
show(P) 
       
clrU = orange; clrL = blue; clrF = green; clrR = (0.9, 0.9, 0.9) ; clrB = yellow; clrD = red; P4 = plot3d_cubie([1/2,1/2,1/2],[clrF,clrU,clrR]) show(P4) 
       
# 以下の例は、mvが未定義なので、試すことができませんでした。 plot3d_cube(mv, title=True) plot_cube(mv, title=True, colors=[(1, 0.63, 1), (1, 1, 0), (1, 0, 0), (0, 1, 0), (1, 0.6, 0.3), (0, 0, 1)]) rubik = CubeGroup() P = rubik.plot_cube("R^2*U^2*R^2*U^2*R^2*U^2", \ colors=[orange, (0, 0, 1), (0, 1, 0), (0.9, 0.9, 0.9), (1, 0.9, 0), (1, 0, 0)]); show(P) 
       
Traceback (click to the left of this block for traceback)
...
NameError: name 'mv' is not defined
Traceback (most recent call last):    P = rubik.plot_cube("R^2*U^2*R^2*U^2*R^2*U^2", \
  File "", line 1, in <module>
    
  File "/tmp/tmp1zZ_o2/___code___.py", line 3, in <module>
    plot3d_cube(mv, title=True)
NameError: name 'mv' is not defined