Update gdiam oriented bounding box algorithmBRL-CAD
Status: ClosedTime to complete: 100 hrs Mentors: Isaac Kamga, DishankTags: C++, C, geometry

BRL-CAD's bb command has a feature to generate oriented bounding boxes (the smallest box containing a geometric object) that makes use of a library called "gdiam". This library is fast, but is unreliable when dealing with simpler shapes. One possibility for improvement is to switch the algorithm being used internally by gdiam for convex hull generation. In this context, a convex hull is a bounding polygonal mesh that creates an envelope around the geometry. That envelope is convex, ie.., all mesh line segments have angles =180 degrees with their neighbors.

You should obtain BRL-CAD source code from our Subversion repository: svn checkout https://svn.code.sf.net/p/brlcad/code/brlcad/trunk brlcad

The goal for this task is to make the code for Monotone Chain convex hull construction by Dan Sunday get used by the gdiam library. The code is already present in the file src/other/libgdiam/gdiam.cpp at line 1603, and the code it is intended to replace is above it at line 1549. The task is to determine what changes are necessary to allow the new code to substitute successfully for the old code, and test the results in MGED using the bb command with the -o option. Here are commands that may be run in mged that will create a rotated mesh box, then create an oriented bounding box around it:

make arbn.s arbn; sed arbn.s; rot 30 30 30; accept; facetize arbn.bot arbn.s; bb -o -c box.s arbn.bot; draw box.s

Submit a patch to gdiam.cpp that enables the new convex hull algorithm successfully.

References:
  • http://sarielhp.org/research/papers/00/diameter/diam_prog.html
  • http://geomalgorithms.com/a10-_hull-1.html
  • src/other/libgdiam
Modify:
  • src/other/libgdiam/gdiam.cpp
Uploaded Work
File name/URLFile sizeDate submitted
task-37-update-gdiam-obb-algorithm.diff5.4 KBDecember 21 2014 23:09 UTC
task-37-update-gdiam-obb-algorithm.diff5.1 KBDecember 21 2014 23:18 UTC
Comments
Andromeda Galaxyon December 21 2014 03:07 UTCTask Claimed

I would like to work on this task.

Sean on December 21 2014 03:15 UTCTask Assigned

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

Andromeda Galaxyon December 21 2014 23:09 UTCReady for review

The work on this task is ready to be reviewed.

Andromeda Galaxyon December 21 2014 23:20 UTCDiff files

Sorry, the first diff contains a couple of extra debugging checks that I was using to make sure that out-of-bounds errors didn't occur that aren't actually necessary.

Sean on December 22 2014 05:24 UTCTask Closed

Congratulations, this task has been completed successfully.

Sean on December 22 2014 05:24 UTCunconfirmed

Andromeda Galaxy,


On quick review, this looks good, but please run the patch by starseeker on IRC to make sure you got it working right if you haven't already.


Cheers!