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 the surface area (units are mm^2). There are numerous examples in our code where we compute surface area for other primitives. The primitives that do not already have a centroid callback are itemized in following. References:
Code:
|
File name/URL | File size | Date submitted | |
---|---|---|---|
rhcsurfarea.patch | 4.5 KB | January 06 2013 12:19 UTC | |
rhcsurfarea2.patch | 2.6 KB | January 08 2013 09:10 UTC |
I would like to work on this task.
The instructions are a little vague. I know C++ but am not to sure about how I should go about doing this task. I figure it's a good time to learn :)
The claim on this task has been removed, someone else can claim it now.
I would like to work on this task.
This task has been assigned to Silvrous. You have 72 hours to complete this task, good luck!
The deadline of the task has been extended with 2 days and 0 hours.
What does the breadth vector signify, exactly? Is its magnitude the distance from the vertex to the back rectangle?
Near the end of our Intro to MGED is an appendix C that provides a graphical depiction of the RHC's parameters. There you can see what B is in terms of the object's shape. The B vector is described in more mathematical terms at the top of the rhc.c source file too.
http://brlcad.org/w/images/c/cf/Introduction_to_MGED.pdf
I would have called it the "height" of the curve from V. Of course, I would have called the H vector the "depth" of the curve too.
See page 264.
I haven't finished yet, and I've clogged the task long enough, I'll let someone else take a stab at this while I try other tasks.
The claim on this task has been removed, someone else can claim it now.
I would like to work on this task.
This task has been assigned to Richard Akira Heru. 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.
This task has been assigned to Richard Akira Heru. You have 72 hours to complete this task, good luck!
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 has detected that the final deadline has passed and it has reopened the task.
I would like to work on this task.
This task has been assigned to Aaron Keesing. You have 72 hours to complete this task, good luck!
I believe that to work out the surface area you need to know the arc length of the cros-sectional hyperbola, but trying to work this out exactly involves incomplete elliptical integrals and other complicated calculus, and it might not even be possible to work out exactly.
The only solution I can think of is to try and approximate the arc length somehow, so that is is within a certain accuracy (so many d.p for example). Simpson's Rule may be one method of doing this. But I'm not sure what would be the best way to implement this in code (whether to write a separate function to do the aproximation of the integral, or do it in the main function). Apart from the arc length I think that the surface area will be relatively easy to compute.
Aaron K
The work on this task is ready to be reviewed.
I used Simpson's Rule to approximate the integral for arclength. Using the value of n=1000000 could slow things down on old hardware, but should give accuracy of 10d.p or greater, from what I've tested (not in BRL-CAD).
The derivation of the formula is similar to that of the centroid for an ehy, and a lot of the code is similar to the code in that function. If necessary I can make another document with the derivation of surface area.
I haven't thoroughly checked all the code and all the math because I am in a little hurry but glancing over my notes everything seems to be correct.
Aaron K
Melange has detected that the deadline has passed and no more work can be submitted. The submitted work should be reviewed.
Aaron, the only issue I see with the code is the need to document the 'n' magic number. Any constants like that in the code need to be documented. Separate that variable and include a comment to say what it is, why that value, what it guarantees, what values would be bad, etc.
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 can't upload the patch to this site unless an extension is given because the time has run out. Or would you rather I create a Sourceforge account and upload to the patch tracker?
Aaron K
The deadline of the task has been extended with 2 days and 0 hours.
Hm, you're supposed to be able to still upload for 24 hours after the time runs out. No matter, extension done.
The work on this task is ready to be reviewed.
Congratulations, this task has been completed successfully.
Thanks Aaron, that looks good. Your patch has been applied as r54145 (and you are already credited in our authorship documentation) with some minor changes.
For what it's worth, you usually want to avoid indentation levels if they're avoidable. It's a minor stylistic point, but you'll usually want to validate your input parameters and exit early.
Aaron, thought you might like to know that you're about four tasks close to making our top five list. There are also about that many days remaining.