EgtGeomKernel 2.1b1 :

- modifiche a Zmap per mantenimento liste triangoli.
This commit is contained in:
Dario Sassi
2019-02-11 11:55:33 +00:00
parent 48ae6e5da5
commit fca22fc56b
7 changed files with 1576 additions and 1412 deletions
+135 -137
View File
@@ -27,7 +27,7 @@ using namespace std ;
//----------------------------------------------------------------------------
bool
VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ,
VolZmap::SubtractIntervals( int nGrid, int nI, int nJ,
double dMin, double dMax, const Vector3d& vtNMin, const Vector3d& vtNMax)
{
// Controllo che dMin e dMax non siano quasi coincidenti
@@ -66,7 +66,7 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ
}
// Recupero dexel da modificare
unsigned int nPos = nJ * m_nNx[nGrid] + nI ;
int nPos = nJ * m_nNx[nGrid] + nI ;
vector<Data>& vDexel = m_Values[nGrid][nPos] ;
// Ciclo sugli intervalli del dexel (ordinati in senso crescente)
@@ -237,7 +237,7 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ
//----------------------------------------------------------------------------
bool
VolZmap::AddIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ,
VolZmap::AddIntervals( int nGrid, int nI, int nJ,
double dMin, double dMax, const Vector3d& vtNMin, const Vector3d& vtNMax)
{
// // Controllo che dMin e dMax non siano quasi coincidenti
@@ -550,7 +550,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
}
// Ciclo sulle mappe
for ( unsigned int i = 0 ; i < m_nMapNum ; ++ i) {
for ( int i = 0 ; i < m_nMapNum ; ++ i) {
// Direzione utensile costante: pura traslazione
if ( AreSameVectorApprox( vtLs[i], vtLe[i])) {
@@ -761,10 +761,10 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
// ---------- Cilindro e sfera -----------------------------------------------
//----------------------------------------------------------------------------
bool
VolZmap::CylBall_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
VolZmap::CylBall_ZDrilling( int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
{
// Verifica sull'interferenza utensile Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -783,8 +783,8 @@ VolZmap::CylBall_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point
double dMinStemZ = min( min( ptS.z, ptTStemS.z), min( ptE.z, ptTStemE.z)) ;
double dMaxStemZ = max( max( ptS.z, ptTStemS.z), max( ptE.z, ptTStemE.z)) ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ;
Point3d ptC( dX, dY, 0) ; Vector3d vtC = ptC - ptSxy ;
@@ -816,10 +816,10 @@ VolZmap::CylBall_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point
//----------------------------------------------------------------------------
bool
VolZmap::CylBall_ZPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::CylBall_ZPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
// Verifica sull'interferenza utensile Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -848,8 +848,8 @@ VolZmap::CylBall_ZPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& p
Vector3d vtV2 = vtV1 ;
vtV2.Rotate( Z_AX, 0, 1) ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ;
@@ -942,10 +942,10 @@ VolZmap::CylBall_ZPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& p
//----------------------------------------------------------------------------
bool
VolZmap::CylBall_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
VolZmap::CylBall_ZMilling( int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
{
// Verifica sull'interferenza utensile Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -1004,8 +1004,8 @@ VolZmap::CylBall_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
double dMin, dMax ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -1075,10 +1075,10 @@ VolZmap::CylBall_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
// ---------- Coni -----------------------------------------------------------
//----------------------------------------------------------------------------
bool
VolZmap::Conus_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
VolZmap::Conus_ZDrilling( int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
{
// Verifica sull'interferenza utensile Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -1107,8 +1107,8 @@ VolZmap::Conus_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d
if ( m_Tool.GetTipRadius() < m_Tool.GetRadius()) {
// Ciclo sui punti
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -1162,8 +1162,8 @@ VolZmap::Conus_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d
else {
// Ciclo sui punti
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -1216,10 +1216,10 @@ VolZmap::Conus_ZDrilling( unsigned int nGrid, const Point3d & ptS, const Point3d
//----------------------------------------------------------------------------
bool
VolZmap::Conus_ZPerp( unsigned int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
VolZmap::Conus_ZPerp( int nGrid, const Point3d & ptS, const Point3d & ptE, const Vector3d & vtToolDir)
{
// Verifica sull'interferenza utensile Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -1262,8 +1262,8 @@ VolZmap::Conus_ZPerp( unsigned int nGrid, const Point3d & ptS, const Point3d & p
Point3d ptVS = ptS - vtToolDir * ( dStemHeigth + dL) ;
Point3d ptVE = ptE - vtToolDir * ( dStemHeigth + dL) ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -1389,8 +1389,8 @@ VolZmap::Conus_ZPerp( unsigned int nGrid, const Point3d & ptS, const Point3d & p
Point3d ptVS = ptS - vtToolDir * ( m_Tool.GetHeigth() - dL) ;
Point3d ptVE = ptE - vtToolDir * ( m_Tool.GetHeigth() - dL) ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -1506,7 +1506,7 @@ VolZmap::Conus_ZPerp( unsigned int nGrid, const Point3d & ptS, const Point3d & p
//----------------------------------------------------------------------------
bool
VolZmap::Conus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::Conus_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
double dStemH = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
@@ -1531,7 +1531,7 @@ VolZmap::Conus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d&
// ----------------------------------------------------------------------------
bool
VolZmap::Mrt_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
VolZmap::Mrt_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
{
// Proiezione della traiettoria sul piano dei movimenti possibili
Vector3d vtMoveOnP = ( ptE - ptS) * vtToolDir * vtToolDir ;
@@ -1584,7 +1584,7 @@ VolZmap::Mrt_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& p
//----------------------------------------------------------------------------
bool
VolZmap::Mrt_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
VolZmap::Mrt_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
{
// Proiezione della traiettoria sul piano di movimento
Vector3d vtPlV = vtToolDir ^ vtAux ;
@@ -1637,7 +1637,7 @@ VolZmap::Mrt_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
//----------------------------------------------------------------------------
bool
VolZmap::Chs_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
VolZmap::Chs_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
{
CompPar_ZDrilling( nGrid, m_Tool.GetMrtChsWidth(), m_Tool.GetMrtChsThickness(), m_Tool.GetHeigth(),
ptS, ptE, vtToolDir, vtAux) ;
@@ -1646,7 +1646,7 @@ VolZmap::Chs_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& p
//----------------------------------------------------------------------------
bool
VolZmap::Chs_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
VolZmap::Chs_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
{
// Proiezione della traiettoria sul piano dei moti possibili
Point3d ptSp = ptS ;
@@ -1662,7 +1662,7 @@ 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( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
// Descrizione geometrica del moto
Point3d ptI = ptS ;
@@ -1738,7 +1738,7 @@ VolZmap::GenTool_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3
//----------------------------------------------------------------------------
bool
VolZmap::GenTool_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::GenTool_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
// Descrizione geometrica del moto
Point3d ptI = ptS ;
@@ -1817,10 +1817,10 @@ VolZmap::GenTool_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d
// --------- Cilindro e sfera ------------------------------------------------
//----------------------------------------------------------------------------
bool
VolZmap::CylBall_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::CylBall_XYDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
// Verifica sull'interferenza utensile Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -1843,8 +1843,8 @@ VolZmap::CylBall_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point
Vector3d vtV2 = vtV1 ;
vtV2.Rotate( Z_AX, 0, 1) ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ;
@@ -1899,10 +1899,10 @@ VolZmap::CylBall_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point
//----------------------------------------------------------------------------
bool
VolZmap::CylBall_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d & vtToolDir)
VolZmap::CylBall_XYPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d & vtToolDir)
{
// Verifica sull'interferenza utensile Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -1963,8 +1963,8 @@ VolZmap::CylBall_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d&
if ( dLenXY < EPS_SMALL) {
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -2020,8 +2020,8 @@ VolZmap::CylBall_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d&
}
else {
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -2163,7 +2163,7 @@ VolZmap::CylBall_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d&
//----------------------------------------------------------------------------
bool
VolZmap::CylBall_XYMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::CylBall_XYMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
if ( m_Tool.GetType() == Tool::CYLMILL)
return CompCyl_Milling( nGrid, ptS, ptE, vtToolDir, m_Tool.GetHeigth(), m_Tool.GetRadius(), false, false) ;
@@ -2183,10 +2183,10 @@ VolZmap::CylBall_XYMilling( unsigned int nGrid, const Point3d& ptS, const Point3
// --------- Coni ------------------------------------------------------------
//----------------------------------------------------------------------------
bool
VolZmap::Conus_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::Conus_XYDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
// Verifica sull'interferenza utensile Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -2230,8 +2230,8 @@ VolZmap::Conus_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d
Point3d ptIxy( ptI.x, ptI.y, 0) ;
// Ciclo sui punti
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -2312,10 +2312,10 @@ VolZmap::Conus_XYDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d
//----------------------------------------------------------------------------
bool
VolZmap::Conus_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::Conus_XYPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
// Verifica sull'interferenza utensile Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestToolBBox( nGrid, ptS, ptE, vtToolDir, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -2361,8 +2361,8 @@ VolZmap::Conus_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
Vector3d vtV1 = - vtToolDir ;
Vector3d vtV2( - vtV1.y, vtV1.x, 0) ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -2466,8 +2466,8 @@ VolZmap::Conus_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
Vector3d vtNmin, vtNmax ;
Point3d ptInt ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -2614,7 +2614,7 @@ VolZmap::Conus_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
//----------------------------------------------------------------------------
bool
VolZmap::Conus_XYMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::Conus_XYMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
@@ -2640,7 +2640,7 @@ VolZmap::Conus_XYMilling( unsigned int nGrid, const Point3d& ptS, const Point3d&
// ---------- Cilindro e sfera -----------------------------------------------
//----------------------------------------------------------------------------
bool
VolZmap::CylBall_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::CylBall_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
// Altezza cilindro
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
@@ -2657,7 +2657,7 @@ VolZmap::CylBall_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d
//----------------------------------------------------------------------------
bool
VolZmap::CylBall_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::CylBall_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
// Altezza cilindro
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
@@ -2675,7 +2675,7 @@ VolZmap::CylBall_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d&
// ---------- Coni -----------------------------------------------------------
//----------------------------------------------------------------------------
bool
VolZmap::Conus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::Conus_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
@@ -2699,7 +2699,7 @@ VolZmap::Conus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d&
//----------------------------------------------------------------------------
bool
VolZmap::Conus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::Conus_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
@@ -2726,7 +2726,7 @@ VolZmap::Conus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& p
// ---------- Mortasatrice ---------------------------------------------------
//----------------------------------------------------------------------------
bool
VolZmap::Mrt_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
VolZmap::Mrt_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
{
// Proiezione della traiettoria sul piano dei movimenti possibili
Point3d ptEOnP = ptS + ( ptE - ptS) * vtToolDir * vtToolDir ;
@@ -2776,7 +2776,7 @@ VolZmap::Mrt_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
//----------------------------------------------------------------------------
bool
VolZmap::Mrt_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
VolZmap::Mrt_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
{
// Proiezione della traiettoria sul piano dei movimenti possibili
Point3d ptSp = ptS ;
@@ -2828,7 +2828,7 @@ VolZmap::Mrt_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE
// ---------- Chisel ---------------------------------------------------------
//----------------------------------------------------------------------------
bool
VolZmap::Chs_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
VolZmap::Chs_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
{
// Proiezione della traiettoria sulla varietà del movimento
Point3d ptProjE = ptS + ( ptE - ptS) * vtToolDir * vtToolDir ;
@@ -2840,7 +2840,7 @@ VolZmap::Chs_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
//----------------------------------------------------------------------------
bool
VolZmap::Chs_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
VolZmap::Chs_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, const Vector3d& vtAux)
{
// Proiezione della traiettoria sul piano dei movimenti possibili
Vector3d vtMoveOnP = ( ptE - ptS) - ( ptE - ptS) * vtToolDir * vtToolDir ;
@@ -2854,7 +2854,7 @@ VolZmap::Chs_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE
// ---------- Utensile generico ----------------------------------------------
//----------------------------------------------------------------------------
bool
VolZmap::GenTool_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::GenTool_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
// Descrizione geometrica del moto
Point3d ptI = ptS ;
@@ -2958,7 +2958,7 @@ VolZmap::GenTool_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d
//----------------------------------------------------------------------------
bool
VolZmap::GenTool_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
VolZmap::GenTool_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir)
{
// Descrizione geometrica del moto
Point3d ptI = ptS ;
@@ -3065,10 +3065,10 @@ VolZmap::GenTool_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d&
//----------------------------------------------------------------------------
bool
VolZmap::CompCyl_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dRad)
VolZmap::CompCyl_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dRad)
{
// Verifica sull'interferenza con lo Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dRad, dRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -3087,8 +3087,8 @@ VolZmap::CompCyl_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3
double dMaxStemZ = max( max( ptS.z, ptTStemS.z), max( ptE.z, ptTStemE.z)) ;
// Ciclo sui punti
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -3108,10 +3108,10 @@ VolZmap::CompCyl_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3
//----------------------------------------------------------------------------
bool
VolZmap::CompConus_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dMaxRad, double dMinRad)
VolZmap::CompConus_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dMaxRad, double dMinRad)
{
// Verifica sull'interferenza con lo Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dMaxRad, dMinRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -3143,8 +3143,8 @@ VolZmap::CompConus_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Poin
Vector3d vtMin, vtMax ;
// Ciclo sui punti
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ;
@@ -3200,7 +3200,7 @@ VolZmap::CompConus_ZDrilling( unsigned int nGrid, const Point3d& ptS, const Poin
//----------------------------------------------------------------------------
bool
VolZmap::CompPar_ZDrilling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
VolZmap::CompPar_ZDrilling( int nGrid, double dLenX, double dLenY, double dLenZ,
const Point3d& ptS, const Point3d& ptE,
const Vector3d& vtToolDir, const Vector3d& vtAux)
{
@@ -3212,7 +3212,7 @@ VolZmap::CompPar_ZDrilling( unsigned int nGrid, double dLenX, double dLenY, doub
dLenZ -= ( 2 * EPS_SMALL) ;
// Controllo sull'interferenza utensile-solido
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestParaBBox( nGrid, ptMyS, ptMyE, vtToolDir, vtAux, dLenX, dLenY, dLenZ, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -3225,8 +3225,8 @@ VolZmap::CompPar_ZDrilling( unsigned int nGrid, double dLenX, double dLenY, doub
double dMinZ = min( min( ptMyS.z, ptMyS.z - vtToolDir.z * dLenZ), min( ptMyE.z, ptMyE.z - vtToolDir.z * dLenZ)) ;
double dMaxZ = max( max( ptMyS.z, ptMyS.z - vtToolDir.z * dLenZ), max( ptMyE.z, ptMyE.z - vtToolDir.z * dLenZ)) ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -3249,10 +3249,10 @@ VolZmap::CompPar_ZDrilling( unsigned int nGrid, double dLenX, double dLenY, doub
//----------------------------------------------------------------------------
bool
VolZmap::CompCyl_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dRad)
VolZmap::CompCyl_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dRad)
{
// Verifica sull'interferenza con lo Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dRad, dRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -3311,8 +3311,8 @@ VolZmap::CompCyl_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d
double dMin, dMax ;
Vector3d vtMin, vtMax ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -3377,9 +3377,9 @@ VolZmap::CompCyl_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d
//----------------------------------------------------------------------------
bool
VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dMaxRad, double dMinRad)
VolZmap::CompConus_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir, double dHei, double dMaxRad, double dMinRad)
{
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dMaxRad, dMinRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -3436,9 +3436,9 @@ VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point
Point3d ptInt ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ; double dY = ( j + 0.5) * m_dStep ;
@@ -3646,7 +3646,7 @@ VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d& ptS, const Point
//----------------------------------------------------------------------------
bool // E' in realtà MillingPerp
VolZmap::CompPar_ZMilling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
VolZmap::CompPar_ZMilling( int nGrid, double dLenX, double dLenY, double dLenZ,
const Point3d& ptS, const Point3d& ptE,
const Vector3d& vtToolDir, const Vector3d& vtAux)
{
@@ -3658,7 +3658,7 @@ VolZmap::CompPar_ZMilling( unsigned int nGrid, double dLenX, double dLenY, doubl
dLenZ -= ( 2 * EPS_SMALL) ;
// Controllo sull'interferenza utensile-solido
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestParaBBox( nGrid, ptMyS, ptMyE, vtToolDir, vtAux, dLenX, dLenY, dLenZ, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -3689,8 +3689,8 @@ VolZmap::CompPar_ZMilling( unsigned int nGrid, double dLenX, double dLenY, doubl
double dLenW2 = vtW2.Len() ;
vtW2 /= dLenW2 ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -3726,16 +3726,14 @@ VolZmap::CompPar_ZMilling( unsigned int nGrid, double dLenX, double dLenY, doubl
return true ;
}
// Asse di simmetria con orientazione generica: FORATURA
//----------------------------------------------------------------------------
bool
VolZmap::CompCyl_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
VolZmap::CompCyl_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
double dHei, double dRad, bool bTapB, bool bTapT)
{
// Verifico che il cilindro con il suo movimento intersechi la griglia
unsigned int nStartI, nEndI, nStartJ, nEndJ ;
int nStartI, nEndI, nStartJ, nEndJ ;
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dRad, dRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -3749,8 +3747,8 @@ VolZmap::CompCyl_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d
// Sistema di riferimento del cilindro
Frame3d CylFrame ; CylFrame.Set( ptF, vtToolDir) ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
Point3d ptC( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, 0) ;
Point3d ptInt1, ptInt2 ;
Vector3d vtN1, vtN2 ;
@@ -3764,10 +3762,10 @@ VolZmap::CompCyl_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d
//----------------------------------------------------------------------------
bool
VolZmap::CompConus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
VolZmap::CompConus_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
double dHei, double dMaxRad, double dMinRad, bool bTapB, bool bTapT)
{
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dMaxRad, dMinRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -3788,8 +3786,8 @@ VolZmap::CompConus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point
// L'altezza del cilindro è il movimento
double dH = ( ptE - ptS).Len() ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -3817,7 +3815,7 @@ VolZmap::CompConus_Drilling( unsigned int nGrid, const Point3d& ptS, const Point
//----------------------------------------------------------------------------
bool
VolZmap::CompPar_Drilling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
VolZmap::CompPar_Drilling( int nGrid, double dLenX, double dLenY, double dLenZ,
const Point3d& ptS, const Point3d& ptE,
const Vector3d& vtToolDir, const Vector3d& vtAux)
{
@@ -3829,7 +3827,7 @@ VolZmap::CompPar_Drilling( unsigned int nGrid, double dLenX, double dLenY, doubl
dLenZ -= ( 2 * EPS_SMALL) ;
// Controllo sull'interferenza utensile-solido
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestParaBBox( nGrid, ptMyS, ptMyE, vtToolDir, vtAux, dLenX, dLenY, dLenZ, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -3843,8 +3841,8 @@ VolZmap::CompPar_Drilling( unsigned int nGrid, double dLenX, double dLenY, doubl
Point3d ptO = ptMyS - ( ( ptMyE - ptMyS) * vtV1 > 0 ? dLenZ : dLenZ + dLenMove) * vtV1 - ( 0.5 * dLenX) * vtV2 ;
Frame3d ParaFrame ; ParaFrame.Set( ptO, vtV2, vtV3, vtV1) ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -3866,11 +3864,11 @@ VolZmap::CompPar_Drilling( unsigned int nGrid, double dLenX, double dLenY, doubl
// Asse di simmetria con orientazione generica: FRESATURA
//----------------------------------------------------------------------------
bool
VolZmap::CompCyl_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE,
VolZmap::CompCyl_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE,
const Vector3d& vtToolDir, double dHei, double dRad, bool bTapB, bool bTapT)
{
// Verifica sull'interferenza utensile Zmap
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dRad, dRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -3901,8 +3899,8 @@ VolZmap::CompCyl_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d&
bool bElpsB = ( abs( vtToolDir * vtUmv) > EPS_SMALL ? true : bTapB) ;
bool bElpsT = ( abs( vtToolDir * vtUmv) > EPS_SMALL ? true : bTapT) ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
Point3d ptC( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, 0) ;
@@ -3952,11 +3950,11 @@ VolZmap::CompCyl_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d&
//----------------------------------------------------------------------------
bool
VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
VolZmap::CompConus_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtToolDir,
double dHei, double dMaxRad, double dMinRad, bool bTapB, bool bTapT)
{
// Verifico interferenza
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestCompoBBox( nGrid, ptS, ptE, vtToolDir, dMaxRad, dMinRad, dHei, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -4040,8 +4038,8 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3
if ( dRatio * dTan <= 1) {
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
Point3d ptC( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, 0) ;
@@ -4212,8 +4210,8 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3
}
else {
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
Point3d ptC( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, 0) ;
@@ -4240,7 +4238,7 @@ VolZmap::CompConus_Milling( unsigned int nGrid, const Point3d& ptS, const Point3
//----------------------------------------------------------------------------
bool
VolZmap::CompPar_Milling( unsigned int nGrid, double dLenX, double dLenY, double dLenZ,
VolZmap::CompPar_Milling( int nGrid, double dLenX, double dLenY, double dLenZ,
const Point3d& ptS, const Point3d& ptE,
const Vector3d& vtToolDir, const Vector3d& vtAux)
{
@@ -4252,7 +4250,7 @@ VolZmap::CompPar_Milling( unsigned int nGrid, double dLenX, double dLenY, double
dLenZ -= ( 2 * EPS_SMALL) ;
// Controllo sull'interferenza utensile-solido
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestParaBBox( nGrid, ptMyS, ptMyE, vtToolDir, vtAux, dLenX, dLenY, dLenZ, nStartI, nStartJ, nEndI, nEndJ))
return true ;
@@ -4283,8 +4281,8 @@ VolZmap::CompPar_Milling( unsigned int nGrid, double dLenX, double dLenY, double
Vector3d vtW2 = vtW3 ^ vtW1 ;
MotionFrame.Set( ptOrig, vtW1, vtW2, vtW3) ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
Point3d ptC( ( i + 0.5) * m_dStep, ( j + 0.5) * m_dStep, 0) ;
@@ -4317,10 +4315,10 @@ VolZmap::CompPar_Milling( unsigned int nGrid, double dLenX, double dLenY, double
//----------------------------------------------------------------------------
bool
VolZmap::CompBall_Milling( unsigned int nGrid, const Point3d& ptLs, const Point3d& ptLe, double dRad)
VolZmap::CompBall_Milling( int nGrid, const Point3d& ptLs, const Point3d& ptLe, double dRad)
{
// Verifico interferisca
unsigned int nStartI, nStartJ, nEndI, nEndJ ;
int nStartI, nStartJ, nEndI, nEndJ ;
if ( ! TestCompoBBox( nGrid, ptLs, ptLe, V_NULL, dRad, 0, 0, nStartI, nStartJ, nEndI, nEndJ))
return true ;
// Vettore modivemnto
@@ -4334,8 +4332,8 @@ VolZmap::CompBall_Milling( unsigned int nGrid, const Point3d& ptLs, const Point3
double dSqRad = dRad * dRad ;
for ( unsigned int i = nStartI ; i <= nEndI ; ++ i) {
for ( unsigned int j = nStartJ ; j <= nEndJ ; ++ j) {
for ( int i = nStartI ; i <= nEndI ; ++ i) {
for ( int j = nStartJ ; j <= nEndJ ; ++ j) {
double dX = ( i + 0.5) * m_dStep ;
double dY = ( j + 0.5) * m_dStep ;
@@ -4425,8 +4423,8 @@ GetSphereMoveBBox( const Point3d& ptP1, const Point3d& ptP2, double dRad)
//----------------------------------------------------------------------------
inline bool
VolZmap::TestToolBBox( unsigned int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
unsigned int& nStI, unsigned int& nStJ, unsigned int& nEnI, unsigned int& nEnJ)
VolZmap::TestToolBBox( int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
int& nStI, int& nStJ, int& nEnI, int& nEnJ)
{
return TestCompoBBox( nGrid, ptP1, ptP2, vtV, m_Tool.GetRadius(), m_Tool.GetTipRadius(), m_Tool.GetHeigth(),
nStI, nStJ, nEnI, nEnJ) ;
@@ -4434,9 +4432,9 @@ VolZmap::TestToolBBox( unsigned int nGrid, const Point3d& ptP1, const Point3d& p
//----------------------------------------------------------------------------
inline bool
VolZmap::TestCompoBBox( unsigned int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
VolZmap::TestCompoBBox( int nGrid, const Point3d& ptP1, const Point3d& ptP2, const Vector3d& vtV,
double dRad, double dTipRad, double dHei,
unsigned int& nStI, unsigned int& nStJ, unsigned int& nEnI, unsigned int& nEnJ)
int& nStI, int& nStJ, int& nEnI, int& nEnJ)
{
// I punti e i vettori devono essere nel sistema di riferimento opportuno
@@ -4457,18 +4455,18 @@ VolZmap::TestCompoBBox( unsigned int nGrid, const Point3d& ptP1, const Point3d&
// Limiti su indici
nStI = max( 0, int( b3Box.GetMin().x / m_dStep)) ;
nEnI = min( m_nNx[nGrid] - 1, unsigned int( b3Box.GetMax().x / m_dStep)) ;
nEnI = min( m_nNx[nGrid] - 1, int( b3Box.GetMax().x / m_dStep)) ;
nStJ = max( 0, int( b3Box.GetMin().y / m_dStep)) ;
nEnJ = min( m_nNy[nGrid] - 1, unsigned int( b3Box.GetMax().y / m_dStep)) ;
nEnJ = min( m_nNy[nGrid] - 1, int( b3Box.GetMax().y / m_dStep)) ;
return true ;
}
//----------------------------------------------------------------------------
inline bool
VolZmap::TestParaBBox( unsigned int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtD, const Vector3d& vtA,
VolZmap::TestParaBBox( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtD, const Vector3d& vtA,
double dLenX, double dLenY, double dLenZ,
unsigned int& nStI, unsigned int& nStJ, unsigned int& nEnI, unsigned int& nEnJ)
int& nStI, int& nStJ, int& nEnI, int& nEnJ)
{
// I punti e i vettori devono essere nel sistema di riferimento opportuno
@@ -4487,8 +4485,8 @@ VolZmap::TestParaBBox( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
double dMaxY = max( max( ptS.y, ptSTip.y), max( ptE.y, ptETip.y)) + dSemiDiag ;
double dMaxZ = max( max( ptS.z, ptSTip.z), max( ptE.z, ptETip.z)) + dSemiDiag ;
unsigned int nMaxNx = m_nNx[nGrid] ;
unsigned int nMaxNy = m_nNy[nGrid] ;
int nMaxNx = m_nNx[nGrid] ;
int nMaxNy = m_nNy[nGrid] ;
double dMaxXValue = nMaxNx * m_dStep ;
double dMaxYValue = nMaxNy * m_dStep ;
@@ -4504,10 +4502,10 @@ VolZmap::TestParaBBox( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
return false ;
// Limiti su indici
nStI = ( dMinX < EPS_SMALL ? 0 : static_cast <unsigned int> ( dMinX / m_dStep)) ;
nEnI = ( dMaxX > dMaxXValue - EPS_SMALL ? nMaxNx - 1 : static_cast <unsigned int> ( dMaxX / m_dStep)) ;
nStJ = ( dMinY < EPS_SMALL ? 0 : static_cast <unsigned int> ( dMinY / m_dStep)) ;
nEnJ = ( dMaxY > dMaxYValue - EPS_SMALL ? nMaxNy - 1 : static_cast <unsigned int> ( dMaxY / m_dStep)) ;
nStI = ( dMinX < EPS_SMALL ? 0 : static_cast<int> ( dMinX / m_dStep)) ;
nEnI = ( dMaxX > dMaxXValue - EPS_SMALL ? nMaxNx - 1 : static_cast<int> ( dMaxX / m_dStep)) ;
nStJ = ( dMinY < EPS_SMALL ? 0 : static_cast<int> ( dMinY / m_dStep)) ;
nEnJ = ( dMaxY > dMaxYValue - EPS_SMALL ? nMaxNy - 1 : static_cast<int> ( dMaxY / m_dStep)) ;
return true ;
}