Cross section in BRL-CAD

Making a cross-sectional view of a model in BRL-CAD is very easy and fun. All we have to know is just “rt” command and some of its arguments. Following are quick steps to create cross-section of a model:

  1. Open MGED and create / draw model.
  2. Use command saveview fileName  to save the current view of model in a file(shell script).
  3. Run the file generated in step 2 with rt command as:
    sh fileName -s1024 -k 0,-5,0,2000
  4. Step 3 create image in raw format i.e. pix format.
  5. Convert pix image to png as:
    pix-png -s1024 < fileName.pix > fileName.png

The option ‘k’ of “rt” take input as: xdir, ydir, zdir, distance. Here xdir, ydir and zdir define the orientation of cutting plane. The line through Point(xdir, ydir, zdir) is normal to cutting plane. This normal always points away from the space to be subtracted. Since as in 3D geometry, to define a plane we need a normal to that plane. Same is here.

The “distance” is distance of plane from origin. That is, distance specifies position of plane w.r.t. to origin.