5ec2993913
- aggiunta possibilità di fresare e svuotare direttamente i testi - migliorata gestione PMIN e PMAX dei percorsi di lavoro - aggiunti MMIN e MMAX alle lavorazioni.
140 lines
8.0 KiB
C++
140 lines
8.0 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2017-2017
|
|
//----------------------------------------------------------------------------
|
|
// File :Pocketing.h Data : 04.02.17 Versione : 1.8b1
|
|
// Contenuto : Dichiarazione della classe Pocketing.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 04.02.17 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "Machining.h"
|
|
#include "PocketingData.h"
|
|
#include "ToolData.h"
|
|
#include "/EgtDev/Include/EGkCurveComposite.h"
|
|
#include "/EgtDev/Include/EgtNumUtils.h"
|
|
|
|
//----------------------------------------------------------------------------
|
|
class Pocketing : public Machining
|
|
{
|
|
public : // IUserObj
|
|
Pocketing* 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_POCKETING ; }
|
|
bool IsEmpty( void) const override
|
|
{ return ( m_nPockets == 0) ; }
|
|
|
|
protected : // Operation
|
|
int GetSolCh( void) const override
|
|
{ return m_Params.m_nSolCh ; }
|
|
|
|
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 :
|
|
Pocketing( void) ;
|
|
|
|
private :
|
|
bool VerifyGeometry( SelData Id, int& nSubs, int& nType) ;
|
|
bool GetCurves( SelData Id, ICURVEPLIST& lstPC) ;
|
|
bool Chain( int nGrpDestId) ;
|
|
bool ProcessPath( int nPathId, int nPvId, int nClId) ;
|
|
bool CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtTool, double dDepth, double dRad, double& dElev) ;
|
|
bool VerifyPathFromBottom( const ICurveComposite* pCompo, const Vector3d& vtTool) ;
|
|
bool GenerateMillingPv( int nPathId, const ICurveComposite* pCompo) ;
|
|
bool AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
|
|
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
|
bool CalcZigZag( const ICurveComposite* pOffs, ICRVCOMPOPOVECTOR& vpCrvs) ;
|
|
bool AddOneWay( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
|
|
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
|
bool AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
|
|
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
|
bool AddSpiralOut( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
|
|
double dDepth, double dElev, double dOkStep, bool bSplitArcs) ;
|
|
bool CalcSpiral( const ICurveComposite* pCompo, bool bSplitArcs,
|
|
ICurveComposite* pMCrv, ICurveComposite* pRCrv) ;
|
|
bool CalcCircleSpiral( const Point3d& ptCen, const Vector3d& vtN, double dOutRad, double dIntRad,
|
|
bool bSplitArcs, ICurveComposite* pMCrv, ICurveComposite* pRCrv) ;
|
|
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
|
|
double dElev, double dAppr) ;
|
|
bool AddLinkApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
|
|
double dElev, double dAppr) ;
|
|
bool AddLinkRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
|
|
double dElev, double dAppr) ;
|
|
bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ,
|
|
double dElev, double dAppr) ;
|
|
bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,
|
|
const ICurveComposite* pRCrv, Point3d& ptP1) ;
|
|
bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart,
|
|
const Vector3d& vtN, const ICurveComposite* pRCrv, bool bAtLeft, bool bSplitArcs, bool bNoneForced = false) ;
|
|
bool AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector3d& vtN,
|
|
const ICurveComposite* pRCrv, bool bSplitArcs, Point3d& ptP1, double& dElev, bool bNoneForced = false) ;
|
|
double GetRadiusForStartEndElevation( void) ;
|
|
bool AdjustContourStart( ICurveComposite* pCompo) ;
|
|
|
|
private :
|
|
double GetSpeed( void) const
|
|
{ return ( abs( m_Params.m_dSpeed) < EPS_MACH_ANG_PAR ? m_TParams.m_dSpeed : m_Params.m_dSpeed) ; }
|
|
double GetFeed( void) const
|
|
{ return ( abs( m_Params.m_dFeed) < EPS_MACH_LEN_PAR ? m_TParams.m_dFeed : m_Params.m_dFeed) ; }
|
|
double GetStartFeed( void) const
|
|
{ return ( abs( m_Params.m_dStartFeed) < EPS_MACH_LEN_PAR ? m_TParams.m_dStartFeed : m_Params.m_dStartFeed) ; }
|
|
double GetEndFeed( void) const
|
|
{ return ( abs( m_Params.m_dEndFeed) < EPS_MACH_LEN_PAR ? m_TParams.m_dEndFeed : m_Params.m_dEndFeed) ; }
|
|
double GetTipFeed( void) const
|
|
{ return ( abs( m_Params.m_dTipFeed) < EPS_MACH_LEN_PAR ? m_TParams.m_dTipFeed : m_Params.m_dTipFeed) ; }
|
|
double GetOffsL( void) const
|
|
{ return ( abs( m_Params.m_dOffsL - UNKNOWN_PAR) < EPS_MACH_LEN_PAR ? m_TParams.m_dOffsL : m_Params.m_dOffsL) ; }
|
|
double GetOffsR( void) const
|
|
{ return ( abs( m_Params.m_dOffsR - UNKNOWN_PAR) < EPS_MACH_LEN_PAR ? m_TParams.m_dOffsR : m_Params.m_dOffsR) ; }
|
|
double GetSideStep( void) const
|
|
{ return Clamp( m_Params.m_dSideStep, min( 0.1 * m_TParams.m_dDiam, 1.0), m_TParams.m_dDiam) ; }
|
|
int GetLeadInType( void) const
|
|
{ if ( m_Params.m_dLiTang < min( 0.1 * m_TParams.m_dDiam, 1.0))
|
|
return POCKET_LI_NONE ;
|
|
if ( m_Params.m_nLeadInType != POCKET_LI_GLIDE && m_Params.m_dLiElev < 10 * EPS_SMALL)
|
|
return POCKET_LI_NONE ;
|
|
return m_Params.m_nLeadInType ; }
|
|
int GetLeadOutType( void) const
|
|
{ if ( m_Params.m_dLoTang < min( 0.1 * m_TParams.m_dDiam, 1.0))
|
|
return POCKET_LO_NONE ;
|
|
return m_Params.m_nLeadOutType ; }
|
|
|
|
private :
|
|
SELVECTOR m_vId ; // identificativi entità geometriche da lavorare
|
|
PocketingData m_Params ; // parametri lavorazione
|
|
ToolData m_TParams ; // parametri utensile
|
|
double m_dMaxHelixRad ; // raggio massimo attacco ad elica nel caso di cerchi
|
|
int m_nPockets ; // numero di percorsi di svuotatura generati
|
|
bool m_bAggrBottom ; // flag di utilizzo dell'aggregato da sotto
|
|
Vector3d m_vtAggrBottom ; // vettore direzione ausiliaria aggregato da sotto
|
|
AggrBottom m_AggrBottom ; // dati eventuale aggregato da sotto
|
|
} ; |