EgtGeomKernel 1.8e1 :

- modifiche a visualizzazione Zmap.
This commit is contained in:
Dario Sassi
2017-05-03 15:54:08 +00:00
parent ddc16d0a3b
commit 291dffc11e
5 changed files with 985 additions and 1258 deletions
BIN
View File
Binary file not shown.
+348 -2
View File
@@ -71,6 +71,352 @@ VolZmap::IntersLineBox( const Point3d& ptP, const Vector3d& vtV,
return ( dU2 >= dU1) ;
}
/*
//----------------------------------------------------------------------------
bool
VolZmap::IntersLineVoxel( const Point3d& ptP, const Vector3d& vtV, int nIndI, int nIndJ, int nIndK,
int& nFace1, int& nFace2, double& dU1, double& dU2) const
{
// Controllo sull'ammissibilità del voxel
if ( nIndI < - 1 || nIndI >= int( m_nNx[0]) ||
nIndJ < - 1 || nIndJ >= int( m_nNy[0]) ||
nIndK < - 1 || nIndK >= int( m_nNy[1]))
return false ;
Point3d ptInt ;
int nIntNum = 0 ;
double dU ;
// Intersezione con le facce 1 e 3
if ( abs( vtV.y) > EPS_ZERO) {
// Intersezione con la prima faccia
dU1 = ( ( nIndJ + 0.5) * m_dStep - ptP.y) / vtV.y ;
ptInt = ptP + dU1 * vtV ;
if ( ptInt.x > ( nIndI + 0.5) * m_dStep - EPS_SMALL &&
ptInt.x < ( nIndI + 1.5) * m_dStep + EPS_SMALL &&
ptInt.z > ( nIndK + 0.5) * m_dStep - EPS_SMALL &&
ptInt.z < ( nIndK + 1.5) * m_dStep + EPS_SMALL) {
nFace1 = 1 ;
++ nIntNum ;
}
// Intersezione con la terza faccia
dU = ( ( nIndJ + 1.5) * m_dStep - ptP.y) / vtV.y ;
ptInt = ptP + dU * vtV ;
if ( ptInt.x > ( nIndI + 0.5) * m_dStep - EPS_SMALL &&
ptInt.x < ( nIndI + 1.5) * m_dStep + EPS_SMALL &&
ptInt.z > ( nIndK + 0.5) * m_dStep - EPS_SMALL &&
ptInt.z < ( nIndK + 1.5) * m_dStep + EPS_SMALL) {
if ( nIntNum == 0) {
dU1 = dU ;
nFace1 = 3 ;
++ nIntNum ;
}
else if ( nIntNum == 1) {
dU2 = dU ;
nFace2 = 3 ;
++ nIntNum ;
}
}
}
// Intersezione con le facce 2 e 4
if ( abs( vtV.x) > EPS_ZERO) {
// Intersezione con la seconda faccia
dU = ( ( nIndI + 0.5) * m_dStep - ptP.x) / vtV.x ;
ptInt = ptP + dU * vtV ;
if ( ptInt.y > ( nIndJ + 0.5) * m_dStep - EPS_SMALL &&
ptInt.y < ( nIndJ + 1.5) * m_dStep + EPS_SMALL &&
ptInt.z > ( nIndK + 0.5) * m_dStep - EPS_SMALL &&
ptInt.z < ( nIndK + 1.5) * m_dStep + EPS_SMALL) {
if ( nIntNum == 0) {
dU1 = dU ;
nFace1 = 2 ;
++ nIntNum ;
}
else if ( nIntNum == 1) {
dU2 = dU ;
nFace2 = 2 ;
++ nIntNum ;
}
}
// Intersezione con la quarta faccia
dU = ( ( nIndI + 1.5) * m_dStep - ptP.x) / vtV.x ;
ptInt = ptP + dU * vtV ;
if ( ptInt.y > ( nIndJ + 0.5) * m_dStep - EPS_SMALL &&
ptInt.y < ( nIndJ + 1.5) * m_dStep + EPS_SMALL &&
ptInt.z > ( nIndK + 0.5) * m_dStep - EPS_SMALL &&
ptInt.z < ( nIndK + 1.5) * m_dStep + EPS_SMALL) {
if ( nIntNum == 0) {
dU1 = dU ;
nFace1 = 4 ;
++ nIntNum ;
}
else if ( nIntNum == 1) {
dU2 = dU ;
nFace2 = 4 ;
++ nIntNum ;
}
}
}
// Intersezione con le facce 5 e 6
if ( abs( vtV.z) > EPS_ZERO) {
// Intersezione con la quinta faccia
dU = ( ( nIndK + 0.5) * m_dStep - ptP.z) / vtV.z ;
ptInt = ptP + dU * vtV ;
if ( ptInt.x > ( nIndI + 0.5) * m_dStep - EPS_SMALL &&
ptInt.x < ( nIndI + 1.5) * m_dStep + EPS_SMALL &&
ptInt.y > ( nIndJ + 0.5) * m_dStep - EPS_SMALL &&
ptInt.y < ( nIndJ + 1.5) * m_dStep + EPS_SMALL) {
if ( nIntNum == 0) {
dU1 = dU ;
nFace1 = 5 ;
++ nIntNum ;
}
else if ( nIntNum == 1) {
dU2 = dU ;
nFace2 = 5 ;
++ nIntNum ;
}
}
// Intersezione con la sesta faccia
dU = ( ( nIndK + 1.5) * m_dStep - ptP.z) / vtV.z ;
ptInt = ptP + dU * vtV ;
if ( ptInt.x > ( nIndI + 0.5) * m_dStep - EPS_SMALL &&
ptInt.x < ( nIndI + 1.5) * m_dStep + EPS_SMALL &&
ptInt.y > ( nIndJ + 0.5) * m_dStep - EPS_SMALL &&
ptInt.y < ( nIndJ + 1.5) * m_dStep + EPS_SMALL) {
if ( nIntNum == 0) {
dU1 = dU ;
nFace1 = 6 ;
++ nIntNum ;
}
else if ( nIntNum == 1) {
dU2 = dU ;
nFace2 = 6 ;
++ nIntNum ;
}
}
}
if ( dU1 > dU2) {
swap( dU1, dU2) ;
swap( nFace1, nFace2) ;
}
return ( nIntNum == 2) ;
} */
//----------------------------------------------------------------------------
bool
VolZmap::IntersLineVoxel( const Point3d& ptP, const Vector3d& vtV, int nIndI, int nIndJ, int nIndK,
int& nFaceF, int& nFaceL, double& dUF, double& dUL) const
{
// Controllo sull'ammissibilità del voxel
if ( nIndI < - 1 || nIndI >= int( m_nNx[0]) ||
nIndJ < - 1 || nIndJ >= int( m_nNy[0]) ||
nIndK < - 1 || nIndK >= int( m_nNy[1]))
return false ;
Point3d ptInt, ptIntF, ptIntL ;
double dSqEps = EPS_SMALL * EPS_SMALL ;
int nIntNum = 0 ;
double dU1 = ( ( nIndJ + 0.5) * m_dStep - ptP.y) / vtV.y ;
double dU2 = ( ( nIndI + 0.5) * m_dStep - ptP.x) / vtV.x ;
double dU3 = ( ( nIndJ + 1.5) * m_dStep - ptP.y) / vtV.y ;
double dU4 = ( ( nIndI + 1.5) * m_dStep - ptP.x) / vtV.x ;
double dU5 = ( ( nIndK + 0.5) * m_dStep - ptP.z) / vtV.z ;
double dU6 = ( ( nIndK + 1.5) * m_dStep - ptP.z) / vtV.z ;
// Intersezione con le facce 1 e 3
if ( abs( vtV.y) > EPS_ZERO) {
// Intersezione con la prima faccia
ptInt = ptP + dU1 * vtV ;
if ( ptInt.x >= ( nIndI + 0.5) * m_dStep &&
ptInt.x <= ( nIndI + 1.5) * m_dStep &&
ptInt.z >= ( nIndK + 0.5) * m_dStep &&
ptInt.z <= ( nIndK + 1.5) * m_dStep) {
dUF = dU1 ;
nFaceF = 1 ;
ptIntF = ptInt ;
++ nIntNum ;
}
// Intersezione con la terza faccia
ptInt = ptP + dU3 * vtV ;
if ( ptInt.x >= ( nIndI + 0.5) * m_dStep &&
ptInt.x <= ( nIndI + 1.5) * m_dStep &&
ptInt.z >= ( nIndK + 0.5) * m_dStep &&
ptInt.z <= ( nIndK + 1.5) * m_dStep) {
if ( nIntNum == 0) {
dUF = dU3 ;
nFaceF = 3 ;
ptIntF = ptInt ;
++ nIntNum ;
}
else if ( nIntNum == 1 &&
( ptIntF - ptInt).SqLen() > dSqEps) {
dUL = dU3 ;
nFaceL = 3 ;
ptIntL = ptInt ;
++ nIntNum ;
}
}
}
// Intersezione con le facce 2 e 4
if ( abs( vtV.x) > EPS_ZERO) {
// Intersezione con la seconda faccia
ptInt = ptP + dU2 * vtV ;
if ( ptInt.y >= ( nIndJ + 0.5) * m_dStep &&
ptInt.y <= ( nIndJ + 1.5) * m_dStep &&
ptInt.z >= ( nIndK + 0.5) * m_dStep &&
ptInt.z <= ( nIndK + 1.5) * m_dStep) {
if ( nIntNum == 0) {
dUF = dU2 ;
nFaceF = 2 ;
ptIntF = ptInt ;
++ nIntNum ;
}
else if ( nIntNum == 1 &&
( ptIntF - ptInt).SqLen() > dSqEps) {
dUL = dU2 ;
nFaceL = 2 ;
ptIntL = ptInt ;
++ nIntNum ;
}
}
// Intersezione con la quarta faccia
ptInt = ptP + dU4 * vtV ;
if ( ptInt.y >= ( nIndJ + 0.5) * m_dStep &&
ptInt.y <= ( nIndJ + 1.5) * m_dStep &&
ptInt.z >= ( nIndK + 0.5) * m_dStep &&
ptInt.z <= ( nIndK + 1.5) * m_dStep) {
if ( nIntNum == 0) {
dUF = dU4 ;
nFaceF = 4 ;
ptIntF = ptInt ;
++ nIntNum ;
}
else if ( nIntNum == 1 &&
( ptIntF - ptInt).SqLen() > dSqEps) {
dUL = dU4 ;
nFaceL = 4 ;
ptIntL = ptInt ;
++ nIntNum ;
}
}
}
// Intersezione con le facce 5 e 6
if ( abs( vtV.z) > EPS_ZERO) {
// Intersezione con la quinta faccia
ptInt = ptP + dU5 * vtV ;
if ( ptInt.x >= ( nIndI + 0.5) * m_dStep &&
ptInt.x <= ( nIndI + 1.5) * m_dStep &&
ptInt.y >= ( nIndJ + 0.5) * m_dStep &&
ptInt.y <= ( nIndJ + 1.5) * m_dStep) {
if ( nIntNum == 0) {
dUF = dU5 ;
nFaceF = 5 ;
ptIntF = ptInt ;
++ nIntNum ;
}
else if ( nIntNum == 1 &&
( ptIntF - ptInt).SqLen() > dSqEps) {
dUL = dU5 ;
nFaceL = 5 ;
ptIntL = ptInt ;
++ nIntNum ;
}
}
// Intersezione con la sesta faccia
ptInt = ptP + dU6 * vtV ;
if ( ptInt.x >= ( nIndI + 0.5) * m_dStep &&
ptInt.x <= ( nIndI + 1.5) * m_dStep &&
ptInt.y >= ( nIndJ + 0.5) * m_dStep &&
ptInt.y <= ( nIndJ + 1.5) * m_dStep) {
if ( nIntNum == 0) {
dUF = dU6 ;
nFaceF = 6 ;
ptIntF = ptInt ;
++ nIntNum ;
}
else if ( nIntNum == 1 &&
( ptIntF - ptInt).SqLen() > dSqEps) {
dUL = dU6 ;
nFaceL = 6 ;
ptIntL = ptInt ;
++ nIntNum ;
}
}
}
if ( dUF > dUL) {
swap( dUF, dUL) ;
swap( nFaceF, nFaceL) ;
}
return ( nIntNum == 2) ;
}
//----------------------------------------------------------------------------
bool
@@ -1038,7 +1384,7 @@ VolZmap::IntersLineEllipticalCylinder( const Vector3d& vtLineDir, const Point3d&
Vector3d vtTan1( 0, - vtCirc1.z, vtCirc1.y) ;
Vector3d vtCross1 = vtTan1 ^ vtMv ;
vtN1 = ( vtCross1 * vtCirc1 > 0 ? vtCross1 : - vtCross1) ;
vtN1 = ( vtCross1 * vtCirc1 > - EPS_ZERO ? vtCross1 : - vtCross1) ;
if ( vtTest2.y > 0) {
@@ -1053,7 +1399,7 @@ VolZmap::IntersLineEllipticalCylinder( const Vector3d& vtLineDir, const Point3d&
Vector3d vtTan2( 0, - vtCirc2.z, vtCirc2.y) ;
Vector3d vtCross2 = vtTan2 ^ vtMv ;
vtN2 = ( vtCross2 * vtCirc2 > 0 ? vtCross2 : - vtCross2) ;
vtN2 = ( vtCross2 * vtCirc2 > - EPS_ZERO ? vtCross2 : - vtCross2) ;
+601 -1098
View File
File diff suppressed because it is too large Load Diff
+25 -148
View File
@@ -169,50 +169,6 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ
}
}
}
/*
// Blocco adiacente in X
if ( nXBlock > 0 &&
( nI % m_nDexNumPBlock == 0) &&
( nI / m_nDexNumPBlock <= m_nFracLin[0] - 1)) {
int nAdjXBlock = nXBlock - 1 ;
for ( int k = nMinZBlock ; k <= nMaxZBlock ; ++ k) {
int nBlockNum = k * nLayerBlock + nYBlock * m_nFracLin[0] + nAdjXBlock ;
m_BlockToUpdate[nBlockNum] = true ;
}
}
// Blocco adiacente in Y
if ( nYBlock > 0 &&
( nJ % m_nDexNumPBlock == 0) &&
( nJ / m_nDexNumPBlock <= m_nFracLin[1] - 1)) {
int nAdjYBlock = nYBlock - 1 ;
for ( int k = nMinZBlock ; k <= nMaxZBlock ; ++ k) {
int nBlockNum = k * nLayerBlock + nAdjYBlock * m_nFracLin[0] + nXBlock ;
m_BlockToUpdate[nBlockNum] = true ;
}
}
// Blocco adiacente in XY
if ( ( nXBlock > 0 &&
( nI % m_nDexNumPBlock == 0) &&
( nI / m_nDexNumPBlock <= m_nFracLin[0] - 1)) &&
( nYBlock > 0 &&
( nJ % m_nDexNumPBlock == 0) &&
( nJ / m_nDexNumPBlock <= m_nFracLin[1] - 1))) {
int nAdjXBlock = nXBlock - 1 ;
int nAdjYBlock = nYBlock - 1 ;
for ( int k = nMinZBlock ; k <= nMaxZBlock ; ++ k) {
int nBlockNum = k * nLayerBlock + nAdjYBlock * m_nFracLin[0] + nAdjXBlock ;
m_BlockToUpdate[nBlockNum] = true ;
}
}*/
}
else if ( nGrid == 1) {
@@ -238,50 +194,6 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ
}
}
}
/*
// Blocco adiacente in Y
if ( nYBlock > 0 &&
( nI % m_nDexNumPBlock == 0) &&
( nI / m_nDexNumPBlock <= m_nFracLin[1] - 1)) {
int nAdjYBlock = nYBlock - 1 ;
for ( int k = nMinXBlock ; k <= nMaxXBlock ; ++ k) {
int nBlockNum = nZBlock * nLayerBlock + nAdjYBlock * m_nFracLin[0] + k ;
m_BlockToUpdate[nBlockNum] = true ;
}
}
// Blocco adiacente in Z
if ( nZBlock > 0 &&
( nJ % m_nDexNumPBlock == 0) &&
( nJ / m_nDexNumPBlock <= m_nFracLin[2] - 1)) {
int nAdjZBlock = nZBlock - 1 ;
for ( int k = nMinXBlock ; k <= nMaxXBlock ; ++ k) {
int nBlockNum = nAdjZBlock * nLayerBlock + nYBlock * m_nFracLin[0] + k ;
m_BlockToUpdate[nBlockNum] = true ;
}
}
// Blocco adiacente in YZ
if ( ( nYBlock > 0 &&
( nI % m_nDexNumPBlock == 0) &&
( nI / m_nDexNumPBlock <= m_nFracLin[1] - 1)) &&
( nZBlock > 0 &&
( nJ % m_nDexNumPBlock == 0) &&
( nJ / m_nDexNumPBlock <= m_nFracLin[2] - 1))) {
int nAdjYBlock = nYBlock - 1 ;
int nAdjZBlock = nZBlock - 1 ;
for ( int k = nMinXBlock ; k <= nMaxXBlock ; ++ k) {
int nBlockNum = nAdjZBlock * nLayerBlock + nAdjYBlock * m_nFracLin[0] + k ;
m_BlockToUpdate[nBlockNum] = true ;
}
} */
}
else if ( nGrid == 2) {
@@ -307,50 +219,6 @@ VolZmap::SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ
}
}
}
/*
// Blocchi adiacenti in X
if ( nXBlock > 0 &&
( nJ % m_nDexNumPBlock == 0) &&
( nJ / m_nDexNumPBlock <= m_nFracLin[0] - 1)) {
int nAdjXBlock = nXBlock - 1 ;
for ( int k = nMinYBlock ; k <= nMaxYBlock ; ++ k) {
int nBlockNum = nZBlock * nLayerBlock + k * m_nFracLin[0] + nAdjXBlock ;
m_BlockToUpdate[nBlockNum] = true ;
}
}
// Blocchi adiacenti in Z
if ( nZBlock > 0 &&
( nI % m_nDexNumPBlock == 0) &&
( nI / m_nDexNumPBlock <= m_nFracLin[2] - 1)) {
int nAdjZBlock = nZBlock - 1 ;
for ( int k = nMinYBlock ; k <= nMaxYBlock ; ++ k) {
int nBlockNum = nAdjZBlock * nLayerBlock + k * m_nFracLin[0] + nXBlock ;
m_BlockToUpdate[nBlockNum] = true ;
}
}
// Blocchi adiacenti in XZ
if ( ( nXBlock > 0 &&
( nJ % m_nDexNumPBlock == 0) &&
( nJ / m_nDexNumPBlock <= m_nFracLin[0] - 1)) &&
( nZBlock > 0 &&
( nI % m_nDexNumPBlock == 0) &&
( nI / m_nDexNumPBlock <= m_nFracLin[2] - 1))) {
int nAdjXBlock = nXBlock - 1 ;
int nAdjZBlock = nZBlock - 1 ;
for ( int k = nMinYBlock ; k <= nMaxYBlock ; ++ k) {
int nBlockNum = nAdjZBlock * nLayerBlock + k * m_nFracLin[0] + nAdjXBlock ;
m_BlockToUpdate[nBlockNum] = true ;
}
}*/
}
m_OGrMgr.Reset() ;
@@ -1162,7 +1030,7 @@ VolZmap::CylBall_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
Vector3d vtTan( - vtCirc.y, vtCirc.x, 0) ; // Tangente alla circonferenza
Vector3d vtCross = vtTan ^ vtMove ;
vtNmax = ( vtCross * vtCirc > 0 ? vtCross : - vtCross) ;
vtNmax = ( vtCross * vtCirc > - EPS_ZERO ? vtCross : - vtCross) ;
vtNmax.Normalize() ;
}
// Minimo
@@ -1180,7 +1048,7 @@ VolZmap::CylBall_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
Vector3d vtTan( - vtCirc.y, vtCirc.x, 0) ; // Tangente alla circonferenza
Vector3d vtCross = vtTan ^ vtMove ;
vtNmin = ( vtCross * vtCirc > 0 ? vtCross : - vtCross) ;
vtNmin = ( vtCross * vtCirc > - EPS_ZERO ? vtCross : - vtCross) ;
vtNmin.Normalize() ;
}
@@ -2636,6 +2504,12 @@ VolZmap::Conus_XYPerp( unsigned int nGrid, const Point3d& ptS, const Point3d& pt
Vector3d vtUpCross = vtMove ^ vtUpTan ;
Vector3d vtDwCross = - vtMove ^ vtDwTan ;
if ( vtUpCross.z > 0)
vtUpCross = - vtUpCross ;
if ( vtDwCross.z < 0)
vtDwCross = - vtDwCross ;
// Descrizione piani tangenti al cono
Vector3d vtR0Up = ptUp - ORIG ;
Vector3d vtR0Dw = ptDw - ORIG ;
@@ -3882,7 +3756,7 @@ VolZmap::CompCyl_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
Vector3d vtTan( - vtCirc.y, vtCirc.x, 0) ;
Vector3d vtCross = vtTan ^ vtMove ;
vtMax = ( vtCross * vtCirc > 0 ? vtCross : - vtCross) ;
vtMax = ( vtCross * vtCirc > - EPS_ZERO ? vtCross : - vtCross) ;
vtMax.Normalize() ;
}
// Minimo
@@ -3900,7 +3774,7 @@ VolZmap::CompCyl_ZMilling( unsigned int nGrid, const Point3d & ptS, const Point3
Vector3d vtTan( - vtCirc.y, vtCirc.x, 0) ;
Vector3d vtCross = vtTan ^ vtMove ;
vtMin = ( vtCross * vtCirc > 0 ? vtCross : - vtCross) ;
vtMin = ( vtCross * vtCirc > - EPS_ZERO ? vtCross : - vtCross) ;
vtMin.Normalize() ;
}
SubtractIntervals( nGrid, i, j, dMin, dMax, vtMin, vtMax) ;
@@ -4171,9 +4045,9 @@ VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d & ptS, const Poin
Vector3d vtCirc = - dIDL_0 * vtV2 - dIDO * vtV3 ;
Vector3d vtTan( - vtCirc.y, vtCirc.x, 0) ;
Vector3d vtCross = vtTan ^ vtUmv ;
vtP = ( vtCross * vtCirc > 0 ? vtCross : - vtCross) ;
vtP.Normalize() ;
vtP.Normalize() ;
}
// Limiti nella direzione negativa di vtV1
@@ -4229,9 +4103,10 @@ VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d & ptS, const Poin
Vector3d vtCirc = - dIDL_0 * vtV2 - dIDO * vtV3 ;
Vector3d vtTan( - vtCirc.y, vtCirc.x, 0) ;
Vector3d vtCross = vtTan ^ vtUmv ;
vtP = ( vtCross * vtCirc > 0 ? vtCross : - vtCross) ;
vtP.Normalize() ;
////////////////////////////////////////////////////////////////////////////////////////
vtP = ( vtCross * vtCirc > - EPS_ZERO ? vtCross : - vtCross) ; // vtCross * vtCirc o vtCross * vtMove?
////////////////////////////////////////////////////////////////////////////////////////
vtP.Normalize() ;
}
// Limiti nella direzione negativa di vtV1
@@ -4272,9 +4147,9 @@ VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d & ptS, const Poin
Vector3d vtCirc = - dIDL_0 * vtV2 - dIDO * vtV3 ;
Vector3d vtTan( - vtCirc.y, vtCirc.x, 0) ;
Vector3d vtCross = vtTan ^ vtUmv ;
vtM = ( vtCross * vtMove > 0 ? vtCross : - vtCross) ;
vtM.Normalize() ;
vtM = ( vtCross * vtMove > - EPS_ZERO ? vtCross : - vtCross) ;
vtM.Normalize() ;
}
else if ( dIDO >= dMinRad * dSin && dIDO < dMaxRad * dSin) {
@@ -4294,9 +4169,10 @@ VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d & ptS, const Poin
Vector3d vtCirc = - dIDL_0 * vtV2 - dIDO * vtV3 ;
Vector3d vtTan( - vtCirc.y, vtCirc.x, 0) ;
Vector3d vtCross = vtTan ^ vtUmv ;
vtM = ( vtCross * vtMove > 0 ? vtCross : - vtCross) ;
vtM.Normalize() ;
vtM = ( vtCross * vtMove > - EPS_ZERO ? vtCross : - vtCross) ;
vtM.Normalize() ;
}
else {
@@ -4323,8 +4199,9 @@ VolZmap::CompConus_ZMilling( unsigned int nGrid, const Point3d & ptS, const Poin
Vector3d vtTan( - vtCirc.y, vtCirc.x, 0) ;
Vector3d vtCross = vtTan ^ vtMove ;
vtM = ( vtCross * vtMove > 0 ? vtCross : - vtCross) ;
vtM.Normalize() ;
vtM = ( vtCross * vtMove > - EPS_ZERO ? vtCross : - vtCross) ;
vtM.Normalize() ;
}
}
+11 -10
View File
@@ -74,8 +74,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW
bool CreateFromTriMesh( const ISurfTriMesh& Surf, double dPrec, bool bTriDex) override ;
bool GetAllTriangles( TRIA3DLIST& lstTria) const override ;
int GetBlockCount( void) const override ;
bool GetBlockInfo( std::vector<bool> & bModified) const override ;
bool GetBlockTriangles( int nBlock, TRIA3DLIST& lstTria) const override ;
bool GetTriangles( bool bAllBlocks, INTVECTOR& nModifiedBlocks, TRIA3DLISTVECTOR& vLstTria) const override ;
bool GetDexelLines( int nDir, int nPos1, int nPos2, POLYLINELIST& lstPL) const override ;
bool SetTolerances( double dLinTol, double dAngTolDeg = 90) override ;
bool SetStdTool( const std::string& pToolName, double dH, double dR, double dCornR) override ;
@@ -117,15 +116,15 @@ class VolZmap : public IVolZmap, public IGeoObjRW
const Vector3d& vtZ, const Vector3d& vtNorm, TRIA3DLIST& lstTria) const ;
bool MarchingCubes( TRIA3DLIST& lstTria) const ;
bool MarchingCubes( int nBlock, TRIA3DLIST& lstTria) const ;
bool ExtMarchingCubes( const int nLimits[], TRIA3DLIST& lstTria, TriHolder& triHold) const ;
bool ExtMarchingCubes( const std::vector <int> VoxelsIndexes, TriHolder& triHold) const ;
bool FlipEdges( TriHolder& triHold) const ;
bool FlipEdgesLocalFlipEdges( TriaStruct& triStrCurr, TriaStruct& triStrAdj) const ;
bool ExtMarchingCubes( const int nLimits[], TRIA3DLIST& lstTria, TriHolder& triHold) const ;
bool FlipEdges( std::vector<TriHolder>& VecTriHold) const ;
bool IsThereMat( int nI, int nJ, int nK) const ;
bool IsThereMat( const int nMatr[][3], int nNum, double & dHx, double & dHy, double & dHz) const ;
bool IntersPos( int nVec1[], int nVec2[], Point3d & ptInt) const ;
bool IntersPos( int nVec1[], int nVec2[], Point3d & ptInt, Vector3d & vtNormal) const ;
bool NewIntersPos( int nVec1[], int nVec2[], bool bFirstCorner, Point3d& ptInt, Vector3d& vtNormal) const ;
bool IntersPos( int nVec1[], int nVec2[], bool bFirstCorner, Point3d& ptInt, Vector3d& vtNormal) const ;
bool IsPointInsideVoxel( int nI, int nJ, int nK, const Point3d& ptP) const ;
bool IsPointInsideVoxelApprox( int nI, int nJ, int nK, const Point3d& ptP) const ;
bool GetPointVoxel( Point3d& ptP, int& nVoxI, int& nVoxJ, int& nVoxK) const ;
// OPERAZIONI SU INTERVALLI
bool SubtractIntervals( unsigned int nGrid, unsigned int nI, unsigned int nJ,
@@ -215,6 +214,8 @@ class VolZmap : public IVolZmap, public IGeoObjRW
// Intersezioni
bool IntersLineBox( const Point3d& ptP, const Vector3d& vtV,
const Point3d& ptMin, const Point3d& ptMax, double& dU1, double& dU2) const ;
bool IntersLineVoxel( const Point3d& ptP, const Vector3d& vtV, int nIndI, int nIndJ, int nIndK,
int& nFace1, int& nFace2, double& dU1, double& dU2) const ;
bool IntersLineZMapBBox( unsigned int nGrid, const Point3d& ptP, const Vector3d& vtV, double& dU1, double& dU2) ;
bool IntersLineDexel( unsigned int nGrid, const Point3d& ptP, const Vector3d& vtV, unsigned int nI, unsigned int nJ,
double& dU1, double& dU2) ;
@@ -244,13 +245,13 @@ class VolZmap : public IVolZmap, public IGeoObjRW
Point3d& ptInt1, Point3d& ptInt2, Vector3d& vtN1, Vector3d& vtN2) ;
// Funzioni di gestione dei blocchi
bool GetBlockIJK( int nIJK[], int nBlock) const ;
bool GetBlockIJK( int nBlock, int nIJK[]) const ;
bool GetBlockLimitsIJK( const int nIJK[], int nLimits[]) const ;
private :
enum Status { ERR = 0, OK = 1, TO_VERIFY = 2} ;
static const int N_MAPS = 3 ;
static const int N_DEXBLOCK = 32;//20;//32 ;
static const int N_DEXBLOCK = 32 ; // 10000 ;//20 ;//32 ;
private :
ObjGraphicsMgr m_OGrMgr ; // gestore grafica dell'oggetto