Converting a Maple plot3d Object to a Graphics3D file.
Note: Worksheets must be executed from the LiveTranslate folder.
The plot to convert to a Graphics3D file. Note: Do not include any axes with the plot object.
This example uses GRTensorII to plot the Kretschmann scalar or a Kerr-Newman Black Hole.
You need GRTensorII and the input file kerrnewmanmc.mpl available from grtensor.org
Calculate the scalar
> restart: grtw();
> qload(kerrnewmanmc);
> grcalc(RiemSq);
Created definition for R(dn,dn,up,up)
> gralter(_,13,6,7);
Component simplification of a GRTensorII object:
Applying routine `Apply constraints repeatedly` to object RiemSq
Applying routine expand to object RiemSq
Applying routine factor to object RiemSq
Dimensionless variables
> grmap(_,subs,r=x*M,Q=e*M,a=A*M,`x`):
Applying routine subs to RiemSq
> grdisplay(_);
Define an appropriate object to plot
> K(x,A,e,theta):=M^4*grcomponent(RiemSq,[]);
Define the plot. (Choose values of A and e.)
> PlotSurface:=plot3d(subs(e=0.0,A=0.8,K(x,A,e,theta)),x=1..2,theta=0..Pi,grid=[75,75]):
> with(plots):
Warning, the name changecoords has been redefined
A view of the plot we are converting.
> plots[display](PlotSurface);
Add the plottools package that includes the vrml function.
> with(plottools):
Warning, the name arrow has been redefined
Export the plot to the directory containing this Maple worksheet.
> vrml(PlotSurface,`.\\vrml.wrl`):
Call the java class to convert the vrml file to a Graphics3D file. The arguments after TranslateFile (the java class) include the name of the vrml file, followed by the output Graphics3D file, followed by optional arguments.
> system(`java -classpath .\\classes\\livetrans TranslateFile vrml.wrl kret.m PlotLabel=Plot AxesLabel={"""r/M""",theta,"""K*M^4"""}`):
Two files will be created. A zip file (kret.zip) containing the newly created Graphics3D file, and an HTML file (kret.html) to display the plot with. Make sure the java archive live.jar is in the same directory as the HTML file. Change "kret" and AxesLabel to whatever is appropriate.