Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#18 BRL 7.10 to CUBIT ACIS converter

release 7.10
closed-fixed
Sean Morrison
5
2007-12-18
2007-10-11
rmf166
No

Hello,

I am attempting to compile and correctly execute a code in the BRL-CAD 7.10 source package. I want to take a BRL-CAD solid model and imported it to CUBIT (10.2) for meshing. There is a utility in the directory ~/brlcad/brlcad-7.10.2/src/external/Cubit that in theory should make this possible. I downloaded and built the CGM libraries from the Sandia website (http://cubit.sandia.gov/cgm). I tried using the Makefile that comes with the g-sat.cxx code and I get an error involving variable and class declarations. The attatchment includes the full description of the error message.

What are some possible solutions to this issue?

Thank you

Discussion

1 2 > >> (Page 1 of 2)
  • rmf166
    rmf166
    2007-10-11

    error message

     
    Attachments
  • Sean Morrison
    Sean Morrison
    2007-10-12

    Logged In: YES
    user_id=785737
    Originator: NO

    I was just talking with one of the other developers on Friday about this very same issue. The makefile template in src/external/Cubit presently has hard-coded paths in it that would have to be updated in order for it to compile (at least it's very unlikely that your paths match the dev that wrote it!). You should be able to either edit src/external/Cubit/Makefile.am, make the necessary changes to update the paths, and then rerun make in that directory in order for it to work. You could probably get it to work without the edit by setting the appropriate CPPFLAGS and LDFLAGS during make (e.g. CPPFLAGS="-I/opt/path/Cubit/include" LDFLAGS="-L/opt/path/Cubit/lib make). It of course won't be anywhere near that "brief" as my example, but hopefully gives you the idea of what I mean. The Makefile.am lists all of the various directories and libraries of Cubit that it's trying to link against.

    Cheers!
    Sean

     
  • Sean Morrison
    Sean Morrison
    2007-10-12

    • milestone: 627207 --> release 7.10
    • assigned_to: nobody --> mjgillich
    • status: open --> open-accepted
     
  • rmf166
    rmf166
    2007-10-12

    Logged In: YES
    user_id=1911181
    Originator: YES

    Thank you for the tip! I've been able to reduce my errors to the following: (looks like a function definitions problem)

    g-sat.cxx: In function ?tree* primitive_func(db_tree_state*, db_full_path*, rt_db_internal*, void*)?:
    g-sat.cxx:640: error: ?X? was not declared in this scope
    g-sat.cxx:640: error: ?Y? was not declared in this scope
    g-sat.cxx:640: error: ?Z? was not declared in this scope
    g-sat.cxx:646: error: ?X? was not declared in this scope
    g-sat.cxx:646: error: ?Y? was not declared in this scope
    g-sat.cxx:646: error: ?Z? was not declared in this scope
    g-sat.cxx:690: error: ?X? was not declared in this scope
    g-sat.cxx:690: error: ?Y? was not declared in this scope
    g-sat.cxx:690: error: ?Z? was not declared in this scope
    g-sat.cxx:698: error: ?X? was not declared in this scope
    g-sat.cxx:698: error: ?Y? was not declared in this scope
    g-sat.cxx:698: error: ?Z? was not declared in this scope
    g-sat.cxx:779: error: ?X? was not declared in this scope
    g-sat.cxx:779: error: ?Y? was not declared in this scope
    g-sat.cxx:779: error: ?Z? was not declared in this scope
    g-sat.cxx:785: error: ?X? was not declared in this scope
    g-sat.cxx:785: error: ?Y? was not declared in this scope
    g-sat.cxx:785: error: ?Z? was not declared in this scope
    g-sat.cxx:851: error: ?X? was not declared in this scope
    g-sat.cxx:851: error: ?Y? was not declared in this scope
    g-sat.cxx:851: error: ?Z? was not declared in this scope
    g-sat.cxx: In function ?void output_triangles(nmgregion*, model*, shell*)?:
    g-sat.cxx:1146: error: ?X? was not declared in this scope
    g-sat.cxx:1146: error: ?Y? was not declared in this scope
    g-sat.cxx:1146: error: ?Z? was not declared in this scope
    g-sat.cxx:1146: error: ?X? was not declared in this scope
    g-sat.cxx:1146: error: ?Y? was not declared in this scope
    g-sat.cxx:1146: error: ?Z? was not declared in this scope
    g-sat.cxx:1163: error: ?X? was not declared in this scope
    g-sat.cxx:1163: error: ?Y? was not declared in this scope
    g-sat.cxx:1163: error: ?Z? was not declared in this scope
    g-sat.cxx: In function ?bool make_bot(nmgregion*, model*, shell*)?:
    g-sat.cxx:1192: error: ?X? was not declared in this scope
    g-sat.cxx:1192: error: ?Y? was not declared in this scope
    g-sat.cxx:1192: error: ?Z? was not declared in this scope
    g-sat.cxx:1193: error: ?X? was not declared in this scope
    g-sat.cxx:1193: error: ?Y? was not declared in this scope
    g-sat.cxx:1193: error: ?Z? was not declared in this scope
    g-sat.cxx:1210: error: ?X? was not declared in this scope
    g-sat.cxx:1210: error: ?Y? was not declared in this scope
    g-sat.cxx:1210: error: ?Z? was not declared in this scope
    g-sat.cxx:1210: error: ?X? was not declared in this scope
    g-sat.cxx:1210: error: ?Y? was not declared in this scope
    g-sat.cxx:1210: error: ?Z? was not declared in this scope
    g-sat.cxx:1227: error: ?X? was not declared in this scope
    g-sat.cxx:1227: error: ?Y? was not declared in this scope
    g-sat.cxx:1227: error: ?Z? was not declared in this scope
    g-sat.cxx:1227: error: ?X? was not declared in this scope
    g-sat.cxx:1227: error: ?Y? was not declared in this scope
    g-sat.cxx:1227: error: ?Z? was not declared in this scope
    g-sat.cxx:1229: error: ?X? was not declared in this scope
    g-sat.cxx:1229: error: ?Y? was not declared in this scope
    g-sat.cxx:1229: error: ?Z? was not declared in this scope
    g-sat.cxx:1253: error: ?class GeometryModifyTool? has no member named ?create_body_from_surfs?
    g-sat.cxx:1268: error: ?X? was not declared in this scope
    g-sat.cxx:1268: error: ?Y? was not declared in this scope
    g-sat.cxx:1268: error: ?Z? was not declared in this scope
    g-sat.cxx:1269: error: ?X? was not declared in this scope
    g-sat.cxx:1269: error: ?Y? was not declared in this scope
    g-sat.cxx:1269: error: ?Z? was not declared in this scope
    g-sat.cxx:1270: error: ?X? was not declared in this scope
    g-sat.cxx:1270: error: ?Y? was not declared in this scope
    g-sat.cxx:1270: error: ?Z? was not declared in this scope
    make: *** [g-sat.o] Error 1

    is this a problem related to the make file? or am I missing a library?

    Thank you so much!

     
  • Sean Morrison
    Sean Morrison
    2007-10-12

    Logged In: YES
    user_id=785737
    Originator: NO

    Huh, that is weird. It is some header declaration/ordering problem it seems. There are X, Y, and Z preprocessor defines provided by vmath.h, but it seems that somewhere they've been undefined. Try adding this to the top of the file after all of the #include lines:

    #define X 0
    #define Y 1
    #define Z 2

    And then give that a try.

     
  • rmf166
    rmf166
    2007-10-12

    Logged In: YES
    user_id=1911181
    Originator: YES

    Great! That got rid of all those nasty declaration complaints. Now I am left with the following error message:

    g-sat.cxx: In function 'bool make_bot(nmgregion*, model*, shell*)':
    g-sat.cxx:1258: error: 'class GeometryModifyTool' has no member named 'create_body_from_surfs'
    make: *** [g-sat.o] Error 1

    This is kind of disturbing, since I *think* that this has to do with something in the libraries that g-sat.cxx uses. Thanks again for the help!

     
  • Sean Morrison
    Sean Morrison
    2007-10-12

    Logged In: YES
    user_id=785737
    Originator: NO

    That's great progress then. That last error looks like something in Cubit's CGM library has changed. g-sat is making a call to create_body_from_surfs() in a GeometryModifyTool object, which no longer apparently exists. The routine was probably just renamed to something else. If you have the headers, look for the GeometryModifyTool class declaration and see if you can find something that looks like create_body_from_surfs(), or see if they have a developer upgrade document somewhere. If it's down to just that one line, then you're pretty close.

    Should caveat that the g-sat converter hasn't yet been extensively tested. It's technically still under development which is why the paths are even still hard-coded in the Makefile template. It's been used on some pretty complete/complex geometries, though, so I wouldn't expect problems.

    Cheers!
    Sean

     
  • rmf166
    rmf166
    2007-10-15

    Logged In: YES
    user_id=1911181
    Originator: YES

    I looked through g-sat.cxx and found the following line (1258):

    status = gmt->create_body_from_surfs(FaceList,BotBody);

    and then I went into GeometryModifyTool.hpp in the ~/CGM-10.1/geom directory and searched for something that resembles to the above. I found in line 1241 "create_solid_bodies_from_surfs." I went back into g-sat.cxx and commented out the original line and substitute it for

    status = gmt->create_body_from_surfs(FaceList,BotBody);

    And it failed to compile, print out the following:

    g++ -DHAVE_CONFIG_H -I. -I. -I../../../include -I/home/ferrrm/local/CGM-10.1/include -I/home/ferrrm/CubitLink -I/home/ferrrm/CGM-10.1/cgm_apps/cgm_cubit_acis -I/home/ferrrm/brlcad/brlcad-7.10.2/src/other/openNURBS -I/usr/local/include -DBRLCADBUILD=1 -I../../../include -pipe -fno-strict-aliasing -fno-common -fexceptions -g -O3 -c -o g-sat.o `test -f 'g-sat.cxx' || echo './'`g-sat.cxx
    g-sat.cxx: In function ?bool make_bot(nmgregion*, model*, shell*)?:
    g-sat.cxx:1260: error: no matching function for call to 'GeometryModifyTool::create_solid_bodies_from_surfs(DLIList<RefFace*>&, Body*&)'
    /usr/local/include/GeometryModifyTool.hpp:1244: note: candidates are: CubitStatus GeometryModifyTool::create_solid_bodies_from_surfs(DLIList<RefFace*>&, DLIList<Body*>&, CubitBoolean, CubitBoolean) const
    make: *** [g-sat.o] Error 1

    Looks like it is still failing. I was wondering, what CGM libraries were used to compile g-sat.cxx? Are they still available online? I think that in the latest CGM release they did a bit more than just change the names of the routines.

     
  • Sean Morrison
    Sean Morrison
    2007-10-16

    Logged In: YES
    user_id=785737
    Originator: NO

    Well, I think you did find the right routine that it changed to. Previously, the create_body_from_surfs() routine took a list of faces and created a body (hence the facelist and botbody parameters). Now it looks like the create_solid_bodies_from_surfs() routine takes a list of faces and will create a list of bodies (plus two unknown boolean parameters).

    I took a complete stab/guess at editing the code and have committed the changes to CVS if you want to try them out. Forewarning that I'm not the original author of the code nor have I even tried compiling against Cubit libraries yet (I don't have Cubit installed here at the moment), but it "should" be right or at least close to right according to what you've seen and given what's going on in the code at that point.

    Give it a try, curious to hear if it worked. You can pull the file from CVS directly, or via this link:

    http://brlcad.cvs.sourceforge.net/\*checkout*/brlcad/brlcad/src/external/Cubit/g-sat.cxx

    Cheers!
    Sean

     
  • rmf166
    rmf166
    2007-10-16

    Logged In: YES
    user_id=1911181
    Originator: YES

    Just yesterday I talked on the phone with Corey Ernst, one of the people in charge of maintaining the CGM libraries at Elemental Technologies. He took a look at g-sat.cxx and 'patched up' the code to get it to work with the newer version of CGM. I still get an error message, but it has to do with CUBIT version (I need to get the 64-bit version). I can send you the 'patched up' version of g-sat.cxx if you want to take a look at it.

    Thanks

     
1 2 > >> (Page 1 of 2)