From ee482c0669377ee3588925cbf3b46ee2472e0e10 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 28 Jul 2026 13:12:44 +0200 Subject: [PATCH] CAMAuto : - piccoli aggiustamenti per disposizione pezzi --- CAMAuto/CreateMachGroups.lua | 20 ++++++++++++-------- CAMAuto/LuaLibs/WinExec.lua | 3 ++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CAMAuto/CreateMachGroups.lua b/CAMAuto/CreateMachGroups.lua index 7b70c78..584f6d4 100644 --- a/CAMAuto/CreateMachGroups.lua +++ b/CAMAuto/CreateMachGroups.lua @@ -188,15 +188,19 @@ local function CalculateSimilarity( Part1, Part2) local ProfilesWeights = { 3, 3, 1, 1} local dScore = 0 - for i = 1, 4 do - if Part1.SemiProfiles[i] == Part2.SemiProfiles[i] then - dScore = dScore + ProfilesWeights[i] - end - end + if abs( Part1.b3Raw:getDimZ() - Part2.b3Raw:getDimZ()) < 100 * GEO.EPS_SMALL and + ((abs( Part1.b3Raw:getDimX() - Part2.b3Raw:getDimX()) < 100 * GEO.EPS_SMALL and abs( Part1.b3Raw:getDimY() - Part2.b3Raw:getDimY()) < 100 * GEO.EPS_SMALL) or + (abs( Part1.b3Raw:getDimY() - Part2.b3Raw:getDimX()) < 100 * GEO.EPS_SMALL and abs( Part1.b3Raw:getDimX() - Part2.b3Raw:getDimY()) < 100 * GEO.EPS_SMALL)) then + for i = 1, 4 do + if Part1.SemiProfiles[i] == Part2.SemiProfiles[i] then + dScore = dScore + ProfilesWeights[i] + end + end - -- punteggio "bonus" se il tipo di pezzo è lo stesso - if Part1.sPieceType and Part2.sPieceType and Part1.sPieceType == Part2.sPieceType then - dScore = dScore + 2 + -- punteggio "bonus" se il tipo di pezzo è lo stesso + if Part1.sPieceType and Part2.sPieceType and Part1.sPieceType == Part2.sPieceType then + dScore = dScore + 2 + end end return dScore diff --git a/CAMAuto/LuaLibs/WinExec.lua b/CAMAuto/LuaLibs/WinExec.lua index c314253..f135465 100644 --- a/CAMAuto/LuaLibs/WinExec.lua +++ b/CAMAuto/LuaLibs/WinExec.lua @@ -538,7 +538,8 @@ function WinExec.ProcessFeatures( PARTS) local maxOffsetX = {} for i = 1, #PARTS do - maxOffsetX[i] = 99 - PARTS[i].RawOffset.dOverMatLeft - PARTS[i].OffsetPartToRaw.X + --maxOffsetX[i] = 99 - PARTS[i].RawOffset.dOverMatLeft - PARTS[i].OffsetPartToRaw.X + maxOffsetX[i] = 80 end for i = 1, #MACHININGS do