I am trying to export a simple cuboid into .SVG format. In the output file, the cuboid is finely meshed, which increases the file size. How to remove this detailed mesh?

 Export[FileNameJoin[{NotebookDirectory[], "trial.svg"}], Graphics3D[Cuboid[]]]

enter image description here

  • 7
    $\begingroup$ If you want the svg file size reduced, I found this reduces it from 48k to 15k on windows 7, using V 9.01 Export["trial.svg", Graphics3D[{FaceForm[], Cuboid[]}]] This removes all face information. $\endgroup$
    – Nasser
    Dec 3, 2013 at 3:06
  • $\begingroup$ @Nasser, your answer is already good enough for me, thanks! $\endgroup$
    – saturasl
    Dec 3, 2013 at 19:23

1 Answer 1


This mesh depends on the whole size of the Graphics3D:

Export["trial.svg", Graphics3D[Cuboid[], PlotRange -> 5, Boxed -> False], 
   Background -> None]

It produces 2.8 KB file (15x reduction) on Linux without the detailed mesh

enter image description here

For further size reduction you can use compressed SVGz format

Export["trial.svgz", ...]

It produces 666 B file. This ability seems to be undocumented.

  • $\begingroup$ Nice! I wonder why ... $\endgroup$ Dec 3, 2013 at 15:18
  • $\begingroup$ @ybeltukov, Your answer shows another example of undocumented attribute... Because in the documentation of SVG format there is no information about the Background. But I understand that the bounding box can itself takes some amount of file storage, so turning it off reduce file size. Thanks! $\endgroup$
    – saturasl
    Dec 3, 2013 at 19:39
  • 1
    $\begingroup$ @saturasl The Background option is hidden in Details section in the documentation of Export. See also my update about svgz format. A lot of applications can use it. It can be useful for you. $\endgroup$
    – ybeltukov
    Dec 3, 2013 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.