diff --git a/AutoNester.cpp b/AutoNester.cpp index 7ca7942..c1a5208 100644 --- a/AutoNester.cpp +++ b/AutoNester.cpp @@ -20,6 +20,7 @@ #include "/EgtDev/Extern/Optalog/Include/cns.h" #include "/EgtDev/Extern/Optalog/Include/cns_tooling.h" #include "/EgtDev/Extern/Optalog/Include/cns_restricted_zone.h" +#include "/EgtDev/Extern/Optalog/Include/cns_textile.h" #include "/EgtDev/Extern/Optalog/Include/cns_egaltech.h" #include "/EgtDev/Include/SELkLockId.h" @@ -360,6 +361,44 @@ AutoNester::SetRestrictedZoneToPart( int nPartId, int nRzConstrId) return true ; } +//---------------------------------------------------------------------------- +bool +AutoNester::SetStripYconstraintToPart( int nPartId, const Point3d& ptRef, double dStripStart, double dStripRepeat) +{ + if ( m_pOrder == nullptr) + return false ; + // cerco il pezzo + const auto Iter = m_IdPartPtr.find( nPartId) ; + if ( Iter == m_IdPartPtr.end()) + return false ; + CNS_PartPtr pPart = Iter->second ; + // imposto il vincolo + CNS_Point CNSPT_Ref ; + CNSPT_Ref.x = ptRef.x ; + CNSPT_Ref.y = ptRef.y ; + CNS_SetPartStripYconstraint( pPart, CNSPT_Ref, dStripStart, dStripRepeat) ; + return true ; +} + +//---------------------------------------------------------------------------- +bool +AutoNester::SetStripXconstraintToPart( int nPartId, const Point3d& ptRef, double dStripStart, double dStripRepeat) +{ + if ( m_pOrder == nullptr) + return false ; + // cerco il pezzo + const auto Iter = m_IdPartPtr.find( nPartId) ; + if ( Iter == m_IdPartPtr.end()) + return false ; + CNS_PartPtr pPart = Iter->second ; + // imposto il vincolo + CNS_Point CNSPT_Ref ; + CNSPT_Ref.x = ptRef.x ; + CNSPT_Ref.y = ptRef.y ; + CNS_SetPartStripXconstraint( pPart, CNSPT_Ref, dStripStart, dStripRepeat) ; + return true ; +} + //---------------------------------------------------------------------------- bool AutoNester::SetInterpartGap( double dGap) diff --git a/AutoNester.h b/AutoNester.h index cbf0a81..f6df30e 100644 --- a/AutoNester.h +++ b/AutoNester.h @@ -38,6 +38,8 @@ class AutoNester : public IAutoNester bool AddAnotherOutlineToPart( int nPartId, const PolyArc& AnotherOutline) override ; bool AddToolOutlineToPart( int nPartId, const PolyArc& ToolOutline) override ; bool SetRestrictedZoneToPart( int nPartId, int nRzConstrId) override ; + bool SetStripYconstraintToPart( int nPartId, const Point3d& ptRef, double dStripStart, double dStripRepeat) override ; + bool SetStripXconstraintToPart( int nPartId, const Point3d& ptRef, double dStripStart, double dStripRepeat) override ; bool SetInterpartGap( double dGap) override ; bool SetReportFile( const std::string& sReportFile) override ; bool Compute( bool bMinimizeOnXvsY, int nMaxTime) override ; diff --git a/EgtNesting.rc b/EgtNesting.rc index ab6174a..26af179 100644 Binary files a/EgtNesting.rc and b/EgtNesting.rc differ