EgtGeomKernel :
- modifiche per aggiunta altezza tagliente di utensili per virtual milling.
This commit is contained in:
+2
-2
@@ -73,14 +73,14 @@ CAvToolSurfTm::AddSurfTm( const ISurfTriMesh& Stm)
|
||||
bool
|
||||
CAvToolSurfTm::SetStdTool( double dH, double dR, double dCornR)
|
||||
{
|
||||
return m_Tool.SetStdTool( "", dH, dR, dCornR, 0) ;
|
||||
return m_Tool.SetStdTool( "", dH, dR, dCornR, 0, 0) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CAvToolSurfTm::SetAdvTool( double dH, double dR, double dTipH, double dTipR, double dCornR)
|
||||
{
|
||||
return m_Tool.SetAdvTool( "", dH, dR, dTipH, dTipR, dCornR, 0) ;
|
||||
return m_Tool.SetAdvTool( "", dH, dR, dTipH, dTipR, dCornR, 0, 0) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
+2
-2
@@ -5145,9 +5145,9 @@ GdbExecutor::ExecuteToolAvoidTriangle( const std::string& sCmd2, const STRVECTOR
|
||||
// Creo un utensile
|
||||
Tool tlTool ;
|
||||
if ( nToolType == 1)
|
||||
tlTool.SetStdTool( "Cilindro", dHei, dRad, 0, 0) ;
|
||||
tlTool.SetStdTool( "Cilindro", dHei, dRad, 0, 0, 0) ;
|
||||
else if ( nToolType == 2)
|
||||
tlTool.SetStdTool( "Sfera", dHei, dRad, dRad, 0) ;
|
||||
tlTool.SetStdTool( "Sfera", dHei, dRad, dRad, 0, 0) ;
|
||||
else
|
||||
return false ;
|
||||
// Determino la distanza di fuga
|
||||
|
||||
@@ -20,14 +20,15 @@
|
||||
#include "/EgtDev/Include/EGkLinePntTgCurve.h"
|
||||
#include "/EgtDev/Include/EGkFilletChamfer.h"
|
||||
#include "/EgtDev/Include/EGkDistPointCurve.h"
|
||||
#include "/EgtDev/Include/EGkIntersCurves.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
Tool::Tool( bool bApproxWithLines)
|
||||
: m_dLinTol( LIN_TOL_STD), m_dAngTolDeg( ANG_TOL_APPROX_DEG), m_nType( UNDEF), m_nCurrentNum( 0), m_dHeight( 0),
|
||||
m_dTipHeight( 0), m_dRadius( 0), m_dRCorner( 0), m_dTipRadius( 0), m_dRefRadius( 0), m_dMrtChsWidth( 0), m_dMrtChsThickness( 0),
|
||||
: m_dLinTol( LIN_TOL_STD), m_dAngTolDeg( ANG_TOL_APPROX_DEG), m_nType( UNDEF), m_nCurrentNum( 0), m_dHeight( 0), m_dTipHeight( 0),
|
||||
m_dRadius( 0), m_dRCorner( 0), m_dTipRadius( 0), m_dRefRadius( 0), m_dCutterHeight( 0), m_dMrtChsWidth( 0), m_dMrtChsThickness( 0),
|
||||
m_bApproxWithLines( bApproxWithLines)
|
||||
{
|
||||
}
|
||||
@@ -70,7 +71,7 @@ Tool::SetTolerances( double dLinTol, double dAngTolDeg)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Tool::SetStdTool( const string& sToolName, double dH, double dR, double dCornR, int nToolNum)
|
||||
Tool::SetStdTool( const string& sToolName, double dH, double dR, double dCornR, double dCutterH, int nToolNum)
|
||||
{
|
||||
// Impostazioni generali
|
||||
m_sName = sToolName ;
|
||||
@@ -78,6 +79,7 @@ Tool::SetStdTool( const string& sToolName, double dH, double dR, double dCornR,
|
||||
m_nType = UNDEF ;
|
||||
m_Outline.Clear() ;
|
||||
m_ArcLineApprox.Clear() ;
|
||||
m_dCutterHeight = dCutterH ;
|
||||
|
||||
// verifica sulle minime dimensioni globali
|
||||
if ( dH < EPS_SMALL || dR < EPS_SMALL || dCornR < - EPS_SMALL)
|
||||
@@ -149,13 +151,17 @@ Tool::SetStdTool( const string& sToolName, double dH, double dR, double dCornR,
|
||||
else
|
||||
return false ;
|
||||
|
||||
return true ;
|
||||
// eventuali sistemazioni per altezza tagliente
|
||||
if ( ModifyForCutterHeight())
|
||||
return SetGenTool( sToolName, &m_Outline, nToolNum) ;
|
||||
else
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Tool::SetAdvTool( const string& sToolName, double dH, double dR,
|
||||
double dTipH, double dTipR, double dCornR, int nToolNum)
|
||||
double dTipH, double dTipR, double dCornR, double dCutterH, int nToolNum)
|
||||
{
|
||||
// Impostazioni generali
|
||||
m_sName = sToolName ;
|
||||
@@ -163,6 +169,7 @@ Tool::SetAdvTool( const string& sToolName, double dH, double dR,
|
||||
m_nType = UNDEF ;
|
||||
m_Outline.Clear() ;
|
||||
m_ArcLineApprox.Clear() ;
|
||||
m_dCutterHeight = dCutterH ;
|
||||
|
||||
// Verifica dimensioni globali
|
||||
if ( dH < EPS_SMALL || dR < EPS_SMALL || dTipH < - EPS_SMALL || dTipR < - EPS_SMALL || dCornR < - EPS_SMALL)
|
||||
@@ -170,7 +177,7 @@ Tool::SetAdvTool( const string& sToolName, double dH, double dR,
|
||||
|
||||
// Se altezza punta nulla, ricado nel caso standard
|
||||
if ( dTipH < EPS_SMALL || abs( dTipR - dR) < EPS_SMALL)
|
||||
return SetStdTool( sToolName, dH, dR, dCornR, nToolNum) ;
|
||||
return SetStdTool( sToolName, dH, dR, dCornR, dCutterH, nToolNum) ;
|
||||
|
||||
// Caso avanzato
|
||||
m_dHeight = dH ;
|
||||
@@ -197,7 +204,11 @@ Tool::SetAdvTool( const string& sToolName, double dH, double dR,
|
||||
m_Outline.AddLine( pt2) ;
|
||||
m_Outline.AddLine( Point3d( m_dTipRadius, - m_dHeight, 0)) ;
|
||||
m_Outline.AddLine( pt5) ;
|
||||
return true ;
|
||||
// eventuali sistemazioni per altezza tagliente
|
||||
if ( ModifyForCutterHeight())
|
||||
return SetGenTool( sToolName, &m_Outline, nToolNum) ;
|
||||
else
|
||||
return true ;
|
||||
}
|
||||
|
||||
// Altrimenti utensile generico
|
||||
@@ -300,9 +311,40 @@ Tool::SetAdvTool( const string& sToolName, double dH, double dR,
|
||||
m_Outline.AddLine( pt5) ;
|
||||
}
|
||||
|
||||
// eventuali sistemazioni per altezza tagliente
|
||||
ModifyForCutterHeight() ;
|
||||
|
||||
return SetGenTool( sToolName, &m_Outline, nToolNum) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Tool::ModifyForCutterHeight( void)
|
||||
{
|
||||
// Se altezza tagliente non definita o superiore alla altezza utensile non devo fare alcunché
|
||||
if ( m_dCutterHeight < EPS_SMALL || m_dCutterHeight > m_dHeight - EPS_SMALL)
|
||||
return false ;
|
||||
// quota di taglio
|
||||
double dYtrim = -m_dHeight + m_dCutterHeight ;
|
||||
// linea di taglio
|
||||
const double LEN_EXTRA = 10 ;
|
||||
CurveLine clTrim ;
|
||||
clTrim.SetPDL( Point3d( -LEN_EXTRA, dYtrim, 0), 0, max( m_dRadius, m_dTipRadius) + LEN_EXTRA) ;
|
||||
// intersezione con il profilo
|
||||
IntersCurveCurve intCC( m_Outline, clTrim) ;
|
||||
int nInters = intCC.GetIntersCount() ;
|
||||
if ( nInters > 0) {
|
||||
IntCrvCrvInfo aInfo ;
|
||||
intCC.GetIntCrvCrvInfo( nInters - 1, aInfo) ;
|
||||
double dU = ( aInfo.bOverlap ? aInfo.IciA[1].dU : aInfo.IciA[0].dU) ;
|
||||
m_Outline.TrimStartAtParam( dU) ;
|
||||
m_Outline.AddLine( Point3d( 0, dYtrim, 0), false) ;
|
||||
m_Outline.AddLine( ORIG, false) ;
|
||||
return true ;
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Tool::SetSawTool( const string& sToolName, double dH, double dR,
|
||||
|
||||
@@ -25,9 +25,9 @@ class Tool
|
||||
public :
|
||||
bool Clear( void) ;
|
||||
bool SetTolerances( double dLinTol, double dAngTolDeg = 45) ;
|
||||
bool SetStdTool( const std::string& sToolName, double dH, double dR, double dCornR, int nToolNum) ;
|
||||
bool SetStdTool( const std::string& sToolName, double dH, double dR, double dCornR, double dCutterH, int nToolNum) ;
|
||||
bool SetAdvTool( const std::string& sToolName,
|
||||
double dH, double dR, double dTipH, double dTipR, double dCornR, int nToolNum) ;
|
||||
double dH, double dR, double dTipH, double dTipR, double dCornR, double dCutterH, int nToolNum) ;
|
||||
bool SetSawTool( const std::string& sToolName, double dH, double dR,
|
||||
double dThick, double dStemR, double dCornR, int nToolNum) ;
|
||||
bool SetGenTool( const std::string& sToolName, const ICurveComposite* pToolOutline, int nToolNum) ;
|
||||
@@ -70,6 +70,9 @@ class Tool
|
||||
MORTISER = 6, // Mortasatrice
|
||||
CHISEL = 7} ; // Scalpello
|
||||
|
||||
private :
|
||||
bool ModifyForCutterHeight( void) ;
|
||||
|
||||
private :
|
||||
bool m_bApproxWithLines ;
|
||||
double m_dLinTol ;
|
||||
@@ -85,6 +88,7 @@ class Tool
|
||||
double m_dRCorner ;
|
||||
double m_dTipRadius ;
|
||||
double m_dRefRadius ;
|
||||
double m_dCutterHeight ;
|
||||
double m_dMrtChsWidth ;
|
||||
double m_dMrtChsThickness ;
|
||||
} ;
|
||||
|
||||
+4
-4
@@ -1714,17 +1714,17 @@ VolZmap::SetTolerances( double dLinTol, double dAngTolDeg)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::SetStdTool( const string& sToolName, double dH, double dR, double dCornR, int nFlag)
|
||||
VolZmap::SetStdTool( const string& sToolName, double dH, double dR, double dCornR, double dCutterH, int nFlag)
|
||||
{
|
||||
return m_Tool.SetStdTool( sToolName, dH, dR, dCornR, nFlag) ;
|
||||
return m_Tool.SetStdTool( sToolName, dH, dR, dCornR, dCutterH, nFlag) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::SetAdvTool( const string& sToolName,
|
||||
double dH, double dR, double dTipH, double dTipR, double dCornR, int nFlag)
|
||||
double dH, double dR, double dTipH, double dTipR, double dCornR, double dCutterH, int nFlag)
|
||||
{
|
||||
return m_Tool.SetAdvTool( sToolName, dH, dR, dTipH, dTipR, dCornR, nFlag) ;
|
||||
return m_Tool.SetAdvTool( sToolName, dH, dR, dTipH, dTipR, dCornR, dCutterH, nFlag) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
@@ -75,9 +75,9 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
bool GetVolume( double& dVol) const override ;
|
||||
bool GetDexelLines( int nDir, int nPos1, int nPos2, POLYLINELIST& lstPL) const override ;
|
||||
bool SetTolerances( double dLinTol, double dAngTolDeg = 90) override ;
|
||||
bool SetStdTool( const std::string& sToolName, double dH, double dR, double dCornR, int nFlag) override ;
|
||||
bool SetStdTool( const std::string& sToolName, double dH, double dR, double dCornR, double dCutterH, int nFlag) override ;
|
||||
bool SetAdvTool( const std::string& sToolName,
|
||||
double dH, double dR, double dTipH, double dTipR, double dCornR, int nFlag) override ;
|
||||
double dH, double dR, double dTipH, double dTipR, double dCornR, double dCutterH, int nFlag) override ;
|
||||
bool SetSawTool( const std::string& sToolName,
|
||||
double dH, double dR, double dThick, double dStemR, double dCornR, int nFlag) override ;
|
||||
bool SetGenTool( const std::string& sToolName, const ICurveComposite* pToolOutline, int nFlag) override ;
|
||||
|
||||
Reference in New Issue
Block a user