diff --git a/CamData.cpp b/CamData.cpp index a2d284e..f573efe 100644 --- a/CamData.cpp +++ b/CamData.cpp @@ -149,6 +149,8 @@ CamData::SetOwner( int nId, IGeomDB* pGDB) { m_nOwnerId = nId ; m_pGeomDB = pGDB ; + if ( m_pGeomDB != nullptr) + m_pGeomDB->SetStipple( m_nOwnerId, ( m_nMove == 0 ? 3 : 0), 0x8C8C) ; return ( m_nOwnerId != GDB_ID_NULL && m_pGeomDB != nullptr) ; } diff --git a/Chiseling.cpp b/Chiseling.cpp index 9b2499a..4651bbd 100644 --- a/Chiseling.cpp +++ b/Chiseling.cpp @@ -595,6 +595,9 @@ Chiseling::Update( bool bPostApply) return true ; } + // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + RemoveClimbRiseHome() ; + // imposto eventuale asse bloccato da lavorazione SetBlockedRotAxis( m_Params.m_sBlockedAxis) ; @@ -1033,8 +1036,8 @@ Chiseling::GetCurves( SelData Id, ICURVEPLIST& lstPC) for ( int nC = nCstart ; nC < nCend ; ++ nC) { // recupero i contorni del chunk for ( int nL = 0 ; nL < pReg->GetLoopCount( nC) ; ++ nL) { - PtrOwner pCrvCompo( CreateCurveComposite()) ; - if ( IsNull( pCrvCompo) || ! pCrvCompo->AddCurve( pReg->GetLoop( nC, nL))) + PtrOwner pCrvCompo ; + if ( ! pCrvCompo.Set( ConvertCurveToComposite( pReg->GetLoop( nC, nL)))) return false ; // assegno l'estrusione dalla normale alla regione pCrvCompo->SetExtrusion( vtN) ; diff --git a/Drilling.cpp b/Drilling.cpp index 2ed6e10..862a2da 100644 --- a/Drilling.cpp +++ b/Drilling.cpp @@ -615,6 +615,9 @@ Drilling::Update( bool bPostApply) return true ; } + // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + RemoveClimbRiseHome() ; + // imposto eventuale asse bloccato da lavorazione SetBlockedRotAxis( m_Params.m_sBlockedAxis) ; diff --git a/GenMachining.cpp b/GenMachining.cpp index 7a8f737..1d0b29e 100644 --- a/GenMachining.cpp +++ b/GenMachining.cpp @@ -636,6 +636,9 @@ GenMachining::Update( bool bPostApply) return true ; } + // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + RemoveClimbRiseHome() ; + // imposto eventuale asse bloccato da lavorazione SetBlockedRotAxis( m_Params.m_sBlockedAxis) ; diff --git a/Milling.cpp b/Milling.cpp index 41e7ef7..ec3e6fd 100644 --- a/Milling.cpp +++ b/Milling.cpp @@ -845,6 +845,9 @@ Milling::Update( bool bPostApply) return true ; } + // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + RemoveClimbRiseHome() ; + // imposto eventuale asse bloccato da lavorazione SetBlockedRotAxis( m_Params.m_sBlockedAxis) ; @@ -1382,8 +1385,8 @@ Milling::GetCurves( SelData Id, ICURVEPLIST& lstPC) for ( int nC = nCstart ; nC < nCend ; ++ nC) { // recupero i contorni del chunk for ( int nL = 0 ; nL < pReg->GetLoopCount( nC) ; ++ nL) { - PtrOwner pCrvCompo( CreateCurveComposite()) ; - if ( IsNull( pCrvCompo) || ! pCrvCompo->AddCurve( pReg->GetLoop( nC, nL))) + PtrOwner pCrvCompo ; + if ( ! pCrvCompo.Set( ConvertCurveToComposite( pReg->GetLoop( nC, nL)))) return false ; // assegno l'estrusione dalla normale alla regione pCrvCompo->SetExtrusion( vtN) ; @@ -2501,7 +2504,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo bAboveEnd = GetPointAboveRaw( ptP1, vtTool) ; else { Vector3d vtCorr = CalcCorrDir( pCompo, nMaxInd + 1) ; - bAboveEnd = GetPointOutOfRaw( ptP1, vtTool, vtCorr, dElev, dSafeZ) ; + bAboveEnd = GetPointOutOfRaw( ptP1, vtTool, vtCorr, dEndElev, dSafeZ) ; } } // correggo elevazione finale per punto fine uscita (se testa da sopra senza aggregato approccio mai Z-) @@ -4438,7 +4441,7 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& if ( pCompo->GetLength( dLen) && pCompo->GetParamAtLength( dLen - m_dAddedOverlap - dTang, dU)) { double dParS, dParE ; pCompo->GetDomain( dParS, dParE) ; - if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( dU, dParE))) + if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( dU, dParE)))) return false ; } else { @@ -4454,7 +4457,7 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& else { double dU ; if ( pCompo->GetParamAtLength( m_dAddedOverlap + dTang, dU)) { - if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( 0, dU))) + if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( 0, dU)))) return false ; } else { @@ -4489,7 +4492,7 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& if ( pCompo->GetParamAtLength( dTang, dU)) { double dParS, dParE ; pCompo->GetDomain( dParS, dParE) ; - if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( dParS, dU))) + if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( dParS, dU)))) return false ; } else { @@ -4502,7 +4505,7 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& if ( pCompo->GetLength( dLen) && pCompo->GetParamAtLength( dLen - dTang, dU)) { double dParS, dParE ; pCompo->GetDomain( dParS, dParE) ; - if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( dU, dParE))) + if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( dU, dParE)))) return false ; } else { @@ -4663,7 +4666,7 @@ Milling::CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vect if ( ! bInvert) { double dU ; if ( pCompo->GetParamAtLength( m_dAddedOverlap + dTang, dU)) { - if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( 0, dU))) + if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( 0, dU)))) return false ; } else { @@ -4678,7 +4681,7 @@ Milling::CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vect if ( pCompo->GetLength( dLen) && pCompo->GetParamAtLength( dLen - m_dAddedOverlap - dTang, dU)) { double dParS, dParE ; pCompo->GetDomain( dParS, dParE) ; - if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( dU, dParE))) + if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( dU, dParE)))) return false ; } else { @@ -4794,7 +4797,7 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d if ( ! bInvert) { double dU ; if ( pCompo->GetParamAtLength( m_dAddedOverlap + dTang, dU)) { - if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( 0, dU))) + if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( 0, dU)))) return false ; } else { @@ -4809,7 +4812,7 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d if ( pCompo->GetLength( dLen) && pCompo->GetParamAtLength( dLen - m_dAddedOverlap - dTang, dU)) { double dParS, dParE ; pCompo->GetDomain( dParS, dParE) ; - if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( dU, dParE))) + if ( ! pCrv.Set( ConvertCurveToComposite( pCompo->CopyParamRange( dU, dParE)))) return false ; } else { diff --git a/Mortising.cpp b/Mortising.cpp index aaeb17c..1a8de01 100644 --- a/Mortising.cpp +++ b/Mortising.cpp @@ -634,6 +634,9 @@ Mortising::Update( bool bPostApply) return true ; } + // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + RemoveClimbRiseHome() ; + // imposto eventuale asse bloccato da lavorazione SetBlockedRotAxis( m_Params.m_sBlockedAxis) ; diff --git a/Operation.cpp b/Operation.cpp index bf5bb47..45fb817 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -1832,19 +1832,15 @@ Operation::SetBlockedRotAxis( const string& sBlockedAxis) const int nLinAxes = m_pMchMgr->GetCurrLinAxes() ; int nRotAxes = m_pMchMgr->GetCurrRotAxes() ; // lo cerco tra i token degli assi rotanti correnti - bool bFound = false ; - for ( int i = 0 ; i < nRotAxes && ! bFound ; ++ i) { + for ( int i = 0 ; i < nRotAxes ; ++ i) { string sAxToken ; if ( m_pMchMgr->GetCurrMachine()->GetCurrAxisToken( i + nLinAxes, sAxToken) && sKey == Trim( sAxToken, " \t\r\n=")) { string sAxis ; m_pMchMgr->GetCurrMachine()->GetCurrAxisName( i + nLinAxes, sAxis) ; - m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ; - bFound = true ; + return m_pMchMgr->SetRotAxisBlock( sAxis, dVal) ; } } - if ( bFound) - return true ; // lo cerco tra gli assi rotanti della macchina return m_pMchMgr->SetRotAxisBlock( sKey, dVal) ; } @@ -3182,6 +3178,21 @@ Operation::RemoveHome( void) return true ; } +//---------------------------------------------------------------------------- +bool +Operation::RemoveClimbRiseHome( void) +{ + // elimino le entità CLIMB, RISE e HOME delle diverse path dell'operazione + int nClId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_CL) ; + int nClPathId = m_pGeomDB->GetFirstGroupInGroup( nClId) ; + while ( nClPathId != GDB_ID_NULL) { + RemoveClimb( nClPathId) ; + RemoveRise( nClPathId) ; + nClPathId = m_pGeomDB->GetNextGroup( nClPathId) ; + } + return ( nClId != GDB_ID_NULL) ; +} + //---------------------------------------------------------------------------- bool Operation::CalcDeltaZForHeadRotation( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, double& dDeltaZ) const diff --git a/Operation.h b/Operation.h index 1807cd8..7cfbad0 100644 --- a/Operation.h +++ b/Operation.h @@ -139,6 +139,7 @@ class Operation : public IUserObj bool AddSpecialRise( const DBLVECTOR& vAxVal, bool bOk = true, int nClPathId = GDB_ID_NULL, int nFlag = 0) ; bool RemoveRise( int nClPathId = GDB_ID_NULL) ; bool AddHome( void) ; + bool RemoveClimbRiseHome( void) ; bool CalcDeltaZForHeadRotation( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, double& dDeltaZ) const ; bool GetExtraZ( const DBLVECTOR& vAx1, const Vector3d& vtTool1, const DBLVECTOR& vAx2, const Vector3d& vtTool2, diff --git a/Pocketing.cpp b/Pocketing.cpp index 5df1574..a518e5b 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -738,6 +738,9 @@ Pocketing::Update( bool bPostApply) return true ; } + // elimino le entit� CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + RemoveClimbRiseHome() ; + // imposto eventuale asse bloccato da lavorazione SetBlockedRotAxis( m_Params.m_sBlockedAxis) ; @@ -1104,7 +1107,7 @@ Pocketing::GetCurves( SelData Id, ICURVEPLIST& lstPC) pOriCurveCompo->SetThickness( dThick) ; pCurve.Set( pOriCurveCompo) ; // recupero eventuali informazioni per lati aperti - SetCurveAllTempProp( Id.nId, pCurve) ; + SetCurveAllTempProp( Id.nId, false, pCurve) ; // se estrusione mancante, imposto default if ( ! pCurve->GetExtrusion( vtExtr) || vtExtr.IsSmall()) pCurve->SetExtrusion( Z_AX) ; @@ -1329,8 +1332,8 @@ Pocketing::GetCurves( SelData Id, ICURVEPLIST& lstPC) for ( int nC = nCstart ; nC < nCend ; ++ nC) { // recupero i contorni del chunk for ( int nL = 0 ; nL < pReg->GetLoopCount( nC) ; ++ nL) { - PtrOwner pCrvCompo( CreateCurveComposite()) ; - if ( IsNull( pCrvCompo) || ! pCrvCompo->AddCurve( pReg->GetLoop( nC, nL))) + PtrOwner pCrvCompo ; + if ( ! pCrvCompo.Set( ConvertCurveToComposite( pReg->GetLoop( nC, nL)))) return false ; // reset proprietà temporanee ( per ogni sottocurva -> nProp0 = 0, nProp1 = -1) ResetCurveAllTempProp( pCrvCompo) ; @@ -1359,14 +1362,16 @@ Pocketing::GetCurves( SelData Id, ICURVEPLIST& lstPC) //---------------------------------------------------------------------------- bool -Pocketing::SetCurveAllTempProp( int nCrvId, ICurve* pCurve) +Pocketing::SetCurveAllTempProp( int nCrvId, bool bForcedClose, ICurve* pCurve, bool* pbSomeOpen) { if ( pCurve == nullptr) return false ; - // reset proprietà temporanee + if ( pbSomeOpen != nullptr) + *pbSomeOpen = false ; + // reset propriet� temporanee ResetCurveAllTempProp( pCurve) ; - // verifico se presenti info per lati aperti - if ( ! m_pGeomDB->ExistsInfo( nCrvId, KEY_OPEN)) + // se forzato chiuso o non presenti info per lati aperti, esco + if ( bForcedClose || ! m_pGeomDB->ExistsInfo( nCrvId, KEY_OPEN)) return true ; // recupero info sui lati aperti INTVECTOR vOpen ; @@ -1374,13 +1379,20 @@ Pocketing::SetCurveAllTempProp( int nCrvId, ICurve* pCurve) // se curva composita ICurveComposite* pCC = GetCurveComposite( pCurve) ; if ( pCC != nullptr) { - for ( int j : vOpen) - pCC->SetCurveTempProp( j, 1) ; + for ( int j : vOpen) { + if ( pCC->SetCurveTempProp( j, 1)) { + if ( pbSomeOpen != nullptr) + *pbSomeOpen = true ; + } + } } // altrimenti else { - if ( ! vOpen.empty() && vOpen[0] == 0) + if ( ! vOpen.empty() && vOpen[0] == 0) { pCurve->SetTempProp( 1) ; + if ( pbSomeOpen != nullptr) + *pbSomeOpen = true ; + } } return true ; } @@ -3310,6 +3322,7 @@ Pocketing::OptimizedZigZag( ISurfFlatRegion* pSrf, const Vector3d& vtTool, doubl // setto proprietà sulle curve if ( ! bSrfOriIsCut) SetCurveAllTempProp( nCrvId, pCrvPocket) ; + SetCurveAllTempProp( nCrvId, GetForcedClosed(), pCrvPocket) ; pCrvPocket->MergeCurves( 10 * EPS_SMALL, 10 * EPS_ANG_SMALL) ; // sistemo senso antiorario visto dalla direzione di estrusione @@ -8231,8 +8244,8 @@ Pocketing::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3 return false ; // eventuale spezzatura if ( bSplitArcs) { - PtrOwner pCompo( CreateCurveComposite()) ; - if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pArc)) || ! ApproxWithLines( pCompo)) + PtrOwner pCompo ; + if ( ! pCompo.Set( ConvertCurveToComposite( Release( pArc))) || ! ApproxWithLines( pCompo)) return false ; return ( AddCurveMove( pCompo, MCH_CL_LEADIN) != GDB_ID_NULL) ; } @@ -8279,7 +8292,7 @@ Pocketing::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3 if ( pRCrv->GetLength( dLen) && pRCrv->GetParamAtLength( dLen - m_Params.m_dLiTang, dU)) { double dParS, dParE ; pRCrv->GetDomain( dParS, dParE) ; - if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pRCrv->CopyParamRange( dU, dParE))) + if ( ! pCrv.Set( ConvertCurveToComposite( pRCrv->CopyParamRange( dU, dParE)))) return false ; } else { @@ -8369,7 +8382,7 @@ Pocketing::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector PtrOwner pCrv ; double dU ; if ( pRCrv->GetParamAtLength( m_Params.m_dLoTang, dU)) { - if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pRCrv->CopyParamRange( 0, dU))) + if ( ! pCrv.Set( ConvertCurveToComposite( pRCrv->CopyParamRange( 0, dU)))) return false ; } else { diff --git a/Pocketing.h b/Pocketing.h index 5cc3afb..ebb0b8f 100644 --- a/Pocketing.h +++ b/Pocketing.h @@ -71,7 +71,7 @@ class Pocketing : public Machining private : bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ; bool GetCurves( SelData Id, ICURVEPLIST& lstPC) ; - bool SetCurveAllTempProp( int nCrvId, ICurve* pCurve) ; + bool SetCurveAllTempProp( int nCrvId, bool bForcedClose, ICurve* pCurve, bool* pbSomeOpen = nullptr) ; bool ResetCurveAllTempProp( ICurve* pCurve) ; bool Chain( int nGrpDestId) ; bool ProcessPath( int nPathId, int nPvId, int nClId) ; diff --git a/SawFinishing.cpp b/SawFinishing.cpp index f107165..849b4ea 100644 --- a/SawFinishing.cpp +++ b/SawFinishing.cpp @@ -607,6 +607,9 @@ SawFinishing::Update( bool bPostApply) return true ; } + // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + RemoveClimbRiseHome() ; + // imposto eventuale asse bloccato da lavorazione SetBlockedRotAxis( m_Params.m_sBlockedAxis) ; @@ -979,8 +982,8 @@ SawFinishing::AdjustGeometry( int nAuxId) if ( ! pGuide->IsFlat( plPlane, false, 10 * EPS_SMALL) || ! AreSameOrOppositeVectorApprox( plPlane.GetVersN(), Z_AX)) return false ; // verifiche sulla curva (che trasformo in composita) - PtrOwner pCompo( CreateCurveComposite()) ; - if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pGuide))) + PtrOwner pCompo ; + if ( ! pCompo.Set( ConvertCurveToComposite( Release( pGuide)))) return false ; // converto in archi e rette pCompo->ArcsBezierCurvesToArcsPerpExtr( LIN_TOL_MID, ANG_TOL_STD_DEG) ; @@ -2400,8 +2403,8 @@ SawFinishing::CalcCurvedAlongVerticalCuts( ICurve* pSect, int nUmin, int nUmax, Vector3d vtMove = ( dY - m_TParams.m_dThick / 2) * Z_AX ; OffsetCurve OffsCrv ; OffsCrv.Make( pGuide, dOffs, ICurve::OFF_FILLET) ; - PtrOwner pCut( CreateCurveComposite()) ; - if ( IsNull( pCut) || ! pCut->AddCurve( OffsCrv.GetLongerCurve())) + PtrOwner pCut ; + if ( ! pCut.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve()))) return false ; VerifyArcs( pCut) ; pCut->SimpleOffset( SAWRF_OFFS, ICurve::OFF_FORCE_OPEN) ; @@ -2475,8 +2478,8 @@ SawFinishing::CalcCurvedAlongStdCuts( ICurve* pSect, double dUmin, double dUmax, Vector3d vtMove = ( ptP.y - m_TParams.m_dThick / 2) * Z_AX ; OffsetCurve OffsCrv ; OffsCrv.Make( pGuide, dOffs, ICurve::OFF_FILLET) ; - PtrOwner pCut( CreateCurveComposite()) ; - if ( IsNull( pCut) || ! pCut->AddCurve( OffsCrv.GetLongerCurve())) + PtrOwner pCut ; + if ( ! pCut.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve()))) return false ; VerifyArcs( pCut) ; pCut->SimpleOffset( SAWRF_OFFS, ICurve::OFF_FORCE_OPEN) ; diff --git a/SawRoughing.cpp b/SawRoughing.cpp index 03ea200..2c32078 100644 --- a/SawRoughing.cpp +++ b/SawRoughing.cpp @@ -571,6 +571,9 @@ SawRoughing::Update( bool bPostApply) return true ; } + // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + RemoveClimbRiseHome() ; + // imposto eventuale asse bloccato da lavorazione SetBlockedRotAxis( m_Params.m_sBlockedAxis) ; @@ -937,8 +940,8 @@ SawRoughing::AdjustGeometry( int nAuxId) if ( ! pGuide->IsFlat( plPlane, false, 10 * EPS_SMALL) || ! AreSameOrOppositeVectorApprox( plPlane.GetVersN(), Z_AX)) return false ; // verifiche sulla curva (che trasformo in composita) - PtrOwner pCompo( CreateCurveComposite()) ; - if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pGuide))) + PtrOwner pCompo ; + if ( ! pCompo.Set( ConvertCurveToComposite( Release( pGuide)))) return false ; // converto in archi e rette pCompo->ArcsBezierCurvesToArcsPerpExtr( LIN_TOL_MID, ANG_TOL_STD_DEG) ; @@ -1327,8 +1330,8 @@ SawRoughing::CalculateCurvedToolPath( int nAuxId, int nClId) // creo la curva di taglio OffsetCurve OffsCrv ; OffsCrv.Make( pGuide, dX, ICurve::OFF_FILLET) ; - PtrOwner pCut( CreateCurveComposite()) ; - if ( IsNull( pCut) || ! pCut->AddCurve( OffsCrv.GetLongerCurve())) + PtrOwner pCut ; + if ( ! pCut.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve()))) return false ; VerifyArcs( pCut) ; Vector3d vtMove = ( dY - m_TParams.m_dThick / 2) * Z_AX ; diff --git a/Sawing.cpp b/Sawing.cpp index 3331bb6..5f43449 100644 --- a/Sawing.cpp +++ b/Sawing.cpp @@ -742,6 +742,9 @@ Sawing::Update( bool bPostApply) return true ; } + // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + RemoveClimbRiseHome() ; + // imposto eventuale asse bloccato da lavorazione SetBlockedRotAxis( m_Params.m_sBlockedAxis) ; @@ -1276,8 +1279,8 @@ Sawing::GetCurve( SelData Id) // recupero l'indice del chunk int nChunk = ( ( Id.nSub == SEL_SUB_ALL) ? 0 : Id.nSub) ; // recupero il contorno esterno del chunk - PtrOwner pCrvCompo( CreateCurveComposite()) ; - if ( IsNull( pCrvCompo) || ! pCrvCompo->AddCurve( pReg->GetLoop( nChunk, 0))) + PtrOwner pCrvCompo ; + if ( ! pCrvCompo.Set( ConvertCurveToComposite( pReg->GetLoop( nChunk, 0)))) return nullptr ; // recupero la normale della regione Vector3d vtN = pReg->GetNormVersor() ; diff --git a/SurfFinishing.cpp b/SurfFinishing.cpp index f750af5..d3f5649 100644 --- a/SurfFinishing.cpp +++ b/SurfFinishing.cpp @@ -606,6 +606,9 @@ SurfFinishing::Update( bool bPostApply) return true ; } + // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + RemoveClimbRiseHome() ; + // imposto eventuale asse bloccato da lavorazione SetBlockedRotAxis( m_Params.m_sBlockedAxis) ; @@ -1328,8 +1331,8 @@ SurfFinishing::AddZigZag( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf, bool bStart = true ; while ( OffsCrv.GetCurveCount() > 0) { // recupero la prima curva di offset - PtrOwner pOffs( CreateCurveComposite()) ; - if ( IsNull( pOffs) || ! pOffs->AddCurve( OffsCrv.GetLongerCurve())) { + PtrOwner pOffs ; + if ( ! pOffs.Set( ConvertCurveToComposite( OffsCrv.GetLongerCurve()))) { m_pMchMgr->SetLastError( 3110, "Error in SurfFinishing : Toolpath not computable") ; return false ; } diff --git a/WaterJetting.cpp b/WaterJetting.cpp index 6cb4e90..1722d2a 100644 --- a/WaterJetting.cpp +++ b/WaterJetting.cpp @@ -740,6 +740,9 @@ WaterJetting::Update( bool bPostApply) return true ; } + // elimino le entità CLIMB, RISE e HOME della lavorazione, potrebbero falsare i calcoli degli assi (in ogni casi vengono riaggiunte dopo) + RemoveClimbRiseHome() ; + // imposto eventuale asse bloccato da lavorazione SetBlockedRotAxis( m_Params.m_sBlockedAxis) ; @@ -2607,8 +2610,8 @@ WaterJetting::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vect pCrv->Invert() ; // eventuale spezzatura if ( bSplitArcs) { - PtrOwner pCompo( CreateCurveComposite()) ; - if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pCrv)) || ! ApproxWithLines( pCompo)) + PtrOwner pCompo ; + if ( ! pCompo.Set( ConvertCurveToComposite( Release( pCrv))) || ! ApproxWithLines( pCompo)) return false ; return ( AddCurveMove( pCompo, MCH_CL_LEADIN) != GDB_ID_NULL) ; } @@ -2678,8 +2681,8 @@ WaterJetting::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vec return false ; // eventuale spezzatura if ( bSplitArcs) { - PtrOwner pCompo( CreateCurveComposite()) ; - if ( IsNull( pCompo) || ! pCompo->AddCurve( Release( pCrv)) || ! ApproxWithLines( pCompo)) + PtrOwner pCompo ; + if ( ! pCompo.Set( ConvertCurveToComposite( Release( pCrv))) || ! ApproxWithLines( pCompo)) return false ; return ( AddCurveMove( pCompo, MCH_CL_LEADOUT) != GDB_ID_NULL) ; }