From abc61f53ba8e0a386c2e1a9f9414ead38515e64d Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 16 Oct 2024 17:01:45 +0200 Subject: [PATCH 1/3] - in nesting e flipRotate correzioni a rotazione pezzi --- NestFlipAndRotate.lua | 4 ++-- NestProcess.lua | 27 +++++++++++++++++---------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/NestFlipAndRotate.lua b/NestFlipAndRotate.lua index 45be4a1..47c94bc 100644 --- a/NestFlipAndRotate.lua +++ b/NestFlipAndRotate.lua @@ -157,9 +157,9 @@ local bManualRot = EgtGetInfo( NFAR.PARTID, "MANUALROT", 'b') -- FLIP local FlipFeatureStates, bLapJoints = ClassifyFlip( vPartProc, b3Part) +local bFlip if not bManualFlip then - local bFlip -- analizzo stati flip delle feature local nFlip0Min = 100 local nFlip0Cnt = 0 @@ -440,7 +440,7 @@ if not bManualRot then -- setto info nel pezzo if nRotate > 0 then local nPartRot = EgtGetInfo( NFAR.PARTID, "ROTATED", 'i') or 0 - local nTotRot = nPartRot - nRotate + local nTotRot = nPartRot - EgtIf( bFlip, -nRotate, nRotate) nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot) EgtSetInfo( NFAR.PARTID, "ROTATED", nTotRot) EgtSetInfo( NFAR.PARTID, "FLIPROTMODIFIED", 1) diff --git a/NestProcess.lua b/NestProcess.lua index ba4d064..2e12443 100644 --- a/NestProcess.lua +++ b/NestProcess.lua @@ -1128,9 +1128,10 @@ local function ClassifyAngles( nPartId, RawPart, sRefOrig, bLockedRot, dMinSheet if nRotate >= 360 then nRotate = nRotate - 360 end - if nRotate > 0 then + if nRotate > 0 then + local bPartFlip = ( ( EgtGetInfo( nPartId, "INVERTED", 'i') or 0) == 180) local nPartRot = EgtGetInfo( nPartId, "ROTATED", 'i') or 0 - local nTotRot = nPartRot - nRotate + local nTotRot = nPartRot - EgtIf( bPartFlip, -nRotate, nRotate) nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot) EgtSetInfo( nPartId, "ROTATED", nTotRot) EgtSetInfo( nPartId, "MODIFIEDFORNEST", 1) @@ -1325,8 +1326,9 @@ local function ComputeRestrictedZones( RawParts) bOnOppositeSide = true -- aggiorno le info di rotazione if res.nRotate > 0 then + local bPartFlip = ( ( EgtGetInfo( AngleClassification[nInd].PartId, "INVERTED", 'i') or 0) == 180) local nPartRot = EgtGetInfo( AngleClassification[nInd].PartId, "ROTATED", 'i') or 0 - local nTotRot = nPartRot - res.nRotate + local nTotRot = nPartRot - EgtIf( bPartFlip, -res.nRotate, res.nRotate) nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot) EgtSetInfo( AngleClassification[nInd].PartId, "ROTATED", nTotRot) EgtSetInfo( AngleClassification[nInd].PartId, "MODIFIEDFORNEST", 1) @@ -1507,7 +1509,6 @@ local function AddParts(RawParts, vPartsDoneManually) bRotNest = false elseif EgtExistsInfo( nPartId, "NestRot") then nStepRotNest = EgtGetInfo( nPartId, "NestStepRot", 'i') - nRotate = EgtGetInfo( nPartId, "NestRot", 'i') bRotNest = EgtGetInfo( nPartId, "NestAllowRot", 'b') -- verifico se rotazione è valida (pezzo è contenuto nel grezzo) local bValidRotationInRaw = b3Part:getDimX() < RawParts[1].Len - 2 * NEST.KERF + GEO.EPS_SMALL and b3Part:getDimY() < dRawMaxWidth - 2 * NEST.KERF + GEO.EPS_SMALL @@ -1884,15 +1885,21 @@ if bNestingOk then EgtSetInfo( nPartDuploId, "POSX", ptPos:getX() + dXCorr) EgtSetInfo( nPartDuploId, "POSY", ptPos:getY() + dYCorr) - local nPartRot = EgtGetInfo( nId, "ROTATED", 'i') or 0 - local nTotRot = dAngRot - nPartRot - nTotRot = EgtIf( nTotRot < 0, nTotRot + 360, nTotRot) - EgtSetInfo( nPartDuploId, "ROT", nTotRot) - - local nPartFlip = EgtGetInfo( nId, "INVERTED", 'i') + local nPartFlip = EgtGetInfo( nId, "INVERTED", 'i') or 0 nPartFlip = EgtIf( nPartFlip == 180, 1, 0) local nTotFlip = EgtIf( nPartFlip ~= nFlag, 180, 0) EgtSetInfo( nPartDuploId, "FLIP", nTotFlip) + + local bPartFlip = ( ( EgtGetInfo( nId, "INVERTED", 'i') or 0) == 180) + local nPartRot = EgtGetInfo( nId, "ROTATED", 'i') or 0 + local nTotRot = nPartRot - EgtIf( bPartFlip, -dAngRot, dAngRot) + if nTotRot < 0 then + nTotRot = nTotRot + 360 + elseif nTotRot >= 360 then + nTotRot = nTotRot - 360 + end + EgtSetInfo( nPartDuploId, "ROT", nTotRot) + end end end From 5d422b6edc7ece2b55654fb008fe2789322a98f6 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 29 Oct 2024 09:10:57 +0100 Subject: [PATCH 2/3] - in NestProcess corretta rotazione in caso di flip deciso da nesting --- NestProcess.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NestProcess.lua b/NestProcess.lua index 2e12443..f70fdd9 100644 --- a/NestProcess.lua +++ b/NestProcess.lua @@ -1890,7 +1890,7 @@ if bNestingOk then local nTotFlip = EgtIf( nPartFlip ~= nFlag, 180, 0) EgtSetInfo( nPartDuploId, "FLIP", nTotFlip) - local bPartFlip = ( ( EgtGetInfo( nId, "INVERTED", 'i') or 0) == 180) + local bPartFlip = ( nTotFlip == 180) local nPartRot = EgtGetInfo( nId, "ROTATED", 'i') or 0 local nTotRot = nPartRot - EgtIf( bPartFlip, -dAngRot, dAngRot) if nTotRot < 0 then From 72020a8874340b2a89b82c23ddf666e38a0972fc Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 29 Oct 2024 09:16:24 +0100 Subject: [PATCH 3/3] update version e log --- UpdateLog.txt | 3 +++ Version.lua | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/UpdateLog.txt b/UpdateLog.txt index 7ffebd8..3941ea4 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,8 @@ ==== Wall Update Log ==== +Versione 2.6j1 (29/10/2024) +- Fixed : in Nesting e Flip/Rot corretto problema in rotazione pezzi che causava ribaltamenti non voluti nella copia grezzo + Versione 2.6i2 (30/09/2024) - Modif : aggiunta nota altezza sottopezzo, per pareti a layer diff --git a/Version.lua b/Version.lua index 48a891d..7eca34f 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Wall NAME = 'Wall' -VERSION = '2.6i2' +VERSION = '2.6j1' MIN_EXE = '2.6h1'