EgtGeomKernel 2.5f4 :

- corretta IntersSegmentCylinder (qui come cilindro si intende solo la superficie dello stesso)
- corretta e velocizzata AvoidSurfTm di VolZmap nel caso di test con singola map.
This commit is contained in:
DarioS
2023-06-21 08:26:21 +02:00
parent c4f1a7f97b
commit 8a3d46416d
4 changed files with 72 additions and 61 deletions
+10 -8
View File
@@ -800,7 +800,7 @@ IntersLineCylinder( const Point3d& ptPLine, const Vector3d& vtVLine,
// Parte della retta appartenente al cilindro
if ( nIntType == CC_INF_INT) {
dU1 = ( ptPCyl- ptPLine) * vtVLine ;
dU1 = ( ptPCyl - ptPLine) * vtVLine ;
// Retta e cilindro equiversi
if ( vtVCyl * vtVLine > 0)
dU2 = dU1 + dCylHeigth ;
@@ -819,8 +819,7 @@ IntersLineCylinder( const Point3d& ptPLine, const Vector3d& vtVLine,
}
// Caso di due intersezioni
else if ( nIntType == CC_TWO_INT) {
// Rigetto le soluzioni fuori dalla
// regione ammissibile del cilindro.
// Elimino le soluzioni fuori dal cilindro finito
Point3d ptInt1 = ptPLine + dU1 * vtVLine ;
Point3d ptInt2 = ptPLine + dU2 * vtVLine ;
int nSolNum = 2 ;
@@ -832,8 +831,7 @@ IntersLineCylinder( const Point3d& ptPLine, const Vector3d& vtVLine,
if ( ( ptInt2 - ptPCyl) * vtVCyl < 0 ||
( ptInt2 - ptPCyl) * vtVCyl > dCylHeigth)
-- nSolNum ;
// Dal numero di soluzioni rimaste
// aggiorno la tipologia di interferenza.
// Aggiorno il tipo di intersezione
if ( nSolNum == 1)
nIntType = CC_ONE_INT_SEC ;
else if ( nSolNum == 0)
@@ -896,8 +894,7 @@ IntersSegmentCylinder( const Point3d& ptPLine, const Vector3d& vtVLine, double d
if ( nIntType == CC_ERROR_INT)
return nIntType ;
// Parte della retta associata
// appartiene al cilindro
// Parte della retta associata appartiene al cilindro
if ( nIntType == CC_INF_INT) {
// Segmento non interferisce
if ( dU1 > dLen + EPS_SMALL)
@@ -925,7 +922,7 @@ IntersSegmentCylinder( const Point3d& ptPLine, const Vector3d& vtVLine, double d
if ( dU1 < - EPS_SMALL || dU1 > dLen + EPS_SMALL)
nIntType = CC_NO_INTERS ;
}
// Retta associata è secante
// Retta associata è secante con due punti di intersezione
else if ( nIntType == CC_TWO_INT) {
// Il segmento non interferisce
if ( dU1 > dLen + EPS_SMALL)
@@ -951,6 +948,11 @@ IntersSegmentCylinder( const Point3d& ptPLine, const Vector3d& vtVLine, double d
nIntType = CC_NO_INTERS ;
}
}
// Retta associata è secante con un punto di intersezione
else if ( nIntType == CC_ONE_INT_SEC) {
if ( dU1 < -EPS_SMALL || dU1 > dLen + EPS_SMALL)
nIntType = CC_NO_INTERS ;
}
return nIntType ;
}