Mathemtica's 3Dgraphics PDF make Inkscape crash...

General discussions about Inkscape.
osfight_de
Posts: 4
Joined: Thu Mar 18, 2010 3:05 am

Mathemtica's 3Dgraphics PDF make Inkscape crash...

Postby osfight_de » Fri Mar 19, 2010 2:36 am

Hi everybody,

I just joined the forum and immediately come up with a tough one.

Attached is a PDF I saved with Mathematica 7, a 3D FCC lattice, using Save As > PDf and option use most compatible vector representation, the file is 500kB and seems to work great with Foxit Pdf Reader (scaling while zooming in and out ). And, I can open it in Inkscape 0.47.
However, It looks like each single pixel of the PDF is treated like a path (which results in a gazillion paths) and Inkscape slows done as crazy.

(BTW: Saving SVG in Mathematica won't work, Mathematica just crashes or produces huge files.)

1st Try - Saving as SVG

Trying to save it as Plain SVG will work on Windows and Ubuntu and save a file of 9.1 mega bytes, which makes it hard to work with. The file opens in inkscape but not improvement in performance visible.

2nd Try - Combining Paths

Does not work on both OS. The job finishes after quite while but than the graphic disappears and only a frame box remains.

3rd Try - Grouping elements

Seems to help a bit, but not as good as wished.

What am I doing wrong, any idea how to improve things?

User avatar
tomh
Posts: 218
Joined: Sat Feb 14, 2009 10:14 pm

Re: Mathemtica's 3Dgraphics PDF make Inkscape crash...

Postby tomh » Tue Mar 23, 2010 4:28 am

Sorry, I can't see the attachment, I don't think this forum can coup with them.

However I have had a play around with some files that I have created myself, as I have access to Mathmatica.

Some quick questions: Does the graphic have any 3d shading, as each different color looks like it gets exported from Mathematica as a separate object. E.g: 1 orange ball = 1 object, 1 shaded ball = 2000 objects. That would explain the very large svg files. This is the basic problem that you need to deal with (at source in Mathematica), or give up and export as a bitmap.

3d plot function appears to be set up to produce a raster image, and the vector export from it will just be the individual pixels from it's output no-matter how you export it. so you are really just dealing with a bitmap stored in a really vector format for this type of data.

EG: This

Plot3D[Sin[x]*Cos[y], {x, 0, 10}, {y, 0, 10}, ColorFunction -> Hue, Mesh -> None]

will always give you an essentially bitmap image, whereas something like

http://demonstrations.wolfram.com/XRayR ... icLattice/

will give you the kind of vector image that you need when exported.

osfight_de
Posts: 4
Joined: Thu Mar 18, 2010 3:05 am

Re: Mathemtica's 3Dgraphics PDF make Inkscape crash...

Postby osfight_de » Tue Mar 23, 2010 9:26 pm

tomh wrote:Sorry, I can't see the attachment, I don't think this forum can coup with them.

However I have had a play around with some files that I have created myself, as I have access to Mathmatica.

Some quick questions: Does the graphic have any 3d shading, as each different color looks like it gets exported from Mathematica as a separate object. E.g: 1 orange ball = 1 object, 1 shaded ball = 2000 objects. That would explain the very large svg files. This is the basic problem that you need to deal with (at source in Mathematica), or give up and export as a bitmap.

3d plot function appears to be set up to produce a raster image, and the vector export from it will just be the individual pixels from it's output no-matter how you export it. so you are really just dealing with a bitmap stored in a really vector format for this type of data.

EG: This

Plot3D[Sin[x]*Cos[y], {x, 0, 10}, {y, 0, 10}, ColorFunction -> Hue, Mesh -> None]

will always give you an essentially bitmap image, whereas something like

http://demonstrations.wolfram.com/XRayR ... icLattice/

will give you the kind of vector image that you need when exported.


Thanks for help. I use the free diamond lattice notebook you can find here http://demonstrations.wolfram.com/DiamondLattice/ it is a real 3Dgraphics object and you are right: It has gradients and shading but this is what it makes actually so pretty. It looks like Mathematica saves them as a thousand of smaller triangles with different colors to mime gradients. I posted also in the Mathematica forum but no response yet. My conclusion is the following: The problem is on Mathematica's site, but it would be still nice if I could manipulate the picture in any way in Inkscape.

My idea is to save is as a 3d graphics file (cad or whatever) and using another program to export it as SVG. I tried to use blender but it looked too complicated. Any idea? I'll post my progress.

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Mathemtica's 3Dgraphics PDF make Inkscape crash...

Postby druban » Wed Mar 24, 2010 5:18 am

Hi OsFight
You wrote:"...saved with Mathematica 7, a 3D FCC lattice, using Save As > PDf and option use most compatible vector representation"

Try saving a PDF without opting for vector representation.
Your mind is what you think it is.

osfight_de
Posts: 4
Joined: Thu Mar 18, 2010 3:05 am

Re: Mathemtica's 3Dgraphics PDF make Inkscape crash...

Postby osfight_de » Wed Mar 24, 2010 11:20 am

But I want a vector graphics, not bitmap in a PDF container.

I spent the whole day trying to reproduce the graphics in Blender as there are some SVG export plugings. However, they are all in a beta stadium and none of them supports gradients or more complex drawings. Screw that.

I also reanimated windows and tried to open the files in Illustrator 3. Illustrator will open all files after while (eps, svg and pdf) but suffers from the same problem.Again, no way of combining paths or grouping them in a way which allows me to work with the files. The program is almost as slow as Inkscape.

osfight_de
Posts: 4
Joined: Thu Mar 18, 2010 3:05 am

Re: Mathemtica's 3Dgraphics PDF make Inkscape crash...

Postby osfight_de » Wed Mar 24, 2010 9:36 pm

Here, I am using the notebook http://www.demonstrations.wolfram.com/ThermalMotionInASolid/ for an fcc lattice and save the picture with Save As -> PDf -> Option: Use most compatible vector representation. http://forums.wolfram.com/student-support/topics/22179/ is the mathematica forum entry.


Return to “General Discussions”