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
    • Recent
    • Tags
    • Users
    • Login

    Triangulate() Problem

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 474 Views
    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 Offline
      Helper
      last edited by

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

      On 06/01/2011 at 12:53, xxxxxxxx wrote:

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

      ---------
      Hey guys,

      I got a problem with the function Triangulate(). I want to triangulate an existinting object (like a converted cube) internal (only for me). And then calculate the area (later volume).

        
        BaseObject* obj = doc->GetActiveObject();  
        PointObject* pointobj =  ToPoint((BaseObject* )(obj));  
        Vector* padr = pobj->GetPoint();  
          LONG pcnt = pobj->GetPointCount()  
        
        CPolygon* tripolys;  
        LONG tricount;  
        if(!Triangulate(padr, pcnt, &tripolys, &tricount)) return FALSE;  
        
        LONG i area=0;  
        for(i=0; i<tricount; i++)  
        {  
            const Vector x = points[tripolys[i].b]-points[tripolys[i].a];  
            const Vector y = points[tripolys[i].a]-points[tripolys[i].c];  
            area+=abs(x.Cross(y).GetLength())/2;  
        }  
      

      But I don´t know what Cinema do?
      tricount is 6 for a cube, but shouldn't it not be 12 (6*2)?
      And tripolys gives some strange points out -> over the room, so the vector get 3d not 2d...

      Help me please. 😢

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

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

        On 10/01/2011 at 14:40, xxxxxxxx wrote:

        How to triangulate polygons intern?

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

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

          On 13/01/2011 at 10:02, xxxxxxxx wrote:

          What about SendModelingCommand(); ?

          Greetings, nux

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

            On 27/02/2013 at 23:32, xxxxxxxx wrote:

            Way late to the party but Triangulate() (and the similar PolyTriangulate class) seem to be attempts at converting point clouds into polygonal meshes by returning triangles over the vertices sent.  My tests show that these are not very useful (unless there is some voodoo required and not mentioned).  Results were very disappointing, even using a planar landscape object or a sphere object with just vertices.

            As NiklasR said, SendModelingCommand(MCOMMAND_TRIANGULATE) is the option to actually take a polygonal mesh object and turn its n-gons and quads into triangles.

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

              On 28/02/2013 at 02:04, xxxxxxxx wrote:

              it is because the class is the capping algorithm for c4d, so it is meant to be used for capping and
              not remeshing.

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

                On 28/02/2013 at 11:19, xxxxxxxx wrote:

                That settles that.  It would be nice if they provided information like that in the documentation.

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