Implement a single function to generate rays based on an object stencilBRL-CAD
Status: ClosedTime to complete: 120 hrs Mentors: SeanTags: function, c, programming, object

Our ray tracing library (librt) has a few functions pertaining to creating a pattern of rays and shooting them as a bundle (i.e., all at once). We have examples you can follow like rt_gen_circular_grid() in src/librt/mkbundle.c that are very similar, just not the right pattern.

Our "rtshot" command line utility is a simple single-shot utility that can help you test your implementation and make sure it's working correctly. See the code there for mentions of rt_gen_circular_grid() and rt_shootrays().

Sources may be obtained from our Subversion repository: svn checkout https://svn.code.sourceforge.net/p/brlcad/code/brlcad/trunk brlcad

Implement a function, e.g., rt_gen_stencil(), that will create a pattern of orthogonal rays originating from a specified plane, in a given direction, with an option for the sampling density (per ray spacing).  The user inputs will be a ray (point+dir) which defines a plane, an object which defines the silhouette, and a ray density (either uniform, or vertical/horizontal density).  The output is a set of rays parallel to the input ray and at or in front of the plane defined by that ray (so you could shoot from inside an object).

Submit the changes in patch format.

References: 

  • src/librt/mkbundle.c
  • src/librt/bundle.c
  • src/rt/rtshot.c
  • http://brlcad.org/wiki/Compiling

Modify: 

  • src/librt/mkbundle.c
    • src/rt/rtshot.c
Uploaded Work
File name/URLFile sizeDate submitted
task-55-implement-stencil-sampling.diff8.0 KBJanuary 15 2015 03:30 UTC
Comments
Andromeda Galaxyon January 14 2015 20:16 UTCTask Claimed

I would like to work on this task.

Deepak on January 14 2015 21:12 UTCTask Assigned

This task has been assigned to Andromeda Galaxy. You have 120 hours to complete this task, good luck!

Andromeda Galaxyon January 15 2015 03:30 UTCReady for review

The work on this task is ready to be reviewed.

Sean on January 15 2015 07:01 UTCTask Closed

Congratulations, this task has been completed successfully.

Sean on January 15 2015 07:04 UTCsignature

I don't think that's probably the function signature we'll eventually want, but this is substantial progress in a very short amont of time!  For example, I don't think the backout flag is necessary -- the behavior can be achieved by the caller and it'll probably be better to have fewer options initially.