1
$\begingroup$

I would like to export 3D data obtained with Mathematica to asymptote. For instance, this nice post shows how to draw a cartoon of the earth

gdm = Reverse[QuantityMagnitude[
GeoElevationData["World", "Geodetic", GeoZoomLevel -> 3, 
 UnitSystem -> "Metric"]]];
et = ListInterpolation[gdm, {{-90, 90}, {-180, 180}}];

With[{s = 2*^5}, ParametricPlot3D[(1 + 
 et[\[CurlyPhi], \[Lambda]]/
  s) {Cos[\[CurlyPhi] \[Degree]] Cos[\[Lambda] \[Degree]], 
Cos[\[CurlyPhi] \[Degree]] Sin[\[Lambda] \[Degree]], 
Sin[\[CurlyPhi] \[Degree]]}, {\[Lambda], -180, 180}, {\[CurlyPhi], -90, 90}, Axes -> None, Boxed -> False, Mesh -> False, ColorFunctionScaling -> False, ColorFunction -> (With[{r = Norm[{#1, #2, #3}]}, 
  ColorData["HypsometricTints", s r - s]] &), MaxRecursion -> 1, PlotPoints -> {1000, 500}, ViewPoint -> {-1.3, 2.4, 2.}]]

Is there a way to export the data in such a way that it can be used in asymptote? That is, it should be really 3D data such that one could add, say, Saturn-like rings. (I understand that in principle one may also manipulate the picture with Mathematica. However, I really want to access some of the nice features of asymptote, which are somewhat hard to reproduce with Mathematica.)

$\endgroup$
  • $\begingroup$ The documentation for the Asymptote tells us: Asymptote can read and write text files (including comma-separated value) files and portable XDR (External Data Representation) binary files. So, you should export your graphics from MMA as text file. The structure of this file have to be adapted to Asymptote syntax. $\endgroup$ – Rom38 Nov 20 '17 at 4:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.