dynamic_geometry.c File Reference
#include "common.h"
#include <math.h>
#include <string.h>
#include "bio.h"
#include "vmath.h"
#include "bn.h"
#include "raytrace.h"
#include "wdb.h"
Include dependency graph for dynamic_geometry.c:

Go to the source code of this file.


int make_hole (struct rt_wdb *wdbp, point_t hole_start, vect_t hole_depth, fastf_t hole_radius, int num_objs, struct directory **dp)
int make_hole_in_prepped_regions (struct rt_wdb *wdbp, struct rt_i *rtip, point_t hole_start, vect_t hole_depth, fastf_t radius, struct bu_ptbl *regions)

Detailed Description

Library for dynamically changing BRL-CAD geometry (i.e., changing already prepped geometry)

The typical use of dynamic geometry involves these steps:

  1. Normal use of " db_dirbuild", "gettrees", and "prep".
  2. Call "wdb_dbopen" to get a "struct rt_wdb" pointer for the database (typically using the RT_WDB_TYPE_DB_INMEM flag)
  3. Create and fill an "rt_reprep_obj_list" structure.
  4. Call "rt_unprep" and pass it the "rt_reprep_obj_list" structure.
  5. Modify geometry (note, you may only modify geometry that you listed in the "rt_reprep_obj_list" as "unprepped"). You may add, remove, modify, translate, rotate, scale objects under the "unprepped" combinations. (Use the "make_hole" routine here).
  6. Call "rt_reprep" with same parameters as you called "rt_unprep".
  7. If you are using liboptical, call "view_re_setup" to setup shaders for regions involved.
  8. Do raytracing.

If you only need to make holes, a simpler and quicker approach is to use the "make_hole_in_prepped_regions" routine:

Steps 1 and 2 are the same as above, then 3. Call "make_hole" and

  1. Do raytracing.

Definition in file dynamic_geometry.c.