BACK

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();

`GRTensorII Version 1.79 (R4)`

`6 February 2001`

`Developed by Peter Musgrave, Denis Pollney and Kay...

`Copyright 1994-2001 by the authors.`

`Latest version available from: http://grtensor.phy...

`D:/Grtii(6)/Metrics`

> qload(kerrnewmanmc);

`Default spacetime` = kerrnewmanmc

`For the kerrnewmanmc spacetime:`

Coordinates

x(up)

`x `^a = vector([t, r, u, phi])

`Line element`

` ds`^2 = -1/(r^2+u^2)*(-r^2+2*M*r-u^2-Q^2)*` d`*t^...
` ds`^2 = -1/(r^2+u^2)*(-r^2+2*M*r-u^2-Q^2)*` d`*t^...

Constraints = [u = a*cos(theta)]

`The Kerr Newman metric in Boyer Lindquist coordina...

> grcalc(RiemSq);

Created definition for R(dn,dn,up,up) 

`CPU Time ` = .270

> 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

`CPU Time ` = .81e-1

Dimensionless variables

> grmap(_,subs,r=x*M,Q=e*M,a=A*M,`x`):

Applying routine subs to RiemSq

> grdisplay(_);

`For the kerrnewmanmc spacetime:`

`Full Contraction of Riemann`

`K ` = -8*(-6*x^6*M^8+12*x^5*M^8*e^2-7*x^4*M^8*e^4+...
`K ` = -8*(-6*x^6*M^8+12*x^5*M^8*e^2-7*x^4*M^8*e^4+...

Define an appropriate object to plot

> K(x,A,e,theta):=M^4*grcomponent(RiemSq,[]);

K(x,A,e,theta) := -8*M^4*(-6*x^6*M^8+12*x^5*M^8*e^2...
K(x,A,e,theta) := -8*M^4*(-6*x^6*M^8+12*x^5*M^8*e^2...

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);

[Maple Plot]

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.