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.Wed, 10 Feb 2021 19:07:25 +0100plot3d shows a black windowhttps://ask.sagemath.org/question/55661/plot3d-shows-a-black-window/ I am using Manjaro 20.1 linux with firefox 85 and Chromium 88. I update to sage math 9.2 and now the plot3d only shows a black screen. It works with jmol and tachyon, but not with threejs nor canvas3d.
Any help is appreciated.
Thanks in advance13negroWed, 10 Feb 2021 19:07:25 +0100https://ask.sagemath.org/question/55661/canvas3d plot does not change.https://ask.sagemath.org/question/10392/canvas3d-plot-does-not-change/I am plotting with show(plt, viewer="canvas3d").
It works the first time, but I always get the same plot no matter how I change what goes into the plt variable. This does not happen when I plot with viewer="jmol".
How do I get canvas3d to refresh its plot?feynmanSat, 21 Sep 2013 19:39:43 +0200https://ask.sagemath.org/question/10392/Interactive viewers for 3d plots?https://ask.sagemath.org/question/10365/interactive-viewers-for-3d-plots/I've been spending much of today trying to create 3D plots. I find that the default viewer (jmol) works fine. I can't get java3d to work (and yes, I gave the java 3d libraries): in a console it does nothing; in a browser I get a still image, but "Click for interactive view" causes the browser to crash (firefox, chrome, midori, all under linux). Canvas3d does give me an interactive view, but some of the plot elements are missing. I have a surface, plane, curve, line, etc all plotted with something like
(S+P+C+L).show(viewer='canvas3d')
however for some reason the curve and line are missing. Maybe canvas3d doesn't like 2d elements...? So far only jmol has given me full interactivity of the entire plot. But I can't get it to export to an image file properly.
Is there any magic by which I can get java3d and canvas3d to work?AlasdairFri, 19 Jul 2013 05:10:14 +0200https://ask.sagemath.org/question/10365/canvas3d: displaying labels on axes and morehttps://ask.sagemath.org/question/9189/canvas3d-displaying-labels-on-axes-and-more/Is there a way to show the labels and numbers on the axes when plotting wireframe polygons in canvas3d? (so that the display is more like Jmol) So far I've managed the axes to be shown but there are no labels and there is no benefit from displaying it.
Also, I'm trying to make sage print the coordinates of the vertices of the selected facet... this code displays "'_PolytopeFace' object is not callable" error. I need sage to print the coordinates so that I can use this to plot tiny spheres at the vertices (as canvas3d doesn't allow you to print points...). Is there a more efficient way of going about it?
Thank you
------------------
P = LatticePolytope([[1,2,3,4],[5,2,5,6],[2,2,5,2],[-3,-2,-5,-1],[-2,-2,-2,-1]])
from sage.geometry.polyhedron.plot import ProjectionFuncStereographic
r=7
facets = P.faces()[3]
@interact
def _(theta_one = slider(0,2*pi,pi/20, default = pi/4, label="theta_one"),
theta_two = slider(0,2*pi,pi/20, default = pi/4, label="theta_two"),
phi = slider(0,2*pi,pi/20, default = pi/4, label="phi"),
u = slider(0, P.nfacets()-1, step_size=1, default=None, label="Nominate a facet")):
a=r*sin(theta_one)*sin(theta_two)*cos(phi)
b=r*sin(theta_one)*sin(theta_two)*sin(phi)
c=r*sin(theta_one)*cos(theta_two)
d=r*cos(theta_one)
proj = ProjectionFuncStereographic([a,b,c,d])
projected_vertices = [proj(v) for v in P.vertices().columns()]
faces = P.faces()[2]
faces_as_vertex_lists = [[projected_vertices[n] for n in face.traverse_boundary()] for face in faces]
scene = Graphics()
for vert_list in faces_as_vertex_lists:
scene = scene + polygon3d(vert_list, color='blue')
scene.show(viewer='canvas3d', axes=True, )
ff = facets[u]
print ff
selected_v = [ff(i) for i in projected_vertices]
print selected_vglee2Mon, 30 Jul 2012 10:03:21 +0200https://ask.sagemath.org/question/9189/using interact and canvas 3dhttps://ask.sagemath.org/question/9184/using-interact-and-canvas-3d/Hi, I'm not sure what I'm doing wrong but my code doesn't seem to be working. I have no errors when I run this code but the input box doesn't appear at all...
------------
P = LatticePolytope([[1,2,3,4],[5,2,5,6],[2,2,5,2],[-3,-2,-5,-1],[-2,-2,-2,-1]])
from sage.geometry.polyhedron.plot import ProjectionFuncStereographic
r=7
@interact
def _(theta_one = slider(0,2*pi,pi/20, default = pi/4, label="theta_one"),
theta_two = slider(0,2*pi,pi/20, default = pi/4, label="theta_two"),
phi = slider(0,2*pi,pi/20, default = pi/4, label="phi")):
a=r*sin(theta_one)*sin(theta_two)*cos(phi)
b=r*sin(theta_one)*sin(theta_two)*sin(phi)
c=r*sin(theta_one)*cos(theta_two)
d=r*cos(theta_one)
proj = ProjectionFuncStereographic([a,b,c,d])
projected_vertices = [proj(v) for v in P.vertices().columns()]
faces = P.faces()[2]
faces_as_vertex_lists = [[projected_vertices[n] for n in face.traverse_boundary()] for face in faces]
scene = Graphics()
for vert_list in faces_as_vertex_lists:
scene = scene + polygon3d(vert_list, color='blue')
scene.show(viewer='canvas3d', axes=True)
def highlight_facet(facet_index = input_box(x, label="facet index")):
facet_index = P.facets()[x]
if facet_index == False:
print "this facet does not exist"
if facet_index == True:
V = [projected_vertices(n) for n in facet_index]
print Vglee2Thu, 26 Jul 2012 12:31:49 +0200https://ask.sagemath.org/question/9184/