Export to .obj format does not work for me

Help
Florite
2011-11-22
2013-04-22
  • Florite
    Florite
    2011-11-22

    hi,
    I'm a newbie to BrlCad and want to use constructive solid geometry then export to the (Wavefront) .obj format. It does not seem to be working for me.  I am running Windows 64, 8Gb ram, BrlCad 7.2.0. What am I doing wrong or is the export to .obj just not working?  I tried with the simple demo mug but the obj file could not be imported in either of Blender 2.6 or Eon Vue 6I.  Both of those programs have imported .obj files created from other program nicely.  I tried BrlCad with a simple box 
    "arb box.s 0 0"
    "r region.r u box.s"  (raytrace showed there is a box)
    "g-obj.exe -o D:\Documents\hobbies\BrlCad\building_test\brl2obj.obj D:\Documents\hobbies\BrlCad\building_test\brl2obj.g box.s"
    This could hardly be simpler but the box could not be imported into Blender 2.6 or Eon Vue6I.
    The whole brl2obj.obj file is below.  Note that the "f" data lines are for faces but they have all "9"s on them which is incorrect.
    # BRL-CAD generated Wavefront OBJ file (Units mm)
    # BRL-CAD model: D:\Documents\hobbies\BrlCad\building_test\brl2obj.g
    # BRL_CAD objects: box.s
    g box.s
    v -50.800000 0.000000 508.000000
    v -50.800000 -508.000000 508.000000
    v 0.000000 0.000000 508.000000
    v 0.000000 -508.000000 508.000000
    v 0.000000 -508.000000 0.000000
    v -50.800000 0.000000 0.000000
    v 0.000000 0.000000 0.000000
    v -50.800000 -508.000000 0.000000
    f 9 9 9
    f 9 9 9
    f 9 9 9
    f 9 9 9
    f 9 9 9
    f 9 9 9
    f 9 9 9
    f 9 9 9
    f 9 9 9
    f 9 9 9
    f 9 9 9
    f 9 9 9

     
  • Sean Morrison
    Sean Morrison
    2011-11-23

    You're not doing anything wrong.  You just encountered a recently-introduced bug.  Fortunately, the bug was identified about a week ago, though, and is already fixed.

    The upcoming 7.22.0 release due out in about a week and a half will include the fix for that importer.  In the meantime, you're available options will be to compile from source or use one of the other polygonal exporters.  The following converters are nearly identical in capability to the OBJ exporter:  g-dxf, g-off, g-x3d.  There are others as well that Blender will definitely be able to read.

    Cheers!
    Sean

     
  • Florite
    Florite
    2011-11-24

    hi,
    Thanks for letting me know. Blender has in import option for .x3d so I ran g-x3d. The g-x3d program gives a wonderfully uninformative message "Attempting /box.s".  The only way to know if it succeeded is to try the import.  Blender 2.6 did not complain about the import but nothing showed up. Sigh. Blender 2.6 does not seem to be able to import the other two file formats.

    Googling "brlcad 7.22" showed a message with this comment "There are a lot of changes that have been under development the past few
    months affecting how geometry is tessellated.  Basically, all of our
    polygonal exporters (including g-obj) are getting an overhaul that is
    expected to be unveiled in the 7.22 release so there is hope coming down
    the pipeline.
    We're painfully aware of the pains users have to go through exporting
    geometry.  The problem runs deep in all CAD software when converting
    between geometric representation formats (from implicit CSG to polygonal
    mesh in this instance) and it's a hard problem to address, but hopefully
    our upcoming changes will at least make things better. "

    So I think I'll wait for 7.22.  Thanks for looking into this and getting back to me quickly.