EgtgeomKernel :

- correzioni a Zmap per virtual milling con utensile a tronco di cono (coda di rondine).
This commit is contained in:
Dario Sassi
2023-12-13 11:29:39 +01:00
parent 903f0c69bc
commit fbbb0739ee
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -2068,14 +2068,14 @@ VolZmap::IntersLineCylinder( const Point3d& ptLineSt, const Vector3d& vtLineDir,
int nBasInt = 0 ;
if ( abs( vtV.z) > EPS_ZERO) {
// le linee tangenti al cilindro non sono considerate intersecanti
double EpsRad = ( vtV.IsZeroXY() ? - EPS_SMALL : EPS_SMALL) ;
double dEpsRad = ( vtV.IsZeroXY() ? - EPS_SMALL : EPS_SMALL) ;
ptInt1 = ptP + ( ( 0 - ptP.z) / vtV.z) * vtV ;
if ( ptInt1.x * ptInt1.x + ptInt1.y * ptInt1.y < dRad * dRad + 2 * dRad * EpsRad) {
if ( ptInt1.x * ptInt1.x + ptInt1.y * ptInt1.y < dRad * dRad + 2 * dRad * dEpsRad) {
nBasInt += 1 ;
vtN1 = Z_AX ;
}
ptInt2 = ptP + ( ( dH - ptP.z) / vtV.z) * vtV ;
if ( ptInt2.x * ptInt2.x + ptInt2.y * ptInt2.y < dRad * dRad + 2 * dRad * EpsRad) {
if ( ptInt2.x * ptInt2.x + ptInt2.y * ptInt2.y < dRad * dRad + 2 * dRad * dEpsRad) {
nBasInt += 2 ;
vtN2 = - Z_AX ;
}
@@ -2196,12 +2196,12 @@ VolZmap::IntersLineConus( const Point3d& ptLineSt, const Vector3d& vtLineDir,
// Determino le eventuali intersezioni con le due basi a quota minima e massima (solo se linea non parallela ad esse)
int nBasInt = 0 ;
if ( abs( vtV.z) > EPS_ZERO) {
ptInt1 = ptP + ( ( dMinH - ptP.z) / vtV.z) * vtV ;
ptInt1 = ptP + ( ( dMinH + dEpsLow - ptP.z) / vtV.z) * vtV ;
if ( ptInt1.x * ptInt1.x + ptInt1.y * ptInt1.y < dMinRad * dMinRad + 2 * dMinRad * dTan * dEpsLow) {
nBasInt += 1 ;
vtN1 = Z_AX ;
}
ptInt2 = ptP + ( ( dMaxH - ptP.z) / vtV.z) * vtV ;
ptInt2 = ptP + ( ( dMaxH + dEpsUp - ptP.z) / vtV.z) * vtV ;
if ( ptInt2.x * ptInt2.x + ptInt2.y * ptInt2.y < dMaxRad * dMaxRad + 2 * dMaxRad * dTan * dEpsUp) {
nBasInt += 2 ;
vtN2 = - Z_AX ;
+2 -2
View File
@@ -3208,7 +3208,7 @@ VolZmap::GenTool_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, con
bTapT = false ;
}
// verifiche curva successiva per eventuale tappo sotto
bool bTapB = false ;
bool bTapB = true ;
const ICurve* pNextCurve = ToolProfile.GetCurve( ++ i) ;
if ( pNextCurve != nullptr && pNextCurve->GetType() == CRV_LINE) {
const ICurveLine* pOthLine = GetCurveLine( pNextCurve) ;
@@ -4371,7 +4371,7 @@ VolZmap::CompConus_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
}
SubtractIntervals( nGrid, i, j, ptInt1.z, ptInt2.z, vtN1, vtN2, nToolNum) ;
}
// Cono finale
ConusFrame.ChangeOrig( ptV + vtMove) ;
if ( IntersLineConus( ptC, Z_AX, ConusFrame, dTan, dl, dL, bTapB, bTapT, ptInt1, vtN1, ptInt2, vtN2)) {