Menu

#429 Surface area function for ars

Incomplete
open
None
5
2016-04-11
2016-02-25
No

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.

1 Attachments

Discussion

  • Sean Morrison

    Sean Morrison - 2016-03-01

    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.

     
    • Rakshika Bagavathy

      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.

       
  • Sean Morrison

    Sean Morrison - 2016-03-01
     
  • Sean Morrison

    Sean Morrison - 2016-03-01

    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

     
    • Rakshika Bagavathy

      It counts the top and bottom areas too. There's a comment in the patch where that is computed.

       
  • Sean Morrison

    Sean Morrison - 2016-03-01

    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).

     
    • Rakshika Bagavathy

      I'm working on this. Will get back as soon as i can.

       
  • Rakshika Bagavathy

    Hey Sean,

    I found some erroneous situations in the existing code.

    1. 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).

    2. 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
  • Sean Morrison

    Sean Morrison - 2016-04-09

    If you provided this for GSoC, what is the name on your proposal?

     
    • Rakshika Bagavathy

      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.

       
  • Sean Morrison

    Sean Morrison - 2016-04-11

    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.

     
    • Rakshika Bagavathy

      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. :)

       
  • Sean Morrison

    Sean Morrison - 2016-04-11

    Orgs only get to see your display name, but it is resolved now. You fortunately put your name into your final proposal.

     

Log in to post a comment.

MongoDB Logo MongoDB