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

    Adding a point to an edge

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 454 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 02/09/2010 at 19:48, xxxxxxxx wrote:

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

      ---------
      Hey everyone.  I have been looking around and trying to figure this out.  I am guessing that I need to use the Modeling class for this.  Can someone point me toward how to add a point to the edge of an existing polygon object?   for example,  I would like to iterate through all points and add a point a certain distance away from each point.  Would I use SetEdgePoint()?   If not what would I use?

      Thanks.

      ~Shawn

      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 02/09/2010 at 20:18, xxxxxxxx wrote:

        If it causes the polygon to go beyond a quadrilateral then you will need to look at the Ngon routines because you can't have a CPolygon with more than 4 vertices (a,b,c,d).  It will need to be an Ngon otherwise.

        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 03/09/2010 at 01:07, xxxxxxxx wrote:

          Please have a look at the edgecuttool.cpp example, specifically the Modeling::SplitEdge and Modeling::SetEdgePoint methods.

          Btw. the Modeling library takes care of the Ngon stuff, so no need to worry about that.

          cheers,
          Matthias

          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 12/09/2010 at 16:08, xxxxxxxx wrote:

            okay so I am trying to cut an edge using the edgecuttool.cpp example..

            Am I doing this right?

              
              
             Real width = data.GetReal(MY_WIDTH);  
              
            Modeling * mod = Modeling::Alloc();  
            if (!mod->InitObject(op)) return FALSE;  
                  for (int i=0; i < lngPolygonCount; i++)  
                  {  
              
              
                      mod->SplitEdge(op, i, oldPoint, width);   
              
                      oldPoint = i;  
              
                  }  
            

            I am not getting any splitting at all happening on my cube.   Anyone know if I am leaving something important out?

            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 12/09/2010 at 16:35, xxxxxxxx wrote:

              Okay here's an update..  I'm sifting through the SDK and trying to match what it says to do...

                
                
              if(vpPoint)  
                        {  
                            AutoAlloc<Modeling> mod;  
                            if (!mod || !mod->InitObject(op)) return FALSE;  
                
                            LONG my1, my2;  
                            Real width = data.GetReal(CHAMFER_WIDTH);  
                
                            for (int i=0; i < lngPolygonCount; i++)  
                            {  
                                my1 = i;  
                                my2 = i-1;  
                
                                mod->SplitEdge(op, my1, my2, width);   
                
                                oldPoint = i;  
                                if (!mod->Commit()) return FALSE;  
                
                            }  
                        }  
              

              still no dice..  trying to put this in the mouse input  method of a tool plugin

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