Code sample Home

Break two intersected circles into arcs
void DemoBreak3 (HANDLE hLcWnd)
{
  HANDLE hBlock, hEnt1, hEnt2, hPtBuf;
  double X, Y;
  double Delta = 0.001;
  int    nPnts, i;

  // get a block, linked with CAD window
  hBlock = lcPropGetHandle( hLcWnd, LC_PROP_WND_VIEWBLOCK );
  
  // add 2 intersected circles
  hEnt1 = lcBlockAddCircle( hBlock, 20,10, 10, false );
  hEnt2 = lcBlockAddCircle( hBlock, 37,15, 15, false );

  // get intersection points
  hPtBuf = lcPaint_CreatePtbuf();
  nPnts = lcIntersection( hEnt1, hEnt2, false );
  for (i=0; i<nPnts; ++i){
    lcInterGetPoint( i, &X, &Y );
    lcPaint_PtbufAddPoint2( hPtBuf, X, Y );
  }

  // break first circle
  lcEntBreak2( hEnt1, hPtBuf, Delta, false, true );
  // break second circle
  lcEntBreak2( hEnt2, hPtBuf, Delta, false, true );
  
  // free points buffer
  lcPaint_DeletePtbuf( hPtBuf );

  // update view
  lcBlockUpdate( hBlock, true, 0 );
  lcWndRedraw( hLcWnd ); 
}
See Also:

Break entity on 2 parts
Break circle on 4 arcs
Find the intersection points of objects