From 433464722075dc2727bc71de63574a99e9d2268a Mon Sep 17 00:00:00 2001 From: DarioS Date: Sun, 19 Dec 2021 18:44:06 +0100 Subject: [PATCH] EgtNesting 2.3l2 : - aggiunte funzioni SetStripYconstraintToPart e SetStripXconstraintToPart. --- AutoNester.cpp | 39 +++++++++++++++++++++++++++++++++++++++ AutoNester.h | 2 ++ EgtNesting.rc | Bin 11646 -> 11646 bytes 3 files changed, 41 insertions(+) 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 ab6174a392cc937dbaa404e968d5538c5b1da2d9..26af1795686c0fc0a7efb598186e66f8a64cb9db 100644 GIT binary patch delta 97 zcmewt^)G6}A2vp#&41annHh~HPvp|w9LCke0v6fNG