> On Jul 24, 2016, at 3:23 AM, Gauravjeet Singh <gaurav.ishwer...@gmail.com> > wrote: > > Step 1: Execute mged Ls command to get a list of objects > Filter the objects without .r extension in their name using a regular > expression. > (The regular expression that works here is /\w*\.r/g )
You shouldn’t make any assumptions about how objects are named. If you want objects that are or are not regions, the “search” command will be more robust (see the "-type region” option, run “brlman search” for docs). > Step 2: Merge the name of objects using a for loop in the final merge > command, which looks something like following. > (mged filepath r newObjName u obj1 u obj 2 ….) Why are you doing this? This presumably changes the model into a single region (i.e., a single part) and also potentially changes the definition/shape of the geometry (depending on how the regions were arranged). I don’t see this being beneficial. > Step 3: Execute merge command > > Step 4: Execute mged ls command once again to get list of objects > Use for loop to convert each object to its respective obj file. > > The problem, However, I am having with this is > It doesn't execute in this sequence. Step 4 executes first and Step 3 > afterwards. This makes the merged object in .g file, but its > respective obj file isn't generated. To figure out what processing is needed, have to understand what you’re trying to accomplish. This is not clear to me. Is the goal to have one .obj file per part (regions), one .obj per assembly (combs above region), one per .g file? Cheers! Sean ------------------------------------------------------------------------------ _______________________________________________ BRL-CAD Developer mailing list brlcad-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-devel