trouble displaying 3D graphics

189 views
Skip to first unread message

John Cremona

unread,
Nov 8, 2021, 6:25:24 AM11/8/21
to SAGE support
I don't often use 3D graphics, but when I run implicitplot3d() I get
a file permissions error (on ubuntu 20.04):

# example from the docstring
sage: var('x,y,z')
(x, y, z)
sage: implicit_plot3d(x^2+y^2+z^2==4, (x,-3,3), (y,-3,3), (z,-3,3))
Launched html viewer for Graphics3d Object

Over in my browser (chromium-browser) I see the error message "Access
to the file was deniedThe file at
file:///home/john/.sage/temp/john-Latitude-E5470/2250012/tmp_x5e1jfy0.html
is not readable. It may have been removed, moved or file permissions
may be preventing access." I changed the permissions on .sage and
everything under it to a+rx and reloaded, with no change. I deleted
all of ~/.sage and restarted sage and reran the commands, but the same
happened.

I can view other html files in my home directory using the browser.

What should I do?

John

rickhg12hs

unread,
Nov 8, 2021, 1:13:48 PM11/8/21
to sage-support
After
```
sage.misc.viewer.viewer.browser('firefox')
```
... do you experience the same behavior?

Dima Pasechnik

unread,
Nov 8, 2021, 1:35:51 PM11/8/21
to sage-support
I cannot  view the file generated by these commands (on latest Sage beta) in a new Chrome, it just displays blank screen.



--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/a1f134eb-76b2-41b3-8715-2021a5323349n%40googlegroups.com.

Dima Pasechnik

unread,
Nov 8, 2021, 1:40:32 PM11/8/21
to sage-support
On Mon, Nov 8, 2021 at 6:35 PM Dima Pasechnik <dim...@gmail.com> wrote:
I cannot  view the file generated by these commands (on latest Sage beta) in a new Chrome, it just displays blank screen.

oops, it's silly of me to assume it would work without a correct three.js.min link in the body.

Dima Pasechnik

unread,
Nov 8, 2021, 2:15:35 PM11/8/21
to sage-support
On Mon, Nov 8, 2021 at 6:40 PM Dima Pasechnik <dim...@gmail.com> wrote:


On Mon, Nov 8, 2021 at 6:35 PM Dima Pasechnik <dim...@gmail.com> wrote:
I cannot  view the file generated by these commands (on latest Sage beta) in a new Chrome, it just displays blank screen.

oops, it's silly of me to assume it would work without a correct three.js.min link in the body.

fixed now, this way it works in Firefox as well as in Chrome.
Perhaps it has something to do with how the interaction of html/js works in Sage.
Upon being posted to a proper http server, it works.
Without it, less so.

It works in Jupyter, i.e. if you start Sage as ./sage -n 
and evaluate a cell with lines

var('x,y,z')
implicit_plot3d(x^2+y^2+z^2==4, (x,-3,3), (y,-3,3), (z,-3,3))

you get the picture all right.

Dima Pasechnik

unread,
Nov 8, 2021, 3:25:36 PM11/8/21
to sage-support
On Mon, Nov 8, 2021 at 7:15 PM Dima Pasechnik <dim...@gmail.com> wrote:


On Mon, Nov 8, 2021 at 6:40 PM Dima Pasechnik <dim...@gmail.com> wrote:


On Mon, Nov 8, 2021 at 6:35 PM Dima Pasechnik <dim...@gmail.com> wrote:
I cannot  view the file generated by these commands (on latest Sage beta) in a new Chrome, it just displays blank screen.

oops, it's silly of me to assume it would work without a correct three.js.min link in the body.

fixed now, this way it works in Firefox as well as in Chrome.
Perhaps it has something to do with how the interaction of html/js works in Sage.
Upon being posted to a proper http server, it works.
Without it, less so.

It works in Jupyter, i.e. if you start Sage as ./sage -n 
and evaluate a cell with lines

