BRL-CAD

Make submodels work with relative paths, fix C/C++ logic

A submodel is a way for one geometry database to reference geometry in another geometry database. You do this by specifying a geometry "file" and an object (a "treetop") in that file. The current implementation lacks some production usability. For this task, you'll help clean things up.

Submodel primitives are implemented in src/librt/primitives/submodel/submodel.c of a source checkout.

For this task, you'll work to make submodels look for their files relative to the current database. You can do this by implementing a function that sets the full path to a submodel given the current open database, and the specified submodel file. You'll then use that function in rt_submodel_prep() and anywhere else the submodel file (i.e., sip->file) is used. Your new function should look like this:

int submodel_path(struct bu_vls *sm_fullpath, const char *db_file, const char *sm_file);

SUBMIT a patch file containing your code changes (see http://brlcad.org/wiki/Patches), code that compiles and has been tested to at least work for you. ;-)

Task tags

  • path
  • submodel
  • c/c++

Students who completed this task

Jeff Sieu

Task type

  • code Code
  • done_all Quality Assurance
close

2017