Obj export file size

Any idea why the exact same model [same face/edge count] exported from rhino in .obj is about 3 time large [file size] then when exported from Zbrush…? [for example… it may be similar from other apps]

thanks a lot
Akash

hey! I have faced the same problem when transfering model between 3dsmax and rhino, try exporting the model as .dwg or .3ds format.

Thanks a lot
Yet the question is about .obj only. [I don’t need the other formats]

with best regards
Akash

Have you checked the units of both softwares and files?

Hello - obj is a text format, not binary, and therefore not very efficient in terms of disk space.

-Pascal

Thanks Pascal,
there is no problem with it being large per se, it is that Rhino saves the same .obj in a 3 to 4 times larger size than ZB. both .obj both identical down to each vertex.

thanks a lot
Akash

Hi Akash - is ZB’s file also text? There may be a binary version of obj for all I know… otherwise I’ll have to ask @tim … he’s the obj master.

-Pascal

Hi @pascal Here’s the same .obj [demo head from zb Lightbox]
all I did is importing to Rhino, and exporting, without touching it at all.
to-Rhino.obj (3.3 MB) FromRhino.obj (9.6 MB)

thanks a lot
Akash

Hi Akash - fromRhino certainly has more lines, by a lot - Rhino is writing vertex normals, it looks like - these are not in the file from ZB

-Pascal

Hi Akash,

There is no binary version of OBJ. But you can control the file size quite a bit. You can omit vertex normals and textures. You can change the precision of the numbers that go into the file. You can make a coarser mesh so there’s fewer items that go into the file.

Tim

I forgot to mention that if you’re importing meshes then you may want to turn off the “Use render mesh setting”. Seems like they would match on a mesh but I don’t know that for sure.

If you turn off vertex normals, vertex textures and use render mesh and set your number precision to 8 you get a 3.43Mb file.

Thanks Tim.

-Pascal

Thanks a lot
I use this Macro with a button for sending directly to ZB [going back and forth all the time between it and Rhino]. it gives the resolution that is correct for my need [can’t go any lower]. it overwrite it self every time so size is not an issue here

! -Export Pause GeometryOnly=Yes SaveTextures=Yes SaveNotes=No “/Users/akash/Zbrush Work/FromRhino.obj” VertexWelding=Welded YUp=Yes Enter DetailedOptions AdvancedOptions Angle=0 AspectRatio=6 Distance=0.0005 Density=1.0 Grid=0 MaxEdgeLength=0 MinEdgeLength=0.0001 EnterEnd

From what you suggest it seems there’s a need for a different one for the finished part [that goes for printing]. so it is not so heavy to send out.

It is just that it has to be so that rhino won’t change the mesh in any way.

is that referring to what is now 17 in the formatting tab?

Not sure I understand how to get these into a macro…

with many thanks
Akash

I don’t know scripting well myself but these are the command line options to pay attention to. Looks like “use render meshes” didn’t make it into the command line. I’ll get that fixed.

Something like this should work-

! _-Export "path&filename.obj" _WritePrecision=8 _ExportmeshvertexNormals=_No _ExportmeshTextureCoordinates=_No _EnterEnd

-Pascal

thanks Tim
pushing it a little bit more [sorry]… But what is WritePrecision?

And how do I get the command line string on the Mac?

thanks a lot
Akash

It has to do with number of digits that are written to a file for a given number. So if your number is 12.3456789 and you have 8 for WritePrecision you’ll see the entire number. But if you have it set to 3, for example, you’d see 12.345 in your file. I may not have the nitty gritty details right but that’s the gist of it. Someone who knows can correct me if I’m wrong.

The max is 17 because anymore than that exceeds the precision of a float number. In version 7 doubles are used for vertexes of meshes internally but normals and texture coordinates are still floats. It doesn’t make sense to write a whole bunch of double digits to a text file anyway.

Tim

1 Like