Suppose we have a MeshRegion
that we want to export to an obj file with, say double precision. Is that possible with Export
? And how would we do that? The documentation on "OBJ"
does not list any options. I am asking explicitly about Export
. Of course, I could write my own OBJ exporter, but this would be somewhat awkward. (I've actually done it already.)
The default seems to export only about 6 decimal digits as the following example is supposed to show:
R = MeshRegion[
{{0., 0., 0.}, {Sqrt[2.], 0., 0.}, {0., Sqrt[2.], 0.}},
Triangle[{{1, 2, 3}}]
];
file = FileNameJoin[{$TemporaryDirectory, "a.obj"}];
Export[file, R];
MeshCoordinates[Import[file]] - MeshCoordinates[R]
{{0., 0., 0.}, {-3.60048*10^-6, 0., 0.}, {0., -3.60048*10^-6, 0.}}