Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OK, well I think I've found a way to get the plot to evaluate. Apparently the method json_repr() will do it:

def test0():
    var('x,y,t')
    def f(x,y,t):
        if x < .5: return(sin(pi*x)*sin(pi*y))
        else: return(sin(pi*x)*sin(pi*y)*e^(-t))
    base_frame = point3d((.5,.5,1), color='red', size=10)
    frames = []
    for t in [0,1]:
        pic = base_frame
        pic += plot3d(lambda x,y:f(x,y,t), (x, 0, 1), (y, 0, 1))
        # This appears to force the line above to be "evaluated"
        foo = pic.json_repr(pic.default_render_params())
        frames += [pic,]
    return(frames)

OK, well I think I've found a way to get the plot to evaluate. Apparently the method json_repr() will do it:it (with much less overhead than actually saving to a file):

def test0():
    var('x,y,t')
    def f(x,y,t):
        if x < .5: return(sin(pi*x)*sin(pi*y))
        else: return(sin(pi*x)*sin(pi*y)*e^(-t))
    base_frame = point3d((.5,.5,1), color='red', size=10)
    frames = []
    for t in [0,1]:
        pic = base_frame
        pic += plot3d(lambda x,y:f(x,y,t), (x, 0, 1), (y, 0, 1))
        # This appears to force the line above to be "evaluated"
        foo = pic.json_repr(pic.default_render_params())
        frames += [pic,]
    return(frames)