Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    Points not on neighbor polygons edges

    SDK Help
    0
    2
    204
    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

      On 16/03/2013 at 15:33, xxxxxxxx wrote:

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

      ---------
      Let's say that I have two triangles (ta and tb) with a neighboring edge.  Using GetPolyInfo(ta), the point of ta that is not on the edge is trivial (for edge[0], it would be ta->c since edge[0] represents an edge from points a->b, etc.).  Is there a simple way to get the point not on the edge for tb or do I really need to find out which of the three point indices of tb (tb->a, tb->b, tb->c) don't match ta->a and ta->b?

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

        On 16/03/2013 at 17:07, xxxxxxxx wrote:

        Well, okay.  I went the 'et tu, brute'-force method.  Here is an example for the curious:

        pinfo =        neighbor.GetPolyInfo(i);  
        if (!pinfo->mark[0])  
        {  
          s->Init(f->p1, f->p2, ks, kd, 0.0, 1000.0);  
          ++s;  
          ++scnt;  
          // Diagonal bracing across points not on edge for triangles  
          ef =    pinfo->face[0];  
          if (ef != NOTOK)  
          {  
              np =    &polys[ef];  
              if ((np->a != p->a) && (np->a != p->b))  
                  s->Init(f->p3, &masses[np->a], ks, kd, 0.0, 1000.0);  
              else if ((np->b != p->a) && (np->b != p->b))  
                  s->Init(f->p3, &masses[np->b], ks, kd, 0.0, 1000.0);  
              else  
                  s->Init(f->p3, &masses[np->c], ks, kd, 0.0, 1000.0);  
              ++s;  
              ++scnt;  
          }  
        }
        

        Note: the number of 'edges' (in this case, the 's' array) total for a triangulated object becomes neighbor->GetEdgeCount() + (polygonCount * 2).

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