I would like to export VTK file in the Mathematica.
Clear["Global`*"]
SetDirectory[NotebookDirectory[]];
plotstyle = {Boxed -> False,
ViewPoint -> {1, 0, 0.7},
ImageSize -> 800};
size = 0.05;
coeff = 0.13;
numarrow2 = 6;
R2 = 1.5;
dtr2 = R2/6;
QV = 1;
x = r Cos[phi]; y = r Sin[ phi]; z = 0;
theta2 = \[Pi];
mx2 = coeff (Cos[QV phi] Sin[theta2]);
my2 = coeff (Sin[QV phi] Sin[theta2]);
mz2 = coeff (Cos[theta2]);
data2 = Flatten[Table[{{x, y, z}, {x + mx2, y + my2, z + mz2}}, {r, 0, R2,
dtr2}, {phi, 0, 2 \[Pi], (2 \[Pi])/numarrow2}], 1];
Graphics3D[{ColorData["Rainbow"][Flatten[#][[6]]], Arrowheads[size], Arrow[Tube[#, size/4]]} & /@ data2, plotstyle]
Export["FIG1a.vtk", %]
But, I always get the same error.
Export::nodta: Graphics3D contains no data that can be exported to the VTK format. >>
I researched the related mathematica's HELP but I cannot find the solution.
Thanks for any help.
Comments
Post a Comment