Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Polygon from point index?

    SDK Help
    0
    9
    577
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 17/06/2005 at 09:26, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.1 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi,

      is there an easy way to find out which polygon a point (index) belongs to?

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 17/06/2005 at 10:36, xxxxxxxx wrote:

        Yep. Use this:

        class Neighbor::GetPointPolys(LONG pnt, LONG** dadr, LONG* dcnt)

        Don't know how to use it. Check the docs. 🙂

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 17/06/2005 at 10:44, xxxxxxxx wrote:

          the neighbor class is too slow for what I need it for but maybe I can preallocate some stuff. thx

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 17/06/2005 at 10:46, xxxxxxxx wrote:

            The only alternative (probably slower) is to loop through each polygon and compare each vertex index within to the point index in question. This is probably what the Neighbor class is doing, just encapsulated.

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 17/06/2005 at 10:47, xxxxxxxx wrote:

              no alternative really as it surely is slower 🙂

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 17/06/2005 at 13:00, xxxxxxxx wrote:

                The Neighbor class is very fast! looking up the points is taken directly from a table generated at Init (as all of its data is!). Even Init is fast, thats the whole point of the class 😉 It really is the best way, precalc the Init and use the functions, if it was slow you would notice it in CINEMA since its used everywhere.

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 17/06/2005 at 23:38, xxxxxxxx wrote:

                  Really? Well, the last time I used it, it was very slow. I used to calculate my vertex normals with it (now I am doing it differently) and uh..hell, was it slow. But ok, I´ll have a look at it then.

                  Thanks to both of you!

                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    On 18/06/2005 at 05:05, xxxxxxxx wrote:

                    Well I don't think I'm giving away any massive MAXON secret with this code snip, but this is the function you were calling (GetPointPolys) directly out of CINEMA:

                        
                        
                          
                        inline void BrowsePoint(LONG pnt, LONG *&data, LONG &cnt)  
                        {  
                         LONG ind = index[pnt];  
                         cnt  = index[pnt+1]-ind;  
                         data = field+ind;  
                        }  
                        
                    

                    Not exactly what you might call slow 😉 maybe something else was wrong? were you calling Init or precalc'ing it?

                    1 Reply Last reply Reply Quote 0
                    • H
                      Helper
                      last edited by

                      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                      On 18/06/2005 at 08:39, xxxxxxxx wrote:

                      lol, yes, that doesn´t look too slow 😉 I don´t know what was wrong but init was only called once. It´s just long time ago I used it because of this experience. I guess I need to rethink here now though. Thanks 🙂

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post