Implicit Plot 3D - ThreeJS

asked 2018-03-13 11:11:37 +0100

jepstra gravatar image

I'm trying to plot several algebraic surfaces, most of which have singularities and other especial properties. Using implicit_plot3d and viewer='threejs' works fine for instance

var('x,y,z')
p=x^3+y^3+z^3+1-0.25*(x+y+z+1)^3
r=5
color='aquamarine'
s = implicit_plot3d(p==0, (x,-r,r), (y,-r,r), (z,-r,r), plot_points=50, region=lambda x,y,z: x**2+y**2+z**2<=r*r, color=color)
s.show(frame=False, viewer='threejs')

But when increasing plot_points=100, SageCell does note return any output (demo) (in a Sage Notebook, everything works fantastic). I guess the query may be too hard for SageCell...

Is there a way to optimize the code / query for SageCell to plot algebraic surfaces with acceptable quality?

edit retag flag offensive close merge delete

Comments

1

implicit_plot3d computes the function to plot at a number of points proportional to the cube of plot_points. If you double plot_points, you (roughly) octuple the necessary RAM and time.

You might, for example, search for a way to parameterize your surfaces, thus reducing your needs to the square of your resolution.

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2018-03-14 01:30:05 +0100 )edit