From d3eb9701d3e225bb413a1692830d2b25228af582 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 14 Jan 2016 17:36:30 +0000 Subject: [PATCH] EgtExecutor 1.6l8 : - modifiche a nesting per snap. --- EXE_Const.h | 2 +- EXE_NstCreateFlatParts.cpp | 2 +- EXE_NstPartNesting.cpp | 378 ++++++++++++++++++++++++++++++++++--- EgtExecutor.rc | Bin 11694 -> 11694 bytes 4 files changed, 350 insertions(+), 32 deletions(-) diff --git a/EXE_Const.h b/EXE_Const.h index 1a5a80a..7f0f009 100644 --- a/EXE_Const.h +++ b/EXE_Const.h @@ -19,7 +19,7 @@ // Curve originali di composite static std::string CRV_ORIG = "ORIG" ; // Per FlatParts (Nesting) -static std::string NST_PART_REG = "Region" ; +static std::string NST_PARTREG_LAYER = "Region" ; static std::string NST_EXT_LAYER = "OutLoop" ; static std::string NST_IN_LAYER = "InLoop" ; static std::string NST_ON_LAYER = "OnPath" ; diff --git a/EXE_NstCreateFlatParts.cpp b/EXE_NstCreateFlatParts.cpp index b5d1e23..243e5f3 100644 --- a/EXE_NstCreateFlatParts.cpp +++ b/EXE_NstCreateFlatParts.cpp @@ -393,7 +393,7 @@ VerifyAndAdjustFlatParts( void) // creo un nuovo layer in cui mettere tutti i concatenati int nRegId = ExeCreateGroup( pPar->GetId(), Frame3d(), RTY_GLOB) ; bOk = bOk && nRegId != GDB_ID_NULL ; - bOk = bOk && pGeomDB->SetName( nRegId, NST_PART_REG) ; + bOk = bOk && pGeomDB->SetName( nRegId, NST_PARTREG_LAYER) ; // concateno tutte le curve INTVECTOR vIds ; vIds.push_back( GDB_ID_SEL) ; diff --git a/EXE_NstPartNesting.cpp b/EXE_NstPartNesting.cpp index 4e0e923..410d97f 100644 --- a/EXE_NstPartNesting.cpp +++ b/EXE_NstPartNesting.cpp @@ -18,6 +18,7 @@ #include "EXE_Macro.h" #include "/EgtDev/Include/EXeExecutor.h" #include "/EgtDev/Include/EXeConst.h" +#include "/EgtDev/Include/EGkCurveLine.h" #include "/EgtDev/Include/EGkCurveComposite.h" #include "/EgtDev/Include/EGkSfrCreate.h" #include "/EgtDev/Include/EGkSimpleCDSurfFrMove.h" @@ -28,12 +29,26 @@ using namespace std ; +//---------------------------------------------------------------------------- +struct SCollInfoEx : public SCollInfo +{ + int nIdM ; // identificativo della regione mobile + bool bIsCutM ; // flag di regione di pezzo o di taglio + int nIdF ; // identificativo della regione fissa + bool bIsCutF ; // flag di regione di pezzo o di taglio + // costruttori + SCollInfoEx() : SCollInfo(), nIdM( GDB_ID_NULL), bIsCutM( false), + nIdF( GDB_ID_NULL), bIsCutF( false) {} + SCollInfoEx( const SCollInfo& Sou) : SCollInfo( Sou), nIdM( GDB_ID_NULL), bIsCutM( false), + nIdF( GDB_ID_NULL), bIsCutF( false) {} +} ; + //---------------------------------------------------------------------------- static int GetFlatPartRegion( IGeomDB* pGeomDB, int nId) { // recupero regione del pezzo (è la prima del sottogruppo di nome Region) - int nRegGrp = pGeomDB->GetFirstNameInGroup( nId, NST_PART_REG) ; + int nRegGrp = pGeomDB->GetFirstNameInGroup( nId, NST_PARTREG_LAYER) ; int nRegId = pGeomDB->GetFirstInGroup( nRegGrp) ; while ( nRegId != GDB_ID_NULL) { if ( pGeomDB->GetGeoType( nRegId) == SRF_FLATRGN) @@ -68,6 +83,51 @@ GetFlatPartCutRegions( IGeomDB* pGeomDB, int nId, bool bReduced, INTVECTOR& vCrI return true ; } +//---------------------------------------------------------------------------- +static int +GetFlatPartFromRegion( IGeomDB* pGeomDB, int nId) +{ + // verifico che il layer di appartenenza sia una regione + int nLayerId = pGeomDB->GetParentId( nId) ; + string sName ; + if ( ! pGeomDB->GetName( nLayerId, sName) && ! EqualNoCase( sName, NST_PARTREG_LAYER)) + return GDB_ID_NULL ; + // restituisco il padre del layer + return ( pGeomDB->GetParentId( nLayerId)) ; +} + +//---------------------------------------------------------------------------- +static int +GetFlatPartFromCut( IGeomDB* pGeomDB, int nId) +{ + // verifico appartenga al gruppo PreView (padre di padre di padre) + int nPvId = pGeomDB->GetParentId( pGeomDB->GetParentId( pGeomDB->GetParentId( nId))) ; + string sName ; + if ( ! pGeomDB->GetName( nPvId, sName) && ! EqualNoCase( sName, MCH_PV)) + return GDB_ID_NULL ; + // restituisco il padre del layer + return ( pGeomDB->GetParentId( nPvId)) ; +} + +//---------------------------------------------------------------------------- +static int +GetGeometryFromCut( IGeomDB* pGeomDB, IMachMgr* pMachMgr, int nId) +{ + // verifico appartenga ad una lavorazione + int nMchId ; + if ( ! pGeomDB->GetInfo( pGeomDB->GetParentId( pGeomDB->GetParentId( nId)), "MId", nMchId)) + return GDB_ID_NULL ; + // recupero la geometria di applicazione della lavorazione (deve essere una sola) + if ( ! pMachMgr->SetCurrMachining( nMchId)) + return GDB_ID_NULL ; + SELVECTOR vIds ; + pMachMgr->GetMachiningGeometry( vIds) ; + if ( vIds.size() == 1) + return vIds[0].nId ; + else + return GDB_ID_NULL ; +} + //---------------------------------------------------------------------------- static int CreateOutBoxRegion( IGeomDB* pGeomDB, int nParentId, @@ -381,17 +441,20 @@ ExePackPartCluster( const INTVECTOR& vIds, bool bReducedCut, } //---------------------------------------------------------------------------- -static SCollInfo s_scInfo ; +static SCollInfoEx s_scInfo ; +static SCollInfoEx s_scInfoSaved ; //---------------------------------------------------------------------------- static double -UpdateCollId( double dLen, double dPrevLen, int nId1, int nId2, SCollInfo scInfoCurr) +UpdateCollId( double dLen, double dPrevLen, int nId1, int nId2, bool bIsCut1, bool bIsCut2, SCollInfo scInfoCurr) { if ( abs( dLen - dPrevLen) < EPS_SMALL) { if ( scInfoCurr.nType == SCI_PNT_LINE || scInfoCurr.nType == SCI_LINE_LINE) { s_scInfo = scInfoCurr ; s_scInfo.nIdM = nId1 ; s_scInfo.nIdF = nId2 ; + s_scInfo.bIsCutM = bIsCut1 ; + s_scInfo.bIsCutF = bIsCut2 ; } return dPrevLen ; } @@ -399,6 +462,8 @@ UpdateCollId( double dLen, double dPrevLen, int nId1, int nId2, SCollInfo scInfo s_scInfo = scInfoCurr ; s_scInfo.nIdM = nId1 ; s_scInfo.nIdF = nId2 ; + s_scInfo.bIsCutM = bIsCut1 ; + s_scInfo.bIsCutF = bIsCut2 ; return dLen ; } else @@ -550,16 +615,16 @@ MyMovePartCluster( const INTVECTOR& vIds, bool bReducedCut, Vector3d& vtMove, SCollInfo scInfoCurr ; // la confronto con il box MySurfFrMoveSimpleNoCollision( nRegId, nBoxId, vtDir, dLen, scInfoCurr) ; - dPrevLen = UpdateCollId( dLen, dPrevLen, nRegId, nBoxId, scInfoCurr) ; + dPrevLen = UpdateCollId( dLen, dPrevLen, nRegId, nBoxId, false, false, scInfoCurr) ; // la confronto con le regioni degli altri pezzi for ( int nOthRegId : vOthReg) { MySurfFrMoveSimpleNoCollision( nRegId, nOthRegId, vtDir, dLen, scInfoCurr) ; - dPrevLen = UpdateCollId( dLen, dPrevLen, nRegId, nOthRegId, scInfoCurr) ; + dPrevLen = UpdateCollId( dLen, dPrevLen, nRegId, nOthRegId, false, false, scInfoCurr) ; } // e con le regioni dei tagli degli altri pezzi for ( int nOthCutRegId : vOthCutReg) { MySurfFrMoveSimpleNoCollision( nRegId, nOthCutRegId, vtDir, dLen, scInfoCurr) ; - dPrevLen = UpdateCollId( dLen, dPrevLen, nRegId, nOthCutRegId, scInfoCurr) ; + dPrevLen = UpdateCollId( dLen, dPrevLen, nRegId, nOthCutRegId, false, true, scInfoCurr) ; } // recupero regioni di lavorazione del pezzo INTVECTOR vCrId ; @@ -571,7 +636,7 @@ MyMovePartCluster( const INTVECTOR& vIds, bool bReducedCut, Vector3d& vtMove, for ( int nCrId : vCrId) { for ( int nOthRegId : vOthReg) { MySurfFrMoveSimpleNoCollision( nCrId, nOthRegId, vtDir, dLen, scInfoCurr) ; - dPrevLen = UpdateCollId( dLen, dPrevLen, nCrId, nOthRegId, scInfoCurr) ; + dPrevLen = UpdateCollId( dLen, dPrevLen, nCrId, nOthRegId, true, false, scInfoCurr) ; } } } @@ -580,7 +645,7 @@ MyMovePartCluster( const INTVECTOR& vIds, bool bReducedCut, Vector3d& vtMove, if ( ! bOk) return false ; - // Log provvisorio + // Log per debug if ( false) { if ( s_scInfo.nType != SCI_NONE) { string sOut = "Id1=" + ToString( s_scInfo.nIdM) + " Id2=" + ToString( s_scInfo.nIdF) + " Info type=" ; @@ -662,26 +727,6 @@ ExeMovePartCluster( const INTVECTOR& vIds, bool bReducedCut, Vector3d& vtMove, } } -//---------------------------------------------------------------------------- -bool -ExeGetObstacleTangent( Vector3d& vtTang) -{ - if ( s_scInfo.nType != SCI_PNT_LINE && s_scInfo.nType != SCI_LINE_LINE) - return false ; - vtTang = s_scInfo.vtDirF ; - return vtTang.Normalize() ; -} - -//---------------------------------------------------------------------------- -bool -ExeGetMovingTangent( Vector3d& vtTang) -{ - if ( s_scInfo.nType != SCI_LINE_PNT && s_scInfo.nType != SCI_LINE_LINE) - return false ; - vtTang = s_scInfo.vtDirM ; - return vtTang.Normalize() ; -} - //---------------------------------------------------------------------------- bool ExeRotatePartCluster( const INTVECTOR& vIds, bool bReducedCut, const Point3d& ptCen, double& dRotAngDeg, @@ -812,10 +857,49 @@ ExeRotatePartCluster( const INTVECTOR& vIds, bool bReducedCut, const Point3d& pt return true ; } +//---------------------------------------------------------------------------- +static bool +GetObstacleTangent( Vector3d& vtTang) +{ + if ( s_scInfo.nType != SCI_PNT_LINE && s_scInfo.nType != SCI_LINE_LINE) + return false ; + vtTang = s_scInfo.vtDirF ; + return vtTang.Normalize() ; +} + +//---------------------------------------------------------------------------- +static bool +GetMovingTangent( Vector3d& vtTang) +{ + if ( s_scInfo.nType != SCI_LINE_PNT && s_scInfo.nType != SCI_LINE_LINE) + return false ; + vtTang = s_scInfo.vtDirM ; + return vtTang.Normalize() ; +} + +//---------------------------------------------------------------------------- +bool +ExeTgMovePartClusterOnCollision( const INTVECTOR& vIds, bool bReducedCut, Vector3d& vtMove, + double dXmin, double dYmin, double dXmax, double dYmax) +{ + // recupero tangente lineare di ostacolo o di mobile + Vector3d vtTang ; + if ( ! GetObstacleTangent( vtTang) && ! GetMovingTangent( vtTang)) { + vtMove = V_NULL ; + return false ; + } + // calcolo il movimento tangente + vtMove = ( vtMove * vtTang) * vtTang ; + // riprovo con questo movimento + if ( ! ExeMovePartCluster( vIds, bReducedCut, vtMove, dXmin, dYmin, dXmax, dYmax)) + return false ; + return true ; +} + //---------------------------------------------------------------------------- bool ExeAlignPartClusterOnCollision( const INTVECTOR& vIds, bool bReducedCut, - double dXmin, double dYmin, double dXmax, double dYmax) + double dXmin, double dYmin, double dXmax, double dYmax, bool& bMoved) { IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, false) @@ -854,6 +938,7 @@ ExeAlignPartClusterOnCollision( const INTVECTOR& vIds, bool bReducedCut, // porto le tangenti nel riferimento globale e le confronto con la tangente dell'ostacolo vtTp.ToGlob( frSfr) ; vtTn.ToGlob( frSfr) ; + // log per debug if ( false) { string sOut = "vtTp=(" + ToString( vtTp) + ") vtTn=(" + ToString( vtTn) + ")" ; LOG_INFO( GetLogger(), sOut.c_str()) ; @@ -862,7 +947,240 @@ ExeAlignPartClusterOnCollision( const INTVECTOR& vIds, bool bReducedCut, double dRotAngDeg = ( abs( vtTp * s_scInfo.vtDirF) > abs( vtTn * s_scInfo.vtDirF)) ? 90 : - 90 ; // provo a ruotare sul punto di collisione in senso orario Point3d ptCen = s_scInfo.ptP1 ; - return ExeRotatePartCluster( vIds, bReducedCut, ptCen, dRotAngDeg, dXmin, dYmin, dXmax, dYmax) ; + if ( ! ExeRotatePartCluster( vIds, bReducedCut, ptCen, dRotAngDeg, dXmin, dYmin, dXmax, dYmax)) + return false ; + bMoved = ( fabs( dRotAngDeg) > EPS_ANG_SMALL) ; + return true ; +} + +//---------------------------------------------------------------------------- +bool +ExeMoveToSnapPointOnCollision( const INTVECTOR& vIds, bool bReducedCut, double dMaxMove, + double dXmin, double dYmin, double dXmax, double dYmax, bool& bMoved) +{ + IGeomDB* pGeomDB = GetCurrGeomDB() ; + VERIFY_GEOMDB( pGeomDB, false) + IMachMgr* pMachMgr = GetCurrMachMgr() ; + VERIFY_MACHMGR( pMachMgr, false) + // la collisione deve essere di tipo linea-linea o punto linea + if ( s_scInfo.nType != SCI_LINE_LINE && s_scInfo.nType != SCI_PNT_LINE) + return false ; + // cerco i due tagli in collisione + int nCutM = GDB_ID_NULL ; + int nGeoM = GDB_ID_NULL ; + Point3d ptStartM, ptEndM ; + Vector3d vtDirM ; + Frame3d frGeoM ; + int nCutF = GDB_ID_NULL ; + int nGeoF = GDB_ID_NULL ; + Point3d ptStartF, ptEndF ; + Vector3d vtDirF ; + Frame3d frGeoF ; + // se mobile è già un taglio, ne ricavo i dati + if ( s_scInfo.bIsCutM) { + nCutM = s_scInfo.nIdM ; + nGeoM = GetGeometryFromCut( pGeomDB, pMachMgr, nCutM) ; + ICurveLine* pLineM = GetCurveLine( pGeomDB->GetGeoObj( nGeoM)) ; + if ( nCutM == GDB_ID_NULL || nGeoM == GDB_ID_NULL || + pLineM == nullptr || ! pGeomDB->GetGlobFrame( nGeoM, frGeoM)) + return false ; + ptStartM = pLineM->GetStart() ; + ptStartM.ToGlob( frGeoM) ; + ptEndM = pLineM->GetEnd() ; + ptEndM.ToGlob( frGeoM) ; + vtDirM = ptEndM - ptStartM ; + vtDirM.Normalize() ; + } + // se fisso è già un taglio, ne ricavo i dati + if ( s_scInfo.bIsCutF) { + nCutF = s_scInfo.nIdF ; + nGeoF = GetGeometryFromCut( pGeomDB, pMachMgr, nCutF) ; + ICurveLine* pLineF = GetCurveLine( pGeomDB->GetGeoObj( nGeoF)) ; + if ( nCutF == GDB_ID_NULL || nGeoF == GDB_ID_NULL || + pLineF == nullptr || ! pGeomDB->GetGlobFrame( nGeoF, frGeoF)) + return false ; + ptStartF = pLineF->GetStart() ; + ptStartF.ToGlob( frGeoF) ; + ptEndF = pLineF->GetEnd() ; + ptEndF.ToGlob( frGeoF) ; + vtDirF = ptEndF - ptStartF ; + vtDirF.Normalize() ; + } + // se fisso pezzo e mobile taglio, cerco il taglio sul fisso + if ( ! s_scInfo.bIsCutF && s_scInfo.bIsCutM) { + // cerco il pezzo del fisso + int nPartId = GetFlatPartFromRegion( pGeomDB, s_scInfo.nIdF) ; + // recupero i suoi tagli + INTVECTOR vCuts ; + if ( ! GetFlatPartCutRegions( pGeomDB, nPartId, bReducedCut, vCuts)) + return false ; + // cerco il taglio che si sovrappone a quello del mobile + BBox3d b3CutM ; + pGeomDB->GetGlobalBBox( nCutM, b3CutM) ; + for ( auto nId : vCuts) { + BBox3d b3Temp ; + pGeomDB->GetGlobalBBox( nId, b3Temp) ; + if ( b3Temp.OverlapsXY( b3CutM)) { + int nGeom = GetGeometryFromCut( pGeomDB, pMachMgr, nId) ; + ICurveLine* pLine = GetCurveLine( pGeomDB->GetGeoObj( nGeom)) ; + if ( nGeom == GDB_ID_NULL || pLine == nullptr || ! pGeomDB->GetGlobFrame( nGeom, frGeoF)) + continue ; + ptStartF = pLine->GetStart() ; + ptStartF.ToGlob( frGeoF) ; + ptEndF = pLine->GetEnd() ; + ptEndF.ToGlob( frGeoF) ; + vtDirF = ptEndF - ptStartF ; + vtDirF.Normalize() ; + if ( AreOppositeVectorApprox( vtDirF, vtDirM)) { + nCutF = nId ; + nGeoF = nGeom ; + break ; + } + } + } + } + // se mobile pezzo e fisso taglio, cerco il taglio sul mobile + if ( ! s_scInfo.bIsCutM && s_scInfo.bIsCutF) { + // cerco il pezzo del mobile + int nPartId = GetFlatPartFromRegion( pGeomDB, s_scInfo.nIdM) ; + // recupero i suoi tagli + INTVECTOR vCuts ; + if ( ! GetFlatPartCutRegions( pGeomDB, nPartId, bReducedCut, vCuts)) + return false ; + // cerco il taglio che si sovrappone a quello del fisso + BBox3d b3CutF ; + pGeomDB->GetGlobalBBox( nCutF, b3CutF) ; + for ( auto nId : vCuts) { + BBox3d b3Temp ; + pGeomDB->GetGlobalBBox( nId, b3Temp) ; + if ( b3Temp.OverlapsXY( b3CutF)) { + int nGeom = GetGeometryFromCut( pGeomDB, pMachMgr, nId) ; + ICurveLine* pLine = GetCurveLine( pGeomDB->GetGeoObj( nGeom)) ; + if ( nGeom == GDB_ID_NULL || pLine == nullptr || ! pGeomDB->GetGlobFrame( nGeom, frGeoM)) + continue ; + ptStartM = pLine->GetStart() ; + ptStartM.ToGlob( frGeoM) ; + ptEndM = pLine->GetEnd() ; + ptEndM.ToGlob( frGeoM) ; + vtDirM = ptEndM - ptStartM ; + vtDirM.Normalize() ; + if ( AreOppositeVectorApprox( vtDirF, vtDirM)) { + nCutM = nId ; + nGeoM = nGeom ; + break ; + } + } + } + } + // se un taglio non definito, esco + if ( nCutM == GDB_ID_NULL || nCutF == GDB_ID_NULL) + return false ; + + // linee adiacenti sul mobile + int nGeoMp = pGeomDB->GetPrev( nGeoM) ; + if ( nGeoMp == GDB_ID_NULL) + nGeoMp = pGeomDB->GetLastInGroup( pGeomDB->GetParentId( nGeoM)) ; + Vector3d vtDirMp ; + if ( pGeomDB->GetGeoType( nGeoMp) == CRV_LINE) { + ICurveLine* pLine = GetCurveLine( pGeomDB->GetGeoObj( nGeoMp)) ; + pLine->GetStartDir( vtDirMp) ; + vtDirMp.ToGlob( frGeoM) ; + } + int nGeoMn = pGeomDB->GetNext( nGeoM) ; + if ( nGeoMn == GDB_ID_NULL) + nGeoMn = pGeomDB->GetFirstInGroup( pGeomDB->GetParentId( nGeoM)) ; + Vector3d vtDirMn ; + if ( pGeomDB->GetGeoType( nGeoMn) == CRV_LINE) { + ICurveLine* pLine = GetCurveLine( pGeomDB->GetGeoObj( nGeoMn)) ; + pLine->GetStartDir( vtDirMn) ; + vtDirMn.ToGlob( frGeoM) ; + } + // linee adiacenti sul fisso + int nGeoFp = pGeomDB->GetPrev( nGeoF) ; + if ( nGeoFp == GDB_ID_NULL) + nGeoFp = pGeomDB->GetLastInGroup( pGeomDB->GetParentId( nGeoF)) ; + Vector3d vtDirFp ; + if ( pGeomDB->GetGeoType( nGeoFp) == CRV_LINE) { + ICurveLine* pLine = GetCurveLine( pGeomDB->GetGeoObj( nGeoFp)) ; + pLine->GetStartDir( vtDirFp) ; + vtDirFp.ToGlob( frGeoF) ; + } + int nGeoFn = pGeomDB->GetNext( nGeoF) ; + if ( nGeoFn == GDB_ID_NULL) + nGeoFn = pGeomDB->GetFirstInGroup( pGeomDB->GetParentId( nGeoF)) ; + Vector3d vtDirFn ; + if ( pGeomDB->GetGeoType( nGeoFn) == CRV_LINE) { + ICurveLine* pLine = GetCurveLine( pGeomDB->GetGeoObj( nGeoFn)) ; + pLine->GetStartDir( vtDirFn) ; + vtDirFn.ToGlob( frGeoF) ; + } + + // verifico se possibile allineare i tagli precedente di mobile e successivo di fisso + double dMoveMp = 2 * dMaxMove ; + if ( ! vtDirMp.IsSmall() && ! vtDirFn.IsSmall()) { + if ( AreSameVectorApprox( vtDirMp, vtDirFn)) { + double dDenom = CrossXY( vtDirF, vtDirFn) ; + if ( abs( dDenom) > EPS_ZERO) + dMoveMp = CrossXY( ptEndF - ptStartM, vtDirFn) / dDenom ; + } + } + double dMoveMn = 2 * dMaxMove ; + if ( ! vtDirMn.IsSmall() && ! vtDirFp.IsSmall()) { + if ( AreSameVectorApprox( vtDirMn, vtDirFp)) { + double dDenom = CrossXY( vtDirF, vtDirFp) ; + if ( abs( dDenom) > EPS_ZERO) + dMoveMn = CrossXY( ptStartF - ptEndM, vtDirFp) / dDenom ; + } + } + // pareggio la parte più vicina, se almeno una sotto soglia + if ( abs( dMoveMp) < dMaxMove || abs( dMoveMn) < dMaxMove) { + // calcolo movimento necessario, se nullo già a posto + Vector3d vtMove = (( abs( dMoveMp) < abs( dMoveMn)) ? dMoveMp : dMoveMn) * vtDirF ; + if ( vtMove.IsSmall()) { + bMoved = false ; + return true ; + } + // eseguo movimento + if ( ExeMovePartCluster( vIds, bReducedCut, vtMove, dXmin, dYmin, dXmax, dYmax)) { + if ( ! vtMove.IsSmall()) { + bMoved = true ; + return true ; + } + } + } + + // verifico se possibile allineare i tagli correnti + // calcolo ingombro dei tagli su direzione del taglio fisso + Frame3d frCutF ; + frCutF.Set( ptStartF, Z_AX, vtDirF) ; + BBox3d b3CutF ; + pGeomDB->GetRefBBox( nCutF, frCutF, b3CutF) ; + BBox3d b3CutM ; + pGeomDB->GetRefBBox( nCutM, frCutF, b3CutM) ; + double dStartDelta = b3CutF.GetMin().x - b3CutM.GetMin().x ; + double dEndDelta = b3CutF.GetMax().x - b3CutM.GetMax().x ; + // pareggio la parte più vicina, se sotto soglia + if ( abs( dStartDelta) > dMaxMove && abs( dEndDelta) > dMaxMove) + return false ; + Vector3d vtMove = (( abs( dStartDelta) < abs( dEndDelta)) ? dStartDelta : dEndDelta) * vtDirF ; + if ( ! ExeMovePartCluster( vIds, bReducedCut, vtMove, dXmin, dYmin, dXmax, dYmax)) + return false ; + bMoved = ( ! vtMove.IsSmall()) ; + return true ; +} + +//---------------------------------------------------------------------------- +void +ExeSaveCollInfo( void) +{ + s_scInfoSaved = s_scInfo ; +} + +//---------------------------------------------------------------------------- +void +ExeRestoreCollInfo( void) +{ + s_scInfo = s_scInfoSaved ; } //----------------------------------------------------------------------------- diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 544724e695707b04f48a1f9ffd654f267059e2b0..bb403fe86f2d9c55e0ffe7d60b32f53c3f4760f2 100644 GIT binary patch delta 97 zcmZ1%y)JsgA2vpd%@@V4Gflq2na5}`Ignd-a{*Tk3sCf++-0W82LxfF21;&>n->Y| cF@rU@0x76sKgP|Iq`|@mn->Y| cF@rU@0x76sKgP|Iq`|@mWB>pF