#282 [PATCH]BagOfTriangles primitive interface and implementation

Untested
closed-accepted
None
5
2014-08-14
2014-06-29
No

Daniel,

I'm totally unsure about what I've wrote, especially about the "Face" role, but I've tried to apply what I learned from Sketch as well as what I understood from various definitions(including BRL-CAD's) of bot.

Here's a (hypothetically) full BoT interface

Thanks,
Andrei

1 Attachments

Discussion

  • Andrei Popescu

    Andrei Popescu - 2014-06-29
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,6 +1,6 @@
     Daniel, 
    
    -I'm totally unsure about what I've wrote, especially about the "Face" role, but I've tried to apply what I learned from Segment as well as what I understood from various definitions(including BRL-CAD's) of bot.
    +I'm totally unsure about what I've wrote, especially about the "Face" role, but I've tried to apply what I learned from Sketch as well as what I understood from various definitions(including BRL-CAD's) of bot.
    
     Here's a (hypothetically) full BoT interface
    
     
  • Daniel Roßberg

    Daniel Roßberg - 2014-06-30

    A face is a triangle. Each face is described by 3 integers. Each integer is the index of a point (or to be mere precise: "i * 3").

    Daniel

     
  • Andrei Popescu

    Andrei Popescu - 2014-07-03

    Here's a modified version of the Bot interface as discussed on IRC.

    LE: edited flags and orientation as well

     
    Last edit: Andrei Popescu 2014-07-03
  • Daniel Roßberg

    Daniel Roßberg - 2014-07-04

    Andrei,

    this patch was a big step backwards (compared to Sketch). It starts with the name of the class: Bot. What happened with the BagOfTriangles? It has inconsistent formatting, isn't compilable, has no methods for adding/getting/deleting triangles and is missing a function for the face_mode flags.

    However, to speed up the development I added a reworked version of the BagOfTriangles.h. It isn't perfect (I even know some places where something is missing) but it should guide you in the right direction. I.e. you can start implementing with it.

    There is an additional "tie" parameter in rt_bot_internal. I don't know what it is used for. You should find it out.

    Daniel

     
  • Andrei Popescu

    Andrei Popescu - 2014-07-04

    Daniel,

    I'm not arguing over what you said, I'm just trying to justify my choices. I'm working on it while I post this message, just saying.

    First of all, on a previous discussion with you on IRC, we've agreed on naming the subclass Triangle, not Face, you've changed it now, and I'll keep it as you set it.

    Secondly, I named the class Bot(instead of BagOfTriangles) because of the namespace issue. In example,

    BagOfTriangles::Face:: takes 22 characters each time, so I thought it might be incovenient.

    To conclude: Yes, I've definetly made some mistakes(omitting add,insert, delete Face, for one) and I will get it rigt this time.

    Thanks,
    Andrei

     
    Last edit: Andrei Popescu 2014-07-04
  • Andrei Popescu

    Andrei Popescu - 2014-07-06

    Daniel,

    I've attached the utility functions (similar to SKetch). I'll continue working on implementation.

    It does compile.

     
    Last edit: Andrei Popescu 2014-07-06
  • Andrei Popescu

    Andrei Popescu - 2014-07-09

    I've added the bot implementation patch so you can figure how my progress is going, but don't review it(maybe just have a look).

    Looking back on what you've done to Sketch, I figured I did the same mistakes with bot, because I didn't know they are mistakes(like, using m_internalp instead of Internal())

    I want to get back to working on Sketch, understand what you changed, sort it out, then move towards BoT.

     
  • Andrei Popescu

    Andrei Popescu - 2014-07-20

    Daniel,

    I've finished reworking the BoT implementation according to what we talked on sketch, however, it has two issues I would hope to talk to you about tommorrow.

    1) I can't figure out the Sketch::Segment* Get equivalent for BagOfTriangles, I wrote an attempt, but it didn't work so it's commented.

    2) I couldn't figure the copy constructor(actually, I didn't know if I should manually move them or not, and it was quite a lot of work, so I d rather ask ahead.)

    3) The destructor doesn't take ip or m_ip as parameter for rt_bot_ifree, I don't know why.

    Status:

    • BagOfTriangles::Face* Get (size_t Index) : not working
    • Constructors and Destructors are a bit of a mess
    • rest works fine, compiles.
     
    Last edit: Andrei Popescu 2014-07-20
  • Daniel Roßberg

    Daniel Roßberg - 2014-07-22

    1) Look at my recommendation for a Get() prototype in my 2014-07-04 post. Bot is different from sketch because Face isn't polymorphic.

    2) It looks like there isn't already a copy function for bots. Therefore you have to do the implementation.

    3) rt_bot_ifree() is nowhere used in the core interface because it operates on the wrong structure. But you could look at bot_ifree2().

    Daniel

     
  • Andrei Popescu

    Andrei Popescu - 2014-07-22

    Daniel,

    I've finished AppendFace and Get. I finally figured what you mean with Get, as I didn't understand much from your previous(2014-07-04) post.

    I have one question, however.
    In the BagOfTriangles.h you gave me, InsertFace has three points instead of an index. I don't understand why?

    regarding the bot_ifree2() and the copy constructor, I haven't done them, but I know how, so I'll write them once this is finished.

    Andrei

     
    Last edit: Andrei Popescu 2014-07-22
  • Andrei Popescu

    Andrei Popescu - 2014-07-26

    Daniel,

    The copy constructor and operator aren't written, but I figured it'll give you plenty of material to review while I work on them, since everything else is pretty much completed.

    I had to copy ibot_free2 and rename it bot_free.

    Thanks,
    Andrei

     
    Last edit: Andrei Popescu 2014-07-26
  • Andrei Popescu

    Andrei Popescu - 2014-07-29

    Daniel,

    I finished bot implementation, with SetNormal and Normal reworked, I think I pretty much understood it right, except for setting FaceNormal, there is a "TODO" in code, look for it and you ll see what I don t understand.

     
  • Daniel Roßberg

    Daniel Roßberg - 2014-08-14
    • status: open --> closed-accepted
    • assigned_to: Andrei Popescu --> Daniel Roßberg
    • Group: Incomplete --> Untested
     
  • Daniel Roßberg

    Daniel Roßberg - 2014-08-14

    Commited the patch to the svn repository. Needs to be completed there.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks