ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 06 Oct 2014 14:06:13 +0200Why does JMOL fail here?https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/Sorry, but I can't think of a good title for the question. I put together code for the Menger's Sponge (3d) [EDIT: and ran it in a Sage notebook. I also tried it in a Sage Cell Server.]
H = J = K = Graphics()
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
H += cube().scale(1).translate(1/2+i, 1/2+j, 1/2+k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
J += H.translate(3/2+3*i, 3/2+3*j, 3/2+3*k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
K += J.translate(4.5+9*i, 4.5+9*j, 4.5+9*k)
#K.show()
K.save('Menger3.gif')
The code runs and creates the image of the 3rd iteration of Menger's sponge. But if I comment out: K.save('Menger3.gif') and uncomment K.show() then the code won't run. I get lots of errors like:
__main__:19: UserWarning: Duplicate name: 'obj_660992.pmesh'
after which I'm told
Traceback (click to the left of this block for traceback)
...
RuntimeError: Jmol failed to create file
'/tmp/tmpMSjmcm/.jmol_images/sage0-size500.jmol.png',
and I'm told to look at a temporary text file (which turns out to be empty).
So the questions are "Why does JMOL fail to create the third iteration of Menger's Sponge when I can view the image of it?", "How do I revise the code so JMOL won't fail?".
By the way, for the second iteration of Menger's Sponge, JMOL works.Mon, 06 Oct 2014 01:11:03 +0200https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/Comment by calc314 for <p>Sorry, but I can't think of a good title for the question. I put together code for the Menger's Sponge (3d) [EDIT: and ran it in a Sage notebook. I also tried it in a Sage Cell Server.]</p>
<pre><code>H = J = K = Graphics()
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
H += cube().scale(1).translate(1/2+i, 1/2+j, 1/2+k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
J += H.translate(3/2+3*i, 3/2+3*j, 3/2+3*k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
K += J.translate(4.5+9*i, 4.5+9*j, 4.5+9*k)
#K.show()
K.save('Menger3.gif')
</code></pre>
<p>The code runs and creates the image of the 3rd iteration of Menger's sponge. But if I comment out: K.save('Menger3.gif') and uncomment K.show() then the code won't run. I get lots of errors like:</p>
<pre><code>__main__:19: UserWarning: Duplicate name: 'obj_660992.pmesh'
</code></pre>
<p>after which I'm told </p>
<pre><code>Traceback (click to the left of this block for traceback)
...
RuntimeError: Jmol failed to create file
'/tmp/tmpMSjmcm/.jmol_images/sage0-size500.jmol.png',
</code></pre>
<p>and I'm told to look at a temporary text file (which turns out to be empty).</p>
<p>So the questions are "Why does JMOL fail to create the third iteration of Menger's Sponge when I can view the image of it?", "How do I revise the code so JMOL won't fail?".</p>
<p>By the way, for the second iteration of Menger's Sponge, JMOL works.</p>
https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/?comment=24402#post-id-24402SMC (which doesn't use JMOL) is creating the gif file but not displaying the 3D image within the worksheet with the `show` command. This appears to be an issue of timing out or some such. Interesting that there are issues in more than one environment.Mon, 06 Oct 2014 04:02:29 +0200https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/?comment=24402#post-id-24402Comment by dazedANDconfused for <p>Sorry, but I can't think of a good title for the question. I put together code for the Menger's Sponge (3d) [EDIT: and ran it in a Sage notebook. I also tried it in a Sage Cell Server.]</p>
<pre><code>H = J = K = Graphics()
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
H += cube().scale(1).translate(1/2+i, 1/2+j, 1/2+k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
J += H.translate(3/2+3*i, 3/2+3*j, 3/2+3*k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
K += J.translate(4.5+9*i, 4.5+9*j, 4.5+9*k)
#K.show()
K.save('Menger3.gif')
</code></pre>
<p>The code runs and creates the image of the 3rd iteration of Menger's sponge. But if I comment out: K.save('Menger3.gif') and uncomment K.show() then the code won't run. I get lots of errors like:</p>
<pre><code>__main__:19: UserWarning: Duplicate name: 'obj_660992.pmesh'
</code></pre>
<p>after which I'm told </p>
<pre><code>Traceback (click to the left of this block for traceback)
...
RuntimeError: Jmol failed to create file
'/tmp/tmpMSjmcm/.jmol_images/sage0-size500.jmol.png',
</code></pre>
<p>and I'm told to look at a temporary text file (which turns out to be empty).</p>
<p>So the questions are "Why does JMOL fail to create the third iteration of Menger's Sponge when I can view the image of it?", "How do I revise the code so JMOL won't fail?".</p>
<p>By the way, for the second iteration of Menger's Sponge, JMOL works.</p>
https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/?comment=24403#post-id-24403I should have mentioned that I ran the Sage code in a notebook. I also tried a Sage Cell Server. It had the same basic behavior as the notebook but a lot slower. I haven't tried SMC.Mon, 06 Oct 2014 07:06:24 +0200https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/?comment=24403#post-id-24403Comment by tmonteil for <p>Sorry, but I can't think of a good title for the question. I put together code for the Menger's Sponge (3d) [EDIT: and ran it in a Sage notebook. I also tried it in a Sage Cell Server.]</p>
<pre><code>H = J = K = Graphics()
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
H += cube().scale(1).translate(1/2+i, 1/2+j, 1/2+k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
J += H.translate(3/2+3*i, 3/2+3*j, 3/2+3*k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
K += J.translate(4.5+9*i, 4.5+9*j, 4.5+9*k)
#K.show()
K.save('Menger3.gif')
</code></pre>
<p>The code runs and creates the image of the 3rd iteration of Menger's sponge. But if I comment out: K.save('Menger3.gif') and uncomment K.show() then the code won't run. I get lots of errors like:</p>
<pre><code>__main__:19: UserWarning: Duplicate name: 'obj_660992.pmesh'
</code></pre>
<p>after which I'm told </p>
<pre><code>Traceback (click to the left of this block for traceback)
...
RuntimeError: Jmol failed to create file
'/tmp/tmpMSjmcm/.jmol_images/sage0-size500.jmol.png',
</code></pre>
<p>and I'm told to look at a temporary text file (which turns out to be empty).</p>
<p>So the questions are "Why does JMOL fail to create the third iteration of Menger's Sponge when I can view the image of it?", "How do I revise the code so JMOL won't fail?".</p>
<p>By the way, for the second iteration of Menger's Sponge, JMOL works.</p>
https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/?comment=24410#post-id-24410It works for me (no error) from the command line, though jmol is very slow due to the number of objects.Mon, 06 Oct 2014 14:06:13 +0200https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/?comment=24410#post-id-24410Comment by bb16 for <p>Sorry, but I can't think of a good title for the question. I put together code for the Menger's Sponge (3d) [EDIT: and ran it in a Sage notebook. I also tried it in a Sage Cell Server.]</p>
<pre><code>H = J = K = Graphics()
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
H += cube().scale(1).translate(1/2+i, 1/2+j, 1/2+k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
J += H.translate(3/2+3*i, 3/2+3*j, 3/2+3*k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
K += J.translate(4.5+9*i, 4.5+9*j, 4.5+9*k)
#K.show()
K.save('Menger3.gif')
</code></pre>
<p>The code runs and creates the image of the 3rd iteration of Menger's sponge. But if I comment out: K.save('Menger3.gif') and uncomment K.show() then the code won't run. I get lots of errors like:</p>
<pre><code>__main__:19: UserWarning: Duplicate name: 'obj_660992.pmesh'
</code></pre>
<p>after which I'm told </p>
<pre><code>Traceback (click to the left of this block for traceback)
...
RuntimeError: Jmol failed to create file
'/tmp/tmpMSjmcm/.jmol_images/sage0-size500.jmol.png',
</code></pre>
<p>and I'm told to look at a temporary text file (which turns out to be empty).</p>
<p>So the questions are "Why does JMOL fail to create the third iteration of Menger's Sponge when I can view the image of it?", "How do I revise the code so JMOL won't fail?".</p>
<p>By the way, for the second iteration of Menger's Sponge, JMOL works.</p>
https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/?comment=24407#post-id-24407Sorry to post second comment.
I tried export "_JAVA_OPTIONS= -server -Xmx2048m"
(different variable from last time ???)
I still got the warnings you described but got a picture with K.show(). making it interactive jmol freezes...
(unable to finish launching).Mon, 06 Oct 2014 12:55:27 +0200https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/?comment=24407#post-id-24407Comment by bb16 for <p>Sorry, but I can't think of a good title for the question. I put together code for the Menger's Sponge (3d) [EDIT: and ran it in a Sage notebook. I also tried it in a Sage Cell Server.]</p>
<pre><code>H = J = K = Graphics()
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
H += cube().scale(1).translate(1/2+i, 1/2+j, 1/2+k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
J += H.translate(3/2+3*i, 3/2+3*j, 3/2+3*k)
for i in range(0,3):
for j in range(0,3):
for k in range(0,3):
if not((i==1 and j==1)or(i==1 and k==1)or(j==1 and k==1)):
K += J.translate(4.5+9*i, 4.5+9*j, 4.5+9*k)
#K.show()
K.save('Menger3.gif')
</code></pre>
<p>The code runs and creates the image of the 3rd iteration of Menger's sponge. But if I comment out: K.save('Menger3.gif') and uncomment K.show() then the code won't run. I get lots of errors like:</p>
<pre><code>__main__:19: UserWarning: Duplicate name: 'obj_660992.pmesh'
</code></pre>
<p>after which I'm told </p>
<pre><code>Traceback (click to the left of this block for traceback)
...
RuntimeError: Jmol failed to create file
'/tmp/tmpMSjmcm/.jmol_images/sage0-size500.jmol.png',
</code></pre>
<p>and I'm told to look at a temporary text file (which turns out to be empty).</p>
<p>So the questions are "Why does JMOL fail to create the third iteration of Menger's Sponge when I can view the image of it?", "How do I revise the code so JMOL won't fail?".</p>
<p>By the way, for the second iteration of Menger's Sponge, JMOL works.</p>
https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/?comment=24405#post-id-24405I got the same kind of errors for a different kind of plot.
The code is messy and uninteresting. Only my text file is not empty:
Viewer handling error condition: java.lang.OutOfMemoryError GC overhead limit exceeded.
(Note that this file is on the server.)
Which led me to think either the file or the computations involed were too big.
I tired export "_JAVA_OPTS= -server -Xmx1024m"
(still on the server) to grant more memory to java
It did work once but I do not know if it is reproducible (might just be chance)
jmol saving view failed to save all the objects (or redisplay them on my machine anyway)
I can reproce your error. making interactive displays a partial picture (not the whole cube)
(I am very new to all this so my guesses are likely unaccurate.)Mon, 06 Oct 2014 10:42:38 +0200https://ask.sagemath.org/question/24401/why-does-jmol-fail-here/?comment=24405#post-id-24405