diff --git a/CalcPocketing.cpp b/CalcPocketing.cpp index 78469a9..a76150b 100644 --- a/CalcPocketing.cpp +++ b/CalcPocketing.cpp @@ -1105,7 +1105,7 @@ AdjustOpenEdge( const ICurveComposite* pCrvCompo, const ICRVCOMPOPOVECTOR& vCrvI if ( AreOppositeVectorApprox( pSfrBean->GetNormVersor(), pSfrInc->GetNormVersor())) pSfrBean->Invert() ; // 7) se la "Regione a fagiolo" non influenza la regione di incidenza, la transcuro - bool bDiscard = true ; + bool bDiscard = ! bIsIsland ; // non trascuro se si tratta di un'isola aperta for ( int cI = 0 ; cI < pSfrInc->GetChunkCount() && bDiscard ; ++ cI) for ( int cB = 0 ; cB < pSfrBean->GetChunkCount() && bDiscard ; ++ cB) bDiscard = ( pSfrInc->GetChunkSimpleClassification( cI, *pSfrBean, cB) != REGC_INTERS) ; @@ -1434,14 +1434,17 @@ ModifySurfByOpenEdges( ISurfFlatRegion* pSfr, const PocketParams& PockParams) // se curva tutta aperta, controllo se l'isola può essere trascurata if ( nCurrTmpProp == 1) { bool bRemove = false ; - if ( ! CheckForRemovingIsland( pCrvIsl, PockParams.dRad_prec > 0 ? 2 * PockParams.dRad_prec + PockParams.dRadialOffset_prec : 2 * PockParams.dRad, + if ( ! CheckForRemovingIsland( pCrvIsl, 2 * PockParams.dRad + 2 * PockParams.dRadialOffset, bRemove)) return false ; - if ( bRemove) + if ( bRemove) // se da rimuovere passo all'isola successiva continue ; + // altrimenti, estendo l'isola aperta ( considero il loop esterno come "isola" per l'estensione) + ICRVCOMPOPOVECTOR vCrvExtLoop ; vCrvExtLoop.emplace_back( pCrvEL->Clone()) ; + if ( ! AdjustContourWithOpenEdges( pCrvIsl, vCrvExtLoop, PockParams)) + return false ; + bIsChunkModified = true ; } - for ( int u = 0 ; u < pCrvIsl->GetCurveCount() ; ++ u) - pCrvIsl->SetCurveTempProp( u, 0, 0) ; // lascio tutto chiuso, ho già esteso vCrvToTIsland.emplace_back( pCrvIsl->Clone()) ; // entra nelle curve della regione da svuotare }