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

    Delete a specific polygon

    SDK Help
    0
    5
    377
    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 01/04/2005 at 00:07, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.1 
      Platform:      
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hello to all and tnx for the tecnichal support !! 😉

      I have a little problem: how is possible to delete from one object a specific polygon ?

      For example, i read the point coordinates of the polygon, and if this coordinates match one specific conditions i must delete it !!

      Tnx in advance and sorry for my bad English !! 🙂

      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 05/04/2005 at 02:36, xxxxxxxx wrote:

        Nothing? 🙂

        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 05/04/2005 at 23:55, xxxxxxxx wrote:

          This is the code:
          <CODE>
          var pip=op->GetPolygonCount(); if (!pip) return TRUE;
          for (i=0; i<pip; i++)
               {
               var poly=op->GetPolygon(i);
               var p1=int(p[poly->a].x);
               var p2=int(p[poly->b].x);
               var p3=int(p[poly->c].x);
               var p4=int(p[poly->d].x);
               if (p1==0 && p2==0 && p3==0 && p4==0)
                    {
                    var vc=new(VariableChanged);
                    var h,map=new(array, pip);
                    for(h=0; h<i; h++) map[h]=h;
                    for(h=i; h<pip; h++) map[h]=h-1;
                    vc->Init(pip,pip-1,map);
                    var ok = op->MultiMessage(MSG_POLYGONS_CHANGED,vc);
                    op->SetPolygons(map);
                    op->Message(MSG_UPDATE);
                    }
               }
               
          return TRUE;
          }

          </CODE>

          Tnx for answer!

          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 08/04/2005 at 11:27, xxxxxxxx wrote:

            Try this code with SendModelingComman()

                
                
                  
                
                
                
                var pip = op->GetPolygonCount() ;
                
                
                
                
                var pt = op->GetPoints() ;
                
                
                
                
                var sel = op->GetPolygonSelection() ; sel->DeselectAll() ;
                
                
                
                
                var i ;
                
                
                
                
                for (i=0; i<pip; i++)
                
                
                
                
                {
                
                
                
                
                var poly=op->GetPolygon(i);
                
                
                
                
                var p1=int(pt[poly->a].x);
                
                
                
                
                var p2=int(pt[poly->b].x);
                
                
                
                
                var p3=int(pt[poly->c].x);
                
                
                
                
                var p4=int(pt[poly->d].x);
                
                
                
                
                if (p1==0 && p2==0 && p3==0 && p4==0) sel->Select(i) ;
                
                
                
                
                }
                
                
                
                
                op->SetPolygonSelection(sel) ;
                
                
                
                
                var bc = new(BaseContainer) ;
                
                
                
                
                SendModelingCommand(MCOMMAND_DELETE, doc, op, bc, MODIFY_POLYGONSELECTION) ;
                
                
                
                
                op->Message(MSG_UPDATE);
            

            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 08/04/2005 at 23:53, xxxxxxxx wrote:

              Tnx Majo for the answer !! 😉

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