Dear BRL-CAD developers,
I have a few questions on importing STEP files, using your library. I want to import 3D models from .step files into my application that uses Ogre3D graphics, therefore it needs a triangular (or at least polygonal) represenation of the objects being loaded. Now, the process I created to do the import is the following:
First, I convert the .step file into a .g database file. For this I use the step-g.exe tool provided with BRL-CAD. This produces a .g file that my sample code loads without errors (db_open and dir_build). After that I walk the database using db_walk_tree() and try to tesselate regions into meshes (using conv\g-xxx_facets.c as reference):
At encountering a database leaf I use nmg_booltree_leaf_tess() to tesselate the part. At region end I evaluate the (already tesselated) bool tree using nmg_booltree_evaluate(), then I process the resulting tesselated tree to build my mesh in Ogre3D. The region start callback returns 0 to indicate that every region is to be processed.
Now the problem is that the step-g converter creates BREP objects (ID_BREP) in the database, for which nmg_booltree_leaf_tess() returns NULL. After investigating the problem a little more, It seems that the tesselation method (rt_brep_tess() in librt\primitives\brep\brep.cpp) for these objects is not implemented, always returns -1.
My questions are:
1) Is this BREP tesselation really unsupported at the moment or am I overlooking something?
2) In case this is unsupported, is there another way to import .step files into a polygonal representation using BRL-CAD?
Thank you for your time and for your answers in advance.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.