From cdfbd188fa182506908d2942b896563f34dac32c Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 16 Mar 2023 11:09:22 +0100 Subject: [PATCH 01/10] 2.5c5 (errato 2.5c4 precedente) --- LuaLibs/ProcessLongCut.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 203c83d..62d46e6 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -13,7 +13,7 @@ -- 2022/07/14 Aggiunta limitazione lavorazione a sinistra anche se il grezzo successivo non ha lavorazioni (finale barra) ma è abbastanza lungo da poter essere riutilizzato (BD.MinRaw). -- 2022/09/23 Modificato l'angolo per l'abilitazione della lama da sotto: ora interviene anche per facce verticali. -- 2022/11/04 Aggiunto passaggio parametro bDownHead (Testa da Sotto) nelle chiamate a MakeSideFace. --- 2022/11/28 Correzioni varie per attacco, pulizia spigoli, utilizzo H3 +-- 2022/11/28 Correzioni varie per attacco, pulizia spigoli, utilizzo H3. -- 2022/11/30 Modifiche su SCC per TURN. -- 2023/01/18 Aggiunta, se richiesta, una lavorazione ulteriore con sega a catena nei casi in cui la doppia lama non sia sufficiente. -- 2023/01/26 Rimossa la pulitura della faccia laterale nel caso in cui la feature abbia almeno una faccia rivolta verso il basso. From 5792c3111dfb56dddcca6bd30443506f8096e3e2 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 16 Mar 2023 12:39:32 +0100 Subject: [PATCH 02/10] fix --- LuaLibs/ProcessLongCut.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 62d46e6..cdf1436 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -1056,7 +1056,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus local bLastCut = ( i == 1) local dSal = EgtIf( bFirstCut, -dEndDist, - dEndAccDist - ( nC - i - 1) * dC) local dEal = EgtIf( bLastCut, -dStartDist, - dStartAccDist - ( i - 2) * dC) - local bShortenStartOrEnd = EgtIf( bFront, not bFirstCut, bFirstCut) + local bShortenStartOrEnd = true local bChainSawOk, sErr = MakeSideFaceByChainSaw( Proc.Id, dChainSawDepth, dChainSawOverMaterial, dSal, dEal, bShortenStartOrEnd, bShortenStartOrEnd) if not bChainSawOk then return false, sErr end end @@ -1069,7 +1069,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- recupero la lavorazione local bDownHead = ( nSide == - 1) sMchType = EgtIf( bDownHead, 'Long2Cut_H2', 'Long2Cut') - local bExcludeH3 = bLarghAsFace and abs( nSide) ~= 1 + -- rimossa l'esclusione della terza testa a seguito di modifica della testa stessa che la rende utilizzabile in tutti i casi + --local bExcludeH3 = bLarghAsFace and abs( nSide) ~= 1 local sMilling = ML.FindMilling( sMchType, dElev, nil, nil, nil, not bDownHead, bDownHead, nil, bExcludeH3) if not sMilling then local sErr = 'Error : milling '..sMchType..' not found in library' From fc8dff216d2ca7c745fe8e72b9abb216e6ccb08f Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 20 Mar 2023 15:19:04 +0100 Subject: [PATCH 03/10] Fix netuse x correzione copia su R: --- .gitlab-ci.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7fe43e7..57191d5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ variables: VERS_MAIN: '1.0' APP_NAME: 'Beam' NEW_REL: '' - NET_SHARE_R: '\\10.74.82.201\EgwTech' + NET_SHARE_X: '\\10.74.82.201\EgwTech' NET_SHARE_Z: '\\10.74.82.201\Artifacts' NET_USERQ: 'steamw\egalware' @@ -37,21 +37,22 @@ variables: # helper copia SORGENTI verso cartella di rete R:\ dei SORGENTI .CodeReplicaR: &CodeReplicaR - | - net use R: /delete - net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD - ROBOCOPY . R:\EgtData\$env:APP_NAME /MIR /XF .git* /XD .git + net use X: /delete SLEEP 2 - net use R: /delete + net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD + ROBOCOPY . X:\EgtData\$env:APP_NAME /MIR /XF .git* /XD .git + SLEEP 2 + net use X: /delete # helper copia script verso cartella di rete R:\ delle cartelle bin .ReplicaR: &ReplicaR - | - net use R: /delete - net use R: $env:NET_SHARE_R /u:$env:NET_USERQ $ZDRIVE_PASSWD - ROBOCOPY /MIR bin R:\EgtData\$env:APP_NAME\bin - ROBOCOPY /MIR Images R:\EgtData\$env:APP_NAME\bin\Images + net use X: /delete + net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD + ROBOCOPY /MIR bin X:\EgtData\$env:APP_NAME\bin + ROBOCOPY /MIR Images X:\EgtData\$env:APP_NAME\bin\Images SLEEP 2 - net use R: /delete + net use X: /delete # helper copia script verso cartella di rete R:\ delle cartelle bin .ReplicaZ: &ReplicaZ From b51737173e826725b4894764c0b72dff8986dc6b Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 20 Mar 2023 15:24:58 +0100 Subject: [PATCH 04/10] typo --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 57191d5..28b8102 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,6 +48,7 @@ variables: .ReplicaR: &ReplicaR - | net use X: /delete + SLEEP 2 net use X: $env:NET_SHARE_X /u:$env:NET_USERQ $ZDRIVE_PASSWD ROBOCOPY /MIR bin X:\EgtData\$env:APP_NAME\bin ROBOCOPY /MIR Images X:\EgtData\$env:APP_NAME\bin\Images From 274ad495bc0b663ca57d0b308117b1fb05c572ed Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 21 Mar 2023 10:16:25 +0100 Subject: [PATCH 05/10] DataBeam : - aggiunti a Version.lua NAME e MIN_EXE. --- Version.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Version.lua b/Version.lua index 8b30290..4b0c473 100644 --- a/Version.lua +++ b/Version.lua @@ -1,4 +1,6 @@ --- Version.lua by Egaltech s.r.l. 2023/03/13 +-- Version.lua by Egaltech s.r.l. 2023/03/20 -- Gestione della versione di Beam +NAME = 'Beam' VERSION = '2.5c5' +MIN_EXE = '2.5b3' From 1ff8907b968bf4355d1dc6816835220ec75ed971 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 21 Mar 2023 17:07:14 +0100 Subject: [PATCH 06/10] DataBeam : - aggiornata gestione compilazione e copia in rete come Wall. --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 28b8102..c3d268f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,7 +34,7 @@ variables: echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName" } -# helper copia SORGENTI verso cartella di rete R:\ dei SORGENTI +# helper copia SORGENTI verso cartella di rete X:\ dei SORGENTI .CodeReplicaR: &CodeReplicaR - | net use X: /delete @@ -44,7 +44,7 @@ variables: SLEEP 2 net use X: /delete -# helper copia script verso cartella di rete R:\ delle cartelle bin +# helper copia script verso cartella di rete X:\ delle cartelle bin .ReplicaR: &ReplicaR - | net use X: /delete @@ -55,10 +55,11 @@ variables: SLEEP 2 net use X: /delete -# helper copia script verso cartella di rete R:\ delle cartelle bin +# helper copia script verso cartella di rete Z:\ delle cartelle bin .ReplicaZ: &ReplicaZ - | net use Z: /delete + SLEEP 2 net use Z: $env:NET_SHARE_Z /u:$env:NET_USERQ $ZDRIVE_PASSWD ROBOCOPY /MIR bin Z:\EgtData\$env:APP_NAME\bin ROBOCOPY /MIR Images Z:\EgtData\$env:APP_NAME\bin\Images From 33668827f7d771b268182fb1312bb69df66b20db Mon Sep 17 00:00:00 2001 From: DarioS Date: Wed, 22 Mar 2023 17:32:37 +0100 Subject: [PATCH 07/10] DataBeam 2.5c6 : - migliorato riconoscimento e gestione lati aperti --- LuaLibs/BeamLib.lua | 251 +++++++++++++---------------------- LuaLibs/ProcessDoubleCut.lua | 40 +----- LuaLibs/ProcessLapJoint.lua | 17 +-- LuaLibs/ProcessMortise.lua | 5 +- Version.lua | 4 +- 5 files changed, 112 insertions(+), 205 deletions(-) diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index aa34f22..f96b9f6 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -1,4 +1,4 @@ --- BeamLib.lua by Egaltech s.r.l. 2023/03/06 +-- BeamLib.lua by Egaltech s.r.l. 2023/03/22 -- Libreria globale per Travi -- 2020/07/28 Corretto calcolo attacchi e uscite di lame per non uscire dalla faccia sotto. -- 2020/08/18 Aggiunto a GetNearestParalOpposite e GetNearestOrthoOpposite parametro opzionale vtNorm. @@ -20,6 +20,7 @@ -- 2023/01/10 In GetFaceWithMostAdj aggiunta verifica che la feature abbia almeno una faccia aperta. -- 2023/01/20 Modificata PutStartNearestToEdge per gestire lato preferito come Y+, Y-, z*, Z-. Aggiunta funzione GetDistanceToNextPart. -- 2023/01/31 Aggiunta funzione ConvertToClosedCurve, precedentemente parte di ProcessMortise.Make +-- 2023/02/22 Modifiche a SetOpenSide, aggiunte ChangeOrOpenStart e CurveWithOnlyStraightLines. -- Tabella per definizione modulo local BeamLib = {} @@ -924,162 +925,82 @@ function BeamLib.CalcCollisionSafety( vtDir) end --------------------------------------------------------------------- -function BeamLib.SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId, nStartPoint) - +function BeamLib.SetOpenSide( nPathInt, b3Solid) -- fondo tra loro le curve compatibili EgtMergeCurvesInCurveCompo( nPathInt) - local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt) - local pLastPIni, pLastPEnd - - -- faccio una copia della curva e la esplodo - if nStartIdEnt then - -- prendo i punti - for i = 1, nNumEnt do - local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB) - local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB) - -- Se normale lungo la Z considero il box in X e Y - if abs(vtOrtho:getZ()) > 0.999 then - -- se corrisponde a X - if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then - -- setto l'entità open - local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or '' - if #sActInfo > 0 then - EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1)) - else - EgtSetInfo( nPathInt, 'OPEN', (i-1)) - end - -- prendo i punti per eventuale modifica del punto di inizio percorso - pLastPIni = pPini - pLastPEnd = pPend - -- altrimenti se corrisponde a Y - elseif ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then - -- setto l'entità open - local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or '' - if #sActInfo > 0 then - EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1)) - else - EgtSetInfo( nPathInt, 'OPEN', (i-1)) - end - -- prendo i punti per eventuale modifica del punto di inizio percorso - pLastPIni = pPini - pLastPEnd = pPend - end - -- altrimenti se normale lungo la Y considero il box in X e Z - elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getY()) > 0.999 then - -- se corrisponde a X - if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then - -- setto l'entità open - local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or '' - if #sActInfo > 0 then - EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1)) - else - EgtSetInfo( nPathInt, 'OPEN', (i-1)) - end - -- prendo i punti per eventuale modifica del punto di inizio percorso - pLastPIni = pPini - pLastPEnd = pPend - -- altrimenti se corrisponde a Z - elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then - -- setto l'entità open - local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or '' - if #sActInfo > 0 then - EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1)) - else - EgtSetInfo( nPathInt, 'OPEN', (i-1)) - end - -- prendo i punti per eventuale modifica del punto di inizio percorso - pLastPIni = pPini - pLastPEnd = pPend - end - -- caso che non dovrebbe mai capitare ma gestito per completezza - -- altrimenti se normale lungo la X considero il box in Y e Z - elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getX()) > 0.999 then - -- se corrisponde a Y - if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then - -- setto l'entità open - local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or '' - if #sActInfo > 0 then - EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1)) - else - EgtSetInfo( nPathInt, 'OPEN', (i-1)) - end - -- prendo i punti per eventuale modifica del punto di inizio percorso - pLastPIni = pPini - pLastPEnd = pPend - -- altrimenti se corrisponde a Z - elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then - -- setto l'entità open - local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or '' - if #sActInfo > 0 then - EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1)) - else - EgtSetInfo( nPathInt, 'OPEN', (i-1)) - end - -- prendo i punti per eventuale modifica del punto di inizio percorso - pLastPIni = pPini - pLastPEnd = pPend - end - -- se asse Z orizzontale verifico se si avvicina piú a Y - elseif abs(vtOrtho:getZ()) < 0.001 then - if abs(vtOrtho:getY()) > 0.75 then - -- se corrisponde a Z - if ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then - -- setto l'entità open - local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or '' - if #sActInfo > 0 then - EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1)) - else - EgtSetInfo( nPathInt, 'OPEN', (i-1)) - end - -- prendo i punti per eventuale modifica del punto di inizio percorso - pLastPIni = pPini - pLastPEnd = pPend - end - end - -- se asse Y a 0 (fresa ne davanti ne dietro) verifico se si avvicina piú a Z+ - elseif abs(vtOrtho:getY()) < 0.001 then - if abs(vtOrtho:getZ()) > 0.75 then - -- se corrisponde a Y - if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then - -- setto l'entità open - local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or '' - if #sActInfo > 0 then - EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1)) - else - EgtSetInfo( nPathInt, 'OPEN', (i-1)) - end - -- prendo i punti per eventuale modifica del punto di inizio percorso - pLastPIni = pPini - pLastPEnd = pPend - end - end - end - end - -- se devo cambiare il punto di partenza - if nStartPoint then - if pLastPIni and pLastPEnd then - -- calcolo il punto medio con gli ultimi punti utilizzati - local ptPs = ( pLastPIni + pLastPEnd) / 2 - EgtChangeClosedCurveStartPoint( nPathInt, ptPs, GDB_RT.GLOB) - -- se devo eliminare la parte open - if nStartPoint == 2 then - EgtRemoveCurveCompoCurve( nPathInt, true) - EgtRemoveCurveCompoCurve( nPathInt, false) - return true - end + -- vettore indici lati aperti + local vOpen = {} + -- ciclo sulle curve elementari della composita + local _, nNumEnt = EgtCurveDomain( nPathInt) + for i = 0, nNumEnt - 1 do + -- se segmento di retta + if EgtCurveCompoRadius( nPathInt, i) == -1 then + -- verifico se giace in uno dei piani limite del pezzo quindi se è un lato aperto + local ptIni = EgtUP( nPathInt, i, GDB_RT.GLOB) + local ptFin = EgtUP( nPathInt, i + 1, GDB_RT.GLOB) + if ( abs( ptIni:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL and abs( ptFin:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL) or + ( abs( ptIni:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL and abs( ptFin:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL) or + ( abs( ptIni:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL and abs( ptFin:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL) or + ( abs( ptIni:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL and abs( ptFin:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL) or + ( abs( ptIni:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL and abs( ptFin:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL) or + ( abs( ptIni:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL and abs( ptFin:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL) then + -- aggiorno il vettore dei lati aperti + table.insert( vOpen, i) end end end + -- assegno gli indici dei lati aperti + EgtSetInfo( nPathInt, 'OPEN', vOpen) + return true +end - return false +--------------------------------------------------------------------- +function BeamLib.ChangeOrOpenStart( nPathInt, nStartPoint) + -- verifico richiesta + if nStartPoint ~= 1 and nStartPoint ~= 2 then + return false + end + -- verifico che la curva sia chiusa + if not EgtCurveIsClosed( nPathInt) then + return true + end + -- recupero l'indice del segmento aperto più lungo + local nMaxOpen, dMaxLen + local vOpen = EgtGetInfo( nPathInt or GDB_ID.NULL, 'OPEN') + for i = 0, #( vOpen or {}) do + -- se primo o più lungo, lo salvo + local dLen = EgtCurveCompoLength( nPathInt, vOpen[i]) + if not dMaxLen or dLen > dMaxLen then + dMaxLen = dLen + nMaxOpen = vOpen[i] + end + end + -- se esiste tratto aperto + if nMaxOpen then + -- sposto il punto di inizio a metà del tratto aperto più lungo (la curva deve essere chiusa) + EgtChangeClosedCurveStart( nPathInt, nMaxOpen + 0.5) + -- aggiorno il vettore dei lati aperti + for i = 1, #vOpen do + vOpen[i] = vOpen[i] - nMaxOpen + end + table.insert( vOpen, #vOpen) + -- se devo eliminare gli estremi aperti + if nStartPoint == 2 then + -- elimino gli estremi + EgtRemoveCurveCompoCurve( nPathInt, true) + EgtRemoveCurveCompoCurve( nPathInt, false) + -- aggiorno il vettore dei lati aperti + table.remove( vOpen, 1) + table.remove( vOpen) + for i = 1, #vOpen do + vOpen[i] = vOpen[i] - 1 + end + end + end + -- assegno gli indici modificati dei lati aperti + EgtSetInfo( nPathInt, 'OPEN', vOpen) + -- restituisco flag percorso aperto + return ( not EgtCurveIsClosed( nPathInt)) end ------------------------------------------------------------------------------------------------------------- @@ -1102,15 +1023,13 @@ function BeamLib.ConvertToClosedCurve( Proc, AuxId) -- sistemo i lati aperti local vFacAdj = EgtSurfTmFacetAdjacencies( Proc.Id, 0)[1] if vFacAdj then - local sOpen = '' + local vOpen = {} for i = 1, #vFacAdj do if vFacAdj[i] < 0 then - sOpen = sOpen .. EgtIf( #sOpen > 0, ',', '') .. tostring( i - 1) + table.insert( vOpen, i - 1) end end - if #sOpen > 0 then - EgtSetInfo( AuxId, 'OPEN', sOpen) - end + EgtSetInfo( AuxId, 'OPEN', vOpen) end end end @@ -1118,5 +1037,25 @@ function BeamLib.ConvertToClosedCurve( Proc, AuxId) return true, bCurveModified end +--------------------------------------------------------------------- +function BeamLib.CurveWithOnlyStraightLines( nPathInt) + -- verifico sia una retta oppure una curva composita + local nType = EgtGetType( nPathInt) + if nType == GDB_TY.CRV_LINE then + return true + elseif nType~= GDB_TY.CRV_COMPO then + return false + end + -- ciclo sulle curve elementari della composita + local _, nNumEnt = EgtCurveDomain( nPathInt) + for i = 0, nNumEnt - 1 do + -- se segmento di retta + if EgtCurveCompoRadius( nPathInt, i) ~= -1 then + return false + end + end + return true +end + ------------------------------------------------------------------------------------------------------------- return BeamLib diff --git a/LuaLibs/ProcessDoubleCut.lua b/LuaLibs/ProcessDoubleCut.lua index d75805a..d5289c7 100644 --- a/LuaLibs/ProcessDoubleCut.lua +++ b/LuaLibs/ProcessDoubleCut.lua @@ -1,6 +1,7 @@ --- ProcessDoubleCut.lua by Egaltech s.r.l. 2022/07/11 +-- ProcessDoubleCut.lua by Egaltech s.r.l. 2023/03/22 -- Gestione calcolo doppi tagli di lama per Travi --- 2022/08/29 Implementata la fresatura dal lato per tagli problematici per PF1250 +-- 2022/08/29 Implementata la fresatura dal lato per tagli problematici per PF1250. +-- 2023/03/22 Eliminata SetOpenSide locale, si usa quella di libreria. -- Tabella per definizione modulo local ProcessDoubleCut = {} @@ -222,39 +223,6 @@ local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bP return bUsePocketing, sPocketing, dMaxDepth, dToolDiam end ---------------------------------------------------------------------- -local function SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId) - -- fondo tra loro le curve compatibili - EgtMergeCurvesInCurveCompo( nPathInt) - local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt) - local pLastPIni, pLastPEnd - -- faccio una copia della curva e la esplodo - if nStartIdEnt then - -- ciclo i lati della curva e controllo per ognuno se giace in uno dei piani limite del pezzo: se sì allora il lato è aperto - for i = 1, nNumEnt do - local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB) - local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB) - if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or - ( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then - -- scrivo nelle proprietà della curva quali sono i lati aperti - local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or '' - if #sActInfo > 0 then - -- se ci sono già altri lati aperti - EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1)) - else - -- se è l'unico - EgtSetInfo( nPathInt, 'OPEN', (i-1)) - end - end - end - end - return false -end - --------------------------------------------------------------------- local function MakeBySidePocket( Proc, nPhase, nRawId, nPartId, nAddGrpId, b3Solid) local nFirstMachId @@ -287,7 +255,7 @@ local function MakeBySidePocket( Proc, nPhase, nRawId, nPartId, nAddGrpId, b3Sol -- e assegno l'estrusione nPathInt = EgtExtractSurfTmLoops( nSurfInt, nAddGrpId) EgtModifyCurveExtrusion( nPathInt, vtOrtho, GDB_RT.GLOB) - SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId) + BL.SetOpenSide( nPathInt, b3Solid) -- variabili per parametri lavorazione local dMachDepth local dElev = 0 diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index e2a2996..cdd8172 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2022/12/21 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/12/22 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. -- 2021/01/24 Con sega a catena ora sempre impostato asse A. @@ -1652,7 +1652,8 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw, -- normale alla faccia aggiunta vtN1 = Vector3d( vtOrtho) -- imposto i lati aperti - BL.SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2) + BL.SetOpenSide( nFirstId, b3Solid) + BL.ChangeOrOpenStart( nFirstId, 2) end -- se non trovato il percorso, esco @@ -2407,11 +2408,6 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI -- ottengo le curve di contorno libero local nAuxId1, nAuxId2, nNumIdAux if bIs3Faces then --- nAuxId1, _ = EgtExtractSurfTmLoops( nSurfInt, nAddGrpId) --- EgtModifyCurveExtrusion( nAuxId1, vtOrtho, GDB_RT.GLOB) --- BL.SetOpenSide( nAuxId1, vtOrtho, b3Solid, nAddGrpId, 1) --- nNumIdAux = 2 - -- estraggo i percorsi nAuxId1, nNumIdAux = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId) -- se percorso creato estraggo solo i percorsi delle facce interessate, non di testa @@ -3530,7 +3526,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha EgtModifyCurveExtrusion( nPathInt, vtOrtho, GDB_RT.GLOB) -- se ho 3 facce oppure se forzato, ciclo sulle entià del percorso per segnare quelle che sono aperte. if bIs3Faces or bSetOpenBorders then - BL.SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId) + BL.SetOpenSide( nPathInt, b3Solid) end -- variabili per parametri lavorazione local dMachDepth @@ -4349,9 +4345,10 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw, end end vtN1 = Vector3d(vtOrtho) - local bOkPath = BL.SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2) + BL.SetOpenSide( nFirstId, b3Solid) + local bOpenPath = BL.ChangeOrOpenStart( nFirstId, 2) -- se non ho un percorso chiuso estraggo i percorsi - if bOkPath then + if bOpenPath then -- creo percorsi antisplint dagli estremi dei percorsi di contorno trovati pPaths = MakePathsOnExtremPoints( nAddGrpId, nFirstId, pPaths, dTDiam) end diff --git a/LuaLibs/ProcessMortise.lua b/LuaLibs/ProcessMortise.lua index e757b5a..5309722 100644 --- a/LuaLibs/ProcessMortise.lua +++ b/LuaLibs/ProcessMortise.lua @@ -296,7 +296,10 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- recupero versore estrusione della curva supplementare local vtExtr = EgtCurveExtrusion( AuxId, GDB_ID.ROOT) -- se curva di contorno aperta la rendo chiusa - BL.ConvertToClosedCurve( Proc, AuxId) + local _, bModif = BL.ConvertToClosedCurve( Proc, AuxId) + if not bModif then + BL.SetOpenSide( AuxId, b3Solid) + end -- verifico se frontale local bFront = ( Proc.Prc == 51) -- recupero i dati della faccia di fondo diff --git a/Version.lua b/Version.lua index 4b0c473..4fb77b0 100644 --- a/Version.lua +++ b/Version.lua @@ -1,6 +1,6 @@ --- Version.lua by Egaltech s.r.l. 2023/03/20 +-- Version.lua by Egaltech s.r.l. 2023/03/22 -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.5c5' +VERSION = '2.5c6' MIN_EXE = '2.5b3' From d486caa1a96c03b0080fd004072be38173b705fc Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Thu, 23 Mar 2023 12:42:28 +0100 Subject: [PATCH 08/10] 2.5c7 : - Correzioni a LongCut e LongDoubleCut a seguito di ottimizzazione delle direzioni di avanzamento --- LuaLibs/ProcessLongCut.lua | 8 ++------ LuaLibs/ProcessLongDoubleCut.lua | 12 ++---------- Version.lua | 2 +- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index cdf1436..2837fd1 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -24,6 +24,7 @@ -- 2023/02/22 Nuova gestione del verso di avanzamento ottimale che contempla tutti i casi. -- 2023/03/06 Correzione per i casi con lavorazione limitata. -- 2023/03/15 Modifica alla lavorazione ulteriore con sega a catena per togliere il codolo e lasciare solo dei punti di supporto. +-- 2023/03/22 Correzione a SCC lama a seguito di modifiche alle direzioni dei tagli. -- Tabella per definizione modulo local ProcessLongCut = {} @@ -977,7 +978,6 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- recupero alcune informazioni utili dalla lavorazione attuale local bIsCurrentBladeCW - local bIsCurrentMachiningInverted if bIsTopBladeCurrent then EgtMdbSetCurrMachining( sCutting) else @@ -1025,11 +1025,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus -- se il flag uso lama custom abilitato (indica che questo script è lanciato dal ProcessCut) -- controllo se componente X versore è maggiore di un valore limite cambio la direzione della forcella if bCustUseBlade and abs(vtN:getX()) > 0.009 + 5 * GEO.EPS_SMALL then - if BD.USE_LONGCUT then - nSCC = EgtIf( ( bFront and k == 1) or ( not bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) - else - nSCC = EgtIf( ( not bFront and k == 1) or ( bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) - end + nSCC = EgtIf( ( not bFront and k == 1) or ( bFront and k == 2), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM) end -- imposto posizione braccio porta testa per non ingombrare agli estremi EgtSetMachiningParam( MCH_MP.SCC, nSCC) diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index df5f958..a1d3bc8 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -16,6 +16,7 @@ -- 2023/02/21 Verso di avanzamento della lama migliorato anche con lama LC. -- 2023/02/22 Nuova gestione del verso di avanzamento ottimale che contempla tutti i casi. -- 2023/03/06 Correzione per i casi con lavorazione limitata. +-- 2023/03/23 Correzione per caso con doppia lama da sotto. -- Tabella per definizione modulo local ProcessLong2Cut = {} @@ -697,48 +698,39 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end -- verifico lama in uso e imposto uso faccia - local bIsTopBladeCurrent + local bIsTopBladeCurrent = not bMachDown local nFaceUseCurrent if bCanUseBlade and bCanUseUnderBlade then if nSide == -1 then dSal, dEal = dEal, dSal if k == 1 then - bIsTopBladeCurrent = true nFaceUseCurrent = nFaceUse2 else - bIsTopBladeCurrent = false nFaceUseCurrent = nFaceUse end else if k == 1 then - bIsTopBladeCurrent = false nFaceUseCurrent = nFaceUse else - bIsTopBladeCurrent = true nFaceUseCurrent = nFaceUse2 end end elseif bCanUseUnderBlade then if k == 1 then - bIsTopBladeCurrent = false nFaceUseCurrent = nFaceUse else - bIsTopBladeCurrent = false nFaceUseCurrent = nFaceUse2 end else if k == 1 then - bIsTopBladeCurrent = true nFaceUseCurrent = nFaceUse else - bIsTopBladeCurrent = true nFaceUseCurrent = nFaceUse2 end end -- recupero alcune informazioni utili dalla lavorazione attuale local bIsCurrentBladeCW - local bIsCurrentMachiningInverted if bIsTopBladeCurrent then EgtMdbSetCurrMachining( sCutting) else diff --git a/Version.lua b/Version.lua index 4fb77b0..daf625f 100644 --- a/Version.lua +++ b/Version.lua @@ -2,5 +2,5 @@ -- Gestione della versione di Beam NAME = 'Beam' -VERSION = '2.5c6' +VERSION = '2.5c7' MIN_EXE = '2.5b3' From 3af41a8d4dd6df124f48db82d7cb75cfa9a37a95 Mon Sep 17 00:00:00 2001 From: DarioS Date: Thu, 23 Mar 2023 19:06:50 +0100 Subject: [PATCH 09/10] DataBeam : - modifica per fare le mortase a coda di rondine prima dei tagli longitudinali indipendentemente dalla sovrapposizione in Y. --- LuaLibs/BeamExec.lua | 8 ++++---- Version.lua | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 337b5cc..8131b40 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -706,14 +706,14 @@ local function OrderFeatures( vProc, b3Raw) B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then return false end - -- se prima è coda di rondine e secondo taglio longitudinale, la coda di rondine va sempre prima + -- se prima è mortasa coda di rondine sul fianco e secondo taglio longitudinale, la coda di rondine va sempre prima if DtMortise.SideIdentify(B1) and ( LongCut.Identify(B2) or Long2Cut.Identify(B2)) and - OverlapsXY( B1.Box, B2.Box) then + OverlapsX( B1.Box, B2.Box) then return true end - -- se primo è taglio longitudinale e seconda è coda di rondine, il taglio longitudinale va sempre dopo + -- se primo è taglio longitudinale e seconda è mortasa coda di rondine sul fianco, il taglio longitudinale va sempre dopo if ( LongCut.Identify(B1) or Long2Cut.Identify(B1)) and DtMortise.SideIdentify(B2) and - OverlapsXY( B1.Box, B2.Box) then + OverlapsX( B1.Box, B2.Box) then return false end -- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone diff --git a/Version.lua b/Version.lua index daf625f..2374e2c 100644 --- a/Version.lua +++ b/Version.lua @@ -1,6 +1,6 @@ --- Version.lua by Egaltech s.r.l. 2023/03/22 +-- Version.lua by Egaltech s.r.l. 2023/03/23 -- Gestione della versione di Beam NAME = 'Beam' VERSION = '2.5c7' -MIN_EXE = '2.5b3' +MIN_EXE = '2.5c1' From 641bf33e4b807bb16b95fe262f07271bd1720afa Mon Sep 17 00:00:00 2001 From: DarioS Date: Thu, 23 Mar 2023 20:46:10 +0100 Subject: [PATCH 10/10] DataBeam : - modifica ingombro tagli inclinati per macchine con trascinatori tipo PF (BD.PRESS_ROLLER). --- LuaLibs/ProcessCut.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 2205a51..cacc7f2 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -212,7 +212,7 @@ local function UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw) if vtN:getZ() > 0.5 then dOffs = dOffs - 0.6 * Proc.Box:getDimX() elseif vtN:getZ() < -0.5 then - dOffs = dOffs - 0.2 * Proc.Box:getDimX() + dOffs = dOffs - EgtIf( BD.PRESS_ROLLER, 0.4, 0.2) * Proc.Box:getDimX() elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then dOffs = dOffs - 0.3 * Proc.Box:getDimX() end @@ -222,7 +222,7 @@ local function UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw) if vtN:getZ() > 0.5 then dOffs = dOffs - 0.6 * Proc.Box:getDimX() elseif vtN:getZ() < -0.5 then - dOffs = dOffs - 0.2 * Proc.Box:getDimX() + dOffs = dOffs - EgtIf( BD.PRESS_ROLLER, 0.4, 0.2) * Proc.Box:getDimX() elseif ( abs( vtN:getY()) > 0.9 and vtN:getZ() > 0.2) then dOffs = dOffs - 0.3 * Proc.Box:getDimX() end