EgtGeomKernel 1.9e3 :

- correzioni a CAvToolTriangle per utensili conici
- migliorato calcolo box utensile in CAvToolSurfTm
- cambiata costante tipo utensile per conico.
This commit is contained in:
Dario Sassi
2018-05-17 08:02:38 +00:00
parent 455d1e5f0c
commit 5fb64bdb3f
7 changed files with 526 additions and 335 deletions
+30 -6
View File
@@ -164,14 +164,38 @@ CAvToolSurfTm::MyTestPosition( Point3d& ptT, const Vector3d& vtDir)
double
CAvToolSurfTm::MyTestPositionHG( Point3d& ptT, const Vector3d& vtDir)
{
double dTotDist = 0 ;
// calcolo box utensile nel riferimento di movimento
BBox3d b3Tool ;
b3Tool.Add( ptT) ;
b3Tool.Add( ptT + vtDir * m_Tool.GetHeigth()) ;
b3Tool.Expand( m_Tool.GetRadius(), m_Tool.GetRadius(), 0) ;
b3Tool.ToLoc( m_frMove) ;
// recupero indici triangoli che intersecano box in 2d
if ( AreSameOrOppositeVectorApprox( vtDir, m_frMove.VersX())) {
Point3d ptTL = ptT ; ptTL.ToLoc( m_frMove) ;
Vector3d vtDirL = vtDir ; vtDirL.ToLoc( m_frMove) ;
b3Tool.Add( ptTL) ;
b3Tool.Add( ptTL - vtDirL * m_Tool.GetHeigth()) ;
b3Tool.Expand( 0, m_Tool.GetRadius(), m_Tool.GetRadius()) ;
}
else if ( AreSameOrOppositeVectorApprox( vtDir, m_frMove.VersY())) {
Point3d ptTL = ptT ; ptTL.ToLoc( m_frMove) ;
Vector3d vtDirL = vtDir ; vtDirL.ToLoc( m_frMove) ;
b3Tool.Add( ptTL) ;
b3Tool.Add( ptTL - vtDirL * m_Tool.GetHeigth()) ;
b3Tool.Expand( m_Tool.GetRadius(), 0, m_Tool.GetRadius()) ;
}
else if ( AreSameOrOppositeVectorApprox( vtDir, m_frMove.VersZ())) {
Point3d ptTL = ptT ; ptTL.ToLoc( m_frMove) ;
Vector3d vtDirL = vtDir ; vtDirL.ToLoc( m_frMove) ;
b3Tool.Add( ptTL) ;
b3Tool.Add( ptTL - vtDirL * m_Tool.GetHeigth()) ;
b3Tool.Expand( m_Tool.GetRadius(), m_Tool.GetRadius(), 0) ;
}
else {
b3Tool.Add( ptT) ;
b3Tool.Add( ptT - vtDir * m_Tool.GetHeigth()) ;
b3Tool.Expand( m_Tool.GetRadius(), m_Tool.GetRadius(), 0) ;
b3Tool.ToLoc( m_frMove) ;
}
b3Tool.Expand( 10 * EPS_SMALL) ;
// ciclo sui triangoli che intersecano box in 2d
double dTotDist = 0 ;
INTVECTOR vnIds ;
if ( m_HGrids.Find( b3Tool, vnIds)) {
for ( int i = 0 ; i < int( vnIds.size()) ; ++ i) {
+457 -291
View File
File diff suppressed because it is too large Load Diff
+27 -26
View File
@@ -17,7 +17,7 @@
#include "/EgtDev/Include/EGkTriangle3d.h"
double CAvToolTriangle( const Tool& tlTool, const Point3d& ptToolOrig, const Vector3d& vtToolAx,
const Triangle3d& trTria, const Vector3d& vtMove) ;
const Triangle3d& trTria, const Vector3d& vtMove) ;
// Componenti:
// Sfera
@@ -29,23 +29,31 @@ double SphereSegmentLeakDist( const Point3d& ptSpheCen, double dSpheRad,
const Vector3d& vtMove) ;
double SpherePointLeakDist( const Point3d& ptSpheCen, double dSpheRad, const Point3d ptP, const Vector3d& vtMove) ;
// Cilindro
double CAvCylinderTriangle( const Point3d& ptCompOrig, const Vector3d& vtCompAx, double dHeigth, double dRad,
const Triangle3d& trTria, const Vector3d& vtMove) ;
double DiskSegmentLeakDistLongMotion( const Point3d& ptDisk, const Vector3d& vtDiscLeak, double dDiscRad,
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen) ;
double DiskTriaInteriorLeakDistLongMot( const Point3d& ptDisk, const Vector3d& vtDiskAx, double dDiskRad,
const Triangle3d& trTria) ;
double CylPointLeakDistOrtMotion( const Point3d& ptP, const Point3d& ptCompOrig,
const Vector3d& vtCylAx, const Vector3d& vtRemDir,
double dCylHei, double dCylRad) ;
double DiskSegmentLeakDistOrtMot( const Point3d& ptSeg, const Point3d& ptDiscOrig,
const Vector3d& vtSeg, const Vector3d& vtDiscAx, const Vector3d& vtRemDir,
double dSegLen, double dDiscRad) ;
double CylSegmentLeakDistOrtMotion( const Point3d& ptSeg, const Point3d& ptCylOrig,
const Vector3d& vtSeg, const Vector3d& vtCylAx, const Vector3d& vtRemDir,
double dSegLen, double dCylHei, double dCylRad) ;
double DiskPlaneLeakDistOrtMot( const Triangle3d& trTria, const Point3d& ptDiscOrig, const Vector3d& vtDiscAx,
const Vector3d& vtMotion, double dCylRad, Point3d& ptContact) ;
double CAvCylinderTriangle( const Point3d& ptCylOrig, const Vector3d& vtCylAx, double dHeigth, double dRad,
const Triangle3d& trTria, const Vector3d& vtMove) ;
double DiskSegmentLeakDistLongMotion( const Point3d& ptDiskCen, double dDiscRad,
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen, const Vector3d& vtMove) ;
double DiskTriaInteriorLeakDistLongMot( const Point3d& ptDiskCen, double dDiskRad,
const Triangle3d& trTria, const Vector3d& vtMove) ;
double CylPointLeakDistOrtMotion( const Point3d& ptCylOrig, const Vector3d& vtCylAx, double dCylHei, double dCylRad,
const Point3d& ptP, const Vector3d& vtMove) ;
double DiskSegmentLeakDistOrtMot( const Point3d& ptDiscCen, const Vector3d& vtDiscAx, double dDiscRad,
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen, const Vector3d& vtMove) ;
double CylSegmentLeakDistOrtMotion( const Point3d& ptCylOrig, const Vector3d& vtCylAx, double dCylHei, double dCylRad,
const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen, const Vector3d& vtMove) ;
double DiskPlaneLeakDistOrtMot( const Point3d& ptDiscCen, const Vector3d& vtDiscAx, double dDiscRad,
const Point3d& ptPlane, const Vector3d& vtPlane,
const Vector3d& vtMotion, Point3d& ptContact) ;
// Cono
double CAvTrConeTriangle( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
double dTrConeH, const Triangle3d& trTria, const Vector3d& vtMove) ;
double TrConePointLeakDistLongMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
double dTrConeH, const Point3d& ptP, const Vector3d& vtMove) ;
double TrConeSegmentLeakDistLongMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
double dTrConeH, const Point3d& ptSeg, const Vector3d& vtSeg, double dSegLen,
const Vector3d& vtMove) ;
double TrConeTriangleInteriorLeakDistLongMot( const Point3d& ptMinBase, const Vector3d& vtTrConeAx, double dMinBaseR, double dMaxBaseR,
double dTrConeH, const Triangle3d& trTria, const Vector3d& vtMove) ;
// Funzioni geometriche di base
double GetPointLineSqDist( const Point3d& ptP, const Point3d& ptLine, const Vector3d& vtLine) ;
double PointPlaneSignedDist( const Point3d& ptP, const Point3d& ptPlane, const Vector3d& vtNorm) ;
@@ -56,17 +64,10 @@ double LineLineSqDist( const Point3d& ptP1, const Vector3d& vtD1, const Point3d&
double LineSegmentSqDist( const Point3d& ptPLn, const Vector3d& vtDLn,
const Point3d& ptPSg, const Vector3d& vtDSg, double dSgLen) ;
bool IsPointInsideTriangle( const Point3d& ptP, const Triangle3d& trTria) ;
bool CoplanarDiscTriangleInterferance( const Point3d& ptCen, double dRad, const Triangle3d& trTria) ;
bool FindMinDistPar( const Point3d& ptL1, const Point3d& ptL2,
const Vector3d& vtV1, const Vector3d& vtV2,
double& dU1, double& dU2) ;
int SphereLineTangentPoints( const Point3d& ptSpheCen, double dSpheRad,
const Point3d& ptSeg, const Vector3d& vtSegDir, double dSegLen,
const Vector3d& vtMove, double& dU1, double& dU2) ;
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -132,7 +132,7 @@ Tool::SetAdvTool( const string& sToolName, double dH, double dR,
// Se raggio corner nullo, allora utensile conico
if ( dCornR < EPS_SMALL) {
m_nType = CONUSMILL ;
m_nType = CONEMILL ;
m_dRCorner = 0 ;
return true ;
}
+3 -3
View File
@@ -61,10 +61,10 @@ class Tool
public :
enum ToolType { UNDEF = 0, // Utensile indefinito
GEN = 1, // Generico da profilo -> usare SetTool
CYLMILL = 2, // Cilindrica
BALLMILL = 3, // Sferica
CYLMILL = 2, // Cilindrico
BALLMILL = 3, // Sferico
BULLNOSEMILL = 4, // Naso di toro
CONUSMILL = 5, // Con parte terminale conica
CONEMILL = 5, // Con parte terminale conica
MORTISER = 6, // Mortasatrice
CHISEL = 7} ; // Scalpello
+8 -8
View File
@@ -651,7 +651,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
case Tool::BALLMILL :
CylBall_ZDrilling( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::CONUSMILL :
case Tool::CONEMILL :
Conus_ZDrilling( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::MORTISER :
@@ -673,7 +673,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
case Tool::BALLMILL :
CylBall_ZPerp( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::CONUSMILL :
case Tool::CONEMILL :
Conus_ZPerp( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::MORTISER :
@@ -695,7 +695,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
case Tool::BALLMILL :
CylBall_ZMilling( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::CONUSMILL :
case Tool::CONEMILL :
Conus_ZMilling( i, ptLs[i], ptLe[i], vtLs[i]) ;
}
}
@@ -721,7 +721,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
case Tool::BALLMILL :
CylBall_XYDrilling( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::CONUSMILL :
case Tool::CONEMILL :
Conus_XYDrilling( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::MORTISER :
@@ -742,7 +742,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
case Tool::BALLMILL :
CylBall_XYPerp( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::CONUSMILL :
case Tool::CONEMILL :
Conus_XYPerp( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::MORTISER :
@@ -763,7 +763,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
case Tool::BALLMILL :
CylBall_XYMilling( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::CONUSMILL :
case Tool::CONEMILL :
Conus_XYMilling( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
}
@@ -788,7 +788,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
case Tool::BALLMILL :
CylBall_Drilling( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::CONUSMILL :
case Tool::CONEMILL :
Conus_Drilling( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::MORTISER :
@@ -809,7 +809,7 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
case Tool::BALLMILL :
CylBall_Milling( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::CONUSMILL :
case Tool::CONEMILL :
Conus_Milling( i, ptLs[i], ptLe[i], vtLs[i]) ;
break ;
case Tool::MORTISER :