Adding a point to an edge

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

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.

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

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?

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