EgtMachkernel :

- in finitura superfici tipo proiezione uniformato calcolo direzione fresa da angoli a quello degli altri tipi.
This commit is contained in:
DarioS
2026-09-01 09:19:30 +02:00
parent 588da1e032
commit cb493b60ba
+9 -3
View File
@@ -1406,7 +1406,7 @@ SurfFinishing::UpdateFrameAndToolDir( int nAuxId, bool& bRecalc)
bRecalc = true ;
Frame3d FrOld = m_Frame ;
// se lavorazione con superficie
// se lavorazione con regione
if ( m_Params.m_nSubType == SURFFIN_SUB_ZIGZAG || m_Params.m_nSubType == SURFFIN_SUB_ONEWAY ||
m_Params.m_nSubType == SURFFIN_SUB_SPIRALIN || m_Params.m_nSubType == SURFFIN_SUB_SPIRALOUT ||
m_Params.m_nSubType == SURFFIN_SUB_Z_CONST || m_Params.m_nSubType == SURFFIN_SUB_OPTIMAL ||
@@ -1414,7 +1414,7 @@ SurfFinishing::UpdateFrameAndToolDir( int nAuxId, bool& bRecalc)
PtrOwner<ISurfFlatRegion> pSfr( nullptr) ;
int nPathId = m_pGeomDB->GetFirstGroupInGroup( nAuxId) ;
while ( nPathId != GDB_ID_NULL) {
// recupero la superficie
// recupero la regione
int nSfrId = m_pGeomDB->GetFirstInGroup( nPathId) ;
if ( m_pGeomDB->GetGeoType( nSfrId) != SRF_FLATRGN)
return false ;
@@ -1484,7 +1484,7 @@ SurfFinishing::UpdateFrameAndToolDir( int nAuxId, bool& bRecalc)
Frame3d frLoc ;
if ( ! frLoc.Set( ptCentroid, vtExtrusion))
return false ;
// recupero la PolyLine assocuata alla prima curva in locale al frame creato
// recupero la PolyLine associata alla prima curva in locale al frame creato
PolyLine PLLoc ;
if ( IsNull( vCrv[0]) || ! vCrv[0]->IsValid() ||
! vCrv[0]->ApproxWithLines( EPS_SMALL, EPS_ANG_ZERO, ICurve::APL_SPECIAL, PLLoc) ||
@@ -1495,6 +1495,12 @@ SurfFinishing::UpdateFrameAndToolDir( int nAuxId, bool& bRecalc)
double dDimX, dDimY ;
if ( ! PLLoc.GetMinAreaRectangleXY( ptFrCenter, vtFrX, dDimX, dDimY))
return false ;
// oriento il frame in modo opportuno rispetto all'asse X
if ( vtFrX.x < - SQRT1_2)
vtFrX.Invert() ;
else if ( abs( vtFrX.x) < SQRT1_2 && vtFrX.y < - SQRT1_2)
vtFrX.Invert() ;
// definisco il frame
ptFrCenter.ToGlob( frLoc) ;
vtFrX.ToGlob( frLoc) ;
if ( ! m_Frame.Set( ptFrCenter, vtExtrusion, vtFrX))