Menu
Logged-In As
ACCOUNTNot Logged In
Implement new API function to reduce duplication #3BRL-CAD
Status: ClosedTime to complete:
72 hrs
Mentors: Sean
This is a follow-on to a new API design task.
This task involves implementing a new function that will measurably help reduce code duplication. You'll need to have already identified a piece of duplicated code that needs to be refactored and/or modified.
This task involves implementing the function per the header doxygen comment specification. Make sure your implementation is clean, fits well with our existing conventions, and is an efficient implementation that will help reduce code. Be meticulous.
Submit a patch file with your implementation.
Uploaded Work
File name/URL | File size | Date submitted | |
---|---|---|---|
bn_polygon_convert.patch | 10.0 KB | January 02 2014 14:25 UTC | |
bn_polygon_convert.patch | 9.7 KB | January 02 2014 17:02 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.
You included a change in the comment for the function bn_polygon_centroid() in your patch. This doesn't belong here.
Furthermore "declaration = initialization" is a good coding paradigma. You should use it whenever it's possible (it isn't always the case). E.g.: point_t **tmp_pts = (point_t **)bu_calloc( ...
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.
The work on this task is ready to be reviewed.
Congratulations, this task has been completed successfully.
committed in r59263
Number of lines is irrelevant. Any code duplication warrants refactoring. What's not clear to me (and will need to be addressed in the API doxygen comment at a minimum) is what implications sorting has on a given input data set.
If I gave you N random coplanar points, they could describe a number of valid polygons (that do not self-intersect). Reordering the points could change not just the orientation, but also the shape of a polygon.
That said, if you literally refactor N identical lines from M places throughout the code, put the N into a function that does exactly the same thing and update the M places, there shouldn't be a problem and the API can state the assumptions implied in those M places where it's used.
You're welcome to get started on surface area and volume functions for any primitives that still lack them and we'll be sure to create and accept those tasks before the deadline.
Note that there is a BoT bounding box function that is still open. Basically we have two implementations including a new one that doesn't work quite right. You could investigate or re-implement, whatever is easier. The task is basically create a bounding box around a mesh (which in theory is just the min/max sum of all vertices):
http://www.google-melange.com/gci/task/view/google/gci2013/5780674933948416
There's not a BoT surface area task because you already implemented it last year. The patch could not be applied because it needed some careful review and testing. We had other priorities take up all our time, but now that you have commit, you can make it all current. Last year's work:
http://www.google-melange.com/gci/task/view/google/gci2012/7968224
http://www.google-melange.com/gci/task/view/google/gci2012/8088204
Really glad to see you complete more than three tasks this year. ;-)
A task for BoT mesh surface areas has been added:
http://www.google-melange.com/gci/task/view/google/gci2013/5836041357361152