EgtMachKernel 1.6v2 :
- gestiti attacchi con elevazione - corretti calcoli con archi di elica (deltaN <> 0).
This commit is contained in:
+25
-1
@@ -43,7 +43,9 @@ static std::string CAM_AXAC = "AxAC" ;
|
||||
static int CAM_PARAM_V3 = 18 ;
|
||||
static std::string CAM_NDIR = "NDir" ;
|
||||
static std::string CAM_AXND = "AxND" ;
|
||||
static int CAM_TOTPARAM =CAM_PARAM_V3 ;
|
||||
static int CAM_PARAM_V4 = 19 ;
|
||||
static std::string CAM_NDLT = "NDlt" ;
|
||||
static int CAM_TOTPARAM =CAM_PARAM_V4 ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkCamData", CamData) ;
|
||||
@@ -75,6 +77,7 @@ CamData::Clone( void) const
|
||||
pCam->m_ptCen = m_ptCen ;
|
||||
pCam->m_dAngCen = m_dAngCen ;
|
||||
pCam->m_vtN = m_vtN ;
|
||||
pCam->m_dDeltaN = m_dDeltaN ;
|
||||
pCam->m_dFeed = m_dFeed ;
|
||||
pCam->m_nFlag = m_nFlag ;
|
||||
pCam->m_nAxesStatus = m_nAxesStatus ;
|
||||
@@ -117,6 +120,7 @@ CamData::Dump( string& sOut, bool bMM, const char* szNewLine) const
|
||||
sOut += CAM_AXMR + "=" + ToString( m_dMachRad) + szNewLine ;
|
||||
sOut += CAM_AXAC + "=" + ToString( m_dMachAngCen) + szNewLine ;
|
||||
sOut += CAM_AXND + "=" + ToString( m_vtMachN) + szNewLine ;
|
||||
sOut += CAM_NDLT + "=" + ToString( m_dDeltaN) + szNewLine ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
@@ -171,6 +175,8 @@ CamData::Save( STRVECTOR& vString) const
|
||||
// parametri aggiunti V3
|
||||
vString[++k] = CAM_NDIR + "=" + ToString( m_vtN) ;
|
||||
vString[++k] = CAM_AXND + "=" + ToString( m_vtMachN) ;
|
||||
// parametri aggiunti V4
|
||||
vString[++k] = CAM_NDLT + "=" + ToString( m_dDeltaN) ;
|
||||
}
|
||||
catch( ...) {
|
||||
return false ;
|
||||
@@ -223,6 +229,14 @@ CamData::Load( const STRVECTOR& vString, int nBaseGdbId)
|
||||
m_vtN = Z_AX ;
|
||||
m_vtMachN = Z_AX ;
|
||||
}
|
||||
// parametri aggiunti V4
|
||||
if ( int( vString.size()) >= CAM_PARAM_V4) {
|
||||
if ( ! GetVal( vString[++k], CAM_NDLT, m_dDeltaN))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
m_dDeltaN = 0 ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -475,6 +489,7 @@ CamData::CamData( void)
|
||||
m_nMove = 0 ;
|
||||
m_nCorre = 0 ;
|
||||
m_dAngCen = 0 ;
|
||||
m_dDeltaN = 0 ;
|
||||
m_dFeed = 0 ;
|
||||
m_nFlag = 0 ;
|
||||
m_nAxesStatus = AS_NONE ;
|
||||
@@ -556,6 +571,15 @@ CamData::SetNormDir( const Vector3d& vtDir)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CamData::SetDeltaN( double dDeltaN)
|
||||
{
|
||||
m_dDeltaN = dDeltaN ;
|
||||
ResetObjGraphics() ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CamData::SetFeed( double dFeed)
|
||||
|
||||
@@ -53,6 +53,7 @@ class CamData : public IUserObj
|
||||
bool SetCenter( const Point3d& ptCen) ;
|
||||
bool SetAngCen( double dAngCen) ;
|
||||
bool SetNormDir( const Vector3d& vtDir) ;
|
||||
bool SetDeltaN( double dDeltaN) ;
|
||||
bool SetFeed( double dFeed) ;
|
||||
bool SetFlag( int nFlag) ;
|
||||
bool SetAxes( int nStatus, const DBLVECTOR& vAxVal) ;
|
||||
@@ -81,6 +82,8 @@ class CamData : public IUserObj
|
||||
{ return m_dAngCen ; }
|
||||
const Vector3d& GetNormDir( void) const
|
||||
{ return m_vtN ; }
|
||||
double GetDeltaN( void) const
|
||||
{ return m_dDeltaN ; }
|
||||
double GetFeed( void) const
|
||||
{ return m_dFeed ; }
|
||||
int GetFlag( void) const
|
||||
@@ -129,6 +132,7 @@ class CamData : public IUserObj
|
||||
Point3d m_ptCen ; // centro per archi
|
||||
double m_dAngCen ; // angolo al centro per archi
|
||||
Vector3d m_vtN ; // vettore normale al piano di giacitura per archi
|
||||
double m_dDeltaN ; // delta fine rispetto a inizio su normale
|
||||
double m_dFeed ; // velocità di avanzamento in lavorazione
|
||||
int m_nFlag ; // flag per usi vari
|
||||
int m_nAxesStatus ; // stato dei valori degli assi
|
||||
|
||||
Binary file not shown.
+75
-63
@@ -1286,20 +1286,18 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
Point3d ptP1 ;
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, false, ptP1))
|
||||
return false ;
|
||||
// aggiungo approccio per frese normali
|
||||
// aggiungo approccio per frese normali con spazio sopra attacco
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// determino elevazione su inizio attacco
|
||||
double dStElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev))
|
||||
dStElev = dElev ;
|
||||
dStElev -= ( ptP1 - ptStart) * vtExtr ;
|
||||
// approccio al punto iniziale
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr))
|
||||
return false ;
|
||||
// affondo al punto iniziale
|
||||
SetFlag( 0) ;
|
||||
SetFeed( GetTipFeed()) ;
|
||||
if ( AddLinearMove( ptP1) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
// altrimenti, approccio per lame
|
||||
// altrimenti, approccio per lame o diretto
|
||||
else {
|
||||
// affondo al punto iniziale
|
||||
SetFlag( 0) ;
|
||||
@@ -1351,6 +1349,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
double dEndElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dEndElev))
|
||||
dEndElev = dElev ;
|
||||
dEndElev -= ( ptP1 - ptEnd) * vtExtr ;
|
||||
// aggiungo retrazione
|
||||
if ( ! AddRetract( ptP1, vtTool, dSafeZ, dEndElev, dAppr))
|
||||
return false ;
|
||||
@@ -1407,16 +1406,14 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
return false ;
|
||||
// se primo step aggiungo approccio per frese normali
|
||||
if ( j == 1 && ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// determino elevazione su inizio attacco
|
||||
double dStElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev))
|
||||
dStElev = dElev ;
|
||||
dStElev -= ( ptP1 - ptStart) * vtExtr ;
|
||||
// approccio al punto iniziale
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr))
|
||||
return false ;
|
||||
// affondo al punto iniziale
|
||||
SetFlag( 0) ;
|
||||
SetFeed( GetTipFeed()) ;
|
||||
if ( AddLinearMove( ptP1) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
// altrimenti, affondo al punto iniziale
|
||||
else {
|
||||
@@ -1537,16 +1534,14 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
return false ;
|
||||
// aggiungo approccio per frese normali
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// determino elevazione su inizio attacco
|
||||
double dStElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev))
|
||||
dStElev = dElev ;
|
||||
dStElev -= ( ptP1 - ptStart) * vtExtr ;
|
||||
// approccio al punto iniziale
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr))
|
||||
return false ;
|
||||
// affondo al punto iniziale
|
||||
SetFlag( 0) ;
|
||||
SetFeed( GetTipFeed()) ;
|
||||
if ( AddLinearMove( ptP1) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
// altrimenti, approccio per lame
|
||||
else {
|
||||
@@ -1663,16 +1658,14 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
return false ;
|
||||
// aggiungo approccio per frese normali
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// determino elevazione su inizio attacco
|
||||
double dStElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev))
|
||||
dStElev = 0 ;
|
||||
dStElev -= ( ptP1 - ptStart) * vtExtr ;
|
||||
// approccio al punto iniziale
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr))
|
||||
return false ;
|
||||
// affondo al punto iniziale
|
||||
SetFlag( 0) ;
|
||||
SetFeed( GetTipFeed()) ;
|
||||
if ( AddLinearMove( ptP1) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
// altrimenti, affondo al punto iniziale per lame
|
||||
else {
|
||||
@@ -1775,16 +1768,14 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
return false ;
|
||||
// aggiungo approccio per frese normali
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// determino elevazione su inizio attacco
|
||||
double dStElev ;
|
||||
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev))
|
||||
dStElev = dElev ;
|
||||
dStElev -= ( ptP1 - ptStart) * vtExtr ;
|
||||
// approccio al punto iniziale
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr))
|
||||
return false ;
|
||||
// affondo al punto iniziale
|
||||
SetFlag( 0) ;
|
||||
SetFeed( GetTipFeed()) ;
|
||||
if ( AddLinearMove( ptP1) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
// altrimenti, affondo per lame
|
||||
else {
|
||||
@@ -1857,27 +1848,41 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
bool
|
||||
Milling::AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr)
|
||||
{
|
||||
// se distanza di sicurezza minore di distanza di inizio
|
||||
if ( dSafeZ < dAppr + 10 * EPS_SMALL) {
|
||||
// 1 -> punto sopra inizio
|
||||
SetFlag( 1) ;
|
||||
Point3d ptP1 = ptP + vtTool * ( dElev + dAppr) ;
|
||||
if ( AddRapidStart( ptP1) == GDB_ID_NULL)
|
||||
// se sopra attacco c'è spazio per sicurezza o approccio
|
||||
if ( dElev + max( dSafeZ, dAppr) > 10 * EPS_SMALL) {
|
||||
// se distanza di sicurezza minore di distanza di inizio
|
||||
if ( dSafeZ < dAppr + 10 * EPS_SMALL) {
|
||||
// 1 -> punto sopra inizio
|
||||
SetFlag( 1) ;
|
||||
Point3d ptP1 = ptP + vtTool * ( dElev + dAppr) ;
|
||||
if ( AddRapidStart( ptP1) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
// 1a -> punto sopra inizio
|
||||
SetFlag( 1) ;
|
||||
Point3d ptP1b = ptP + vtTool * ( dElev + dAppr) ;
|
||||
Point3d ptP1a = ptP1b + vtTool * ( dSafeZ - dAppr) ;
|
||||
if ( AddRapidStart( ptP1a) == GDB_ID_NULL)
|
||||
return false ;
|
||||
// 1b -> punto appena sopra inizio
|
||||
if ( ( dElev + dAppr) > EPS_SMALL) {
|
||||
SetFlag( 0) ;
|
||||
if ( AddRapidMove( ptP1b) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
// affondo al punto iniziale
|
||||
SetFlag( 0) ;
|
||||
SetFeed( GetTipFeed()) ;
|
||||
if ( AddLinearMove( ptP) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
// 1a -> punto sopra inizio
|
||||
SetFlag( 1) ;
|
||||
Point3d ptP1b = ptP + vtTool * ( dElev + dAppr) ;
|
||||
Point3d ptP1a = ptP1b + vtTool * ( dSafeZ - dAppr) ;
|
||||
if ( AddRapidStart( ptP1a) == GDB_ID_NULL)
|
||||
// affondo diretto al punto iniziale
|
||||
SetFlag( 0) ;
|
||||
if ( AddRapidStart( ptP) == GDB_ID_NULL)
|
||||
return false ;
|
||||
// 1b -> punto appena sopra inizio
|
||||
if ( ( dElev + dAppr) > EPS_SMALL) {
|
||||
SetFlag( 0) ;
|
||||
if ( AddRapidMove( ptP1b) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
@@ -1886,25 +1891,28 @@ Milling::AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ,
|
||||
bool
|
||||
Milling::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr)
|
||||
{
|
||||
if ( dSafeZ < dAppr + 10 * EPS_SMALL) {
|
||||
// 4 -> movimento di risalita sopra il punto finale
|
||||
SetFeed( GetEndFeed()) ;
|
||||
Point3d ptP4 = ptP + vtTool * ( dElev + dAppr) ;
|
||||
if ( AddLinearMove( ptP4) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
// 4a -> movimento di risalita appena sopra il punto finale
|
||||
Point3d ptP4a = ptP + vtTool * ( dElev + dAppr) ;
|
||||
if ( dElev + dAppr > EPS_SMALL) {
|
||||
// se sopra uscita c'è spazio per sicurezza o approccio
|
||||
if ( dElev + max( dSafeZ, dAppr) > 10 * EPS_SMALL) {
|
||||
if ( dSafeZ < dAppr + 10 * EPS_SMALL) {
|
||||
// 4 -> movimento di risalita sopra il punto finale
|
||||
SetFeed( GetEndFeed()) ;
|
||||
if ( AddLinearMove( ptP4a) == GDB_ID_NULL)
|
||||
Point3d ptP4 = ptP + vtTool * ( dElev + dAppr) ;
|
||||
if ( AddLinearMove( ptP4) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
// 4a -> movimento di risalita appena sopra il punto finale
|
||||
Point3d ptP4a = ptP + vtTool * ( dElev + dAppr) ;
|
||||
if ( dElev + dAppr > EPS_SMALL) {
|
||||
SetFeed( GetEndFeed()) ;
|
||||
if ( AddLinearMove( ptP4a) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
// 4b -> movimento di risalita sopra il punto finale
|
||||
Point3d ptP4b = ptP4a + vtTool * ( dSafeZ - dAppr) ;
|
||||
if ( AddRapidMove( ptP4b) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
// 4b -> movimento di risalita sopra il punto finale
|
||||
Point3d ptP4b = ptP4a + vtTool * ( dSafeZ - dAppr) ;
|
||||
if ( AddRapidMove( ptP4b) == GDB_ID_NULL)
|
||||
return false ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
@@ -1918,6 +1926,7 @@ Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const
|
||||
int nType = m_Params.m_nLeadInType ;
|
||||
double dTang = m_Params.m_dLiTang ;
|
||||
double dPerp = m_Params.m_dLiPerp ;
|
||||
double dElev = m_Params.m_dLiElev ;
|
||||
// se step invertito
|
||||
if ( bInvert) {
|
||||
switch ( m_Params.m_nLeadOutType) {
|
||||
@@ -1930,6 +1939,7 @@ Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const
|
||||
if ( m_Params.m_nLeadOutType != MILL_LO_AS_LI) {
|
||||
dTang = m_Params.m_dLoTang ;
|
||||
dPerp = m_Params.m_dLoPerp ;
|
||||
dElev = m_Params.m_dLoElev ;
|
||||
}
|
||||
}
|
||||
// senso di rotazione da dir tg a dir esterna
|
||||
@@ -1946,7 +1956,7 @@ Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const
|
||||
return false ;
|
||||
Vector3d vtPerp = vtStart ;
|
||||
vtPerp.Rotate( vtN, ( bCcwRot ? 90 : - 90)) ;
|
||||
ptP1 = ptStart - vtStart * dTang + vtPerp * dPerp ;
|
||||
ptP1 = ptStart - vtStart * dTang + vtPerp * dPerp + vtN * dElev ;
|
||||
return true ;
|
||||
}
|
||||
case MILL_LI_GLIDE :
|
||||
@@ -2065,6 +2075,7 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
|
||||
int nType = m_Params.m_nLeadOutType ;
|
||||
double dTang = m_Params.m_dLoTang ;
|
||||
double dPerp = m_Params.m_dLoPerp ;
|
||||
double dElev = m_Params.m_dLoElev ;
|
||||
// se uscita come ingresso o step invertito
|
||||
if ( nType == MILL_LO_AS_LI || bInvert) {
|
||||
switch ( m_Params.m_nLeadInType) {
|
||||
@@ -2077,6 +2088,7 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
|
||||
}
|
||||
dTang = m_Params.m_dLiTang ;
|
||||
dPerp = m_Params.m_dLiPerp ;
|
||||
dElev = m_Params.m_dLiElev ;
|
||||
}
|
||||
if ( bSplitArcs) {
|
||||
if ( nType == MILL_LO_TANGENT)
|
||||
@@ -2096,7 +2108,7 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
|
||||
return false ;
|
||||
Vector3d vtPerp = vtEnd ;
|
||||
vtPerp.Rotate( vtN, ( bCcwRot ? 90 : - 90)) ;
|
||||
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp ;
|
||||
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtN * dElev ;
|
||||
return ( AddLinearMove( ptP1, MCH_CL_LEADOUT) != GDB_ID_NULL) ;
|
||||
}
|
||||
case MILL_LO_TANGENT :
|
||||
@@ -2106,7 +2118,7 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
|
||||
return false ;
|
||||
Vector3d vtPerp = vtEnd ;
|
||||
vtPerp.Rotate( vtN, ( bCcwRot ? 90 : - 90)) ;
|
||||
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp ;
|
||||
ptP1 = ptEnd + vtEnd * dTang + vtPerp * dPerp + vtN * dElev ;
|
||||
// inserisco uscita
|
||||
PtrOwner<ICurve> pCrv( GetArc2PVN( ptEnd, ptP1, vtEnd, vtN)) ;
|
||||
if ( IsNull( pCrv))
|
||||
|
||||
+22
-6
@@ -724,13 +724,15 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
|
||||
}
|
||||
// salvo i valori degli assi
|
||||
pCamData->SetAxes( CamData::AS_OK, vAxVal) ;
|
||||
// se arco (per ora solo nel piano XY) devo calcolarne il centro in assi macchina
|
||||
// se arco devo calcolarne il centro in assi macchina
|
||||
if ( pCamData->IsArc()) {
|
||||
// ricavo punto medio
|
||||
// devo lavorare con arco schiacciato nel suo piano
|
||||
Point3d ptCen = pCamData->GetCenter() ;
|
||||
double dAngCen = pCamData->GetAngCen() ;
|
||||
Vector3d vtN = pCamData->GetNormDir() ;
|
||||
Point3d ptMid = ptP ;
|
||||
double dDeltaN = pCamData->GetDeltaN() ;
|
||||
// ricavo punto medio nel piano dell'arco
|
||||
Point3d ptMid = ptP - dDeltaN * vtN ;
|
||||
ptMid.Rotate( ptCen, vtN, - dAngCen / 2) ;
|
||||
// determino i valori degli assi al punto medio
|
||||
DBLVECTOR vAngMid( vAng1.size()) ;
|
||||
@@ -744,10 +746,24 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
|
||||
pCamData->SetAxes( CamData::AS_ERR, vAxVal) ;
|
||||
continue ;
|
||||
}
|
||||
// ricavo punto finale nel piano dell'arco
|
||||
Point3d ptEnd = ptP - dDeltaN * vtN ;
|
||||
// determino i valori degli assi al punto finale
|
||||
DBLVECTOR vAngEnd( vAng1.size()) ;
|
||||
for ( size_t i = 0 ; i < vAng1.size() ; ++ i)
|
||||
vAngEnd[i] = vAng1[i] ;
|
||||
int nLendStat ;
|
||||
double dXend, dYend, dZend ;
|
||||
bool bLendOk = m_pMchMgr->GetCalcPositions( ptEnd, vAngEnd, nLendStat, dXend, dYend, dZend) ;
|
||||
if ( ! bLendOk || nLendStat != 0) {
|
||||
bOk = false ;
|
||||
pCamData->SetAxes( CamData::AS_ERR, vAxVal) ;
|
||||
continue ;
|
||||
}
|
||||
// punti espressi in assi macchina
|
||||
Point3d ptP1M( dXprec, dYprec, dZprec) ;
|
||||
Point3d ptP2M( dXmid, dYmid, dZmid) ;
|
||||
Point3d ptP3M( dX, dY, dZ) ;
|
||||
Point3d ptP3M( dXend, dYend, dZend) ;
|
||||
// se coincidono
|
||||
if ( AreSamePointApprox( ptP1M, ptP2M) && AreSamePointApprox( ptP1M, ptP3M)) {
|
||||
// lo considero un arco di raggio nullo
|
||||
@@ -785,8 +801,8 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
|
||||
Vector3d vtCurr = Point3d( dXprec, dYprec, dZprec) - ptCen ;
|
||||
for ( int i = 1 ; i < NUM_VERIF_STEP ; ++ i) {
|
||||
vtCurr.Rotate( vtN, dAngCenStep) ;
|
||||
Point3d ptCurr = ptCen + vtCurr ;
|
||||
double dCoeff = i / NUM_VERIF_STEP ;
|
||||
double dCoeff = double( i) / NUM_VERIF_STEP ;
|
||||
Point3d ptCurr = ptCen + vtCurr + vtN * dDeltaN * dCoeff ;
|
||||
DBLVECTOR vAng( vAng1.size()) ;
|
||||
for ( size_t i = 0 ; i < vAng1.size() ; ++ i)
|
||||
vAng[i] = vAxRotPrec[i] * ( 1 - dCoeff) + vAng1[i] * dCoeff ;
|
||||
|
||||
@@ -259,6 +259,7 @@ Operation::AddArcMove( const Point3d& ptP, const Point3d& ptCen, double dAngCen,
|
||||
pCam->SetEndPoint( ptP) ;
|
||||
pCam->SetCenter( ptCen) ;
|
||||
pCam->SetAngCen( dAngCen) ;
|
||||
pCam->SetDeltaN( dDeltaZ) ;
|
||||
pCam->SetNormDir( vtN) ;
|
||||
pCam->SetFeed( m_dFeed) ;
|
||||
pCam->SetFlag( m_nFlag) ;
|
||||
|
||||
Reference in New Issue
Block a user