EgtMachKernel 1.8d1 :
- aggiunti a fresature attacchi e uscite ad inseguimento - corretti problemi con verifica collisioni - corretti problemi con caricamento utensili su testa con TC.
This commit is contained in:
+153
-48
@@ -23,6 +23,7 @@
|
||||
#include "/EgtDev/Include/EGkArcSpecial.h"
|
||||
#include "/EgtDev/Include/EGkChainCurves.h"
|
||||
#include "/EgtDev/Include/EGkOffsetCurve.h"
|
||||
#include "/EgtDev/Include/EGkCurveAux.h"
|
||||
#include "/EgtDev/Include/EGkSfrCreate.h"
|
||||
#include "/EgtDev/Include/EGkSurfTriMesh.h"
|
||||
#include "/EgtDev/Include/EGkUserObjFactory.h"
|
||||
@@ -1601,7 +1602,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
dStElev = dElev ;
|
||||
// determino inizio attacco
|
||||
Point3d ptP1 ;
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, false, ptP1))
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, false, pCompo, ptP1))
|
||||
return false ;
|
||||
// determino se l'inizio dell'attacco è fuori dal grezzo
|
||||
bool bOutStart = GetPointOutOfRaw( ptP1, vtTool) ;
|
||||
@@ -1609,10 +1610,10 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// correggo elevazione iniziale con punto inizio attacco
|
||||
dStElev -= ( ptP1 - ptStart) * vtExtr ;
|
||||
// se attacco a zigzag o a spirale o a scivolo, l'elevazione va nell'attacco
|
||||
if ( IsLeadInHelixZigzagGlide()) {
|
||||
ptP1 += vtExtr * dStElev ;
|
||||
dStElev = 0 ;
|
||||
// se attacco a zigzag o a spirale, l'elevazione va nell'attacco
|
||||
if ( IsLeadInHelixOrZigzag()) {
|
||||
ptP1 += vtExtr * ( dStElev + LIO_ELEV_TOL) ;
|
||||
dStElev = - LIO_ELEV_TOL ;
|
||||
}
|
||||
// approccio al punto iniziale
|
||||
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr, bOutStart))
|
||||
@@ -1632,7 +1633,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
}
|
||||
// aggiungo attacco
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, false, bSplitArcs)) {
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, false, pCompo, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : LeadIn not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -1670,7 +1671,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo
|
||||
// aggiungo uscita
|
||||
Point3d ptP1 ;
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, false, bSplitArcs, ptP1)) {
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, false, pCompo, bSplitArcs, ptP1)) {
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadOut not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -1738,7 +1739,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
dStElev = dStep - LIO_ELEV_TOL - 10 * EPS_SMALL ;
|
||||
// determino inizio attacco
|
||||
Point3d ptP1 ;
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, bInvert, ptP1))
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, bInvert, pCompo, ptP1))
|
||||
return false ;
|
||||
// determino se l'inizio dell'attacco è fuori dal grezzo
|
||||
bool bOutStart = GetPointOutOfRaw( ptP1, vtTool) ;
|
||||
@@ -1779,7 +1780,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
}
|
||||
// aggiungo attacco
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, bInvert, bSplitArcs)) {
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, bInvert, pCompo, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : LeadIn not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -1821,7 +1822,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo uscita
|
||||
Point3d ptP1 ;
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, bInvert, bSplitArcs, ptP1)) {
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, bInvert, pCompo, bSplitArcs, ptP1)) {
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadOut not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -1850,17 +1851,15 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// lunghezza di approccio/retrazione
|
||||
double dAppr = m_Params.m_dStartPos ;
|
||||
|
||||
// percorso speciale : chiuso e con attacco a spirale o zigzag
|
||||
bool bSpecial = pCompo->IsClosed() && IsLeadInHelixOrZigzag() ;
|
||||
|
||||
// determino numero e affondamento degli step
|
||||
int nStep = max( 1, static_cast<int>( ceil( dElev / dOkStep))) ;
|
||||
double dStep = dElev / nStep ;
|
||||
|
||||
bool bClosed = pCompo->IsClosed() ;
|
||||
int nMaxInd = pCompo->GetCurveCount() - 1 ;
|
||||
|
||||
// percorso speciale : chiuso e con attacco a spirale o zigzag
|
||||
bool bSpecial = bClosed && ( GetLeadInType() == MILL_LI_HELIX || GetLeadInType() == MILL_LI_ZIGZAG) ;
|
||||
|
||||
// ciclo sugli step
|
||||
int nMaxInd = pCompo->GetCurveCount() - 1 ;
|
||||
for ( int j = 1 ; j <= nStep ; ++ j) {
|
||||
// ciclo sulle curve elementari
|
||||
for ( int i = 0 ; i <= nMaxInd ; ++ i) {
|
||||
@@ -1892,7 +1891,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev))
|
||||
dStElev = dElev ;
|
||||
// determino inizio attacco
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, false, ptP1))
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, false, pCompo, ptP1))
|
||||
return false ;
|
||||
// determino se l'inizio dell'attacco è fuori dal grezzo
|
||||
bool bOutStart = GetPointOutOfRaw( ptP1, vtTool) ;
|
||||
@@ -1900,8 +1899,8 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
// correggo elevazione iniziale con punto inizio attacco
|
||||
dStElev -= ( ptP1 - ptStart) * vtExtr ;
|
||||
// se attacco a zigzag o a spirale o a scivolo, l'elevazione va nell'attacco
|
||||
if ( IsLeadInHelixZigzagGlide()) {
|
||||
// se attacco a zigzag o a spirale, l'elevazione va nell'attacco
|
||||
if ( IsLeadInHelixOrZigzag()) {
|
||||
ptP1 += vtExtr * ( dStElev - ( j - 1) * dStep) ;
|
||||
dStElev = ( j - 1) * dStep ;
|
||||
}
|
||||
@@ -1924,7 +1923,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
}
|
||||
// aggiungo attacco
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, false, bSplitArcs)) {
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, false, pCompo, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : LeadIn not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -1965,7 +1964,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo uscita
|
||||
Point3d ptP1 ;
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, false, bSplitArcs, ptP1)) {
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, false, pCompo, bSplitArcs, ptP1)) {
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadOut not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -2036,7 +2035,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
dStElev = 0 ;
|
||||
// determino inizio attacco
|
||||
Point3d ptP1 ;
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, false, ptP1))
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, false, pCompo, ptP1))
|
||||
return false ;
|
||||
// determino se l'inizio dell'attacco è fuori dal grezzo
|
||||
bool bOutStart = GetPointOutOfRaw( ptP1, vtTool) ;
|
||||
@@ -2062,7 +2061,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
}
|
||||
// aggiungo attacco
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, false, bSplitArcs)) {
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, false, pCompo, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : LeadIn not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -2104,7 +2103,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo uscita
|
||||
Point3d ptP1 ;
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, false, bSplitArcs, ptP1)) {
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, false, pCompo, bSplitArcs, ptP1)) {
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadOut not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -2158,7 +2157,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
dStElev = dElev ;
|
||||
// determino inizio attacco
|
||||
Point3d ptP1 ;
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, bInvert, ptP1))
|
||||
if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, bInvert, pCompo, ptP1))
|
||||
return false ;
|
||||
// aggiungo approccio per frese normali
|
||||
if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) {
|
||||
@@ -2178,7 +2177,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
}
|
||||
// aggiungo attacco
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, bInvert, bSplitArcs)) {
|
||||
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, bInvert, pCompo, bSplitArcs)) {
|
||||
m_pMchMgr->SetLastError( 2309, "Error in Milling : LeadIn not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -2220,7 +2219,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool
|
||||
// aggiungo uscita
|
||||
Point3d ptP1 ;
|
||||
SetFeed( GetStartFeed()) ;
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, bInvert, bSplitArcs, ptP1)) {
|
||||
if ( ! AddLeadOut( ptEnd, vtEnd, vtExtr, dEndElev, bInvert, pCompo, bSplitArcs, ptP1)) {
|
||||
m_pMchMgr->SetLastError( 2310, "Error in Milling : LeadOut not computable") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -2376,11 +2375,11 @@ Milling::GetLeadInType( void) const
|
||||
if ( ( m_Params.m_nLeadInType == MILL_LI_HELIX || m_Params.m_nLeadInType == MILL_LI_ZIGZAG) &&
|
||||
( m_Params.m_dLiTang < min( 0.1 * m_TParams.m_dDiam, 1.0) || m_Params.m_dLiElev < 10 * EPS_SMALL))
|
||||
return MILL_LI_NONE ;
|
||||
if ( ( m_Params.m_nLeadInType == MILL_LI_HELIX || m_Params.m_nLeadInType == MILL_LI_ZIGZAG ||
|
||||
m_Params.m_nLeadInType == MILL_LI_GLIDE) && m_Params.m_nStepType == MILL_ST_ZIGZAG)
|
||||
if ( ( m_Params.m_nLeadInType == MILL_LI_HELIX || m_Params.m_nLeadInType == MILL_LI_ZIGZAG) &&
|
||||
m_Params.m_nStepType == MILL_ST_ZIGZAG)
|
||||
return MILL_LI_NONE ;
|
||||
if ( ( m_Params.m_nLeadInType == MILL_LI_HELIX || m_Params.m_nLeadInType == MILL_LI_ZIGZAG ||
|
||||
m_Params.m_nLeadInType == MILL_LI_GLIDE) && m_Params.m_nStepType == MILL_ST_SPIRAL)
|
||||
if ( ( m_Params.m_nLeadInType == MILL_LI_HELIX || m_Params.m_nLeadInType == MILL_LI_ZIGZAG) &&
|
||||
m_Params.m_nStepType == MILL_ST_SPIRAL)
|
||||
return MILL_LI_NONE ;
|
||||
if ( ( m_Params.m_nLeadInType == MILL_LI_HELIX || m_Params.m_nLeadInType == MILL_LI_ZIGZAG) &&
|
||||
( m_TParams.m_nType & TF_SAWBLADE) != 0)
|
||||
@@ -2391,7 +2390,7 @@ Milling::GetLeadInType( void) const
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
|
||||
double dStElev, bool bInvert, Point3d& ptP1)
|
||||
double dStElev, bool bInvert, const ICurveComposite* pCompo, Point3d& ptP1)
|
||||
{
|
||||
// Assegno tipo e parametri
|
||||
int nType = GetLeadInType() ;
|
||||
@@ -2416,8 +2415,8 @@ Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const
|
||||
// senso di rotazione da dir tg a dir esterna
|
||||
bool bCcwRot = (( ! bInvert && m_Params.m_nWorkSide == MILL_WS_LEFT) ||
|
||||
( bInvert && m_Params.m_nWorkSide != MILL_WS_LEFT)) ;
|
||||
// !!! provvisorio : GLIDE -> NONE !!!
|
||||
if ( nType == MILL_LI_GLIDE)
|
||||
// verifico di poter fare l'ingresso a inseguimento
|
||||
if ( nType == MILL_LI_GLIDE && ! pCompo->IsClosed())
|
||||
nType = MILL_LI_NONE ;
|
||||
// Calcolo punto iniziale
|
||||
switch ( nType) {
|
||||
@@ -2432,8 +2431,26 @@ Milling::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const
|
||||
return true ;
|
||||
}
|
||||
case MILL_LI_GLIDE :
|
||||
// !!! DA FARE !!!
|
||||
return false ;
|
||||
{
|
||||
if ( ! bInvert) {
|
||||
double dLen, dU ;
|
||||
if ( ! pCompo->GetLength( dLen) || ! pCompo->GetParamAtLength( dLen - dTang, dU) ||
|
||||
! pCompo->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP1)) {
|
||||
if ( ! pCompo->GetStartPoint( ptP1))
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
else {
|
||||
double dU ;
|
||||
if ( ! pCompo->GetParamAtLength( dTang, dU) ||
|
||||
! pCompo->GetPointD1D2( dU, ICurve::FROM_MINUS, ptP1)) {
|
||||
if ( ! pCompo->GetEndPoint( ptP1))
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
ptP1 += vtN * ( vtN * ( ptStart - ptP1)) + vtN * dElev ;
|
||||
return true ;
|
||||
}
|
||||
case MILL_LI_ZIGZAG :
|
||||
ptP1 = ptStart ;
|
||||
return true ;
|
||||
@@ -2448,10 +2465,11 @@ 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, bool bSplitArcs)
|
||||
const Vector3d& vtN, bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs)
|
||||
{
|
||||
// Assegno il tipo
|
||||
int nType = GetLeadInType() ;
|
||||
double dTang = m_Params.m_dLiTang ;
|
||||
// se step invertito
|
||||
if ( bInvert) {
|
||||
switch ( GetLeadOutType()) {
|
||||
@@ -2461,9 +2479,11 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
|
||||
case MILL_LO_AS_LI : /* resta inalterato */ ; break ;
|
||||
default : nType = MILL_LI_NONE ; break ;
|
||||
}
|
||||
if ( m_Params.m_nLeadOutType != MILL_LO_AS_LI)
|
||||
dTang = m_Params.m_dLoTang ;
|
||||
}
|
||||
// !!! provvisorio : GLIDE -> NONE !!!
|
||||
if ( nType == MILL_LI_GLIDE)
|
||||
// verifico di poter fare l'ingresso a inseguimento
|
||||
if ( nType == MILL_LI_GLIDE && ! pCompo->IsClosed())
|
||||
nType = MILL_LI_NONE ;
|
||||
// Eseguo a seconda del tipo
|
||||
switch ( nType) {
|
||||
@@ -2480,8 +2500,49 @@ Milling::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d&
|
||||
return ( AddCurveMove( pCrv, MCH_CL_LEADIN) != GDB_ID_NULL) ;
|
||||
}
|
||||
case MILL_LI_GLIDE :
|
||||
// !!! DA FARE !!!
|
||||
return false ;
|
||||
{
|
||||
// recupero la parte richiesta della curva
|
||||
PtrOwner<ICurveComposite> pCrv ;
|
||||
if ( ! bInvert) {
|
||||
double dLen, dU ;
|
||||
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)))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( ! pCrv.Set( pCompo->Clone()))
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
else {
|
||||
double dU ;
|
||||
if ( pCompo->GetParamAtLength( dTang, dU)) {
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( 0, dU)))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( ! pCrv.Set( pCompo->Clone()))
|
||||
return false ;
|
||||
}
|
||||
pCrv->Invert() ;
|
||||
}
|
||||
pCrv->SetExtrusion( vtN) ;
|
||||
// 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 ;
|
||||
AdjustCurveSlope( pCrv, dNini, dNfin) ;
|
||||
// eventuale spezzatura
|
||||
if ( bSplitArcs && ! ApproxWithLines( pCrv))
|
||||
return false ;
|
||||
// emetto
|
||||
return ( AddCurveMove( pCrv) != GDB_ID_NULL) ;
|
||||
}
|
||||
case MILL_LI_ZIGZAG :
|
||||
{
|
||||
double dDeltaN = ( ptStart - ptP1) * vtN ;
|
||||
@@ -2534,15 +2595,16 @@ int
|
||||
Milling::GetLeadOutType( void) const
|
||||
{
|
||||
if ( abs( m_Params.m_dLoTang) < min( 0.1 * m_TParams.m_dDiam, 0.1) &&
|
||||
abs( m_Params.m_dLoPerp) < min( 0.1 * m_TParams.m_dDiam, 0.1))
|
||||
abs( m_Params.m_dLoPerp) < min( 0.1 * m_TParams.m_dDiam, 0.1) &&
|
||||
m_Params.m_nLeadOutType != MILL_LO_AS_LI)
|
||||
return MILL_LO_NONE ;
|
||||
return m_Params.m_nLeadOutType ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
|
||||
double dEndElev, bool bInvert, bool bSplitArcs, Point3d& ptP1)
|
||||
Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN, double dEndElev,
|
||||
bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs, Point3d& ptP1)
|
||||
{
|
||||
// assegno i parametri
|
||||
int nType = GetLeadOutType() ;
|
||||
@@ -2566,8 +2628,8 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
|
||||
// senso di rotazione da dir tg a dir esterna
|
||||
bool bCcwRot = (( ! bInvert && m_Params.m_nWorkSide == MILL_WS_LEFT) ||
|
||||
( bInvert && m_Params.m_nWorkSide != MILL_WS_LEFT)) ;
|
||||
// !!! provvisorio : GLIDE -> NONE !!!
|
||||
if ( nType == MILL_LO_GLIDE)
|
||||
// verifico di poter fare l'uscita a inseguimento
|
||||
if ( nType == MILL_LO_GLIDE && ! pCompo->IsClosed())
|
||||
nType = MILL_LO_NONE ;
|
||||
// eseguo a seconda del tipo
|
||||
switch ( nType) {
|
||||
@@ -2594,8 +2656,51 @@ Milling::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d
|
||||
return ( AddCurveMove( pCrv, MCH_CL_LEADOUT) != GDB_ID_NULL) ;
|
||||
}
|
||||
case MILL_LO_GLIDE :
|
||||
// !!! DA FARE !!!
|
||||
return false ;
|
||||
{
|
||||
// recupero la parte richiesta della curva di ritorno
|
||||
PtrOwner<ICurveComposite> pCrv ;
|
||||
if ( ! bInvert) {
|
||||
double dU ;
|
||||
if ( pCompo->GetParamAtLength( dTang, dU)) {
|
||||
if ( ! pCrv.Set( CreateCurveComposite()) || ! pCrv->AddCurve( pCompo->CopyParamRange( 0, dU)))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( ! pCrv.Set( pCompo->Clone()))
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
else {
|
||||
double dLen, dU ;
|
||||
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)))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( ! pCrv.Set( pCompo->Clone()))
|
||||
return false ;
|
||||
}
|
||||
pCrv->Invert() ;
|
||||
}
|
||||
pCrv->SetExtrusion( vtN) ;
|
||||
// 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 ;
|
||||
AdjustCurveSlope( pCrv, dNini, dNini + dElev) ;
|
||||
// eventuale spezzatura
|
||||
if ( bSplitArcs && ! ApproxWithLines( pCrv))
|
||||
return false ;
|
||||
// emetto
|
||||
AddCurveMove( pCrv) ;
|
||||
// assegno punto finale dell'uscita
|
||||
pCrv->GetEndPoint( ptP1) ;
|
||||
return true ;
|
||||
}
|
||||
default :
|
||||
return false ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user