diff --git a/CAvToolTriangle.cpp b/CAvToolTriangle.cpp index 1d36936..a7acf56 100644 --- a/CAvToolTriangle.cpp +++ b/CAvToolTriangle.cpp @@ -2440,12 +2440,10 @@ CAvDiskTriangle( const Point3d& ptDiskCen, const Vector3d& vtDiskAx, double dDis // Allontanamento dall'interno double dEscapeDist = max( DiskTriaInteriorEscapeDistGenMot( ptDiskCen, vtDiskAx, dDiskRad, trTria, vtMove), 0.) ; // Allontanamento dalla frontiera - Vector3d vtMoveOrt = vtMove - vtMove * vtDiskAx * vtDiskAx ; + Vector3d vtMoveOrt = OrthoCompo( vtMove, vtDiskAx) ; vtMoveOrt.Normalize() ; Frame3d DiskFrame ; - Vector3d vtJ = vtDiskAx ^ vtMoveOrt ; - vtJ.Normalize() ; - DiskFrame.Set( ptDiskCen, vtMoveOrt, vtJ, vtDiskAx) ; + DiskFrame.Set( ptDiskCen, vtDiskAx, vtMoveOrt) ; Triangle3d trTriaLoc = trTria ; Vector3d vtMoveLoc = vtMove ; trTriaLoc.ToLoc( DiskFrame) ; diff --git a/CalcPocketing.cpp b/CalcPocketing.cpp index c1d8e73..eb824f7 100644 --- a/CalcPocketing.cpp +++ b/CalcPocketing.cpp @@ -2690,15 +2690,30 @@ IsForcedStepTrapezoid( const ICurveComposite* pCrvTrap, const PocketParams& Pock bForced = true ; // se entrambe le basi sono aperte else if ( vnProps[nBase] == TEMP_PROP_OPEN_EDGE && vnProps[nSecondBase] == TEMP_PROP_OPEN_EDGE) { - const ICurve* pCrvOpenBase = pCrvTrap->GetCurve( nBase) ; - const ICurve* pCrvOpenSecondBase = pCrvTrap->GetCurve( nSecondBase) ; - if ( pCrvOpenBase == nullptr || ! pCrvOpenBase->IsValid() || - pCrvOpenSecondBase == nullptr || ! pCrvOpenSecondBase->IsValid()) - return false ; - double dLenOpenBase ; pCrvOpenBase->GetLength( dLenOpenBase) ; - double dLenSecondOpenBase ; pCrvOpenSecondBase->GetLength( dLenSecondOpenBase) ; - bForced = ( dLenOpenBase < dDiam + 10. * EPS_SMALL && - dLenSecondOpenBase < dDiam + 10. * EPS_SMALL) ; + double dLenOpen = 0. ; + for ( int i = 0 ; i < 4 ; ++ i) { + if ( i == nBase || i == nSecondBase) { + const ICurve* pCrvOpen = pCrvTrap->GetCurve( i) ; + if ( pCrvOpen == nullptr || ! pCrvOpen->IsValid()) + return false ; + // essendo nei casi a trapezio, ho solo segmenti + pCrvOpen->GetLength( dLenOpen) ; + Vector3d vtDir ; pCrvOpen->GetStartDir( vtDir) ; + vtDir *= dLenOpen ; + const ICurve* pCrvClosePrev = pCrvTrap->GetCurve( ( i == 0 ? 3 : i - 1)) ; + if ( pCrvClosePrev == nullptr || ! pCrvClosePrev->IsValid()) + return false ; + const ICurve* pCrvCloseAft = pCrvTrap->GetCurve( ( i == 3 ? 0 : i + 1)) ; + if ( pCrvCloseAft == nullptr || ! pCrvCloseAft->IsValid()) + return false ; + // essendo un trapezio queste due direzioni me le aspetto parallele tra loro + Vector3d vtDirPrev ; pCrvClosePrev->GetEndDir( vtDirPrev) ; + Vector3d vtDirAft ; pCrvCloseAft->GetStartDir( vtDirAft) ; + dLenOpen = min( { OrthoCompo( vtDir, vtDirPrev).Len(), OrthoCompo( vtDir, vtDirAft).Len(), dLenOpen}) ; + break ; + } + } + bForced = ( dLenOpen < dDiam + TOL_TRAPEZOID) ; } // se alternate, non forzo else @@ -2724,14 +2739,14 @@ IsForcedStepTrapezoid( const ICurveComposite* pCrvTrap, const PocketParams& Pock const ICurve* pCrvCloseAft = pCrvTrap->GetCurve( ( i == 3 ? 0 : i + 1)) ; if ( pCrvCloseAft == nullptr || ! pCrvCloseAft->IsValid()) return false ; - // essendo un trapezio queste due direzioni me le apsetto parallele tra loro + // essendo un trapezio queste due direzioni me le aspetto parallele tra loro Vector3d vtDirPrev ; pCrvClosePrev->GetEndDir( vtDirPrev) ; Vector3d vtDirAft ; pCrvCloseAft->GetStartDir( vtDirAft) ; dLenOpen = min( { OrthoCompo( vtDir, vtDirPrev).Len(), OrthoCompo( vtDir, vtDirAft).Len(), dLenOpen}) ; break ; } } - bForced = ( dLenOpen < dDiam + 10. * EPS_SMALL) ; + bForced = ( dLenOpen < dDiam + TOL_TRAPEZOID) ; } break ; // se tutto chiuso, è forzato diff --git a/ProjectCurveSurf.cpp b/ProjectCurveSurf.cpp index 6c189f7..e403193 100644 --- a/ProjectCurveSurf.cpp +++ b/ProjectCurveSurf.cpp @@ -393,7 +393,7 @@ typedef std::vector INTPARLINESTMPVECTOR ; //---------------------------------------------------------------------------- static bool ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const Frame3d& frRefLine, const INTPARLINESTMPVECTOR& vpIntPLSTM, - double dPar, Point5ax& Pt5ax) + double dPar, bool bFromVsTo, Point5ax& Pt5ax) { // intersezione retta di proiezione con superfici (conservo l'intersezione più alta) Point3d ptL = GetToLoc( ptP, frRefLine) ; @@ -402,23 +402,48 @@ ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const Frame for ( int i = 0 ; i < ssize( vpIntPLSTM) ; ++ i) { ILSIVECTOR vIntRes ; if ( vpIntPLSTM[i]->GetInters( ptL, 1, vIntRes, false)) { - // cerco la prima intersezione valida a partire dall'ultima (è la più alta) - int nI = ssize( vIntRes) - 1 ; - while ( nI >= 0 && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) - --nI ; - // se trovata - if ( nI >= 0) { - if ( nInd < 0) { - IntRes = vIntRes[nI] ; - nInd = i ; - } - else { - double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU2 : IntRes.dU) ; - double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU2 : vIntRes[nI].dU) ; - if ( dU > dUref) { + // se dalla direzione + if ( bFromVsTo) { + // cerco la prima intersezione valida a partire dall'ultima (è la più alta) + int nI = ssize( vIntRes) - 1 ; + while ( nI >= 0 && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) + --nI ; + // se trovata + if ( nI >= 0) { + if ( nInd < 0) { IntRes = vIntRes[nI] ; nInd = i ; } + else { + double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU2 : IntRes.dU) ; + double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU2 : vIntRes[nI].dU) ; + if ( dU > dUref) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + } + } + } + // altrimenti verso la direzione + else { + // cerco la prima intersezione valida a partire dalla prima (è la più alta) + int nI = 0 ; + while ( nI < ssize( vIntRes) && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) + ++nI ; + // se trovata + if ( nI < ssize( vIntRes)) { + if ( nInd < 0) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + else { + double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU : IntRes.dU2) ; + double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU : vIntRes[nI].dU2) ; + if ( dU < dUref) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + } } } } @@ -455,7 +480,7 @@ ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const Frame //---------------------------------------------------------------------------- bool ProjectCurveOnSurf( const ICurve& crCrv, const CISURFPVECTOR& vpSurf, const Vector3d& vtDir, - double dLinTol, double dMaxSegmLen, bool bSharpEdges, PNT5AXVECTOR& vPt5ax) + double dLinTol, double dMaxSegmLen, bool bSharpEdges, bool bFromVsTo, PNT5AXVECTOR& vPt5ax) { // sistemazioni per tipo di superficie CISRFTMPVECTOR vpSurfTm ; @@ -521,7 +546,7 @@ ProjectCurveOnSurf( const ICurve& crCrv, const CISURFPVECTOR& vpSurf, const Vect while ( bFound) { // se trovo proiezione, la salvo Point5ax Pt5ax ; - if ( ProjectPointOnSurf( ptP, vpSurfTm, frRefLine, vpIntPLSTM, dPar, Pt5ax)) + if ( ProjectPointOnSurf( ptP, vpSurfTm, frRefLine, vpIntPLSTM, dPar, bFromVsTo, Pt5ax)) vPt5ax.emplace_back( Pt5ax) ; // passo al successivo bFound = PL.GetNextUPoint( &dPar, &ptP) ; @@ -543,7 +568,8 @@ ProjectCurveOnSurf( const ICurve& crCrv, const CISURFPVECTOR& vpSurf, const Vect //---------------------------------------------------------------------------- static bool -ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const IGeoPoint3d& gpRef, double dPar, Point5ax& Pt5ax) +ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const IGeoPoint3d& gpRef, double dPar, bool bFromVsTo, + Point5ax& Pt5ax) { // punto di riferimento Point3d ptMin = gpRef.GetPoint() ; @@ -558,23 +584,48 @@ ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const IGeoP for ( int i = 0 ; i < ssize( vpStm) ; ++ i) { ILSIVECTOR vIntRes ; if ( IntersLineSurfTm( ptP, vtLine, dLineLen, *vpStm[i], vIntRes, false)) { - // cerco la prima intersezione valida a partire dall'ultima (è la più alta) - int nI = ssize( vIntRes) - 1 ; - while ( nI >= 0 && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) - --nI ; - // se trovata - if ( nI >= 0) { - if ( nInd < 0) { - IntRes = vIntRes[nI] ; - nInd = i ; - } - else { - double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU2 : IntRes.dU) ; - double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU2 : vIntRes[nI].dU) ; - if ( dU > dUref) { + // se dal punto + if ( bFromVsTo) { + // cerco la prima intersezione valida a partire dall'ultima (è la più alta) + int nI = ssize( vIntRes) - 1 ; + while ( nI >= 0 && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) + --nI ; + // se trovata + if ( nI >= 0) { + if ( nInd < 0) { IntRes = vIntRes[nI] ; nInd = i ; } + else { + double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU2 : IntRes.dU) ; + double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU2 : vIntRes[nI].dU) ; + if ( dU > dUref) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + } + } + } + // altrimenti verso il punto + else { + // cerco la prima intersezione valida a partire dalla prima (è la più alta) + int nI = 0 ; + while ( nI < ssize( vIntRes) && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) + ++nI ; + // se trovata + if ( nI < ssize( vIntRes)) { + if ( nInd < 0) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + else { + double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU : IntRes.dU2) ; + double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU : vIntRes[nI].dU2) ; + if ( dU < dUref) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + } } } } @@ -612,7 +663,7 @@ ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const IGeoP //---------------------------------------------------------------------------- bool ProjectCurveOnSurf( const ICurve& crCrv, const CISURFPVECTOR& vpSurf, const IGeoPoint3d& gpRef, - double dLinTol, double dMaxSegmLen, bool bSharpEdges, PNT5AXVECTOR& vPt5ax) + double dLinTol, double dMaxSegmLen, bool bSharpEdges, bool bFromVsTo, PNT5AXVECTOR& vPt5ax) { // sistemazioni per tipo di superficie CISRFTMPVECTOR vpSurfTm ; @@ -663,7 +714,7 @@ ProjectCurveOnSurf( const ICurve& crCrv, const CISURFPVECTOR& vpSurf, const IGeo while ( bFound) { // se trovo proiezione, la salvo Point5ax Pt5ax ; - if ( ProjectPointOnSurf( ptP, vpSurfTm, gpRef, dPar, Pt5ax)) + if ( ProjectPointOnSurf( ptP, vpSurfTm, gpRef, dPar, bFromVsTo, Pt5ax)) vPt5ax.emplace_back( Pt5ax) ; // passo al successivo bFound = PL.GetNextUPoint( &dPar, &ptP) ; @@ -681,7 +732,8 @@ ProjectCurveOnSurf( const ICurve& crCrv, const CISURFPVECTOR& vpSurf, const IGeo //---------------------------------------------------------------------------- static bool -ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const ICurve& crRef, double dPar, Point5ax& Pt5ax) +ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const ICurve& crRef, double dPar, bool bFromVsTo, + Point5ax& Pt5ax) { // punto a minima distanza DistPointCurve dPC( ptP, crRef) ; @@ -699,23 +751,48 @@ ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const ICurv for ( int i = 0 ; i < ssize( vpStm) ; ++ i) { ILSIVECTOR vIntRes ; if ( IntersLineSurfTm( ptP, vtLine, dLineLen, *vpStm[i], vIntRes, false)) { - // cerco la prima intersezione valida a partire dall'ultima (è la più alta) - int nI = ssize( vIntRes) - 1 ; - while ( nI >= 0 && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) - --nI ; - // se trovata - if ( nI >= 0) { - if ( nInd < 0) { - IntRes = vIntRes[nI] ; - nInd = i ; - } - else { - double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU2 : IntRes.dU) ; - double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU2 : vIntRes[nI].dU) ; - if ( dU > dUref) { + // se dalla curva + if ( bFromVsTo) { + // cerco la prima intersezione valida a partire dall'ultima (è la più alta) + int nI = ssize( vIntRes) - 1 ; + while ( nI >= 0 && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) + --nI ; + // se trovata + if ( nI >= 0) { + if ( nInd < 0) { IntRes = vIntRes[nI] ; nInd = i ; } + else { + double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU2 : IntRes.dU) ; + double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU2 : vIntRes[nI].dU) ; + if ( dU > dUref) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + } + } + } + // altrimenti verso la curva + else { + // cerco la prima intersezione valida a partire dalla prima (è la più alta) + int nI = 0 ; + while ( nI < ssize( vIntRes) && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) + ++nI ; + // se trovata + if ( nI < ssize( vIntRes)) { + if ( nInd < 0) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + else { + double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU : IntRes.dU2) ; + double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU : vIntRes[nI].dU2) ; + if ( dU < dUref) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + } } } } @@ -738,7 +815,7 @@ ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const ICurv // assegno valori al punto 5assi Pt5ax.ptP = ptInt ; Pt5ax.vtDir1 = vtN ; - Pt5ax.vtDir2 = vtLine ; + Pt5ax.vtDir2 = ( bFromVsTo ? vtLine : -vtLine) ; Pt5ax.vtDirU = V_NULL ; Pt5ax.vtDirV = V_NULL ; Pt5ax.dPar = dPar ; @@ -754,7 +831,7 @@ ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const ICurv //---------------------------------------------------------------------------- bool ProjectCurveOnSurf( const ICurve& crCrv, const CISURFPVECTOR& vpSurf, const ICurve& crRef, - double dLinTol, double dMaxSegmLen, bool bSharpEdges, PNT5AXVECTOR& vPt5ax) + double dLinTol, double dMaxSegmLen, bool bSharpEdges, bool bFromVsTo, PNT5AXVECTOR& vPt5ax) { // Sistemazioni per tipo di superficie CISRFTMPVECTOR vpSurfTm ; @@ -805,7 +882,7 @@ ProjectCurveOnSurf( const ICurve& crCrv, const CISURFPVECTOR& vpSurf, const ICur while ( bFound) { // se trovo proiezione, la salvo Point5ax Pt5ax ; - if ( ProjectPointOnSurf( ptP, vpSurfTm, crRef, dPar, Pt5ax)) + if ( ProjectPointOnSurf( ptP, vpSurfTm, crRef, dPar, bFromVsTo, Pt5ax)) vPt5ax.emplace_back( Pt5ax) ; // passo al successivo bFound = PL.GetNextUPoint( &dPar, &ptP) ; @@ -823,7 +900,8 @@ ProjectCurveOnSurf( const ICurve& crCrv, const CISURFPVECTOR& vpSurf, const ICur //---------------------------------------------------------------------------- static bool -ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const SurfTriMesh& stmRef, double dPar, Point5ax& Pt5ax) +ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const SurfTriMesh& stmRef, double dPar, bool bFromVsTo, + Point5ax& Pt5ax) { // punto sulla superficie guida a minima distanza DistPointSurfTm dPS( ptP, stmRef) ; @@ -850,23 +928,48 @@ ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const SurfT for ( int i = 0 ; i < ssize( vpStm) ; ++ i) { ILSIVECTOR vIntRes ; if ( IntersLineSurfTm( ptP, vtLine, dLineLen, *vpStm[i], vIntRes, false)) { - // cerco la prima intersezione valida a partire dall'ultima (è la più alta) - int nI = ssize( vIntRes) - 1 ; - while ( nI >= 0 && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) - --nI ; - // se trovata - if ( nI >= 0) { - if ( nInd < 0) { - IntRes = vIntRes[nI] ; - nInd = i ; - } - else { - double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU2 : IntRes.dU) ; - double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU2 : vIntRes[nI].dU) ; - if ( dU > dUref) { + // se dalla superficie + if ( bFromVsTo) { + // cerco la prima intersezione valida a partire dall'ultima (è la più alta) + int nI = ssize( vIntRes) - 1 ; + while ( nI >= 0 && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) + --nI ; + // se trovata + if ( nI >= 0) { + if ( nInd < 0) { IntRes = vIntRes[nI] ; nInd = i ; } + else { + double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU2 : IntRes.dU) ; + double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU2 : vIntRes[nI].dU) ; + if ( dU > dUref) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + } + } + } + // altrimenti verso la superficie + else { + // cerco la prima intersezione valida a partire dalla prima (è la più alta) + int nI = 0 ; + while ( nI < ssize( vIntRes) && abs( vIntRes[nI].dCosDN) < COS_ANG_LIM) + ++nI ; + // se trovata + if ( nI < ssize( vIntRes)) { + if ( nInd < 0) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + else { + double dUref = (( IntRes.nILTT == ILTT_SEGM || IntRes.nILTT == ILTT_SEGM_ON_EDGE) ? IntRes.dU : IntRes.dU2) ; + double dU = (( vIntRes[nI].nILTT == ILTT_SEGM || vIntRes[nI].nILTT == ILTT_SEGM_ON_EDGE) ? vIntRes[nI].dU : vIntRes[nI].dU2) ; + if ( dU < dUref) { + IntRes = vIntRes[nI] ; + nInd = i ; + } + } } } } @@ -911,7 +1014,7 @@ ProjectPointOnSurf( const Point3d& ptP, const CISRFTMPVECTOR& vpStm, const SurfT //---------------------------------------------------------------------------- bool ProjectCurveOnSurf( const ICurve& crCrv, const CISURFPVECTOR& vpSurf, const ISurf& sfRef, - double dLinTol, double dMaxSegmLen, bool bSharpEdges, PNT5AXVECTOR& vPt5ax) + double dLinTol, double dMaxSegmLen, bool bSharpEdges, bool bFromVsTo, PNT5AXVECTOR& vPt5ax) { // sistemazioni per tipo di superficie CISRFTMPVECTOR vpSurfTm ; @@ -983,7 +1086,7 @@ ProjectCurveOnSurf( const ICurve& crCrv, const CISURFPVECTOR& vpSurf, const ISur while ( bFound) { // se trovo proiezione, la salvo Point5ax Pt5ax ; - if ( ProjectPointOnSurf( ptP, vpSurfTm, *pRefTm, dPar, Pt5ax)) + if ( ProjectPointOnSurf( ptP, vpSurfTm, *pRefTm, dPar, bFromVsTo, Pt5ax)) vPt5ax.emplace_back( Pt5ax) ; // passo al successivo bFound = PL.GetNextUPoint( &dPar, &ptP) ;