EgtGeomKernel :

- modifiche a sistemazione topologie di intersezioni di curve composite
- eliminazione di linee inutili in generale
- cambio nome di variabili che nascondono omonime.
This commit is contained in:
Dario Sassi
2020-10-05 06:56:24 +00:00
parent 74df7ecfcd
commit be027def9c
18 changed files with 152 additions and 232 deletions
+7 -25
View File
@@ -845,7 +845,6 @@ VolZmap::CylBall_ZPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const
// Parametri geometrici dell'utensile
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
double dSqRad = m_Tool.GetRadius() * m_Tool.GetRadius() ;
double dSafeRad = m_Tool.GetRadius() - EPS_SMALL ;
double dSafeSqRad = dSafeRad * dSafeRad ;
@@ -990,22 +989,18 @@ VolZmap::CylBall_ZMilling( int nGrid, const Point3d & ptS, const Point3d & ptE,
double dZMaxI = max( ptI.z, ptIT.z) ;
double dZMaxF = max( ptF.z, ptFT.z) ;
double dZMinI = dZMaxI - dStemHeigth ;
double dZMinF = dZMaxF - dStemHeigth ;
double dDeltaZ = dZMaxF - dZMaxI ;
// Vettori caratterizzanti il moto
Vector3d vtMove = ptF - ptI ;
Vector3d vtMoveXY( vtMove.x, vtMove.y, 0) ;
double dLen = vtMove.Len() ;
double dLenXY = vtMoveXY.LenXY() ;
vtMove.Normalize() ;
// Parametri per determinare l'ellisse proiettata
double dCos = vtToolDir * vtMove ;
double dSin = ( abs( dCos) < 1 ? 1 - dCos * dCos : 0) ;
double dSemiAxMin = m_Tool.GetRadius() * dCos ; // x1^2 = a^2 - (a / b)^2 x2^2 ; a = r dCos e b = r;
double dSqSemiAxMin = dSemiAxMin * dSemiAxMin ; // da cui si ottiene x1^2 = a^2 - dCos^2 x2^2
double dSqRatio = dSqSemiAxMin / dSqRad ;
// Definizione di un sistema di riferimento ad hoc
Vector3d vtV1, vtV2 ;
@@ -1649,7 +1644,7 @@ VolZmap::GenTool_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
const ICurve* pCurve = ToolProfile.GetFirstCurve() ;
while ( pCurve != nullptr) {
double dHeight ;
double dHeight = 0 ;
// Se segmento
if ( pCurve->GetType() == CRV_LINE) {
@@ -1738,7 +1733,7 @@ VolZmap::GenTool_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, co
const ICurve* pCurve = ToolProfile.GetFirstCurve() ;
while ( pCurve != nullptr) {
double dHeight ;
double dHeight = 0 ;
// Se segmento
if ( pCurve->GetType() == CRV_LINE) {
@@ -1953,7 +1948,6 @@ VolZmap::CylBall_XYPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, cons
// Parte sferica
double dCos = vtMove.z ; // vtMove.z > 0 : ptF.z >= ptI.z
double dSin = ( dCos < 1 ? sqrt( 1 - dCos * dCos) : 0) ;
double dSemiAxMin = m_Tool.GetRadius() * dCos ;
double dInfZ, dSupZ ;
@@ -2191,8 +2185,6 @@ VolZmap::Conus_XYDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, co
double dMinRad = min( m_Tool.GetRadius(), m_Tool.GetTipRadius()) ;
double dMaxRad = max( m_Tool.GetRadius(), m_Tool.GetTipRadius()) ;
double dDeltaRad = dMaxRad - dMinRad ;
double dSqMinRad = dMinRad * dMinRad ;
double dSqMaxRad = dMaxRad * dMaxRad ;
// Geometria del moto
double dLenXY = ( ptE - ptS).LenXY() ;
@@ -2319,11 +2311,8 @@ VolZmap::Conus_XYPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const
double dStemHeigth = m_Tool.GetHeigth() - m_Tool.GetTipHeigth() ;
double dMinRad = min( m_Tool.GetRadius(), m_Tool.GetTipRadius()) ;
double dMaxRad = max( m_Tool.GetRadius(), m_Tool.GetTipRadius()) ;
double dSqTipRad = m_Tool.GetTipRadius() * m_Tool.GetTipRadius() ;
double dSqRad = m_Tool.GetRadius() * m_Tool.GetRadius() ;
double dDeltaRad = dMaxRad - dMinRad ;
double dSqMinRad = dMinRad * dMinRad ;
double dSqMaxRad = dMaxRad * dMaxRad ;
// Studio delle simmetrie del moto
Point3d ptI = ( ptS.z < ptE.z ? ptS : ptE) ;
@@ -2337,7 +2326,6 @@ VolZmap::Conus_XYPerp( int nGrid, const Point3d& ptS, const Point3d& ptE, const
// Cinematica del moto
Vector3d vtMove = ptF - ptI ;
double dLenPath = vtMove.Len() ;
double dLengthPathXY = vtMove.LenXY() ;
double dDeltaZ = ptF.z - ptI.z ;
double dZI = ptI.z ;
@@ -2870,7 +2858,7 @@ VolZmap::GenTool_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, co
const ICurve* pCurve = ToolProfile.GetFirstCurve() ;
while ( pCurve != nullptr) {
double dHeight ;
double dHeight = 0 ;
// Se segmento
if ( pCurve->GetType() == CRV_LINE) {
@@ -2987,7 +2975,7 @@ VolZmap::GenTool_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, con
const ICurve* pCurve = ToolProfile.GetFirstCurve() ;
while ( pCurve != nullptr) {
double dHeight ;
double dHeight = 0 ;
// Se segmento
if ( pCurve->GetType() == CRV_LINE) {
@@ -3317,22 +3305,18 @@ VolZmap::CompCyl_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, co
double dZMaxI = max( ptI.z, ptIT.z) ;
double dZMaxF = max( ptF.z, ptFT.z) ;
double dZMinI = dZMaxI - dHei ;
double dZMinF = dZMaxF - dHei ;
double dDeltaZ = dZMaxF - dZMaxI ;
// Vettori caratterizzanti il moto
Vector3d vtMove = ptF - ptI ;
Vector3d vtMoveXY( vtMove.x, vtMove.y, 0) ;
double dLen = vtMove.Len() ;
double dLenXY = vtMoveXY.LenXY() ;
vtMove.Normalize() ;
// Parametri per determinare l'ellisse proiettata
double dCos = vtToolDir * vtMove ;
double dSin = ( abs( dCos) < 1 ? 1 - dCos * dCos : 0) ;
double dSemiAxMin = dRad * dCos ; // x1^2 = a^2 - (a / b)^2 x2^2 ; a = r dCos e b = r;
double dSqSemiAxMin = dSemiAxMin * dSemiAxMin ; // da cui si ottiene x1^2 = a^2 - dCos^2 x2^2
double dSqRatio = dSqSemiAxMin / dSqRad ;
double dSafeRad = dRad - EPS_SMALL ;
@@ -3436,8 +3420,8 @@ VolZmap::CompConus_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE,
Point3d ptIxy( ptI.x, ptI.y, 0) ;
Point3d ptFxy( ptF.x, ptF.y, 0) ;
Vector3d vtMove = ptF - ptI ; double dLen = vtMove.Len() ;
Vector3d vtMLong = ( vtMove * vtToolDir) * vtToolDir ; double dLLong = vtMLong.Len() ;
Vector3d vtMove = ptF - ptI ;
Vector3d vtMLong = ( vtMove * vtToolDir) * vtToolDir ;
Vector3d vtMOrt = vtMove - vtMLong ; double dLOrt = vtMOrt.Len() ;
Vector3d vtV1 = vtToolDir ;
@@ -3472,7 +3456,7 @@ VolZmap::CompConus_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE,
double dDots = vtR0 * vtNs ;
double dDotd = vtR0 * vtNd ;
double dMin, dMax, dPLim, dMLim ;
double dMin = 0, dMax = 0, dPLim = 0, dMLim = 0 ;
Vector3d vtMin, vtMax, vtP, vtM ;
Vector3d vtUmv = vtMove ;
@@ -3624,7 +3608,6 @@ VolZmap::CompConus_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE,
}
else {
double dLatMin = dMinRad * dSin ;
double dLatMax = dMaxRad * dSin ;
double dDeltaLat = dDeltaR * dSin ;
Vector3d vtRadial = dCos * vtV2 - dSin * vtV3 ;
vtRadial.Normalize() ;
@@ -3660,7 +3643,6 @@ VolZmap::CompConus_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE,
}
else {
double dLatMin = dMinRad * dSin ;
double dLatMax = dMaxRad * dSin ;
double dDeltaLat = dDeltaR * dSin ;
Vector3d vtRadial = dCos * vtV2 + dSin * vtV3 ;
vtRadial.Normalize() ;