Merge commit 'eb48c9f9a05b7038fc9007bbdc57b1e46aff1ed8'
This commit is contained in:
+33
-22
@@ -2441,26 +2441,17 @@ SurfFinishing::GetZConstFacesInsideSfrParallelToTool( const SURFLOCALVECTOR& vSr
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
ICAvParSilhouettesSurfTm*
|
||||
SurfFinishing::GetParSilhouettesForZConst( const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frSurf,
|
||||
const ISurfFlatRegion* pSfr) const
|
||||
SurfFinishing::GetParSilhouettesForZConst( const ISURFTMPOVECTOR& vStm, const ISurfFlatRegion* pSfr) const
|
||||
{
|
||||
// controllo dei parametri
|
||||
if ( vSrfLoc.empty() || ! frSurf.IsValid() || pSfr == nullptr || ! pSfr->IsValid())
|
||||
if ( vStm.empty() || pSfr == nullptr || ! pSfr->IsValid())
|
||||
return nullptr ;
|
||||
|
||||
// inizializzo la classe di calcolo delle silhouette nei piani come sopra
|
||||
CISURFTMPVECTOR vpStm ; vpStm.reserve( vSrfLoc.size()) ;
|
||||
for ( int i = 0 ; i < int( vSrfLoc.size()) ; ++ i) {
|
||||
ISurfTriMesh* pStm = CloneSurfTriMesh( GetSurfTriMesh( vSrfLoc[i].Get())) ;
|
||||
if ( pStm != nullptr && pStm->IsValid() && pStm->GetTriangleCount() > 0) {
|
||||
pStm->ToGlob( frSurf) ;
|
||||
vpStm.emplace_back( pStm) ;
|
||||
}
|
||||
else {
|
||||
delete( pStm) ;
|
||||
pStm = nullptr ;
|
||||
}
|
||||
}
|
||||
CISURFTMPVECTOR vpStm ; vpStm.reserve( vStm.size()) ;
|
||||
for ( int i = 0 ; i < int( vStm.size()) ; ++ i)
|
||||
vpStm.emplace_back( vStm[i]) ;
|
||||
|
||||
const double SILH_SHARPED_ANG_TOL = ( ANG_TOL_STD_DEG / 3.) ;
|
||||
PtrOwner<ICAvParSilhouettesSurfTm> pCavParSilh( CreateCAvParSilhouettesSurfTm()) ;
|
||||
if ( IsNull( pCavParSilh) ||
|
||||
@@ -2603,7 +2594,7 @@ SurfFinishing::CalcZConstSilCrv( ICAvParSilhouettesSurfTm* pCavParSilh, const SU
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
SurfFinishing::CreateZConstPaths( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frSurf,
|
||||
SurfFinishing::CreateZConstPaths( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf,
|
||||
vector<ICRVCOMPOPOVECTOR>& vCrvCompo, const Vector3d& vtTool, const ISurfFlatRegion* pSfr,
|
||||
double dDepth, ICRVCOMPOPOVECTOR& vCrvPath)
|
||||
{
|
||||
@@ -2960,7 +2951,15 @@ SurfFinishing::AddZConst( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSrf
|
||||
return false ;
|
||||
|
||||
// inizializzo la classe di calcolo delle silhouette nei piani come sopra
|
||||
PtrOwner<ICAvParSilhouettesSurfTm> pCavParSilh( GetParSilhouettesForZConst( vSrfLoc, frSurf, pSfrClass)) ;
|
||||
ISURFTMPOVECTOR vpStm ; vpStm.reserve( vSrfLoc.size()) ;
|
||||
for ( int i = 0 ; i < int( vSrfLoc.size()) ; ++ i) {
|
||||
PtrOwner<ISurfTriMesh> pStm( CloneSurfTriMesh( GetSurfTriMesh( vSrfLoc[i].Get()))) ;
|
||||
if ( ! IsNull( pStm) && pStm->IsValid() && pStm->GetTriangleCount() > 0) {
|
||||
pStm->ToGlob( frSurf) ;
|
||||
vpStm.emplace_back( Release( pStm)) ;
|
||||
}
|
||||
}
|
||||
PtrOwner<ICAvParSilhouettesSurfTm> pCavParSilh( GetParSilhouettesForZConst( vpStm, pSfrClass)) ;
|
||||
if ( IsNull( pCavParSilh))
|
||||
return false ;
|
||||
|
||||
@@ -2982,7 +2981,7 @@ SurfFinishing::AddZConst( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSrf
|
||||
|
||||
// collego tra loro le curve trovate
|
||||
ICRVCOMPOPOVECTOR vCrvPath ;
|
||||
if ( ! CreateZConstPaths( pCAvTlStm, vSrfLoc, frSurf, vCrvCompo, vtTool, pSfrClass, dDepth, vCrvPath)) {
|
||||
if ( ! CreateZConstPaths( pCAvTlStm, frSurf, vCrvCompo, vtTool, pSfrClass, dDepth, vCrvPath)) {
|
||||
m_pMchMgr->SetLastError( 3127, "Error in SurfFinishing : Computing ZConst Paths failed") ;
|
||||
return false ;
|
||||
}
|
||||
@@ -3434,7 +3433,7 @@ SurfFinishing::SplitStmInTwoSilSfrByClippingAngle( const SURFLOCALVECTOR& vSrfLo
|
||||
StmSoup.End() ;
|
||||
|
||||
// definisco vettori superfici locali ZConst e superficiTM perpendicolari a vtTool
|
||||
CISURFTMPVECTOR vStmLocZConst ;
|
||||
ISURFTMPOVECTOR vStmLocZConst ;
|
||||
// recupero le superfici trimesh
|
||||
PtrOwner<ISurfTriMesh> pStmCurr( StmSoup.GetSurf()) ;
|
||||
while ( ! IsNull( pStmCurr) && pStmCurr->IsValid() && pStmCurr->GetTriangleCount() > 0) {
|
||||
@@ -3459,9 +3458,13 @@ SurfFinishing::SplitStmInTwoSilSfrByClippingAngle( const SURFLOCALVECTOR& vSrfLo
|
||||
// construisco la regione piana per ZConst
|
||||
pSfrSpiral->CopyFrom( pSfrCnt) ; // superficie per spiral uguale all'originale
|
||||
if ( ! vStmLocZConst.empty()) {
|
||||
// definisco il vettore di TriMesh
|
||||
CISURFTMPVECTOR vStmConst ; vStmConst.reserve( vStmLocZConst.size()) ;
|
||||
for ( int i = 0 ; i < int( vStmLocZConst.size()) ; ++ i)
|
||||
vStmConst.emplace_back( vStmLocZConst[i]) ;
|
||||
// inizializzo classe di calcolo della Silhoeutte
|
||||
PtrOwner<ICAvParSilhouettesSurfTm> pCavParSilh( CreateCAvParSilhouettesSurfTm()) ;
|
||||
if ( IsNull( pCavParSilh) || ! pCavParSilh->SetData( vStmLocZConst, frLoc, SILH_TOL))
|
||||
if ( IsNull( pCavParSilh) || ! pCavParSilh->SetData( vStmConst, frLoc, SILH_TOL))
|
||||
return false ;
|
||||
// recupero la regione piana
|
||||
if ( ! GetSfrBySilhouette( pCavParSilh, dDepth, SILH_TOL, 2. * dMaxRad, ANG_TOL_STD_DEG, pSfrZConst))
|
||||
@@ -3767,7 +3770,15 @@ SurfFinishing::AddOptimal( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSr
|
||||
}
|
||||
}
|
||||
// inizializzo la classe di calcolo delle silhouette nei piani come sopra
|
||||
PtrOwner<ICAvParSilhouettesSurfTm> pCavParSilh( GetParSilhouettesForZConst( vSrfLoc, frSurf, pSfrToWork)) ;
|
||||
ISURFTMPOVECTOR vpStm ; vpStm.reserve( vSrfLoc.size()) ;
|
||||
for ( int i = 0 ; i < int( vSrfLoc.size()) ; ++ i) {
|
||||
PtrOwner<ISurfTriMesh> pStm( CloneSurfTriMesh( GetSurfTriMesh( vSrfLoc[i].Get()))) ;
|
||||
if ( ! IsNull( pStm) && pStm->IsValid() && pStm->GetTriangleCount() > 0) {
|
||||
pStm->ToGlob( frSurf) ;
|
||||
vpStm.emplace_back( Release( pStm)) ;
|
||||
}
|
||||
}
|
||||
PtrOwner<ICAvParSilhouettesSurfTm> pCavParSilh( GetParSilhouettesForZConst( vpStm, pSfrToWork)) ;
|
||||
if ( IsNull( pCavParSilh))
|
||||
return false ;
|
||||
// recupero le curve singole definite dal bordo della Silhouette
|
||||
@@ -3780,7 +3791,7 @@ SurfFinishing::AddOptimal( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSr
|
||||
if ( ! vCrvCompo.empty()) {
|
||||
// collego tra loro le curve trovate
|
||||
ICRVCOMPOPOVECTOR vCrv ;
|
||||
if ( ! CreateZConstPaths( pCAvTlStm, vSrfLoc, frSurf, vCrvCompo, vtTool, pSfrToWork, dDepth, vCrv)) {
|
||||
if ( ! CreateZConstPaths( pCAvTlStm, frSurf, vCrvCompo, vtTool, pSfrToWork, dDepth, vCrv)) {
|
||||
m_pMchMgr->SetLastError( 3127, "Error in SurfFinishing : Computing ZConst Paths failed") ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
+3
-3
@@ -19,6 +19,7 @@
|
||||
#include "ToolData.h"
|
||||
#include "MachiningConst.h"
|
||||
#include "/EgtDev/Include/EGkCurveComposite.h"
|
||||
#include "/EgtDev/Include/EGkSurfTriMesh.h"
|
||||
#include "/EgtDev/Include/EgtNumUtils.h"
|
||||
#include "/EgtDev/Include/EGkSurfLocal.h"
|
||||
|
||||
@@ -120,11 +121,10 @@ class SurfFinishing : public Machining
|
||||
double dDepth, const Vector3d& vtTool, double dClippingAngle, ISurfFlatRegion* pSfrSpiral, ISurfFlatRegion* pSfrZConst) ;
|
||||
bool GetZConstFacesInsideSfrParallelToTool( const SURFLOCALVECTOR&, const Frame3d& frSurf, const ISurfFlatRegion* pSfr,
|
||||
const Vector3d& vtTool, std::set<double>& setZAmbiguos) ;
|
||||
ICAvParSilhouettesSurfTm* GetParSilhouettesForZConst( const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frSurf,
|
||||
const ISurfFlatRegion* pSfr) const ;
|
||||
ICAvParSilhouettesSurfTm* GetParSilhouettesForZConst( const ISURFTMPOVECTOR& vStm, const ISurfFlatRegion* pSfr) const ;
|
||||
bool CalcZConstSilCrv( ICAvParSilhouettesSurfTm* pCavParSilh, const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frSurf, const ISurfFlatRegion* pSfr,
|
||||
const Vector3d& vtTool, double dDepth, std::vector<ICRVCOMPOPOVECTOR>& vCrvCompo) ;
|
||||
bool CreateZConstPaths( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR& vSrfLoc, const Frame3d& frSurf, std::vector<ICRVCOMPOPOVECTOR>& vCrvCompo, const Vector3d& vtTool,
|
||||
bool CreateZConstPaths( ICAvToolSurfTm* pCAvTlStm, const Frame3d& frSurf, std::vector<ICRVCOMPOPOVECTOR>& vCrvCompo, const Vector3d& vtTool,
|
||||
const ISurfFlatRegion* pSfr, double dDepth, ICRVCOMPOPOVECTOR& vCrvPath) ;
|
||||
bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
|
||||
bool AddLinkApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;
|
||||
|
||||
Reference in New Issue
Block a user