Implement surface area function for NURBS objects (BREP)BRL-CAD
Status: ClosedTime to complete: 72 hrs Mentors: SeanTags:

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/brep/brep.cpp (implement your function here)
  • src/librt/primitives/table.c (add a reference to your callback 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.

Uploaded Work
File name/URLFile sizeDate submitted
brep_surf_area.diff1.9 KBDecember 22 2013 16:54 UTC
brep_surf_area.diff1.9 KBDecember 22 2013 18:10 UTC
brep_surf_area_check.diff1.9 KBDecember 22 2013 18:18 UTC
Comments
MirceaSon November 19 2013 18:57 UTCTask Claimed

I would like to work on this task.

Mandeep Kaur on November 19 2013 19:09 UTCTask Assigned

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

Melange on November 22 2013 19:09 UTCInitial Deadline passed

Melange has detected that the initial deadline has passed and it has set the task status to ActionNeeded. The student has 24 hours to submit the work before the task is reopened and sent back to the pool for other students to claim.

Melange on November 23 2013 19:09 UTCTask Reopened

Melange has detected that the final deadline has passed and it has reopened the task.

Johannes Schulteon December 1 2013 15:45 UTC

openNurbs offers a method to convert Nurbs to an approximated polygonal Mesh. Is calculating the surface area of this mesh good enough or do you want a more elaborated solution?

Peter Amidonon December 22 2013 15:09 UTCTask Claimed

I would like to work on this task.

Mandeep Kaur on December 22 2013 16:39 UTCTask Assigned

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

Peter Amidonon December 22 2013 16:55 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 22 2013 17:58 UTCAreaMassProperties()

This is the right basic approach, but note that AreaMassProperties() does nothing.  The Rhino folks remove the code for that function.  Also, you access m_mass, but should be accessing mp.Area() instead.


Fix the m_mass issue and while surface areas still won't work, we can call this GCI task complete (and consider a follow-on to implement ON_Surface::AreaMassProperties()).


 

Sean on December 22 2013 17:58 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Peter Amidonon December 22 2013 18:11 UTCReady for review

The work on this task is ready to be reviewed.

Sean on December 23 2013 08:19 UTCTask Closed

Congratulations, this task has been completed successfully.