Implement a volume function for volumetric data objects (VOL)BRL-CAD
Status: ClosedTime to complete: 72 hrs Mentors: Daniel RossbergTags: C, volume, math

BRL-CAD provides more than two dozen types of geometry ''primitives'' such as ellipsoids, boxes, and cones. Every primitive is described by a collection of callback functions, for example rt_ell_bbox() returns the bounding box dimensions for an ellipsoid. Wikipedia, Wolfram Mathworld, and various other math sites (and research papers) around the web include the equations for most of our basic primitives while others are a little more difficult to compute.

References:

  • http://en.wikipedia.org/wiki/Volume
  • http://mathworld.wolfram.com/
  • http://www.dtic.mil/cgi-bin/GetTRDoc?AD=AD0274936
  • include/raytrace.h: See ft_volume callback defined in rt_functab structure

Code:

  • src/librt/primitives/vol/vol.c (implement your function here)
  • src/librt/primitives/table.c (add a reference to your function here)

This task involves writing a new callback function that takes an rt_db_internal object and calculates the volume (units are mm^3). There are numerous examples in our code where we compute volume for other primitives. Submit a patch file the may be applied cleanly.

If you succeed, a follow-on task may be created to enable and validate your function.

Uploaded Work
File name/URLFile sizeDate submitted
vol-volume.patch3.3 KBDecember 19 2013 08:43 UTC
Comments
agkphysicson December 19 2013 06:28 UTCTask Claimed

I would like to work on this task.

Mandeep Kaur on December 19 2013 07:50 UTCTask Assigned

This task has been assigned to agkphysics. You have 72 hours to complete this task, good luck!

agkphysicson December 19 2013 09:08 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 19 2013 20:32 UTCapplied

Patch applied in r59061!


This is fantastic work.  Have you read the HACKING file yet, the CONTRIBUTOR RESPONSIBILITIES section in particular?  Send me an e-mail when you have (devs@brlcad.org).


 

Sean on December 19 2013 20:33 UTCTask Closed

Congratulations, this task has been completed successfully.