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 tricky to compute.
References:
- http://en.wikipedia.org/wiki/Surface_area
- http://mathworld.wolfram.com/
- http://www.dtic.mil/cgi-bin/GetTRDoc?AD=AD0274936
- include/raytrace.h: See ft_surf_area callback defined in the rt_functab structure
Code:
- src/librt/primitives/ehy/ehy.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 surface area (units are mm^2). There are numerous examples in our code where we compute surface area 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.
File name/URL | File size | Date submitted | |
---|---|---|---|
ehy_surf_area.patch | 1.4 KB | November 24 2013 21:28 UTC |
I would like to work on this task.
This task has been assigned to Johannes Schulte. You have 72 hours to complete this task, good luck!
The work on this task is ready to be reviewed.
We've not yet verified that formula, but your code looks a reasonable codification on (really) quick glance. Hopefully progress! We'll need some exact test cases to verify and validate this regardless (separate GCI tasks).
Congratulations, this task has been completed successfully.
That's two for two, patch applied in r58646.