EgtGeomKernel :
- modifiche a Zmap per utensili generici e per features.
This commit is contained in:
@@ -26,8 +26,8 @@ using namespace std ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
Tool::Tool( void)
|
||||
: m_dLinTol( LIN_TOL_STD), m_dAngTolDeg( ANG_TOL_APPROX_DEG), m_nType( UNDEF), m_nCurrentNum( 0), m_dHeigth( 0),
|
||||
m_dTipHeigth( 0), m_dRadius( 0), m_dRCorner( 0), m_dTipRadius( 0), m_dMrtChsWidth( 0), m_dMrtChsThickness( 0)
|
||||
: m_dLinTol( 2 * 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_dMrtChsWidth( 0), m_dMrtChsThickness( 0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -62,25 +62,25 @@ Tool::SetStdTool( const string& sToolName, double dH, double dR, double dCornR,
|
||||
// utensile cilindrico
|
||||
if ( dCornR < EPS_SMALL) {
|
||||
m_nType = CYLMILL ;
|
||||
m_dHeigth = dH ;
|
||||
m_dHeight = dH ;
|
||||
m_dRadius = dR ;
|
||||
m_dTipHeigth = 0 ;
|
||||
m_dTipHeight = 0 ;
|
||||
m_dTipRadius = m_dRadius ;
|
||||
m_dRCorner = 0 ;
|
||||
}
|
||||
// utensile naso di toro
|
||||
else if ( dCornR < dR - EPS_SMALL) {
|
||||
m_dHeigth = dH ;
|
||||
m_dHeight = dH ;
|
||||
m_dRadius = dR ;
|
||||
m_dTipHeigth = dCornR ;
|
||||
m_dTipHeight = dCornR ;
|
||||
m_dTipRadius = dR - dCornR ;
|
||||
m_dRCorner = dCornR ;
|
||||
// come profilo
|
||||
Point3d pt0( 0, 0, 0) ;
|
||||
Point3d pt1( m_dRadius, 0, 0) ;
|
||||
Point3d pt2( m_dRadius, - m_dHeigth + m_dTipHeigth, 0) ;
|
||||
Point3d pt3( m_dTipRadius, - m_dHeigth, 0) ;
|
||||
Point3d pt4( 0, - m_dHeigth, 0) ;
|
||||
Point3d pt2( m_dRadius, - m_dHeight + m_dTipHeight, 0) ;
|
||||
Point3d pt3( m_dTipRadius, - m_dHeight, 0) ;
|
||||
Point3d pt4( 0, - m_dHeight, 0) ;
|
||||
m_Outline.Clear() ;
|
||||
CurveLine Line ;
|
||||
Line.Set( pt0, pt1) ;
|
||||
@@ -93,9 +93,9 @@ Tool::SetStdTool( const string& sToolName, double dH, double dR, double dCornR,
|
||||
// utensile sferico
|
||||
else if ( dCornR < dR + EPS_SMALL) {
|
||||
m_nType = BALLMILL ;
|
||||
m_dHeigth = dH ;
|
||||
m_dHeight = dH ;
|
||||
m_dRadius = dR ;
|
||||
m_dTipHeigth = m_dRadius ;
|
||||
m_dTipHeight = m_dRadius ;
|
||||
m_dTipRadius = 0 ;
|
||||
m_dRCorner = m_dRadius ;
|
||||
}
|
||||
@@ -125,9 +125,9 @@ Tool::SetAdvTool( const string& sToolName, double dH, double dR,
|
||||
return SetStdTool( sToolName, dH, dR, dCornR, nToolNum) ;
|
||||
|
||||
// Caso avanzato
|
||||
m_dHeigth = dH ;
|
||||
m_dHeight = dH ;
|
||||
m_dRadius = dR ;
|
||||
m_dTipHeigth = dTipH ;
|
||||
m_dTipHeight = dTipH ;
|
||||
m_dTipRadius = max( dTipR, 0.) ;
|
||||
|
||||
// Se raggio corner nullo, allora utensile conico
|
||||
@@ -144,7 +144,7 @@ Tool::SetAdvTool( const string& sToolName, double dH, double dR,
|
||||
// Definisco il profilo
|
||||
Point3d pt0( 0, 0, 0) ;
|
||||
Point3d pt1( m_dRadius, 0, 0) ;
|
||||
Point3d pt2( m_dRadius, - m_dHeigth + m_dTipHeigth, 0) ;
|
||||
Point3d pt2( m_dRadius, - m_dHeight + m_dTipHeight, 0) ;
|
||||
|
||||
if ( m_dTipRadius < m_dRadius) {
|
||||
|
||||
@@ -296,11 +296,14 @@ Tool::SetGenTool( const string& sToolName, const ICurveComposite* pToolOutline,
|
||||
|
||||
m_nType = GEN ;
|
||||
|
||||
// Dimensioni dell'utensile
|
||||
// Il profilo dell'utensile deve stare nel 4° quadrante del piano XY
|
||||
BBox3d Bounding ;
|
||||
m_Outline.GetLocalBBox( Bounding) ;
|
||||
double m_dHeight = Bounding.GetMax().y - Bounding.GetMin().y ;
|
||||
double m_dRadius = Bounding.GetMax().x - Bounding.GetMin().x ;
|
||||
m_Outline.GetLocalBBox( Bounding) ;
|
||||
if ( Bounding.GetMin().x < - 10 * EPS_SMALL || Bounding.GetMax().y > 10 * EPS_SMALL)
|
||||
return false ;
|
||||
// Assegno le dimensioni dell'utensile
|
||||
m_dHeight = - Bounding.GetMin().y ;
|
||||
m_dRadius = Bounding.GetMax().x ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
@@ -319,7 +322,7 @@ Tool::SetMortiserTool( const std::string& sToolName, double dH, double dW, doubl
|
||||
dTh < EPS_SMALL || dRc < 0 || dW - 2 * dRc < 0)
|
||||
return false ;
|
||||
|
||||
m_dHeigth = dH ;
|
||||
m_dHeight = dH ;
|
||||
m_dRCorner = dRc ;
|
||||
m_dMrtChsWidth = dW ;
|
||||
m_dMrtChsThickness = dTh ;
|
||||
@@ -344,7 +347,7 @@ Tool::SetChiselTool( const string& sToolName, double dH, double dW, double dTh,
|
||||
if ( dH < EPS_SMALL || dW < EPS_SMALL || dTh < 0)
|
||||
return false ;
|
||||
|
||||
m_dHeigth = dH ;
|
||||
m_dHeight = dH ;
|
||||
m_dMrtChsWidth = dW ;
|
||||
m_dMrtChsThickness = dTh ;
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ class Tool
|
||||
int GetCurrentToolNum() const
|
||||
{ return m_nCurrentNum ; }
|
||||
double GetHeigth() const
|
||||
{ return m_dHeigth ; }
|
||||
{ return m_dHeight ; }
|
||||
double GetTipHeigth() const
|
||||
{ return m_dTipHeigth ; }
|
||||
{ return m_dTipHeight ; }
|
||||
double GetRadius() const
|
||||
{ return m_dRadius ; }
|
||||
double GetTipRadius() const
|
||||
@@ -76,8 +76,8 @@ class Tool
|
||||
int m_nCurrentNum ;
|
||||
CurveComposite m_Outline ;
|
||||
CurveComposite m_ArcLineApprox ;
|
||||
double m_dHeigth ;
|
||||
double m_dTipHeigth ;
|
||||
double m_dHeight ;
|
||||
double m_dTipHeight ;
|
||||
double m_dRadius ;
|
||||
double m_dRCorner ;
|
||||
double m_dTipRadius ;
|
||||
|
||||
@@ -37,7 +37,7 @@ struct TriaStruct {
|
||||
// Vettore di TriaStruct con sharp fature interni a un blocco
|
||||
typedef std::vector<TriaStruct> TriHolder ;
|
||||
|
||||
// Vettori di TriHolder con sharp feature di frontiera:
|
||||
// Vettore di TriHolder con sharp feature di frontiera:
|
||||
// il primo indice individua il blocco, il secondo il voxel
|
||||
typedef std::vector<TriHolder> TriaMatrix ;
|
||||
|
||||
@@ -137,6 +137,8 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
struct HeigthAndColor {
|
||||
int nTool ;
|
||||
double dHeigth ;
|
||||
HeigthAndColor( void) : nTool( 0), dHeigth( 0) {}
|
||||
HeigthAndColor( int nT, double dH) : nTool( nT), dHeigth( dH) {}
|
||||
} ;
|
||||
typedef std::unordered_map <int, HeigthAndColor> VoxelContainer ;
|
||||
// Struttura voxel
|
||||
@@ -157,7 +159,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW
|
||||
bool ProcessCell( int nGrid, int nCellI, int nCellJ, const Plane3d& plPlane, std::vector<CurveLine>& vLine) const ;
|
||||
bool ExtMarchingCubes( int nBlock, TRIA3DEXLIST& lstTria, TriHolder& triHold) const ;
|
||||
bool ExtMarchingCubes( std::vector<Voxel>& vVox, TRIA3DEXLIST& lstTria, bool bEnh) const ;
|
||||
bool FlipEdgesII( TriHolder& TriHold, bool bGraph) const ;
|
||||
bool FlipEdgesII( TriHolder& TriHold) const ;
|
||||
bool FlipEdgesBB( TriaMatrix& InterTria) const ;
|
||||
bool IsThereMat( int nI, int nJ, int nK) const ;
|
||||
bool InOut( const Plane3d& plPlane, int nGrid, int nI, int nJ) const ;
|
||||
|
||||
+304
-438
File diff suppressed because it is too large
Load Diff
+202
-326
@@ -15,6 +15,7 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "CurveLine.h"
|
||||
#include "CurveArc.h"
|
||||
#include "VolZmap.h"
|
||||
#include "GeoConst.h"
|
||||
#include "IntersLineSurfTm.h"
|
||||
@@ -669,6 +670,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
// Fresatura con vettore movimento perpendicolare all'utensile
|
||||
else if ( abs( vtMove.z) < EPS_SMALL) {
|
||||
switch ( m_Tool.GetType()) {
|
||||
@@ -690,6 +692,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
|
||||
break ;
|
||||
}
|
||||
}
|
||||
|
||||
// Fresatura con vettore movimento generico rispetto all'utensile
|
||||
else {
|
||||
switch ( m_Tool.GetType()) {
|
||||
@@ -705,6 +708,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Versore utensile nel piano
|
||||
else if ( abs( vtLs[i].z) < EPS_SMALL) {
|
||||
|
||||
@@ -825,6 +829,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else ;
|
||||
// Altri casi al momento non gestiti
|
||||
// return false ;
|
||||
@@ -1764,105 +1769,84 @@ VolZmap::Chs_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GenTool_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
VolZmap::GenTool_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Posizioni iniziale e finale dell'utensile
|
||||
// Posizioni iniziale e finale dell'utensile
|
||||
Point3d ptI = ptS ;
|
||||
Point3d ptF = ptE ;
|
||||
|
||||
// vettore movimento
|
||||
// Vettore movimento
|
||||
Vector3d vtMove = ptE - ptS ;
|
||||
|
||||
// Settaggio profilo
|
||||
const CurveComposite* pToolProfile = m_Tool.GetOutline() ;
|
||||
|
||||
// Ciclo sulle curve
|
||||
const CurveComposite* pToolProfile = m_Tool.GetOutline() ;
|
||||
const ICurve* pCurve = pToolProfile->GetFirstCurve() ;
|
||||
while ( pCurve != nullptr) {
|
||||
|
||||
|
||||
double dHeight ;
|
||||
int nCurveType = pCurve -> GetType() ;
|
||||
|
||||
// Caso segmento
|
||||
if ( nCurveType == CRV_LINE) {
|
||||
|
||||
Point3d ptStart, ptEnd ;
|
||||
|
||||
pCurve -> GetStartPoint( ptStart) ;
|
||||
pCurve -> GetEndPoint( ptEnd) ;
|
||||
|
||||
if ( abs( ptStart.y - ptEnd.y) > EPS_SMALL) {
|
||||
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
|
||||
// Il componente è un cilindro
|
||||
// Se segmento
|
||||
if ( pCurve->GetType() == CRV_LINE) {
|
||||
// Recupero gli estremi
|
||||
const ICurveLine* pLine = GetCurveLine( pCurve) ;
|
||||
Point3d ptStart = pLine->GetStart() ;
|
||||
Point3d ptEnd = pLine->GetEnd() ;
|
||||
// Ne determino l'altezza
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
if ( dHeight > EPS_SMALL) {
|
||||
// Se X costante, è un cilindro
|
||||
if ( abs( ptStart.x - ptEnd.x) < EPS_SMALL) {
|
||||
double dRadius = ptStart.x ;
|
||||
CompCyl_ZDrilling( nGrid, ptI, ptF, vtToolDir, dHeight, dRadius) ;
|
||||
}
|
||||
|
||||
// Il componente è un cono con vettore equiverso a quello dell'utensile
|
||||
// Se X crescente, è un cono con vettore equiverso a quello dell'utensile
|
||||
else if ( ptStart.x > ptEnd.x) {
|
||||
double dMaxRad = ptStart.x ;
|
||||
double dMinRad = ptEnd.x ;
|
||||
CompConus_ZDrilling( nGrid, ptI, ptF, vtToolDir, dHeight, dMaxRad, dMinRad) ;
|
||||
}
|
||||
|
||||
// Il componente è un cono con vettore opposto a quello dell'utesile
|
||||
// Se X decrescente, è un cono con vettore opposto a quello dell'utensile
|
||||
else if ( ptStart.x < ptEnd.x) {
|
||||
double dMaxRad = ptEnd.x ;
|
||||
double dMinRad = ptStart.x ;
|
||||
Point3d ptIn = ptI - vtToolDir * dHeight ;
|
||||
Point3d ptFn = ptIn + vtMove ;
|
||||
CompConus_ZDrilling( nGrid, ptIn, ptFn, - vtToolDir, dHeight, dMaxRad, dMinRad) ;
|
||||
}
|
||||
CompConus_ZDrilling( nGrid, ptIn, ptFn, - vtToolDir, dHeight, dMaxRad, dMinRad) ;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
dHeight = 0 ;
|
||||
}
|
||||
|
||||
// Caso arco
|
||||
else if ( nCurveType == CRV_ARC) {
|
||||
|
||||
// Centro e Punti iniziale e finale del cerchio
|
||||
Point3d ptStart, ptEnd, ptO ;
|
||||
|
||||
pCurve -> GetStartPoint( ptStart) ;
|
||||
pCurve -> GetEndPoint( ptEnd) ;
|
||||
pCurve -> GetCenterPoint( ptO) ;
|
||||
|
||||
// Determino il raggio
|
||||
Vector3d vtStRad = ptStart - ptO ;
|
||||
Vector3d vtEnRad = ptEnd - ptO ;
|
||||
|
||||
double dRadius = 0.5 * ( vtStRad.LenXY() + vtEnRad.LenXY()) ;
|
||||
|
||||
// Determino le posizioni iniziale e finale del centrodella sfera
|
||||
Point3d ptOSt = ptI - vtToolDir * ( ptStart.y - ptO.y) ;
|
||||
Point3d ptOEn = ptOSt + vtMove ;
|
||||
|
||||
// Eseguo l'asportazione del materiale
|
||||
CompBall_Milling( nGrid, ptOSt, ptOEn, dRadius) ;
|
||||
|
||||
|
||||
// se altrimenti arco
|
||||
else if ( pCurve->GetType() == CRV_ARC) {
|
||||
// Recupero estremi, centro e raggio
|
||||
const ICurveArc* pArc = GetCurveArc( pCurve) ;
|
||||
Point3d ptStart ; pArc->GetStartPoint( ptStart) ;
|
||||
Point3d ptEnd ; pArc->GetEndPoint( ptEnd) ;
|
||||
Point3d ptCen = pArc->GetCenter() ;
|
||||
double dRadius = pArc->GetRadius() ;
|
||||
// Determino le posizioni iniziale e finale del centro della sfera
|
||||
Point3d ptCenS = ptI - vtToolDir * ( ptStart.y - ptCen.y) ;
|
||||
Point3d ptCenE = ptCenS + vtMove ;
|
||||
// Eseguo l'asportazione del materiale
|
||||
CompBall_Milling( nGrid, ptCenS, ptCenE, dRadius) ;
|
||||
// aggiorno l'altezza
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
}
|
||||
}
|
||||
|
||||
// Determino le posizioni iniziale e finale del componente successivo
|
||||
ptI = ptI - vtToolDir * dHeight ;
|
||||
ptF = ptI + vtMove ;
|
||||
|
||||
// Aggiorno il puntatore
|
||||
// Passo alla curva successiva del profilo
|
||||
pCurve = pToolProfile->GetNextCurve() ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GenTool_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
VolZmap::GenTool_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Posizioni iniziale e finale dell'utensile
|
||||
Point3d ptI = ptS ;
|
||||
@@ -1871,43 +1855,34 @@ VolZmap::GenTool_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
|
||||
// vettore movimento
|
||||
Vector3d vtMove = ptE - ptS ;
|
||||
|
||||
// Settaggio profilo
|
||||
// Ciclo sulle curve del profilo utensile
|
||||
const CurveComposite* pToolProfile = m_Tool.GetOutline() ;
|
||||
|
||||
// Ciclo sulle curve
|
||||
const ICurve* pCurve = pToolProfile->GetFirstCurve() ;
|
||||
while ( pCurve != nullptr) {
|
||||
|
||||
double dHeight ;
|
||||
|
||||
int nCurveType = pCurve -> GetType() ;
|
||||
|
||||
// Caso segmento
|
||||
if ( nCurveType == CRV_LINE) {
|
||||
|
||||
Point3d ptStart, ptEnd ;
|
||||
|
||||
pCurve -> GetStartPoint( ptStart) ;
|
||||
pCurve -> GetEndPoint( ptEnd) ;
|
||||
|
||||
if ( abs( ptStart.y - ptEnd.y) > EPS_SMALL) {
|
||||
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
|
||||
// Il componente è un cilindro
|
||||
// Se segmento
|
||||
if ( pCurve->GetType() == CRV_LINE) {
|
||||
// Recupero gli estremi
|
||||
const ICurveLine* pLine = GetCurveLine( pCurve) ;
|
||||
Point3d ptStart = pLine->GetStart() ;
|
||||
Point3d ptEnd = pLine->GetEnd() ;
|
||||
// Ne determino l'altezza
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
if ( dHeight > EPS_SMALL) {
|
||||
// Se X costante, è un cilindro
|
||||
if ( abs( ptStart.x - ptEnd.x) < EPS_SMALL) {
|
||||
double dRadius = ptStart.x ;
|
||||
CompCyl_ZMilling( nGrid, ptI, ptF, vtToolDir, dHeight, dRadius) ;
|
||||
}
|
||||
|
||||
// Il componente è un cono con vettore equiverso a quello dell'utensile
|
||||
// Se X crescente, è un cono con vettore equiverso a quello dell'utensile
|
||||
else if ( ptStart.x > ptEnd.x) {
|
||||
double dMaxRad = ptStart.x ;
|
||||
double dMinRad = ptEnd.x ;
|
||||
CompConus_ZMilling( nGrid, ptI, ptF, vtToolDir, dHeight, dMaxRad, dMinRad) ;
|
||||
}
|
||||
|
||||
// Il componente è un cono con vettore opposto a quello dell'utensile
|
||||
// Se X decrescente, è un cono con vettore opposto a quello dell'utensile
|
||||
else if ( ptStart.x < ptEnd.x) {
|
||||
double dMaxRad = ptEnd.x ;
|
||||
double dMinRad = ptStart.x ;
|
||||
@@ -1916,34 +1891,21 @@ VolZmap::GenTool_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
|
||||
CompConus_ZMilling( nGrid, ptIn, ptFn, - vtToolDir, dHeight, dMaxRad, dMinRad) ;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
dHeight = 0 ;
|
||||
}
|
||||
|
||||
// Caso arco
|
||||
else if ( nCurveType == CRV_ARC) {
|
||||
|
||||
// Centro e Punti iniziale e finale del cerchio
|
||||
Point3d ptStart, ptEnd, ptO ;
|
||||
|
||||
pCurve -> GetStartPoint( ptStart) ;
|
||||
pCurve -> GetEndPoint( ptEnd) ;
|
||||
pCurve -> GetCenterPoint( ptO) ;
|
||||
|
||||
// Determino il raggio
|
||||
Vector3d vtStRad = ptStart - ptO ;
|
||||
Vector3d vtEnRad = ptEnd - ptO ;
|
||||
|
||||
double dRadius = 0.5 * ( vtStRad.LenXY() + vtEnRad.LenXY()) ;
|
||||
|
||||
// Determino le posizioni iniziale e finale del centrodella sfera
|
||||
Point3d ptOSt = ptI - vtToolDir * ( ptStart.y - ptO.y) ;
|
||||
Point3d ptOEn = ptOSt + vtMove ;
|
||||
|
||||
// se altrimenti arco
|
||||
else if ( pCurve->GetType() == CRV_ARC) {
|
||||
// Recupero estremi, centro e raggio
|
||||
const ICurveArc* pArc = GetCurveArc( pCurve) ;
|
||||
Point3d ptStart ; pArc->GetStartPoint( ptStart) ;
|
||||
Point3d ptEnd ; pArc->GetEndPoint( ptEnd) ;
|
||||
Point3d ptCen = pArc->GetCenter() ;
|
||||
double dRadius = pArc->GetRadius() ;
|
||||
// Determino le posizioni iniziale e finale del centro della sfera
|
||||
Point3d ptCenS = ptI - vtToolDir * ( ptStart.y - ptCen.y) ;
|
||||
Point3d ptCenE = ptCenS + vtMove ;
|
||||
// Eseguo l'asportazione del materiale
|
||||
CompBall_Milling( nGrid, ptOSt, ptOEn, dRadius) ;
|
||||
|
||||
CompBall_Milling( nGrid, ptCenS, ptCenE, dRadius) ;
|
||||
// aggiorno l'altezza
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
}
|
||||
@@ -1952,9 +1914,10 @@ VolZmap::GenTool_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
|
||||
ptI = ptI - vtToolDir * dHeight ;
|
||||
ptF = ptI + vtMove ;
|
||||
|
||||
// Aggiorno il puntatore
|
||||
// Passo alla curva successiva del profilo
|
||||
pCurve = pToolProfile->GetNextCurve() ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -3029,95 +2992,61 @@ VolZmap::Chs_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GenTool_Drilling( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
VolZmap::GenTool_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Descrizione geometrica del moto
|
||||
Point3d ptI = ptS ;
|
||||
Point3d ptF = ptE ;
|
||||
Vector3d vtMove = ptE - ptS ;
|
||||
|
||||
// Settaggio profilo
|
||||
// Ciclo sulle curve del profilo
|
||||
const CurveComposite* pToolProfile = m_Tool.GetOutline() ;
|
||||
|
||||
// Ciclo sulle curve
|
||||
const ICurve* pPrevCurve = nullptr ;
|
||||
const ICurve* pCurve = pToolProfile->GetFirstCurve() ;
|
||||
const ICurve* pFirstConst = pCurve ;
|
||||
|
||||
while ( pCurve != nullptr) {
|
||||
|
||||
double dHeight ;
|
||||
|
||||
int nCurveType = pCurve -> GetType() ;
|
||||
|
||||
// Caso di segmento
|
||||
if ( nCurveType == CRV_LINE) {
|
||||
|
||||
Point3d ptStart, ptEnd ;
|
||||
|
||||
pCurve -> GetStartPoint( ptStart) ;
|
||||
pCurve -> GetEndPoint( ptEnd) ;
|
||||
|
||||
if ( abs( ptStart.y - ptEnd.y) > EPS_SMALL) {
|
||||
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
|
||||
bool bTapB, bTapT ;
|
||||
|
||||
pCurve = pToolProfile -> GetPrevCurve() ;
|
||||
|
||||
// Dettagli curva precedente
|
||||
int nPrevType = pCurve -> GetType() ;
|
||||
Point3d ptPrevFirst, ptPrevLast ;
|
||||
pCurve -> GetStartPoint( ptPrevFirst) ;
|
||||
pCurve -> GetEndPoint( ptPrevLast) ;
|
||||
|
||||
double dAbsDYPr = abs( ptPrevFirst.y - ptPrevLast.y) ;
|
||||
double dDeltaXPr = ptPrevFirst.x - ptPrevLast.x ;
|
||||
|
||||
// Setto le variabili per il tappo superiore
|
||||
if ( pCurve == pFirstConst ||
|
||||
nPrevType == CRV_ARC ||
|
||||
( dDeltaXPr < 0 && dAbsDYPr))
|
||||
bTapB = false ;
|
||||
else
|
||||
bTapB = true ;
|
||||
|
||||
// Dettagli curva successiva
|
||||
|
||||
pCurve = pToolProfile -> GetNextCurve() ;
|
||||
pCurve = pToolProfile -> GetNextCurve() ;
|
||||
|
||||
int nNextType = pCurve -> GetType() ;
|
||||
Point3d ptNextFirst ;
|
||||
Point3d ptNextLast ;
|
||||
pCurve -> GetStartPoint( ptNextFirst) ;
|
||||
pCurve -> GetEndPoint( ptNextLast) ;
|
||||
|
||||
double dAbsDYNx = abs( ptNextFirst.y - ptNextLast.y) ;
|
||||
double dDeltaXNx = ptNextFirst.x - ptNextLast.x ;
|
||||
double dAbsXEnd = abs( ptNextLast.x) ;
|
||||
|
||||
if ( pCurve == nullptr ||
|
||||
nNextType == CRV_ARC ||
|
||||
( dAbsDYNx < EPS_SMALL && ( dDeltaXNx > 0 || dAbsXEnd < EPS_SMALL)))
|
||||
bTapT = false ;
|
||||
else
|
||||
bTapT = true ;
|
||||
|
||||
// Il componente è un cilindro
|
||||
// Se segmento
|
||||
if ( pCurve->GetType() == CRV_LINE) {
|
||||
// Recupero gli estremi
|
||||
const ICurveLine* pLine = GetCurveLine( pCurve) ;
|
||||
Point3d ptStart = pLine->GetStart() ;
|
||||
Point3d ptEnd = pLine->GetEnd() ;
|
||||
// Ne determino l'altezza
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
if ( dHeight > EPS_SMALL) {
|
||||
// Verifiche curva precedente per eventuale tappo sopra
|
||||
bool bTapT = false ;
|
||||
if ( pPrevCurve != nullptr && pPrevCurve->GetType() == CRV_LINE) {
|
||||
const ICurveLine* pOthLine = GetCurveLine( pPrevCurve) ;
|
||||
Point3d ptOthStart = pOthLine->GetStart() ;
|
||||
Point3d ptOthEnd = pOthLine->GetEnd() ;
|
||||
if ( abs( ptOthStart.y - ptOthEnd.y) < EPS_SMALL && ptOthStart.x < ptOthEnd.x)
|
||||
bTapT = true ;
|
||||
}
|
||||
// Verifiche curva successiva per eventuale tappo sotto
|
||||
bool bTapB = false ;
|
||||
const ICurve* pNextCurve = pToolProfile->GetNextCurve() ;
|
||||
if ( pNextCurve != nullptr && pNextCurve->GetType() == CRV_LINE) {
|
||||
const ICurveLine* pOthLine = GetCurveLine( pNextCurve) ;
|
||||
Point3d ptOthStart = pOthLine->GetStart() ;
|
||||
Point3d ptOthEnd = pOthLine->GetEnd() ;
|
||||
if ( abs( ptOthStart.y - ptOthEnd.y) < EPS_SMALL && ptOthStart.x > ptOthEnd.x)
|
||||
bTapB = true ;
|
||||
}
|
||||
// Se X costante, è un cilindro
|
||||
if ( abs( ptStart.x - ptEnd.x) < EPS_SMALL) {
|
||||
double dRadius = ptStart.x ;
|
||||
CompCyl_Drilling( nGrid, ptI, ptF, vtToolDir, dHeight, dRadius, bTapB, bTapT) ;
|
||||
}
|
||||
|
||||
// Il componente è un cono con vettore equiverso a quello dell'utensile
|
||||
// Se X crescente, è un cono con vettore equiverso a quello dell'utensile
|
||||
else if ( ptStart.x > ptEnd.x) {
|
||||
double dMaxRad = ptStart.x ;
|
||||
double dMinRad = ptEnd.x ;
|
||||
CompConus_Drilling( nGrid, ptI, ptF, vtToolDir, dHeight, dMaxRad, dMinRad, bTapB, bTapT) ;
|
||||
}
|
||||
|
||||
// Il componente è un cono con vettore opposto a quello dell'utensile
|
||||
// Se X decrescente, è un cono con vettore opposto a quello dell'utensile
|
||||
else if ( ptStart.x < ptEnd.x) {
|
||||
double dMaxRad = ptEnd.x ;
|
||||
double dMinRad = ptStart.x ;
|
||||
@@ -3125,49 +3054,40 @@ VolZmap::GenTool_Drilling( unsigned int nGrid, const Point3d & ptS, const Point3
|
||||
Point3d ptFn = ptIn + vtMove ;
|
||||
CompConus_Drilling( nGrid, ptIn, ptFn, - vtToolDir, dHeight, dMaxRad, dMinRad, bTapT, bTapB) ;
|
||||
}
|
||||
// Passo alla curva successiva
|
||||
pPrevCurve = pCurve ;
|
||||
pCurve = pNextCurve ;
|
||||
}
|
||||
|
||||
else {
|
||||
dHeight = 0 ;
|
||||
pCurve = pToolProfile -> GetNextCurve() ;
|
||||
// Passo alla curva successiva
|
||||
pPrevCurve = pCurve ;
|
||||
pCurve = pToolProfile->GetNextCurve() ;
|
||||
}
|
||||
}
|
||||
|
||||
// Caso arco
|
||||
else if ( nCurveType == CRV_ARC) {
|
||||
|
||||
// Centro e Punti iniziale e finale del cerchio
|
||||
Point3d ptStart, ptEnd, ptO ;
|
||||
|
||||
pCurve -> GetStartPoint( ptStart) ;
|
||||
pCurve -> GetEndPoint( ptEnd) ;
|
||||
pCurve -> GetCenterPoint( ptO) ;
|
||||
|
||||
// Determino il raggio
|
||||
Vector3d vtStRad = ptStart - ptO ;
|
||||
Vector3d vtEnRad = ptEnd - ptO ;
|
||||
|
||||
double dRadius = 0.5 * ( vtStRad.LenXY() + vtEnRad.LenXY()) ;
|
||||
|
||||
// Se arco
|
||||
else if ( pCurve->GetType() == CRV_ARC) {
|
||||
// Recupero estremi, centro e raggio
|
||||
const ICurveArc* pArc = GetCurveArc( pCurve) ;
|
||||
Point3d ptStart ; pArc->GetStartPoint( ptStart) ;
|
||||
Point3d ptEnd ; pArc->GetEndPoint( ptEnd) ;
|
||||
Point3d ptCen = pArc->GetCenter() ;
|
||||
double dRadius = pArc->GetRadius() ;
|
||||
// Determino le posizioni iniziale e finale del centro della sfera
|
||||
Point3d ptOSt = ptI - vtToolDir * ( ptStart.y - ptO.y) ;
|
||||
Point3d ptOEn = ptOSt + vtMove ;
|
||||
|
||||
Point3d ptCenS = ptI - vtToolDir * ( ptStart.y - ptCen.y) ;
|
||||
Point3d ptCenE = ptCenS + vtMove ;
|
||||
// Eseguo l'asportazione del materiale
|
||||
CompBall_Milling( nGrid, ptOSt, ptOEn, dRadius) ;
|
||||
|
||||
CompBall_Milling( nGrid, ptCenS, ptCenE, dRadius) ;
|
||||
// aggiorno l'altezza
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
|
||||
pCurve = pToolProfile -> GetNextCurve() ;
|
||||
// Passo alla curva successiva
|
||||
pPrevCurve = pCurve ;
|
||||
pCurve = pToolProfile->GetNextCurve() ;
|
||||
}
|
||||
|
||||
// Determino le posizioni iniziale e finale del componente successivo
|
||||
ptI = ptI - vtToolDir * dHeight ;
|
||||
ptF = ptI + vtMove ;
|
||||
|
||||
// Aggiorno il puntatore
|
||||
// pCurve = pToolProfile->GetNextCurve() ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
@@ -3175,137 +3095,97 @@ VolZmap::GenTool_Drilling( unsigned int nGrid, const Point3d & ptS, const Point3
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
VolZmap::GenTool_Milling( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
|
||||
VolZmap::GenTool_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
|
||||
{
|
||||
// Descrizione geometrica del moto
|
||||
Point3d ptI = ptS ;
|
||||
Point3d ptF = ptE ;
|
||||
Vector3d vtMove = ptE - ptS ;
|
||||
|
||||
// Settaggio profilo
|
||||
|
||||
// Ciclo sulle curve del profilo
|
||||
const CurveComposite* pToolProfile = m_Tool.GetOutline() ;
|
||||
|
||||
// Ciclo sulle curve
|
||||
const ICurve* pPrevCurve = nullptr ;
|
||||
const ICurve* pCurve = pToolProfile->GetFirstCurve() ;
|
||||
const ICurve* pFirstConst = pCurve ;
|
||||
|
||||
while ( pCurve != nullptr) {
|
||||
|
||||
double dHeight ;
|
||||
|
||||
int nCurveType = pCurve -> GetType() ;
|
||||
|
||||
// Caso di segmento
|
||||
if ( nCurveType == CRV_LINE) {
|
||||
|
||||
Point3d ptStart, ptEnd ;
|
||||
|
||||
pCurve -> GetStartPoint( ptStart) ;
|
||||
pCurve -> GetEndPoint( ptEnd) ;
|
||||
|
||||
if ( abs( ptStart.y - ptEnd.y) > EPS_SMALL) {
|
||||
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
|
||||
bool bTapB, bTapT ;
|
||||
|
||||
pCurve = pToolProfile -> GetPrevCurve() ;
|
||||
|
||||
// Dettagli curva precedente
|
||||
int nPrevType = pCurve -> GetType() ;
|
||||
Point3d ptPrevFirst, ptPrevLast ;
|
||||
pCurve -> GetStartPoint( ptPrevFirst) ;
|
||||
pCurve -> GetEndPoint( ptPrevLast) ;
|
||||
|
||||
double dAbsDYPr = abs( ptPrevFirst.y - ptPrevLast.y) ;
|
||||
double dDeltaXPr = ptPrevFirst.x - ptPrevLast.x ;
|
||||
|
||||
// Setto le variabili per il tappo superiore
|
||||
if ( pCurve == pFirstConst ||
|
||||
nPrevType == CRV_ARC ||
|
||||
( dDeltaXPr < 0 && dAbsDYPr))
|
||||
bTapB = false ;
|
||||
else
|
||||
bTapB = true ;
|
||||
|
||||
// Dettagli curva successiva
|
||||
pCurve = pToolProfile -> GetNextCurve() ;
|
||||
pCurve = pToolProfile -> GetNextCurve() ;
|
||||
|
||||
int nNextType = pCurve -> GetType() ;
|
||||
Point3d ptNextFirst ;
|
||||
Point3d ptNextLast ;
|
||||
pCurve -> GetStartPoint( ptNextFirst) ;
|
||||
pCurve -> GetEndPoint( ptNextLast) ;
|
||||
|
||||
double dAbsDYNx = abs( ptNextFirst.y - ptNextLast.y) ;
|
||||
double dDeltaXNx = ptNextFirst.x - ptNextLast.x ;
|
||||
double dAbsXEnd = abs( ptNextLast.x) ;
|
||||
|
||||
if ( pCurve == nullptr ||
|
||||
nNextType == CRV_ARC ||
|
||||
( dAbsDYNx < EPS_SMALL && ( dDeltaXNx > 0 || dAbsXEnd < EPS_SMALL)))
|
||||
|
||||
bTapT = false ;
|
||||
else
|
||||
bTapT = true ;
|
||||
|
||||
// Il componente è un cilindro
|
||||
// Se segmento
|
||||
if ( pCurve->GetType() == CRV_LINE) {
|
||||
// Recupero gli estremi
|
||||
const ICurveLine* pLine = GetCurveLine( pCurve) ;
|
||||
Point3d ptStart = pLine->GetStart() ;
|
||||
Point3d ptEnd = pLine->GetEnd() ;
|
||||
// Ne determino l'altezza
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
if ( dHeight > EPS_SMALL) {
|
||||
// verifiche curva precedente per eventuale tappo sopra
|
||||
bool bTapT = false ;
|
||||
if ( pPrevCurve != nullptr && pPrevCurve->GetType() == CRV_LINE) {
|
||||
const ICurveLine* pOthLine = GetCurveLine( pPrevCurve) ;
|
||||
Point3d ptOthStart = pOthLine->GetStart() ;
|
||||
Point3d ptOthEnd = pOthLine->GetEnd() ;
|
||||
if ( abs( ptOthStart.y - ptOthEnd.y) < EPS_SMALL && ptOthStart.x < ptOthEnd.x)
|
||||
bTapT = true ;
|
||||
}
|
||||
// verifiche curva successiva per eventuale tappo sotto
|
||||
bool bTapB = false ;
|
||||
const ICurve* pNextCurve = pToolProfile->GetNextCurve() ;
|
||||
if ( pNextCurve != nullptr && pNextCurve->GetType() == CRV_LINE) {
|
||||
const ICurveLine* pOthLine = GetCurveLine( pNextCurve) ;
|
||||
Point3d ptOthStart = pOthLine->GetStart() ;
|
||||
Point3d ptOthEnd = pOthLine->GetEnd() ;
|
||||
if ( abs( ptOthStart.y - ptOthEnd.y) < EPS_SMALL && ptOthStart.x > ptOthEnd.x)
|
||||
bTapB = true ;
|
||||
}
|
||||
// Se X costante, è un cilindro
|
||||
if ( abs( ptStart.x - ptEnd.x) < EPS_SMALL) {
|
||||
double dRadius = ptStart.x ;
|
||||
CompCyl_Milling( nGrid, ptI, ptF, vtToolDir, dHeight, dRadius, bTapB, bTapT) ;
|
||||
}
|
||||
|
||||
// Il componente è un cono con vettore equiverso a quello dell'utensile
|
||||
// Se X crescente, è un cono con vettore equiverso a quello dell'utensile
|
||||
else if ( ptStart.x > ptEnd.x) {
|
||||
double dMaxRad = ptStart.x ;
|
||||
double dMinRad = ptEnd.x ;
|
||||
CompConus_Milling( nGrid, ptI, ptF, vtToolDir, dHeight, dMaxRad, dMinRad, bTapB, bTapT) ;
|
||||
}
|
||||
|
||||
// Il componente è un cono con vettore opposto a quello dell'utensile
|
||||
// Se X decrescente, è un cono con vettore opposto a quello dell'utensile
|
||||
else if ( ptStart.x < ptEnd.x) {
|
||||
double dMaxRad = ptEnd.x ;
|
||||
double dMinRad = ptStart.x ;
|
||||
Point3d ptIn = ptI - vtToolDir * dHeight ;
|
||||
Point3d ptFn = ptIn + vtMove ;
|
||||
CompConus_Milling( nGrid, ptIn, ptFn, - vtToolDir, dHeight, dMaxRad, dMinRad, bTapT, bTapB) ;
|
||||
}
|
||||
}
|
||||
// Passo alla curva successiva
|
||||
pPrevCurve = pCurve ;
|
||||
pCurve = pNextCurve ;
|
||||
}
|
||||
|
||||
else {
|
||||
dHeight = 0 ;
|
||||
pCurve = pToolProfile -> GetNextCurve() ;
|
||||
// Passo alla curva successiva
|
||||
pPrevCurve = pCurve ;
|
||||
pCurve = pToolProfile->GetNextCurve() ;
|
||||
}
|
||||
}
|
||||
|
||||
// Caso arco
|
||||
else if ( nCurveType == CRV_ARC) {
|
||||
|
||||
// Centro e Punti iniziale e finale del cerchio
|
||||
Point3d ptStart, ptEnd, ptO ;
|
||||
|
||||
pCurve -> GetStartPoint( ptStart) ;
|
||||
pCurve -> GetEndPoint( ptEnd) ;
|
||||
pCurve -> GetCenterPoint( ptO) ;
|
||||
|
||||
// Determino il raggio
|
||||
Vector3d vtStRad = ptStart - ptO ;
|
||||
Vector3d vtEnRad = ptEnd - ptO ;
|
||||
|
||||
double dRadius = 0.5 * ( vtStRad.LenXY() + vtEnRad.LenXY()) ;
|
||||
|
||||
// Se arco
|
||||
else if ( pCurve->GetType() == CRV_ARC) {
|
||||
// Recupero estremi, centro e raggio
|
||||
const ICurveArc* pArc = GetCurveArc( pCurve) ;
|
||||
Point3d ptStart ; pArc->GetStartPoint( ptStart) ;
|
||||
Point3d ptEnd ; pArc->GetEndPoint( ptEnd) ;
|
||||
Point3d ptCen = pArc->GetCenter() ;
|
||||
double dRadius = pArc->GetRadius() ;
|
||||
// Determino le posizioni iniziale e finale del centro della sfera
|
||||
Point3d ptOSt = ptI - vtToolDir * ( ptStart.y - ptO.y) ;
|
||||
Point3d ptOEn = ptOSt + vtMove ;
|
||||
|
||||
Point3d ptCenS = ptI - vtToolDir * ( ptStart.y - ptCen.y) ;
|
||||
Point3d ptCenE = ptCenS + vtMove ;
|
||||
// Eseguo l'asportazione del materiale
|
||||
CompBall_Milling( nGrid, ptOSt, ptOEn, dRadius) ;
|
||||
|
||||
CompBall_Milling( nGrid, ptCenS, ptCenE, dRadius) ;
|
||||
// aggiorno l'altezza
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
|
||||
pCurve = pToolProfile -> GetNextCurve() ;
|
||||
// Passo alla curva successiva
|
||||
pPrevCurve = pCurve ;
|
||||
pCurve = pToolProfile->GetNextCurve() ;
|
||||
}
|
||||
|
||||
// Determino le posizioni iniziale e finale del componente successivo
|
||||
@@ -3325,18 +3205,15 @@ VolZmap::CompCyl_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point
|
||||
{
|
||||
// Verifica sull'interferenza con lo Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
bool bTest = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ,
|
||||
dRad, dRad, dHei) ;
|
||||
|
||||
if ( ! bTest)
|
||||
bool bInterf = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ, dRad, dRad, dHei) ;
|
||||
if ( ! bInterf)
|
||||
return true ;
|
||||
|
||||
// Proiezione dei punti sul piano
|
||||
Point3d ptSxy( ptS.x, ptS.y, 0) ;
|
||||
|
||||
// Parametri geometrici dell'utensile
|
||||
double dSqRad = dRad * dRad ;
|
||||
double dSafeSqRad = dSqRad - 2 * dRad * EPS_SMALL ;
|
||||
double dSafeSqRad = dRad * dRad - 2 * dRad * EPS_SMALL ;
|
||||
|
||||
// Punte del gambo
|
||||
Point3d ptTStemS = ptS - vtToolDir * dHei ;
|
||||
@@ -3350,15 +3227,17 @@ VolZmap::CompCyl_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point
|
||||
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
|
||||
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
|
||||
|
||||
double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ;
|
||||
double dX = ( i + 0.5) * m_dStep ;
|
||||
double dY = ( j + 0.5) * m_dStep ;
|
||||
|
||||
Point3d ptC( dX, dY, 0) ; Vector3d vtC = ptC - ptSxy ;
|
||||
Point3d ptC( dX, dY, 0) ;
|
||||
Vector3d vtC = ptC - ptSxy ;
|
||||
|
||||
double dSqLen = vtC.SqLen() ;
|
||||
|
||||
// Se il punto si trova dentro il cerchio taglio
|
||||
if ( dSqLen < dSafeSqRad)
|
||||
SubtractIntervals( nGrid, i, j, dMinStemZ, dMaxStemZ, Z_AX, - Z_AX) ;
|
||||
SubtractIntervals( nGrid, i, j, dMinStemZ, dMaxStemZ, Z_AX, -Z_AX) ;
|
||||
}
|
||||
}
|
||||
return true ;
|
||||
@@ -3370,9 +3249,8 @@ VolZmap::CompConus_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Poi
|
||||
{
|
||||
// Verifica sull'interferenza con lo Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
bool Control = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ, dMaxRad, dMinRad, dHei) ;
|
||||
|
||||
if ( ! Control)
|
||||
bool bInterf = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ, dMaxRad, dMinRad, dHei) ;
|
||||
if ( ! bInterf)
|
||||
return true ;
|
||||
|
||||
Point3d ptO( ptS.x, ptS.y, 0) ;
|
||||
@@ -3512,9 +3390,8 @@ VolZmap::CompCyl_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
|
||||
{
|
||||
// Verifica sull'interferenza con lo Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
bool bTest = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ, dRad, dRad, dHei) ;
|
||||
|
||||
if ( ! bTest)
|
||||
bool bInterf = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ, dRad, dRad, dHei) ;
|
||||
if ( ! bInterf)
|
||||
return true ;
|
||||
|
||||
// Parametri geometrici
|
||||
@@ -3642,9 +3519,8 @@ bool
|
||||
VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dMaxRad, double dMinRad)
|
||||
{
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
bool Control = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ, dMaxRad, dMinRad, dHei) ;
|
||||
|
||||
if ( ! Control)
|
||||
bool bInterf = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ, dMaxRad, dMinRad, dHei) ;
|
||||
if ( ! bInterf)
|
||||
return true ;
|
||||
|
||||
Point3d ptI = ( vtToolDir * ( ptE - ptS) > 0 ? ptS : ptE) ;
|
||||
@@ -4023,9 +3899,9 @@ VolZmap::CompCyl_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d
|
||||
double dHei, double dRad, bool bTapB, bool bTapT)
|
||||
{
|
||||
unsigned int nStartI, nEndI, nStartJ, nEndJ ;
|
||||
bool Control = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ,
|
||||
bool bInterf = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ,
|
||||
dRad, dRad, dHei) ;
|
||||
if ( ! Control)
|
||||
if ( ! bInterf)
|
||||
return true ;
|
||||
|
||||
// Studio delle simmetrie
|
||||
@@ -4092,9 +3968,9 @@ VolZmap::CompConus_Drilling( unsigned int nGrid, const Point3d & ptS, const Poin
|
||||
double dHei, double dMaxRad, double dMinRad, bool bTapB, bool bTapT)
|
||||
{
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
bool Control = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ,
|
||||
bool bInterf = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ,
|
||||
dMaxRad, dMinRad, dHei) ;
|
||||
if ( ! Control)
|
||||
if ( ! bInterf)
|
||||
return true ;
|
||||
|
||||
// Apertura del cono
|
||||
@@ -4251,9 +4127,9 @@ VolZmap::CompCyl_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d&
|
||||
{
|
||||
// Verifica sull'interferenza utensile Zmap
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
bool Control = BBoxComponent( nGrid, ptS, ptE, vtToolDir,
|
||||
bool bInterf = BBoxComponent( nGrid, ptS, ptE, vtToolDir,
|
||||
nStartI, nStartJ, nEndI, nEndJ, dRad, dRad, dHei) ;
|
||||
if ( ! Control)
|
||||
if ( ! bInterf)
|
||||
return true ;
|
||||
|
||||
// Studio delle simmetrie
|
||||
@@ -4404,9 +4280,9 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d & ptS, const Point
|
||||
double dHei, double dMaxRad, double dMinRad, bool bTapB, bool bTapT)
|
||||
{
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
bool Control = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ,
|
||||
bool bInterf = BBoxComponent( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ,
|
||||
dMaxRad, dMinRad, dHei) ;
|
||||
if ( ! Control)
|
||||
if ( ! bInterf)
|
||||
return true ;
|
||||
|
||||
// Geometria del cono
|
||||
@@ -4941,8 +4817,8 @@ bool
|
||||
VolZmap::CompBall_Milling( unsigned int nGrid, const Point3d & ptLs, const Point3d & ptLe, double dRad)
|
||||
{
|
||||
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
|
||||
bool Control = BBoxComponent( nGrid, ptLs, ptLe, V_NULL, nStartI, nStartJ, nEndI, nEndJ, dRad, 0, 0) ;
|
||||
if ( ! Control)
|
||||
bool bInterf = BBoxComponent( nGrid, ptLs, ptLe, V_NULL, nStartI, nStartJ, nEndI, nEndJ, dRad, 0, 0) ;
|
||||
if ( ! bInterf)
|
||||
return true ;
|
||||
|
||||
Vector3d vtV = ptLe - ptLs ;
|
||||
|
||||
Reference in New Issue
Block a user