EgtMachKernel :
- modifiche in svuotature per gestione di lati aperti concatenati con rientranze.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{0BD58222-92F3-48B2-B656-4497D1956874}</ProjectGuid>
|
||||
<RootNamespace>EgtMachKernel</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0.20348.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
|
||||
+45
-15
@@ -5501,25 +5501,49 @@ Pocketing::AdjustContourWithOpenEdges( ICurveComposite* pCompo)
|
||||
AdjustContourStart( pCompo) ;
|
||||
// raggio di riferimento per offset
|
||||
double dRad = 0.5 * m_TParams.m_dDiam + GetOffsR() ;
|
||||
// estraggo tutte le curve in un vettore
|
||||
// estraggo parti con proprietà uniforme in un vettore
|
||||
ICURVEPOVECTOR vpCrvs ;
|
||||
vpCrvs.reserve( pCompo->GetCurveCount()) ;
|
||||
while ( pCompo->GetCurveCount() > 0)
|
||||
vpCrvs.emplace_back( pCompo->RemoveFirstOrLastCurve( false)) ;
|
||||
// elimino le curve troppo corte (10 epsilon)
|
||||
for ( int i = 0 ; i < int( vpCrvs.size()) ;) {
|
||||
double dLen = 0 ; vpCrvs[i]->GetLength( dLen) ;
|
||||
if ( dLen < 10 * EPS_SMALL)
|
||||
vpCrvs.erase( vpCrvs.begin() + i) ;
|
||||
else
|
||||
++ i ;
|
||||
int nCurrTempProp ;
|
||||
int nParStart = 0 ;
|
||||
for ( int i = 0 ; i < pCompo->GetCurveCount() ; ++ i) {
|
||||
int nTempProp ;
|
||||
pCompo->GetCurveTempProp( i, nTempProp) ;
|
||||
if ( i == 0) {
|
||||
nCurrTempProp = nTempProp ;
|
||||
nParStart = i ;
|
||||
}
|
||||
else if ( nCurrTempProp != nTempProp) {
|
||||
PtrOwner<ICurve> pCrv( pCompo->CopyParamRange( nParStart, i)) ;
|
||||
if ( IsNull( pCrv))
|
||||
return false ;
|
||||
pCrv->SetTempProp( nCurrTempProp) ;
|
||||
pCrv->SetExtrusion( vtExtr) ;
|
||||
vpCrvs.emplace_back( Release( pCrv)) ;
|
||||
nCurrTempProp = nTempProp ;
|
||||
nParStart = i ;
|
||||
}
|
||||
}
|
||||
PtrOwner<ICurve> pCrv( pCompo->CopyParamRange( nParStart, pCompo->GetCurveCount())) ;
|
||||
if ( IsNull( pCrv))
|
||||
return false ;
|
||||
pCrv->SetTempProp( nCurrTempProp) ;
|
||||
pCrv->SetExtrusion( vtExtr) ;
|
||||
vpCrvs.emplace_back( Release( pCrv)) ;
|
||||
// offsetto del raggio le curve aperte
|
||||
for ( int i = 0 ; i < int( vpCrvs.size()) ; ++ i) {
|
||||
if ( vpCrvs[i]->GetTempProp() == 1)
|
||||
vpCrvs[i]->SimpleOffset( dRad) ;
|
||||
if ( vpCrvs[i]->GetTempProp() == 1) {
|
||||
OffsetCurve OffsCrv ;
|
||||
if ( ! OffsCrv.Make( vpCrvs[i], dRad, ICurve::OFF_FILLET) || OffsCrv.GetCurveCount() == 0) {
|
||||
m_pMchMgr->SetLastError( 2412, "Error in Pocketing : Offset not computable") ;
|
||||
return false ;
|
||||
}
|
||||
vpCrvs[i].Set( OffsCrv.GetLongerCurve()) ;
|
||||
vpCrvs[i]->SetTempProp( 1) ;
|
||||
}
|
||||
}
|
||||
// reinserisco le curve, chiudendo eventuali gap
|
||||
pCompo->Clear() ;
|
||||
pCompo->SetExtrusion( vtExtr) ;
|
||||
bool bOpenCurr = false ;
|
||||
double dDiam = 1.05 * m_TParams.m_dDiam + 2 * GetOffsR() ;
|
||||
for ( int i = 0 ; i < int( vpCrvs.size()) ; ++ i) {
|
||||
@@ -5552,8 +5576,14 @@ Pocketing::AdjustContourWithOpenEdges( ICurveComposite* pCompo)
|
||||
pJCrv->ToGlob( frPocket) ;
|
||||
vpCrvs[i]->ToGlob( frPocket) ;
|
||||
// taglio opportunamente le curve
|
||||
IntCrvCrvInfo aInfo ;
|
||||
if ( intCC.GetIntCrvCrvInfo( intCC.GetIntersCount() - 1, aInfo)) {
|
||||
if ( intCC.GetIntersCount() > 0) {
|
||||
// cerco la prima intersezione che entra nella curva aperta
|
||||
IntCrvCrvInfo aInfo ;
|
||||
for ( int j = 0 ; j < intCC.GetIntersCount() ; ++ j) {
|
||||
if ( intCC.GetIntCrvCrvInfo( j, aInfo) && aInfo.IciA[0].nPrevTy == ICCT_OUT) {
|
||||
break ;
|
||||
}
|
||||
}
|
||||
pJCrv->TrimEndAtParam( aInfo.IciA[0].dU) ;
|
||||
vpCrvs[i]->TrimStartAtParam( aInfo.IciB[0].dU) ;
|
||||
pCompo->AddCurve( ::Release( pJCrv), true, 10 * EPS_SMALL) ;
|
||||
|
||||
Reference in New Issue
Block a user