var('x,y,z')
implicit_plot3d(x^2+y^2+z^2==4, (x,-3,3), (y,-3,3), (z,-3,3))

you get the picture all right.

it turns out it works in Firefox from terminal, too - I just needed to restart it, as it was updated... Duh.

Eric Gourgoulhon

unread,
Nov 9, 2021, 4:16:34 AM11/9/21
to sage-support
I confirm the issue experienced by John with Chromium: on my Ubuntu 20.04.3 computer, the implicit_plot3d command from Sage console
- works out of the box by opening a new tab in Firefox (my default browser)
- results in a file access error with Chromium, after having selected the latter by
  sage: sage.misc.viewer.viewer.browser('chromium')
 
It turns out that one cannot even open the directory ~/.sage from Chromium with a simple CTRL+O: this results in "Permission denied", while the same CTRL+O works fine with Firefox. Actually, no hidden directory can be opened from Chromium. So this is certainly a configuration issue on the Chromium side.

Eric.

Eric Gourgoulhon

unread,
Nov 9, 2021, 4:23:51 AM11/9/21
to sage-support
Le mardi 9 novembre 2021 à 10:16:34 UTC+1, Eric Gourgoulhon a écrit :
I confirm the issue experienced by John with Chromium: on my Ubuntu 20.04.3 computer, the implicit_plot3d command from Sage console
- works out of the box by opening a new tab in Firefox (my default browser)
- results in a file access error with Chromium, after having selected the latter by
  sage: sage.misc.viewer.viewer.browser('chromium')
 
It turns out that one cannot even open the directory ~/.sage from Chromium with a simple CTRL+O: this results in "Permission denied", while the same CTRL+O works fine with Firefox. Actually, no hidden directory can be opened from Chromium. So this is certainly a configuration issue on the Chromium side.

Eric.

The Chromium issue with hidden files has been already reported here:
No solution has been proposed though...

Dima Pasechnik

unread,
Nov 9, 2021, 4:38:29 AM11/9/21
to sage-support
I wonder if 'file:///' must be present in the URL for the script source for Chrome/Chromium to load it.

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.

Eric Gourgoulhon

unread,
Nov 9, 2021, 5:23:05 AM11/9/21
to sage-support
Le mardi 9 novembre 2021 à 10:38:29 UTC+1, dim...@gmail.com a écrit :
I wonder if 'file:///' must be present in the URL for the script source for Chrome/Chromium to load it.

This does not seem to be an issue with 'file:///' in the URL since Chromium refuses to open any hidden directory while browsing directories in the window opened after CTRL+O. 

Dima Pasechnik

unread,
Nov 9, 2021, 7:06:34 AM11/9/21
to sage-support
Right, one can see more of these "Chromium cannot open hidden files/directories" posts
elsewhere, cf. e.g.

I don't see a good and quick way out, rather than renaming ~/.sage/ to something without leading '.'.

 




--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.

John Cremona

unread,
Nov 9, 2021, 12:15:39 PM11/9/21
to sage-support
Thanks for all the replies. I did not respond earlier just because I have my Google groups set to daily summary for this group which meant that none of the replies even landed in my inbox until today's summary. That's not very helpful of Google.

OK, so for the time being I ll use Firefox to see these. I'm sure I will be able to find out how to get sage to use that instead of my default browser.

John

John H Palmieri

unread,
Nov 9, 2021, 2:36:43 PM11/9/21
to sage-support
Is there a way for users to redefine SAGE_TMP (without editing Sage source code) so that these graphics files would be produced elsewhere?

John Cremona

unread,
Nov 10, 2021, 12:17:49 PM11/10/21
to sage-support
As expected, using firefox to navigate to the file in .sage works fine.  But also, I found that within a notebook the 3d display is just fine on chromium too -- complete with rotation and zooming in and out.  That is very nice.
Reply all
Reply to author
Forward
0 new messages