Correzione errori vm additivo

This commit is contained in:
LorenzoM
2022-01-13 17:55:39 +01:00
parent e4b5e4c0a9
commit 1c8ee6a332
3 changed files with 26 additions and 20 deletions
+1 -1
View File
@@ -362,7 +362,7 @@ class VolZmap : public IVolZmap, public IGeoObjRW
Point3d& ptInt1, Vector3d& vtN1, Point3d& ptInt2, Vector3d& vtN2) const ;
bool IntersLineMyPolyhedron( const Point3d& ptLineSt, const Vector3d& vtLineDir,
const Frame3d& PolyFrame, double dLenX, double dLenY, double dLenZ, double dDeltaX,
Point3d& ptInt1, Vector3d& vtN1, Point3d& ptInt2, Vector3d& vtN2) const ;
Point3d& ptInt1, Vector3d& vtN1, Point3d& ptInt2, Vector3d& vtN2, bool bSubtracting = true) const ;
bool IntersLineTruncatedPyramid( const Point3d& ptLineSt, const Vector3d& vtLineDir,
const Frame3d& frTruncPyramFrame, double dSegMin, double dSegMax, double dHeight,
Point3d& ptInt1, Vector3d& vtN1, Point3d& ptInt2, Vector3d& vtN2) const ;
+14 -12
View File
@@ -2681,7 +2681,7 @@ VolZmap::IntersLineEllipticalCylinder( const Point3d& ptLineSt, const Vector3d&
bool
VolZmap::IntersLineMyPolyhedron( const Point3d& ptLineSt, const Vector3d& vtLineDir,
const Frame3d& PolyFrame, double dLenX, double dLenY, double dLenZ, double dDeltaZ,
Point3d& ptInt1, Vector3d& vtN1, Point3d& ptInt2, Vector3d& vtN2) const
Point3d& ptInt1, Vector3d& vtN1, Point3d& ptInt2, Vector3d& vtN2, bool bSubtracting) const
{
// Controllo sulle dimensioni lineari affinché sia valido il poliedro
if ( dLenX <= EPS_SMALL || dLenY <= EPS_SMALL || dLenZ <= EPS_SMALL)
@@ -2705,17 +2705,19 @@ VolZmap::IntersLineMyPolyhedron( const Point3d& ptLineSt, const Vector3d& vtLine
// Controlli affinché non vengano tagliati dexel a filo
// con il passaggio dell'utensile:
// Controllo sulle facce 1 e 2
if ( abs( vtV.y) < EPS_ZERO && abs( ptP.y) > ptFacet135.y)
return false ;
// Controllo sulle facce 3 e 4
if ( abs( vtV.x) < EPS_ZERO && ( ptP.x < ptFacet135.x || ptP.x > ptFacet246.x))
return false ;
// Controllo sulle facce 5 e 6
double dP1 = abs ( ( ptFacet135 - ptP) * vtOb) ;
double dP2 = abs ( ( ptFacet246 - ptP) * vtOb) ;
if ( abs( vtV * vtOb) < EPS_ZERO && ( dP1 < EPS_SMALL || dP2 < EPS_SMALL))
return false ;
if ( bSubtracting) {
// Controllo sulle facce 1 e 2
if ( abs( vtV.y) < EPS_ZERO && abs( ptP.y) > ptFacet135.y)
return false ;
// Controllo sulle facce 3 e 4
if ( abs( vtV.x) < EPS_ZERO && ( ptP.x < ptFacet135.x || ptP.x > ptFacet246.x))
return false ;
// Controllo sulle facce 5 e 6
double dP1 = abs ( ( ptFacet135 - ptP) * vtOb) ;
double dP2 = abs ( ( ptFacet246 - ptP) * vtOb) ;
if ( abs( vtV * vtOb) < EPS_ZERO && ( dP1 < EPS_SMALL || dP2 < EPS_SMALL))
return false ;
}
// Punti notevoli
Point3d ptI1 = ptP + ( ( ptFacet135.y - ptP.y) / vtV.y) * vtV ;
+11 -7
View File
@@ -737,6 +737,9 @@ VolZmap::MillingTranslationStep( const Point3d& ptPs, const Point3d& ptPe, const
Vector3d vtALs[N_MAPS] ;
InitializePointsAndVectors( ptPs, ptPe, vtD, vtA, ptLs, ptLe, vtLs, vtALs) ;
// Ciclo sulle mappe
/*for ( int i = 0 ; i < m_nMapNum ; ++ i) {
SelectMotion( i, ptLs[i], ptLe[i], vtLs[i], vtALs[i]) ;
}*/
vector< future<bool>> vRes ;
vRes.resize( m_nMapNum) ;
for ( int i = 0 ; i < m_nMapNum ; ++ i) {
@@ -7833,23 +7836,24 @@ VolZmap::AddingMotion( int nGrid, const Point3d& ptS, const Point3d& ptE, const
double dX1 = vtStC * vtV1 ;
double dX2 = vtStC * vtV2 ;
if ( ( dX1 > 0 && dX1 < dLen1 && abs( dX2) < dRad) ||
vtStC.SqLen() < dRad * dRad ||
vtEnC.SqLen() < dRad * dRad) {
if ( ( dX1 > 0 && dX1 < dLen1 && abs( dX2) < dRad + EPS_SMALL) ||
vtStC.SqLen() < dRad * dRad + 2 * dRad * EPS_SMALL ||
vtEnC.SqLen() < dRad * dRad + 2 * dRad * EPS_SMALL) {
AddIntervals( nGrid, i, j, ptS.z - dHei, ptS.z, - Z_AX, Z_AX) ;
}
}
}
}
else {
double dMyTol = 0/*EPS_SMALL*/;
Frame3d CylFrame, PolyFrame ;
CylFrame.Set( ptS - dHei * vtAx, vtAx) ;
PolyFrame.Set( ptS - ( dHei + EPS_SMALL) * vtAx, vtV1, vtAx ^ vtV1, vtAx) ;
PolyFrame.Set( ptS - ( dHei + dMyTol) * vtAx, vtV1, vtAx ^ vtV1, vtAx) ;
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 ;
@@ -7863,8 +7867,8 @@ VolZmap::AddingMotion( int nGrid, const Point3d& ptS, const Point3d& ptE, const
AddIntervals( nGrid, i, j, ptInt1.z + dLen1 * vtV1.z, ptInt2.z + dLen1 * vtV1.z, - vtN1, - vtN2) ;
}
if ( IntersLineMyPolyhedron( ptC, Z_AX, PolyFrame, dLen1, 2 * ( dRad + EPS_SMALL), dHei + 2 * EPS_SMALL, 0,
ptInt1, vtN1, ptInt2, vtN2)) {
if ( IntersLineMyPolyhedron( ptC, Z_AX, PolyFrame, dLen1, 2 * ( dRad + dMyTol), dHei + 2 * dMyTol, 0,
ptInt1, vtN1, ptInt2, vtN2, false)) {
AddIntervals( nGrid, i, j, ptInt1.z, ptInt2.z, - vtN1, - vtN2) ;
}
}