Error importing Mathematica graphics
Error importing Mathematica graphics
I found no testcase in test-io.de.jreality.reader.mathematica. Is the import of Mathematica graphics ( still ) supported? If so, could you please provide a ( minimal ) testcase?
Last edited by ndroock1 on Thu 18. Mar 2010, 23:03, edited 1 time in total.
Re: Import Mathematica graphics
A simple example can be found at
http://www3.math.tu-berlin.de/jreality/ ... a_graphics
http://www3.math.tu-berlin.de/jreality/ ... a_graphics
Error when importing Mathematica graphics
I tried this earlier but didn't work.steffen wrote:A simple example can be found at
http://www3.math.tu-berlin.de/jreality/ ... a_graphics
Exactly as in the wiki I created the sinus.m file.
I tried to load the graphics using 'Load Content' menu option in the viewer.
Then in my Mathematica Workbench (=Eclipse) console i got the following message:
initing gl
graphics3D
line 1:12: unexpected token: Graphics3D
I have the last jReality version loaded from subversion. I have seen many files including grammar and parsers for a Mathematica Reader but unexpectedly no JUnit tests which explains my question.
I created the file with Mathematica 7, have tried Mathematica as well, same result.
Re: Error importing Mathematica graphics
I think there may be an error on the page
http://www3.math.tu-berlin.de/jreality/ ... a_graphics
To write out the mathematica graphics object, use the following:
instead of
http://www3.math.tu-berlin.de/jreality/ ... a_graphics
To write out the mathematica graphics object, use the following:
Code: Select all
g >> C:\sinus.m
Code: Select all
Graphics3D[g] >> C:\sinus.m
jReality core developer
-
- Posts: 17
- Joined: Thu 6. Mar 2008, 15:18
- Location: TU Berlin, Germany
- Contact:
Re: Error importing Mathematica graphics
The Mathematica Graphics3D Format is quite complicated and changed completely in version 7 (or 6???). The Mathematica import might work for same input, but it does not work for all input.
Try to export from Mathematica to the JavaView format (.jvx) (see guide/3DGeometryAndModelingFormats in the Mathematica Help Browser) which you may then import into JReality. At least for me that worked.
If that works for you let me know. We should then add this to the Wiki page.
Try to export from Mathematica to the JavaView format (.jvx) (see guide/3DGeometryAndModelingFormats in the Mathematica Help Browser) which you may then import into JReality. At least for me that worked.
If that works for you let me know. We should then add this to the Wiki page.
Paul Peters
Re: Error importing Mathematica graphics
Yes, using Export to a ".jvx" file of a graphic in Mathematica I managed to load the content in the jReality viewer. Amazingly cool.paul peters wrote:If that works for you let me know. We should then add this to the Wiki page.
Thanks.
-
- Posts: 17
- Joined: Thu 6. Mar 2008, 15:18
- Location: TU Berlin, Germany
- Contact:
Re: Error importing Mathematica graphics
Thx for checking. I updated the tutorial:
http://www3.math.tu-berlin.de/jreality/ ... a_graphics
and also checked the export/import of Graphics3d (via test.m) with Mathematica 7. It worked.
http://www3.math.tu-berlin.de/jreality/ ... a_graphics
and also checked the export/import of Graphics3d (via test.m) with Mathematica 7. It worked.
Paul Peters
Re: Error importing Mathematica graphics
Using the jvx format from Mathematica is great! I see colors and one can use multiple "graphics styles".
But, although I can see different colors in the jReality viewer, exporting it to the "u3d" or "pdf" format just results in "blue surfaces".
However, when I used the old parser with the '.m' format, the export of the color into 'u3d' format worked perfectly.
Any ideas?
But, although I can see different colors in the jReality viewer, exporting it to the "u3d" or "pdf" format just results in "blue surfaces".
However, when I used the old parser with the '.m' format, the export of the color into 'u3d' format worked perfectly.
Any ideas?
Re: Error importing Mathematica graphics
Hi srossegg,
can you provide us with a jvx file you exported and that produces the false colors when exporting? This would be helpfull.
Stefan
can you provide us with a jvx file you exported and that produces the false colors when exporting? This would be helpfull.
Stefan
Re: Error importing Mathematica graphics
Hello,
I recreated the jvx file with Mathematica80, which didn't work (see TPC.jvx).
The import of the m-file (not attached) shows the colors when exported to pdf, but unfortunately one can't use "Polygon" structures when using this kind of wrapper.
Since I have your attentation, I could also ask for a more "complicated" shading e.g.
nut = SphericalPlot3D[1 + Sin[15 \[Phi]] Sin[10 \[Theta]]/10, {\[Theta], 0, Pi}, {\[Phi],
0, 2 Pi}, Mesh -> None, ColorFunction -> "PlumColors"]
nut >> nut.m
Export["nut.jvx", nut]
In this case (see nut.jvx), both exports to pdf do not include the color which is shown in your viewerApp. But I guess this one is more complicated ...
Thanks!
I recreated the jvx file with Mathematica80, which didn't work (see TPC.jvx).
The import of the m-file (not attached) shows the colors when exported to pdf, but unfortunately one can't use "Polygon" structures when using this kind of wrapper.
Since I have your attentation, I could also ask for a more "complicated" shading e.g.
nut = SphericalPlot3D[1 + Sin[15 \[Phi]] Sin[10 \[Theta]]/10, {\[Theta], 0, Pi}, {\[Phi],
0, 2 Pi}, Mesh -> None, ColorFunction -> "PlumColors"]
nut >> nut.m
Export["nut.jvx", nut]
In this case (see nut.jvx), both exports to pdf do not include the color which is shown in your viewerApp. But I guess this one is more complicated ...
Thanks!
- Attachments
-
- examples.tar.gz
- tar file content:
- nut.jvx
- TPC.jvx - (207.7 KiB) Downloaded 74 times
Re: Error importing Mathematica graphics
Hi srossegg,
u3d merges the appearance of the material with that of the vertex colors. In jReality vertex color have the priority and overwrite the material behaviour. Please set the Appearance of the geometry to have a white diffuse color to see the vertex colors of your mesh. There still seems to be some bug in either in the export or in the adobe renderer regarding vertex colors. The diffuse and specular lighting is off when using vertex colors.
Hope that improves the sittuation.
Stefan
u3d merges the appearance of the material with that of the vertex colors. In jReality vertex color have the priority and overwrite the material behaviour. Please set the Appearance of the geometry to have a white diffuse color to see the vertex colors of your mesh. There still seems to be some bug in either in the export or in the adobe renderer regarding vertex colors. The diffuse and specular lighting is off when using vertex colors.
Hope that improves the sittuation.
Stefan