0d0f195d8b
- modifiche a fresature per approcci/retrazioni con frese che non lavorano di testa.
189 lines
12 KiB
C++
189 lines
12 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2015-2015
|
|
//----------------------------------------------------------------------------
|
|
// File : Milling.h Data : 07.06.15 Versione : 1.6f2
|
|
// Contenuto : Dichiarazione della classe Milling.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 07.06.15 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "Machining.h"
|
|
#include "MillingData.h"
|
|
#include "ToolData.h"
|
|
#include "/EgtDev/Include/EGkCurve.h"
|
|
|
|
class ICurveLine ;
|
|
class ICurveArc ;
|
|
class ICurveComposite ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class Milling : public Machining
|
|
{
|
|
public : // IUserObj
|
|
Milling* Clone( void) const override ;
|
|
const std::string& GetClassName( void) const override ;
|
|
bool Dump( std::string& sOut, bool bMM = true, const char* szNewLine = "\n") const override ;
|
|
bool ToSave( void) const override
|
|
{ return true ; }
|
|
bool Save( int nBaseId, STRVECTOR& vString) const override ;
|
|
bool Load( const STRVECTOR& vString, int nBaseGdbId) override ;
|
|
|
|
public : // Operation
|
|
int GetType( void) const override
|
|
{ return OPER_MILLING ; }
|
|
bool IsEmpty( void) const override
|
|
{ return ( m_nMills == 0) ; }
|
|
bool UpdateStatus( int nModif) override
|
|
{ m_nStatus |= nModif ; return true ; }
|
|
|
|
protected : // Operation
|
|
int GetSolCh( void) const override
|
|
{ return m_Params.m_nSolCh ; }
|
|
bool AdjustEndPointForAxesCalc( const CamData* pCamData, Point3d& ptP) const override ;
|
|
bool AdjustArcCenterForAxesCalc( const CamData* pCamData, Point3d& ptCen) const override ;
|
|
|
|
public : // Machining
|
|
bool Prepare( const std::string& sMillName) override ;
|
|
bool SetParam( int nType, bool bVal) override ;
|
|
bool SetParam( int nType, int nVal) override ;
|
|
bool SetParam( int nType, double dVal) override ;
|
|
bool SetParam( int nType, const std::string& sVal) override ;
|
|
bool SetGeometry( const SELVECTOR& vIds) override ;
|
|
bool Preview( bool bRecalc) override ;
|
|
bool Apply( bool bRecalc, bool bPostApply) override ;
|
|
bool Update( bool bPostApply) override ;
|
|
bool GetParam( int nType, bool& bVal) const override ;
|
|
bool GetParam( int nType, int& nVal) const override ;
|
|
bool GetParam( int nType, double& dVal) const override ;
|
|
bool GetParam( int nType, std::string& sVal) const override ;
|
|
bool UpdateToolData( bool* pbChanged = nullptr) override ;
|
|
const ToolData& GetToolData( void) const override ;
|
|
bool GetGeometry( SELVECTOR& vIds) const override ;
|
|
|
|
public :
|
|
Milling( void) ;
|
|
|
|
private :
|
|
struct TabData {
|
|
double m_dBottomLen ;
|
|
double m_dRampLen ;
|
|
double m_dTopLen ;
|
|
} ;
|
|
|
|
private :
|
|
bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ;
|
|
bool GetCurves( SelData Id, ICURVEPLIST& lstPC) ;
|
|
bool Chain( int nGrpDestId) ;
|
|
bool CalcSurfAuxView( int nAuxId, int nAuxViewId) ;
|
|
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
|
|
bool AdjustPathDrawForSaw( int nClPathId) ;
|
|
bool CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double& dElev) const ;
|
|
bool VerifyPathFromBottom( const ICurveComposite* pCompo, const Vector3d& vtTool) ;
|
|
bool GenerateMillingPv( int nPathId, const ICurveComposite* pCompo, double dRbDist, double dDepth) ;
|
|
bool AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTool,
|
|
double dDepth, double dElev, bool bSplitArcs, bool bPathTabsEnable, bool bPathOscEnable) ;
|
|
bool AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dElev,
|
|
double dOkStep, bool bStepUp, bool bSplitArcs, bool bPathTabsEnable, bool bPathOscEnable) ;
|
|
bool AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dElev,
|
|
double dOkStep, bool bStepUp, bool bSplitArcs, bool bPathTabsEnable, bool bPathOscEnable) ;
|
|
bool AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool,
|
|
double dDepth, double dElev, double dOkStep, bool bSplitArcs, bool bPathTabsEnable, bool bPathOscEnable) ;
|
|
bool AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool,
|
|
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
|
bool AddSawOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool,
|
|
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
|
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
|
|
double dElev, double dAppr, bool bOutStart, bool bAboveStart) ;
|
|
bool AddSawBladeSideApproach( const Point3d& ptP, const Vector3d& vtAppr, const Vector3d& vtTool,
|
|
double dSafeZ, double dSawStElev, double dStElev, double dAppr) ;
|
|
bool AddDirectApproach( const Point3d& ptP) ;
|
|
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, const Vector3d& vtTool,
|
|
double dSafeZ, double dSawEndElev, double dEndElev, double dAppr) ;
|
|
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtTool,
|
|
double dStElev, bool bInvert, const ICurveComposite* pCompo, Point3d& ptP1, Vector3d& vtDir1) const ;
|
|
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart,
|
|
const Vector3d& vtTool, double dStElev, 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& vtTool, double dEndElev,
|
|
bool bInvert, const ICurveComposite* pCompo, bool bSplitArcs, Point3d& ptP1, Vector3d& vtDir1) ;
|
|
bool AdjustOscillParams( const ICurve* pCrv, bool& bPathOscEnable, double& dRampLen, double& dFlatLen) ;
|
|
bool AddOscillLine( const ICurveLine* pLine, const Vector3d& vtTool, double dRampLen, double dFlatLen) ;
|
|
bool AddOscillArc( const ICurveArc* pArc, const Vector3d& vtTool, double dRampLen, double dFlatLen) ;
|
|
bool AdjustTabsParams( const ICurve* pCrv, bool& bPathTabsEnable, TabData& tdTabs) ;
|
|
bool CalcTabsPositions( const ICurveComposite* pCompo, double dDepth, bool bPathTabsEnable, const TabData& tdTabs, DBLVECTOR& vdTabs) ;
|
|
bool AddTabsLine( const ICurveLine* pLine, const Vector3d& vtTool, const DBLVECTOR& vdTabs, const TabData& tdTabs) ;
|
|
bool AddTabsArc( const ICurveArc* pArc, const Vector3d& vtTool, const DBLVECTOR& vdTabs, const TabData& tdTabs) ;
|
|
double GetRadiusForStartEndElevation( bool bExtra = true) const ;
|
|
bool GetSimplePointOutOfRaw( const Point3d& ptP, const Vector3d& vtTool, const Vector3d& vtCorr) const ;
|
|
bool GetPointOutOfRaw( const Point3d& ptP, const Vector3d& vtTool, const Vector3d& vtCorr, double dElev, double dSafeZ) const ;
|
|
bool GetPointAboveRaw( const Point3d& ptP, const Vector3d& vtTool) const ;
|
|
bool GetPointBelowRaw( const Point3d& ptP, const Vector3d& vtTool) const ;
|
|
bool CalcAndSetCorrAuxDir( const ICurveComposite* pCompo, double dU, bool bInvertSide = false) ;
|
|
Vector3d CalcCorrDir( const ICurveComposite* pCompo, double dU, bool bInvertSide = false) ;
|
|
bool CalcOffset( ICurveComposite* pCompo, double dSignOffs) ;
|
|
bool TrimExtendCurveToClosedStm( ICurveComposite* pCompo, int nCstmId, bool bInvert) ;
|
|
|
|
private :
|
|
double GetSpeed() const
|
|
{ return ( IsNullAngValue( m_Params.m_dSpeed) ? m_TParams.m_dSpeed : m_Params.m_dSpeed) ; }
|
|
double GetFeed() const
|
|
{ return ( IsNullLenValue( m_Params.m_dFeed) ? m_TParams.m_dFeed : m_Params.m_dFeed) ; }
|
|
double GetStartFeed() const
|
|
{ return ( IsNullLenValue( m_Params.m_dStartFeed) ? m_TParams.m_dStartFeed : m_Params.m_dStartFeed) ; }
|
|
double GetEndFeed() const
|
|
{ return ( IsNullLenValue( m_Params.m_dEndFeed) ? m_TParams.m_dEndFeed : m_Params.m_dEndFeed) ; }
|
|
double GetTipFeed() const
|
|
{ return ( IsNullLenValue( m_Params.m_dTipFeed) ? m_TParams.m_dTipFeed : m_Params.m_dTipFeed) ; }
|
|
double GetOffsL() const
|
|
{ return ( IsUnknownValue( m_Params.m_dOffsL) ? m_TParams.m_dOffsL : m_Params.m_dOffsL) ; }
|
|
double GetOffsR() const
|
|
{ return ( IsUnknownValue( m_Params.m_dOffsR) ? m_TParams.m_dOffsR : m_Params.m_dOffsR) ; }
|
|
int GetLeadInType( void) const ;
|
|
int GetLeadOutType( void) const ;
|
|
bool IsLeadInHelixOrZigzag() const
|
|
{ int nType = GetLeadInType() ;
|
|
return ( nType == MILL_LI_ZIGZAG || nType == MILL_LI_HELIX) ; }
|
|
bool IsLeadInHelixOrZigzagOrGlide() const
|
|
{ int nType = GetLeadInType() ;
|
|
return ( nType == MILL_LI_ZIGZAG || nType == MILL_LI_HELIX || nType == MILL_LI_GLIDE) ; }
|
|
bool LeadInRawIsOk( void) const
|
|
{ if ( ( m_TParams.m_nType & TF_SAWBLADE) != 0)
|
|
return false ;
|
|
if ( m_TParams.m_nType != TT_MILL_NOTIP)
|
|
return true ;
|
|
return ( IsLeadInHelixOrZigzag() &&
|
|
m_Params.m_dLiTang >= 0.9 * m_TParams.m_dDiam && m_Params.m_dLiElev <= 2) ; }
|
|
friend class LeadIOStatus ;
|
|
|
|
private :
|
|
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
|
|
MillingData m_Params ; // parametri lavorazione
|
|
ToolData m_TParams ; // parametri utensile
|
|
double m_dTHoldBase ; // posizione base del porta-utensile
|
|
double m_dTHoldLen ; // lunghezza del porta-utensile
|
|
double m_dTHoldDiam ; // diametro del porta-utensile
|
|
int m_nStatus ; // stato di aggiornamento della lavorazione
|
|
int m_nMills ; // numero di percorsi di lavoro generati
|
|
bool m_bStepOn ; // flag per indicare che effettivamente si lavora a step
|
|
double m_dAddedOverlap ; // overlap effettivamente aggiunto a percorso chiuso
|
|
int m_nHeadSolCh ; // criterio scelta soluzione impostato nella testa
|
|
bool m_bTiltingTab ; // flag utilizzo tavola basculante
|
|
Vector3d m_vtTiltingAx ; // versore direzione eventuale asse basculante
|
|
bool m_bAboveHead ; // flag utilizzo testa da sopra
|
|
bool m_bAggrBottom ; // flag utilizzo di aggregato da sotto
|
|
Vector3d m_vtAggrBottom ; // vettore direzione ausiliaria aggregato da sotto
|
|
AggrBottom m_AggrBottom ; // dati eventuale aggregato da sotto
|
|
double m_dCurrOscillLen ; // lunghezza corrente lungo il percorso per l'oscillazione
|
|
double m_dCurrTabsLen ; // lunghezza corrente lungo il percorso per tabs
|
|
bool m_bStartOutRaw ; // flag forzatura inizio fuori dal grezzo
|
|
bool m_bEndOutRaw ; // flag forzatura fine fuori dal grezzo
|
|
} ; |