EgtMachKernel :

- modifiche estetiche.
This commit is contained in:
DarioS
2022-12-12 07:57:52 +01:00
parent dfa857c533
commit 992249f687
2 changed files with 39 additions and 39 deletions
+35 -35
View File
@@ -3895,7 +3895,7 @@ Milling::GetLeadInType( void) const
//----------------------------------------------------------------------------
bool
Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtTool,
double dStElev, bool bInvert, const ICurveComposite* pCompo, Point3d& ptP1) const
{
// Assegno tipo e parametri
@@ -3937,9 +3937,9 @@ Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const
case MILL_LI_TG_PERP :
case MILL_LI_TANGENT : {
Vector3d vtPerp = vtStart ;
Vector3d vtRot = vtN - vtN * vtStart * vtStart ;
Vector3d vtRot = vtTool - vtTool * vtStart * vtStart ;
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
ptP1 = ptStart - vtStart * dTang + vtPerp * dPerp + vtN * dElev ;
ptP1 = ptStart - vtStart * dTang + vtPerp * dPerp + vtTool * dElev ;
return true ;
}
case MILL_LI_GLIDE :
@@ -3960,7 +3960,7 @@ Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const
return false ;
}
}
ptP1 += vtN * ( vtN * ( ptStart - ptP1)) + vtN * dElev ;
ptP1 += vtTool * ( vtTool * ( ptStart - ptP1)) + vtTool * dElev ;
return true ;
}
case MILL_LI_ZIGZAG :
@@ -3977,7 +3977,7 @@ Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const
//----------------------------------------------------------------------------
bool
Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart,
const Vector3d& vtN, bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs)
const Vector3d& vtTool, bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs)
{
// Assegno il tipo
int nType = GetLeadInType() ;
@@ -4017,7 +4017,7 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
{
// direzione perpendicolare
Vector3d vtPerp = vtStart ;
Vector3d vtRot = vtN - vtN * vtStart * vtStart ;
Vector3d vtRot = vtTool - vtTool * vtStart * vtStart ;
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
Point3d ptMid = ptStart + vtPerp * dPerp ;
return ( AddLinearMove( ptMid, MCH_CL_LEADIN) != GDB_ID_NULL &&
@@ -4025,7 +4025,7 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
}
case MILL_LI_TANGENT :
{
PtrOwner<ICurve> pCrv( GetArc2PVN( ptStart, ptP1, - vtStart, vtN)) ;
PtrOwner<ICurve> pCrv( GetArc2PVN( ptStart, ptP1, - vtStart, vtTool)) ;
if ( IsNull( pCrv))
return false ;
pCrv->Invert() ;
@@ -4076,14 +4076,14 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
pCrv->TrimStartAtLen( m_dAddedOverlap) ;
pCrv->Invert() ;
}
pCrv->SetExtrusion( vtN) ;
pCrv->SetExtrusion( vtTool) ;
// la porto alla giusta quota
Point3d ptFin ; pCrv->GetEndPoint( ptFin) ;
Vector3d vtMove = ptStart - ptFin ;
pCrv->Translate( vtMove) ;
// assegno la corretta pendenza
double dNini = ( ptP1 - ORIG) * vtN ;
double dNfin = ( ptStart - ORIG) * vtN ;
double dNini = ( ptP1 - ORIG) * vtTool ;
double dNfin = ( ptStart - ORIG) * vtTool ;
AdjustCurveSlope( pCrv, dNini, dNfin) ;
// eventuale spezzatura
if ( bSplitArcs && ! ApproxWithLines( pCrv))
@@ -4122,7 +4122,7 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
}
pCrv->Invert() ;
}
pCrv->SetExtrusion( vtN) ;
pCrv->SetExtrusion( vtTool) ;
// la porto alla giusta quota
Point3d ptIni ; pCrv->GetStartPoint( ptIni) ;
Vector3d vtMove = ptStart - ptIni ;
@@ -4131,12 +4131,12 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
if ( bSplitArcs && ! ApproxWithLines( pCrv))
return false ;
// la ripeto a zigzag
double dDeltaN = ( ptStart - ptP1) * vtN ;
double dDeltaN = ( ptStart - ptP1) * vtTool ;
int nStep = int( ceil( - dDeltaN / ( m_Params.m_dLiElev + 10 * EPS_SMALL))) ;
double dStep = - dDeltaN / nStep ;
for ( int i = 1 ; i <= nStep ; ++ i) {
// calcolo quote per pendenza
double dNini = ( ptP1 - ORIG) * vtN - ( i - 1) * dStep ;
double dNini = ( ptP1 - ORIG) * vtTool - ( i - 1) * dStep ;
double dNmid = dNini - 0.5 * dStep ;
double dNfin = dNmid - 0.5 * dStep ;
// copio per zig
@@ -4162,15 +4162,15 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
bool bAtLeft = ( bInvert != ( m_Params.m_nWorkSide != MILL_WS_RIGHT)) ;
// vettore dal punto al centro elica
Vector3d vtCen = vtStart ;
vtCen.Rotate( vtN, 0, ( bAtLeft ? 1 : - 1)) ;
vtCen.Rotate( vtTool, 0, ( bAtLeft ? 1 : - 1)) ;
// dati dell'elica
double dRad = 0.5 * min( m_Params.m_dLiTang, m_TParams.m_dDiam) ;
Point3d ptCen = ptP1 + vtCen * dRad ;
double dDeltaN = ( ptStart - ptP1) * vtN ;
double dDeltaN = ( ptStart - ptP1) * vtTool ;
double dAngCen = ceil( - dDeltaN / ( m_Params.m_dLiElev + 10 * EPS_SMALL)) * ( bAtLeft ? ANG_FULL : - ANG_FULL) ;
// creo l'elica
PtrOwner<ICurveArc> pArc( CreateCurveArc()) ;
if ( IsNull( pArc) || ! pArc->Set( ptCen, vtN, dRad, - vtCen, dAngCen, dDeltaN))
if ( IsNull( pArc) || ! pArc->Set( ptCen, vtTool, dRad, - vtCen, dAngCen, dDeltaN))
return false ;
// eventuale spezzatura
if ( bSplitArcs) {
@@ -4202,7 +4202,7 @@ Milling::GetLeadOutType( void) const
//----------------------------------------------------------------------------
bool
Milling::CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
Milling::CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtTool,
double dEndElev, bool bInvert, const ICurveComposite* pCompo, Point3d& ptP1) const
{
// assegno i parametri
@@ -4244,27 +4244,27 @@ Milling::CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vect
case MILL_LO_LINEAR :
{
Vector3d vtPerp = vtEnd ;
Vector3d vtRot = vtN - vtN * vtEnd * vtEnd ;
Vector3d vtRot = vtTool - vtTool * vtEnd * vtEnd ;
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtN * dElev ;
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtTool * dElev ;
return true ;
}
case MILL_LO_PERP_TG :
{
Vector3d vtPerp = vtEnd ;
Vector3d vtRot = vtN - vtN * vtEnd * vtEnd ;
Vector3d vtRot = vtTool - vtTool * vtEnd * vtEnd ;
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
Point3d ptMid = ptEnd + vtPerp * dPerp ;
ptP1 = ptMid + vtEnd * dTang + vtN * dElev ;
ptP1 = ptMid + vtEnd * dTang + vtTool * dElev ;
return true ;
}
case MILL_LO_TANGENT :
{
// calcolo punto finale dell'uscita
Vector3d vtPerp = vtEnd ;
Vector3d vtRot = vtN - vtN * vtEnd * vtEnd ;
Vector3d vtRot = vtTool - vtTool * vtEnd * vtEnd ;
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtN * dElev ;
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtTool * dElev ;
return true ;
}
case MILL_LO_GLIDE :
@@ -4300,13 +4300,13 @@ Milling::CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vect
if ( m_dAddedOverlap > EPS_SMALL)
pCrv->TrimStartAtLen( m_dAddedOverlap) ;
}
pCrv->SetExtrusion( vtN) ;
pCrv->SetExtrusion( vtTool) ;
// la porto alla giusta quota
Point3d ptIni ; pCrv->GetStartPoint( ptIni) ;
Vector3d vtMove = ptEnd - ptIni ;
pCrv->Translate( vtMove) ;
// assegno la corretta pendenza
double dNini = ( ptEnd - ORIG) * vtN ;
double dNini = ( ptEnd - ORIG) * vtTool ;
AdjustCurveSlope( pCrv, dNini, dNini + dElev) ;
// assegno punto finale dell'uscita
pCrv->GetEndPoint( ptP1) ;
@@ -4319,7 +4319,7 @@ Milling::CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vect
//----------------------------------------------------------------------------
bool
Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN, double dEndElev,
Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtTool, double dEndElev,
bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs, Point3d& ptP1)
{
// assegno i parametri
@@ -4361,18 +4361,18 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
case MILL_LO_LINEAR :
{
Vector3d vtPerp = vtEnd ;
Vector3d vtRot = vtN - vtN * vtEnd * vtEnd ;
Vector3d vtRot = vtTool - vtTool * vtEnd * vtEnd ;
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtN * dElev ;
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtTool * dElev ;
return ( AddLinearMove( ptP1, MCH_CL_LEADOUT) != GDB_ID_NULL) ;
}
case MILL_LO_PERP_TG :
{
Vector3d vtPerp = vtEnd ;
Vector3d vtRot = vtN - vtN * vtEnd * vtEnd ;
Vector3d vtRot = vtTool - vtTool * vtEnd * vtEnd ;
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
Point3d ptMid = ptEnd + vtPerp * dPerp ;
ptP1 = ptMid + vtEnd * dTang + vtN * dElev ;
ptP1 = ptMid + vtEnd * dTang + vtTool * dElev ;
return ( AddLinearMove( ptMid, MCH_CL_LEADOUT) != GDB_ID_NULL &&
AddLinearMove( ptP1, MCH_CL_LEADOUT) != GDB_ID_NULL) ;
}
@@ -4380,11 +4380,11 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
{
// calcolo punto finale dell'uscita
Vector3d vtPerp = vtEnd ;
Vector3d vtRot = vtN - vtN * vtEnd * vtEnd ;
Vector3d vtRot = vtTool - vtTool * vtEnd * vtEnd ;
vtPerp.Rotate( vtRot, 0, ( bCcwRot ? 1 : - 1)) ;
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtN * dElev ;
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtTool * dElev ;
// inserisco uscita
PtrOwner<ICurve> pCrv( GetArc2PVN( ptEnd, ptP1, vtEnd, vtN)) ;
PtrOwner<ICurve> pCrv( GetArc2PVN( ptEnd, ptP1, vtEnd, vtTool)) ;
if ( IsNull( pCrv))
return false ;
// eventuale spezzatura
@@ -4431,13 +4431,13 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
if ( m_dAddedOverlap > EPS_SMALL)
pCrv->TrimStartAtLen( m_dAddedOverlap) ;
}
pCrv->SetExtrusion( vtN) ;
pCrv->SetExtrusion( vtTool) ;
// la porto alla giusta quota
Point3d ptIni ; pCrv->GetStartPoint( ptIni) ;
Vector3d vtMove = ptEnd - ptIni ;
pCrv->Translate( vtMove) ;
// assegno la corretta pendenza
double dNini = ( ptEnd - ORIG) * vtN ;
double dNini = ( ptEnd - ORIG) * vtTool ;
AdjustCurveSlope( pCrv, dNini, dNini + dElev) ;
// eventuale spezzatura
if ( bSplitArcs && ! ApproxWithLines( pCrv))
+4 -4
View File
@@ -103,13 +103,13 @@ class Milling : public Machining
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
double dElev, double dAppr, bool bAboveEnd) ;
bool AddSawBladeSideRetract( const Point3d& ptP, const Vector3d& vtRetr, double dSafeZ, double dEndElev, double dAppr) ;
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtTool,
double dStElev, bool bInvert, const ICurveComposite* pCompo, Point3d& ptP1) const ;
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart,
const Vector3d& vtN, bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs) ;
bool CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
const Vector3d& vtTool, bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs) ;
bool CalcLeadOutEnd( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtTool,
double dEndElev, bool bInvert, const ICurveComposite* pCompo, Point3d& ptP1) const ;
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN, double dEndElev,
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtTool, double dEndElev,
bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs, Point3d& ptP1) ;
bool AdjustOscillParams( const ICurve* pCrv, bool& bPathOscEnable, double& dRampLen, double& dFlatLen) ;
bool AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double dRampLen, double dFlatLen) ;