38 Commits

Author SHA1 Message Date
Dario Sassi 408a49c099 EgtNesting 3.1e2 :
- ricompilazione con cambio versione.
2026-05-12 16:36:46 +02:00
Dario Sassi d9497aae35 EgtNesting 3.1e1 :
- ricompilazione con cambio versione.
2026-05-07 12:24:00 +02:00
Dario Sassi 770d436664 EgtNesting 3.1d2 :
- ricompilazione con cambio versione.
2026-04-22 18:32:21 +02:00
Dario Sassi d996ff2b81 EgtNesting 3.1d1 :
- ricompilazione con cambio versione.
2026-04-13 12:20:55 +02:00
Dario Sassi 1b280e8fa0 EgtNesting 3.1c1 :
- ricompilazione con cambio versione.
2026-03-05 11:19:54 +01:00
Dario Sassi 6637b590f2 EgtNesting 3.1b1 :
- ricompilazione con cambio versione.
2026-02-24 08:38:08 +01:00
Dario Sassi ba38cd3c47 EgtNesting 3.1a1 :
- ricompilazione con cambio major version.
2026-01-02 18:29:49 +01:00
Dario Sassi 43c7e5c0b5 EgtNesting 2.7l2 :
- ricompilazione con cambio versione.
2025-12-19 09:48:07 +01:00
Dario Sassi 2a1a0d2521 EgtNesting 2.7l1 :
- ricompilazione con cambio versione.
2025-12-09 08:19:10 +01:00
Dario Sassi 44d3aa5eae EgtNesting 2.7k1 :
- ricompilazione per passaggio a C++ 20
2025-11-01 17:35:30 +01:00
Dario Sassi 89d2797d53 EgtNesting 2.7j1 :
- ricompilazione con cambio versione.
2025-10-11 10:12:52 +02:00
SaraP 918481ee67 EgtNesting 2.7i2 :
- aggiunte funzioni per calcolo shear sequence.
2025-09-12 10:16:47 +02:00
Dario Sassi c7f9eb871c EgtNesting 2.7i1 :
- ricompilazione con cambio versione.
2025-09-05 08:18:41 +02:00
Dario Sassi c4561c2033 EgtNesting 2.7h1 :
- ricompilazione con cambio versione.
2025-08-22 11:52:21 +02:00
Dario Sassi 4428536b16 EgtNesting 2.7g1 :
- ricompilazione con cambio versione.
2025-07-02 19:51:02 +02:00
Dario Sassi b1a7e2e497 EgtNesting 2.7f2 :
- ricompilazione con cambio versione.
2025-06-26 09:49:12 +02:00
Dario Sassi 38f2ef696c EgtNesting 2.7e3 :
- aggiornata la configurazione di compilazione a 32bit.
2025-05-31 12:02:44 +02:00
Dario Sassi 4c86f86900 EgtNesting 2.7e2 :
- ricompilazione con cambio versione.
2025-05-16 17:44:14 +02:00
Dario Sassi 4295e0114c EgtNesting 2.7d2 :
- ricompilazione con cambio versione.
2025-04-21 11:20:16 +02:00
Dario Sassi e851f46c83 EgtNesting 2.7c4 :
- ricompilazione con cambio di versione.
2025-03-28 20:21:57 +01:00
Dario Sassi e045ad9bd7 EgtNesting 2.7c1 :
- ricompilazione con cambio versione.
2025-03-13 19:19:34 +01:00
Dario Sassi 96833a29e6 EgtNesting 2.7b1 :
- ricompilazione con cambio versione.
2025-02-28 12:12:04 +01:00
Dario Sassi cb01161e49 EgtNesting 2.7a1 :
- cambio annuale di versione
- compilazione 32bit senza più limiti per Windows XP.
2025-01-09 18:01:06 +01:00
Dario Sassi 634d3285cd EgtNesting 2.6l2 :
- ricompilazione con cambio versione.
2024-12-04 15:08:38 +01:00
Dario Sassi 567f6f0c89 EgtNesting 2.6i1 :
- ricompilazione con cambio versione.
2024-09-23 13:05:57 +02:00
Dario Sassi 9b94cc255b EgtNesting 2.6h2 :
- ricompilazione con cambio versione.
2024-08-22 09:14:00 +02:00
Dario Sassi 00060cfc3e EgtNesting 2.6g5 :
- ricompilazione con cambio versione.
2024-07-18 20:20:28 +02:00
Dario Sassi 55744af21a EgtNesting 2.6g1 :
- ricompilazione con cambio versione.
2024-07-09 11:16:14 +02:00
Dario Sassi a60a77808b EgtNesting 2.6f4 :
- ricompilazione con cambio versione.
2024-06-26 08:44:27 +02:00
Dario Sassi ca66a7d69d EgtNesting 2.6f3 :
- ricompilazione con cambio versione.
2024-06-13 08:02:58 +02:00
Dario Sassi d7b9247b8e EgtNesting 2.6f1 :
- ricompilazione con cambio versione.
2024-06-07 19:01:43 +02:00
Dario Sassi 5d03fae5fc EgtNesting 2.6e1 :
- ricompilazione per modifiche a gestione chiave di rete.
2024-04-30 16:55:39 +02:00
Dario Sassi 58bb9d1234 EgtNesting 2.6d3 :
- ricompilazione con cambio versione.
2024-04-13 17:22:40 +02:00
Dario Sassi 39f673fdcc EgtNesting 2.6d1 :
- ricompilazione con cambio versione.
2024-04-05 16:53:59 +02:00
Dario Sassi d38072d208 EgtNesting 2.6c2 :
- ricompilazione con cambio versione.
2024-03-10 10:26:39 +01:00
Dario Sassi b379dec480 EgtNesting 2.6b3 :
- ricompilazione con cambio versione.
2024-02-16 08:47:56 +01:00
Dario Sassi 3d361016ce EgtNesting 2.6b1 :
- ricompilazione con cambio versione.
2024-02-13 14:36:15 +01:00
Dario Sassi 1464915d42 EgtNesting 2.6a1
- ricompilazione con cambio versione.
2024-01-16 15:50:58 +01:00
4 changed files with 95 additions and 14 deletions
+82 -6
View File
@@ -21,6 +21,7 @@
#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_shear_sequence.h"
#include "/EgtDev/Extern/Optalog/Include/cns_egaltech.h"
#include "/EgtDev/Include/SELkLockId.h"
@@ -59,7 +60,7 @@ GetCNSPath( const PolyArc& Outline, double dOffsX, double dOffsY, vector<CNS_Ele
// AutoNester
//----------------------------------------------------------------------------
AutoNester::AutoNester( void)
: m_pOrder( nullptr), m_pComp( nullptr), m_dInterpartGap( 0)
: m_pOrder( nullptr), m_pComp( nullptr), m_dInterpartGap( 0), m_dShearGap( 0), m_bGuillotine( false)
{
}
@@ -87,6 +88,8 @@ AutoNester::Clear( void)
m_IdRzCstrPtr.clear() ;
m_IdPartPtr.clear() ;
m_dInterpartGap = 0 ;
m_dShearGap = 0 ;
m_bGuillotine = false ;
return true ;
}
@@ -106,6 +109,7 @@ AutoNester::SetGuillotineMode( void)
if ( m_pOrder == nullptr)
return false ;
CNS_SetShearMode( m_pOrder, 1) ;
m_bGuillotine = true ;
return true ;
}
@@ -153,7 +157,7 @@ AutoNester::AddSheet( int nSheetId, const PolyArc& Outline, double dKerf, int nP
dOffsY = ptMin.y ;
// imposto altri dati
CNS_SetSheetGaps( pSheet, dKerf, dKerf, dKerf, dKerf) ;
// se richiesto, ritorno che è un rettangolo
// se richiesto, ritorno che è un rettangolo
if ( pbIsRect != nullptr)
*pbIsRect = true ;
}
@@ -167,7 +171,7 @@ AutoNester::AddSheet( int nSheetId, const PolyArc& Outline, double dKerf, int nP
return false ;
// imposto altri dati
CNS_SetNonRectangularSheetGaps( pSheet, dKerf, dKerf, dKerf, dKerf, dKerf) ;
// se richiesto, ritorno che non è un rettangolo
// se richiesto, ritorno che non è un rettangolo
if ( pbIsRect != nullptr)
*pbIsRect = false ;
}
@@ -175,7 +179,7 @@ AutoNester::AddSheet( int nSheetId, const PolyArc& Outline, double dKerf, int nP
CNS_SetSheetUserString( pSheet, ToString( nSheetId).c_str()) ;
CNS_SetSheetPriority( pSheet, nPriority) ;
// lo inserisco nel map
m_IdSheetInfo.emplace( nSheetId, SheetInfo( pSheet, dOffsX, dOffsY)) ;
m_IdSheetInfo.emplace( nSheetId, SheetInfo( pSheet, dOffsX, dOffsY, dKerf)) ;
return true ;
}
@@ -416,6 +420,16 @@ AutoNester::SetInterpartGap( double dGap)
return true ;
}
//----------------------------------------------------------------------------
bool
AutoNester::SetShearGap( double dShearGap)
{
if ( m_pOrder == nullptr)
return false ;
m_dShearGap = max( 0., dShearGap) ;
return true ;
}
//----------------------------------------------------------------------------
bool
AutoNester::SetReportFile( const string& sReportFile)
@@ -438,6 +452,10 @@ AutoNester::Compute( bool bMinimizeOnXvsY, int nMaxTime)
for ( auto Iter = m_IdSheetInfo.begin() ; Iter != m_IdSheetInfo.end() ; ++ Iter)
CNS_SetDefectGap( Iter->second.pSheet, m_dInterpartGap) ;
}
// shear gap
if ( m_dShearGap > 10 * EPS_SMALL)
CNS_SetShearGap( m_pOrder, m_dShearGap) ;
// per evitare pezzi posti inutilmente di sghembo su ultimo pannello
CNS_SetObjective( m_pOrder, ( bMinimizeOnXvsY ? CNS_IntelligentMinimizeX : CNS_IntelligentMinimizeY)) ;
// recupero i codici di sblocco del nesting
@@ -491,7 +509,7 @@ AutoNester::GetComputationStatus( int& nStatus)
bool
AutoNester::GetResults( double& dTotFillRatio, ANIVECT& vANI)
{
// verifico validità calcolo
// verifico validità calcolo
if ( m_pComp == nullptr)
return false ;
// recupero la soluzione
@@ -537,11 +555,69 @@ AutoNester::GetResults( double& dTotFillRatio, ANIVECT& vANI)
return true ;
}
//----------------------------------------------------------------------------
bool
AutoNester::CalcShearSequence( int nNesting, PNTVECTOR& vPtStart, PNTVECTOR& vPtEnd)
{
vPtStart.clear() ;
vPtEnd.clear() ;
// verifico se impostata modalità ghigliottina
if ( ! m_bGuillotine)
return false ;
// verifico vincolo con intergap tra i pezzi
if ( m_dShearGap < m_dInterpartGap - EPS_SMALL)
return false ;
// verifico validità calcolo
if ( m_pComp == nullptr)
return false ;
// recupero la soluzione
CNS_SolutionPtr pSol = CNS_GetSolution( m_pComp) ;
if ( pSol == nullptr)
return false ;
// recupero il nesting richiesto
int nNestCount = CNS_GetNumberOfNestings( pSol) ;
if ( nNesting < 0 || nNesting > nNestCount - 1)
return false ;
CNS_NestingPtr pNest = CNS_GetNesting( pSol, nNesting) ;
// recupero pannello
CNS_SheetPtr pSheet = CNS_GetSheet( pNest) ;
const char* szSheetId = CNS_GetSheetUserString( pSheet) ;
int nSheetId = 999 ;
if ( szSheetId != nullptr)
FromString( szSheetId, nSheetId) ;
const auto Iter = m_IdSheetInfo.find( nSheetId) ;
// verifico vincolo con kerf del pannello
double dSheetKerf = ( Iter != m_IdSheetInfo.end() ? Iter->second.dKerf : 0) ;
if ( dSheetKerf > EPS_SMALL && m_dShearGap > dSheetKerf + EPS_SMALL)
return false ;
// offset per origine pannello
double dOffsX = ( Iter != m_IdSheetInfo.end() ? Iter->second.dOffsX : 0) ;
double dOffsY = ( Iter != m_IdSheetInfo.end() ? Iter->second.dOffsY : 0) ;
// calcolo shear sequence
CNS_ShearSequencePtr pShearSeq = CNS_ComputeShearSequence( pNest) ;
int nCnt = CNS_GetNumberOfElementsInShearSequence( pShearSeq) ;
vPtStart.reserve( nCnt) ;
vPtEnd.reserve( nCnt) ;
for ( int j = 0 ; j < nCnt ; j ++) {
double dStartX, dEndX, dStartY, dEndY ;
CNS_GetElementInShearSequence( pShearSeq, j, &dStartX, &dStartY, &dEndX, &dEndY) ;
vPtStart.emplace_back( dStartX + dOffsX, dStartY + dOffsY, 0) ;
vPtEnd.emplace_back( dEndX + dOffsX, dEndY + dOffsY, 0) ;
}
CNS_DeleteShearSequence( pShearSeq) ;
return true ;
}
//----------------------------------------------------------------------------
bool
AutoNester::PrintResults( const string& sHtmlFile)
{
// verifico validità calcolo
// verifico validità calcolo
if ( m_pComp == nullptr)
return false ;
// recupero la soluzione
+6 -1
View File
@@ -41,11 +41,13 @@ class AutoNester : public IAutoNester
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 SetShearGap( double dShearGap) override ;
bool SetReportFile( const std::string& sReportFile) override ;
bool Compute( bool bMinimizeOnXvsY, int nMaxTime) override ;
bool CancelComputation( void) override ;
bool GetComputationStatus( int& nStatus) override ;
bool GetResults( double& dTotFillRatio, ANIVECT& vANI) override ;
bool CalcShearSequence( int nNesting, std::vector<Point3d>& vPtStart, std::vector<Point3d>& vPtEnd) override ;
bool PrintResults( const std::string& sHtmlFile) override ;
public :
@@ -59,7 +61,8 @@ class AutoNester : public IAutoNester
CNS_Sheet* pSheet ;
double dOffsX ;
double dOffsY ;
SheetInfo( CNS_Sheet* pS, double dX, double dY) : pSheet( pS), dOffsX( dX), dOffsY( dY) {}
double dKerf ;
SheetInfo( CNS_Sheet* pS, double dX, double dY, double dKerf) : pSheet( pS), dOffsX( dX), dOffsY( dY), dKerf( dKerf) {}
} ;
typedef std::unordered_map< int, SheetInfo> IDSHEETINFO_UMAP ;
typedef std::unordered_map< int, CNS_RestrictedZoneConstraint*> IDRZCSTRPTR_UMAP ;
@@ -72,5 +75,7 @@ class AutoNester : public IAutoNester
IDRZCSTRPTR_UMAP m_IdRzCstrPtr ; // map dei vincoli di zone ristrette basato su identificativi
IDPARTPTR_UMAP m_IdPartPtr ; // map dei pezzi basato su identificativi
double m_dInterpartGap ; // distanza minima tra i pezzi
double m_dShearGap ;
bool m_bGuillotine ; // flag per indicare se è impostata modalità a ghigliottina
std::string m_sReportFile ; // file di report dei dati da inviare a Optalog in caso di problemi
} ;
BIN
View File
Binary file not shown.
+7 -7
View File
@@ -22,14 +22,14 @@
<ProjectGuid>{29956D5C-1F3C-4AF4-81C6-53E144808B78}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>EgtNesting</RootNamespace>
<WindowsTargetPlatformVersion>10.0.20348.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
@@ -42,7 +42,7 @@
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141_xp</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
@@ -103,7 +103,7 @@
<PreprocessorDefinitions>WIN32;I_AM_ENS;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OpenMPSupport>false</OpenMPSupport>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -126,7 +126,7 @@ copy $(TargetPath) \EgtProg\DllD32</Command>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;I_AM_ENS;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<OpenMPSupport>true</OpenMPSupport>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
</ClCompile>
<Link>
@@ -159,7 +159,7 @@ copy $(TargetPath) \EgtProg\DllD64</Command>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -192,7 +192,7 @@ copy $(TargetPath) \EgtProg\Dll32</Command>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<WholeProgramOptimization>false</WholeProgramOptimization>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
</ClCompile>
<Link>