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. This task involves writing a new callback function that takes an rt_db_internal object and calculates its centroid (as a point_t 3D point). There are numerous examples in our code where we compute centroids for other primtiives. The primitives that do not already have a centroid callback are itemized in following. References:
Code:
|
File name/URL | File size | Date submitted | |
---|---|---|---|
arbcent.patch | 1.6 KB | December 03 2012 05:23 UTC | |
centroidv2.patch | 1.9 KB | December 03 2012 11:23 UTC | |
centroid.patch | 1.8 KB | December 03 2012 12:55 UTC | |
centroidone | 3.2 KB | December 03 2012 13:18 UTC | |
centroidone.patch | 3.2 KB | December 03 2012 14:55 UTC | |
finalcentroid.patch | 4.0 KB | December 03 2012 16:47 UTC | |
finallycentroid.patch | 4.0 KB | December 03 2012 20:23 UTC |
I would like to work on this task.
This task has been assigned to Ashwin Lokkur. You have 72 hours to complete this task, good luck!
The claim on this task has been removed, someone else can claim it now.
I would like to work on this task.
The claim on this task has been removed, someone else can claim it now.
I couldn't work on the task... I had my exams coming up :(
You don't have to apologize. ;)
Thank you for your interest. If you (or anyone else) would like to try again, the task is still available to be claimed.
I would like to work on this task.
There is a centroid function defined already in arb8.c.I assume it is non functional and I have to replace it?
This task has been assigned to Silvrous. You have 72 hours to complete this task, good luck!
That would be an odd assumption to make. I don't know if it's right or wrong, but it's certainly not the right function signature for being added to table.c -- you should certainly merge it with your work or eliminate it, just don't ignore it.
The work on this task is ready to be reviewed.
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.
Couple problems. Your patch doesn't follow our coding guidelines (see the HACKING file) particularly w.r.t. space around operators.
Also, you don't hook the new function into the callback table.
The work on this task is ready to be reviewed.
In every block you have to declare all variables first before any other operation. Not all supported compilers are C99 conform, e.g. MS Visual Studio C/C++.
Daniel
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.
I've just recognized that the check was removed.
I can re-close it?
The work on this task is ready to be reviewed.
You have changed the rt_arb_centroid() parameters. Therefore you should change every use of this function accordingly.
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.
I'd realized the problem before reading your comment, and tried making separate functions first, then corrected the parameters.
The correct patch is centroidone.patch .
The work on this task is ready to be reviewed.
There should be now the correct prototype.
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.
src/librt/primitives/arb8/arb8.c:326:5: error: ISO C90 forbids mixed declarations and code [-Werror=edantic]
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.
We'll likely have a follow-on task to confirm that your implementation works (maybe a unit test), but it looks reasonable at a glance. Thanks for your efforts including bonus points for cleaning up analyze command and identifying that existing centroid function while you were at it. ;)
A follow-on task has been created:
http://www.google-melange.com/gci/task/view/google/gci2012/8086202