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 difficult to compute. This task involves writing a new callback function that takes an rt_db_internal object and calculates the volume (units are mm^3). There are numerous examples in our code where we compute volume for other primitives. The primitives that do not already have a volume callback are itemized in following. References:
Code:
|
File name/URL | File size | Date submitted | |
---|---|---|---|
rt_vol_volume.patch | 1.5 KB | December 05 2012 07:18 UTC | |
rt_vol_volume.patch | 1.5 KB | December 05 2012 15:14 UTC | |
rt_vol_volume2.patch | 1.5 KB | December 05 2012 18:11 UTC | |
rt_vol_volume3.patch | 1.5 KB | December 06 2012 15:17 UTC | |
implement_rt_vol_volime.patch | 1.5 KB | December 23 2012 07:53 UTC | |
rt_vol_volume2.patch | 1.4 KB | December 25 2012 16:34 UTC | |
revisedpatch.patch | 1.4 KB | December 29 2012 09:45 UTC | |
fix-null-ptr-behaviour.patch | 1.5 KB | December 31 2012 16:21 UTC | |
change_types.patch | 1.5 KB | January 01 2013 03:03 UTC |
I would like to work on this task.
This task has been assigned to fernozzle. You have 72 hours to complete this task, good luck!
The work on this task is ready to be reviewed.
My name is Michael Huang.
Thanks!
Values equal to vip-~dim won't crash the program but are unnecessary.
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.
Sorry about that.
Are you sure?
BTW, do you see any chance to test the function by yourself?
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.
Sorry about that. This is embarrassing. I've submitted a corrected vesion.
I did manage to test the function, but I later copy/pasted the "boilerplate" vip/CHK_MAGIC lines afterward to better match that of the ellipse volume function, and I forgot to replace "ell" with "vol".
Now there are again the = in the loop conditions.
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.
[ 27%] Building C object src/librt/CMakeFiles/librt.dir/primitives/vol/vol.c.o
/home/rossberg/Devel/brlcad/src/librt/primitives/vol/vol.c: In function ‘rt_vol_volume’:
/home/rossberg/Devel/brlcad/src/librt/primitives/vol/vol.c:416:5: error: ISO C90 forbids mixed declarations and code [-Werror=edantic]
cc1: all warnings being treated as errors
make[2]: *** [src/librt/CMakeFiles/librt.dir/primitives/vol/vol.c.o] Fehler 1
make[1]: *** [src/librt/CMakeFiles/librt.dir/all] Fehler 2
make: *** [all] Fehler 2
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 claim on this task has been removed, someone else can claim it now.
It sounds like you were close to compiling cleanly. The error daniel posted is because you have to only declare variables at the top of a function.
I would like to work on this task.
This task has been assigned to Vibhav Pant. You have 72 hours to complete this task, good luck!
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.
Vibhav, it looks like you fixed the warning, but your patch doesn't follow our indentation coding style. See other places throughout our code for examples or see our HACKING file, but it's 4spc, 1tab, 1tab+4spc, 2tab, etc for indentation levels.
The work on this task is ready to be reviewed.
Melange has detected that the deadline has passed and no more work can be submitted. The submitted work should be reviewed.
Vibav, your patch still doesn't follow our indentation coding style. The latest patch uses all tabs. If you are familiar with vim or emacs, we provide a local-variables block and modeline at the bottom of every file that will help auto-format the sources.
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 deadline of the task has been extended with 2 days and 0 hours.
Due to lack of time, I could not work on the patch. Could you please extended the deadline with 2 days?
Melange has detected that the final deadline has passed and it has reopened the task.
Vibhav, you (or anyone else) can reclaim the task and get another 72 hours. The work is basically done, but surprisingly nobody has been able to conform to our simple coding guidelines. The task is open to anyone again.
I would like to work on this task.
This task has been assigned to Vibhav Pant. You have 72 hours to complete this task, good luck!
The work on this task is ready to be reviewed.
I have rewritten the whole implementation using emacs.
Using the right tool can make all the diference. The patch formatting looks correct now.
Looking at the code in the patch, have you tried compiling this? I see a type error on the volume= line that I'd imagine the compiler would have reported. Also, the function should be well-behaved if the caller passes a NULL pointer.
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.
Should just a "return" work when a NULL pointer is passed?
yep
The work on this task is ready to be reviewed.
You apparently didn't upload a new version of the patch?
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.
voxel gets its value from an unsigned char and will be casted to a size_t before it will be compared to an uint32_t. There is no short in this pipeline. How about making it an unsigned char and if necessary casting it to uint32_t for comparing it with an uint32_t?
And how about making voxelcount making a size_t, the type of the sizes and indices of arrays?
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 deadline of the task has been extended with 1 days and 0 hours.
The work on this task is ready to be reviewed.
Congratulations, this task has been completed successfully.
As GCI comes to a close, we wanted to take the time to say THANK YOU for all your efforts. This comment interface closes after GCI is over, so you're encouraged to join our mailing list where we'll be announcing contributions from GCI participants like yourelf over the upcoming months:
https://lists.sourceforge.net/lists/listinfo/brlcad-news
If you've provided your full name, we'll be sure to credit you in our authorship documentation and you'll see your name in a future announcement. If you contact us at devs@brlcad.org or via IRC, we'll even let you know when your work is integrated and follow up with updates. You're welcome and encouraged to contact us any time, especially if you have a question about how to continue participating in Open Source after GCI is over, but even if just to keep in touch. Take care, be well, and thank you again!