I've written a function to calculate the surface area of an arbitrary faceted solid - 'ars'. I've also used the function in analyze file to test it. And updated it in table.c as well.
Rakshika, is there a reason you didn't use the ft_surf_area callback? Your patch introduces an extern symbol that is undesirable. See analyze_sketch() for an example on how to utilize the callback you set in table.c properly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sean,
Sorry for the late response, i was in the middle of my tests.
No reason for not using ft_surf_area, i just looked at how the other function callbacks were set in table.c and followed it. Do you mean i should use the ft_surf_area() callback in analyze_ars() instead of directly calling rt_ars_surf_area()? I tested that and it works. Although i'm not quite sure how ft_surf_area() works. I'm attaching the updated patch with ft_surf_area() here.
Another question, does this surface area only calculate the triangles along the sides of the ars or does it also count up the top and bottom areas? e.g., http://brlcad.org/wiki/BRL-CAD_Primitives#ars
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Found another issue digging deeper for your to look at. From the patch and looking at the current state of the code, it looks like there was already code in there for computing the surface area of ARS, yes? How do your calculations compare? Providing some comparison examples would help demonstrate this is the same (or if it's not, help prove that yours is an improvement).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found some erroneous situations in the existing code.
It does not handle the cases of left twist and right twist separately (they need to be handled separately as the area between four triangles depends on the way we take the diagonal). The existing code takes them all to be a right twist. I've included code for both cases (in case no twist, either method will work).
In case of rectangular faces, it returns only half the area between the intermediate waterlines. This is because the variable 'old_plane' is the same for both the triangular faces of the rectangular face, thus it takes into account only one of them. Consequently, only half the area is returned. This problem does not arise in my new patch.
I've attached the updated patch and some screenshots to compare the results of the analyze command using the existing code and the new patch.
Sean,
I saw this task under 'Contributor Quickies' and thought i'd work on it to get myself familiarised with the code. This was before i started working on my proposal. I'm not sure i got your question completely.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You didn't get my question at all. :) I was asking what your proposal name was because "Rakshika Bagavathy" did not submit an application. I've since determined what name you used, so it's been resolved.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sincere apologies for the inconvenience caused. I hope everything has been resolved now. But my name on the summer of code website is still "Rakshika Bagavathy", although my display name is tandoorichick if that's what you were looking for. Sorry again. :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Rakshika, is there a reason you didn't use the ft_surf_area callback? Your patch introduces an extern symbol that is undesirable. See analyze_sketch() for an example on how to utilize the callback you set in table.c properly.
Sean,
Sorry for the late response, i was in the middle of my tests.
No reason for not using ft_surf_area, i just looked at how the other function callbacks were set in table.c and followed it. Do you mean i should use the ft_surf_area() callback in analyze_ars() instead of directly calling rt_ars_surf_area()? I tested that and it works. Although i'm not quite sure how ft_surf_area() works. I'm attaching the updated patch with ft_surf_area() here.
Another question, does this surface area only calculate the triangles along the sides of the ars or does it also count up the top and bottom areas? e.g., http://brlcad.org/wiki/BRL-CAD_Primitives#ars
It counts the top and bottom areas too. There's a comment in the patch where that is computed.
Found another issue digging deeper for your to look at. From the patch and looking at the current state of the code, it looks like there was already code in there for computing the surface area of ARS, yes? How do your calculations compare? Providing some comparison examples would help demonstrate this is the same (or if it's not, help prove that yours is an improvement).
I'm working on this. Will get back as soon as i can.
Hey Sean,
I found some erroneous situations in the existing code.
It does not handle the cases of left twist and right twist separately (they need to be handled separately as the area between four triangles depends on the way we take the diagonal). The existing code takes them all to be a right twist. I've included code for both cases (in case no twist, either method will work).
In case of rectangular faces, it returns only half the area between the intermediate waterlines. This is because the variable 'old_plane' is the same for both the triangular faces of the rectangular face, thus it takes into account only one of them. Consequently, only half the area is returned. This problem does not arise in my new patch.
I've attached the updated patch and some screenshots to compare the results of the analyze command using the existing code and the new patch.
Last edit: Rakshika Bagavathy 2016-03-06
If you provided this for GSoC, what is the name on your proposal?
Sean,
I saw this task under 'Contributor Quickies' and thought i'd work on it to get myself familiarised with the code. This was before i started working on my proposal. I'm not sure i got your question completely.
You didn't get my question at all. :) I was asking what your proposal name was because "Rakshika Bagavathy" did not submit an application. I've since determined what name you used, so it's been resolved.
Sincere apologies for the inconvenience caused. I hope everything has been resolved now. But my name on the summer of code website is still "Rakshika Bagavathy", although my display name is tandoorichick if that's what you were looking for. Sorry again. :)
Orgs only get to see your display name, but it is resolved now. You fortunately put your name into your final proposal.