EgtNesting 2.2a2 :

- aggiunta funzione AddHoleToPart.
This commit is contained in:
Dario Sassi
2020-01-29 09:37:42 +00:00
parent 126c18e945
commit df8a590c04
3 changed files with 24 additions and 2 deletions
+21
View File
@@ -165,6 +165,27 @@ AutoNester::AddPart( int nPartId, const PolyArc& Outline, bool bCanFlip, bool bC
return true ;
}
//----------------------------------------------------------------------------
bool
AutoNester::AddHoleToPart( int nPartId, const PolyArc& Hole)
{
if ( m_pOrder == nullptr)
return false ;
// verifico buco
if ( Hole.GetArcNbr() == 0 || ! Hole.IsClosed())
return false ;
// cerco il pezzo
const auto Iter = m_IdPartPtr.find( nPartId) ;
if ( Iter == m_IdPartPtr.end())
return false ;
CNS_PartPtr pPart = Iter->second ;
// aggiungo buco al pezzo
vector<CNS_Element> vElem ;
GetCNSPath( Hole, vElem) ;
CNS_AddHoleToPart( pPart, int( vElem.size()), vElem.data()) ;
return true ;
}
//----------------------------------------------------------------------------
bool
AutoNester::AddAnotherOutlineToPart( int nPartId, const PolyArc& AnotherOutline)