From 725d993256cf9b0bff62875894b84991d9b4ba52 Mon Sep 17 00:00:00 2001 From: DarioS Date: Wed, 15 Dec 2021 23:53:56 +0100 Subject: [PATCH 1/5] DataBeam : - corretta CompareFeature e aggiunto strumento di debug per verifica sua simmetria. --- LuaLibs/BeamExec.lua | 100 +++++++++++++++++++++++++++++-------------- LuaLibs/DiceCut.lua | 2 +- 2 files changed, 68 insertions(+), 34 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 63d1bcc..cbd0f55 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1,4 +1,4 @@ --- BeamExec.lua by Egaltech s.r.l. 2021/11/27 +-- BeamExec.lua by Egaltech s.r.l. 2021/12/15 -- Libreria esecuzione lavorazioni per Travi -- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3. -- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato. @@ -23,6 +23,7 @@ -- 2021/02/25 Aggiunta gestione eventuale ricalcolo per macchine tipo PF. -- 2021/07/13 Aggiunta gestione posizionamento pezzo TR/BR per macchine con carico a destra e scarico a sinistra. -- 2021/11/27 House mortise sempre prima di (dt)mortise, house tenon sempre dopo (dt)tenon. +-- 2021/12/15 Corretta CompareFeature (risultato deve essere simmetrico scambiando le feature). -- Tabella per definizione modulo local BeamExec = {} @@ -338,6 +339,24 @@ local function IsTailFeature( Proc, b3Raw, dCurrOvmH) return false end +------------------------------------------------------------------------------------------------------------- +local function PrintFeatures( vProc, b3Raw) + EgtOutLog( ' RawBox=' .. tostring( b3Raw)) + for i = 1, #vProc do + local Proc = vProc[i] + local sOut = string.format( ' Id=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Down=%s Side=%s Head=%s Tail=%s Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s', + Proc.Id, Proc.Grp, Proc.Prc, Proc.TaskId, Proc.CutId, + Proc.Flg, EgtIf( Proc.Down, 'T', 'F'), EgtIf( Proc.Side, 'T', 'F'), EgtIf( Proc.Head, 'T', 'F'), EgtIf( Proc.Tail, 'T', 'F'), + Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, tostring( Proc.Box)) + -- info speciali per Block Haus Half Lap + if Proc.Prc == 37 then + local sSpec = string.format( ' N=%s Hd=%s', tostring( Proc.vtN or V_NULL()), EgtIf( Proc.HeadDir, 'T', 'F')) + sOut = sOut .. sSpec + end + EgtOutLog( sOut) + end +end + ------------------------------------------------------------------------------------------------------------- local function CollectFeatures( PartId, b3Raw, dCurrOvmH) -- recupero le feature @@ -434,12 +453,12 @@ local function OrderFeatures( vProc, b3Raw) -- funzione di confronto -- secondo centro box in X (taglio di intestazione prima di altri tagli di testa e taglio di separazione però prima di altri tagli di coda) local function CompareFeatures( B1, B2) - -- se primo disabilitato va sempre alla fine - if B1.Flg == 0 then + -- se primo disabilitato e secondo no va dopo + if B1.Flg == 0 and B2.Flg ~= 0 then return false end - -- se secondo disabilitato va sempre alla fine - if B2.Flg == 0 then + -- se secondo disabilitato e primo no va lasciato dopo + if B2.Flg == 0 and B1.Flg ~= 0 then return true end -- se primo è intestazione va sempre prima @@ -460,21 +479,23 @@ local function OrderFeatures( vProc, b3Raw) return ( ( B1.Prc == 50 or B1.Prc == 55) and B2.Prc == 52) end -- se primo house mortise, secondo mortise e si intersecano, metto prima house mortise - if Mortise.Identify( B1) and B1.Prc == 53 and ( Mortise.Identify( B2) or DtMortise.Identify( B2)) and + if Mortise.Identify( B1) and B1.Prc == 53 and ( Mortise.Identify( B2) or DtMortise.Identify( B2)) and B2.Prc ~= 53 and B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then return true end -- se primo mortise, secondo house mortise e si intersecano, metto prima house mortise - if ( Mortise.Identify( B1) or DtMortise.Identify( B1)) and Mortise.Identify( B2) and B2.Prc == 53 and + if ( Mortise.Identify( B1) or DtMortise.Identify( B1)) and B1.Prc ~= 53 and Mortise.Identify( B2) and B2.Prc == 53 and B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then return false end - -- se entrambi di testa e primo è scasso o mortasa va messo dopo - if B1.Head and B2.Head and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) then + -- se entrambi di testa e primo è scasso o mortasa e secondo no va messo dopo + if B1.Head and B2.Head and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) and + not ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) then return false end - -- se entrambi di testa e secondo è scasso o mortasa va messo dopo - if B1.Head and B2.Head and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) then + -- se entrambi di testa e secondo è scasso o mortasa va lasciato dopo + if B1.Head and B2.Head and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) and + not ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) then return true end -- se primo è feature di coda e l'altro è separazione o non è feature di coda @@ -508,19 +529,31 @@ local function OrderFeatures( vProc, b3Raw) end -- se primo è foro e l'altro no, lo penalizzo if B1.Prc == 40 and B2.Prc ~= 40 then - return B1.Box:getCenter():getX() - dDrillPenalty > B2.Box:getMax():getX() + return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty) end -- se primo è altro e secondo è foro, lo premio if B1.Prc ~= 40 and B2.Prc == 40 then - return B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX() + return ( B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX()) end -- se entrambi fori con posizione praticamente uguale ordino secondo diametro e faccia di inizio (Fcs) if B1.Prc == 40 and B2.Prc == 40 and abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < dSmallDrillRange then if abs( B1.Diam - B2.Diam) < 1.0 then if B1.Fcs == B2.Fcs then - return B1.Box:getCenter():getX() > B2.Box:getCenter():getX() + if abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < 1.0 then + if abs( B1.Box:getCenter():getY() - B2.Box:getCenter():getY()) < 1.0 then + if abs( B1.Box:getCenter():getZ() - B2.Box:getCenter():getZ()) < 1.0 then + return ( B1.Id < B2.Id) + else + return ( B1.Box:getCenter():getZ() > B2.Box:getCenter():getZ()) + end + else + return ( B1.Box:getCenter():getY() > B2.Box:getCenter():getY()) + end + else + return ( B1.Box:getCenter():getX() > B2.Box:getCenter():getX()) + end else - return B1.Fcs > B2.Fcs + return ( B1.Fcs > B2.Fcs) end else return ( B1.Diam > B2.Diam) @@ -538,6 +571,25 @@ local function OrderFeatures( vProc, b3Raw) end end + -- test della funzione di ordinamento + if EgtGetDebugLevel() >= 3 then + EgtOutLog( ' CompareFeatures Test ') + local bCompTest = true + for i = 1, #vProc do + for j = i + 1, #vProc do + local bComp1 = CompareFeatures( vProc[i], vProc[j]) + local bComp2 = CompareFeatures( vProc[j], vProc[i]) + if bComp1 == bComp2 then + bCompTest = false + EgtOutLog( string.format( ' ProcId : %d vs %d --> ERROR', vProc[i].Id, vProc[j].Id)) + end + end + end + if bCompTest then + EgtOutLog( ' ALL OK') + end + end + -- eseguo ordinamento table.sort( vProc, CompareFeatures) @@ -812,24 +864,6 @@ local function ClassifyFeatures( vProc, b3Raw, Stats) return bAllOk, bSomeDown, bSomeSide, bSplitRot end -------------------------------------------------------------------------------------------------------------- -local function PrintFeatures( vProc, b3Raw) - EgtOutLog( ' RawBox=' .. tostring( b3Raw)) - for i = 1, #vProc do - local Proc = vProc[i] - local sOut = string.format( ' Id=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Down=%s Side=%s Head=%s Tail=%s Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s', - Proc.Id, Proc.Grp, Proc.Prc, Proc.TaskId, Proc.CutId, - Proc.Flg, EgtIf( Proc.Down, 'T', 'F'), EgtIf( Proc.Side, 'T', 'F'), EgtIf( Proc.Head, 'T', 'F'), EgtIf( Proc.Tail, 'T', 'F'), - Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, tostring( Proc.Box)) - -- info speciali per Block Haus Half Lap - if Proc.Prc == 37 then - local sSpec = string.format( ' N=%s Hd=%s', tostring( Proc.vtN or V_NULL()), EgtIf( Proc.HeadDir, 'T', 'F')) - sOut = sOut .. sSpec - end - EgtOutLog( sOut) - end -end - ------------------------------------------------------------------------------------------------------------- local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw) local bOk = true diff --git a/LuaLibs/DiceCut.lua b/LuaLibs/DiceCut.lua index 82bd6a9..1b4130f 100644 --- a/LuaLibs/DiceCut.lua +++ b/LuaLibs/DiceCut.lua @@ -626,7 +626,7 @@ local function DiceCutTest() CutTable = DiceCut.GetDice( nParent, BBoxRawPart, ptC1, vtN1, false, TabPlanesFeatures[2].ptC, TabPlanesFeatures[2].vtN) end - if EgtGetDebugLevel() > 1 then + if EgtGetDebugLevel() >= 3 then DiceCut.PrintOrderCut( CutTable) end From 83b43872de63cf7ef163f89f5185516ef3e1853b Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 21 Dec 2021 05:26:13 +0100 Subject: [PATCH 2/5] DataBeam : - Ulteriori correzioni a CompareFeature. --- LuaLibs/BeamExec.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index cbd0f55..52b215e 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -1,4 +1,4 @@ --- BeamExec.lua by Egaltech s.r.l. 2021/12/15 +-- BeamExec.lua by Egaltech s.r.l. 2021/12/20 -- Libreria esecuzione lavorazioni per Travi -- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3. -- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato. @@ -24,6 +24,7 @@ -- 2021/07/13 Aggiunta gestione posizionamento pezzo TR/BR per macchine con carico a destra e scarico a sinistra. -- 2021/11/27 House mortise sempre prima di (dt)mortise, house tenon sempre dopo (dt)tenon. -- 2021/12/15 Corretta CompareFeature (risultato deve essere simmetrico scambiando le feature). +-- 2021/12/20 Ulteriore correzione a CompareFeature (caso con entrambe senza geometria). -- Tabella per definizione modulo local BeamExec = {} @@ -461,6 +462,10 @@ local function OrderFeatures( vProc, b3Raw) if B2.Flg == 0 and B1.Flg ~= 0 then return true end + -- se entrambi disabilitati seguo l'Id + if B1.Flg == 0 and B2.Flg == 0 then + return ( B1.Id < B2.Id) + end -- se primo è intestazione va sempre prima if Hcut.Identify( B1) then return true @@ -493,7 +498,7 @@ local function OrderFeatures( vProc, b3Raw) not ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) then return false end - -- se entrambi di testa e secondo è scasso o mortasa va lasciato dopo + -- se entrambi di testa e secondo è scasso o mortasa e primo no va lasciato dopo if B1.Head and B2.Head and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) and not ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) then return true @@ -506,12 +511,14 @@ local function OrderFeatures( vProc, b3Raw) if B2.Tail and ( Split.Identify( B1) or not B1.Tail) then return true end - -- se primo è scasso o mortasa di coda, sempre dopo tutto - if B1.Tail and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) then + -- se primo è scasso o mortasa di coda e secondo no, sempre dopo + if B1.Tail and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1)) and + not ( B2.Tail and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2))) then return false end - -- se secondo è scasso o mortasa di coda, sempre dopo tutto - if B2.Tail and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) then + -- se secondo è scasso o mortasa di coda e primo no, va lasciato dopo + if B2.Tail and ( LapJoint.Identify( B2) or Mortise.Identify( B2) or DtMortise.Identify( B2)) and + not ( B1.Tail and ( LapJoint.Identify( B1) or Mortise.Identify( B1) or DtMortise.Identify( B1))) then return true end -- se primo è taglio longitudinale completo o altra lav. lunga, dopo tutte le altre feature non di coda @@ -567,7 +574,7 @@ local function OrderFeatures( vProc, b3Raw) elseif abs( B1.Box:getCenter():getZ() - B2.Box:getCenter():getZ()) > 0.1 * ( B1.Box:getDimZ() + B2.Box:getDimZ()) then return B1.Box:getCenter():getZ() > B2.Box:getCenter():getZ() else - return B1.Box:getCenter():getX() > B2.Box:getCenter():getX() + return ( B1.Id < B2.Id) end end From da0daf96ce3a981826987f5a3ae3701cdc277967 Mon Sep 17 00:00:00 2001 From: DarioS Date: Thu, 23 Dec 2021 17:19:30 +0100 Subject: [PATCH 3/5] DataBeam : - in tenoni a coda di rondine se appartengono a pezzo poco alto e in asse aumentato angolo verso il basso a 22 gradi - in tagli a cubetti non aumento dimensione cubetti se faccia in asse e testa da sotto. --- LuaLibs/DiceCut.lua | 4 ++-- LuaLibs/ProcessDtTenon.lua | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LuaLibs/DiceCut.lua b/LuaLibs/DiceCut.lua index 1b4130f..f1f9312 100644 --- a/LuaLibs/DiceCut.lua +++ b/LuaLibs/DiceCut.lua @@ -404,8 +404,8 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl -- inclinazione limite per taglio da sotto local dNzLimDwnUp = BL.GetNzLimDownUp( BBoxRawPart) - -- se normali senza componenti in Y con faccia quasi verticale e trave non alta, uso per offset i limiti dei tagli di testa e coda - if abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then + -- se non c'è testa da sotto e normali senza componenti in Y con faccia quasi verticale e trave non alta, uso per offset i limiti dei tagli di testa e coda + if not BD.DOWN_HEAD and abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then OffsetO = dOrthoMaxDim or BD.MAX_DIM_HTCUT end diff --git a/LuaLibs/ProcessDtTenon.lua b/LuaLibs/ProcessDtTenon.lua index 3004440..d7da2c0 100644 --- a/LuaLibs/ProcessDtTenon.lua +++ b/LuaLibs/ProcessDtTenon.lua @@ -1,4 +1,4 @@ --- ProcessTenon.lua by Egaltech s.r.l. 2021/04/08 +-- ProcessTenon.lua by Egaltech s.r.l. 2021/12/22 -- Gestione calcolo tenone a coda di rondine per Travi -- 2021/04/08 Aggiunto controllo massimo materiale lavorabile dalla fresa. @@ -43,9 +43,9 @@ local function VerifyOrientation( Proc, vtN, b3Raw) end -- se trave media elseif b3Raw:getDimZ() <= 350 then - -- se tenone praticamente in asse, accetto fino a -20 deg + -- se tenone praticamente in asse, accetto fino a -22 deg if abs( vtN:getY()) < 0.04 then - return ( vtN:getZ() >= -0.343) + return ( vtN:getZ() >= -0.375) -- altrimenti, accetto fino a -10 deg else return ( vtN:getZ() >= -0.174) From 0af1db72ac0e3d9fbaf7ba4fe475908b679b18d9 Mon Sep 17 00:00:00 2001 From: DarioS Date: Fri, 7 Jan 2022 09:41:01 +0100 Subject: [PATCH 4/5] DataBeam : - correzione per Duplo in barre. --- BatchProcessNew.lua | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index e240285..3943243 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -1,4 +1,4 @@ --- BatchProcess.lua by Egaltech s.r.l. 2021/08/04 +-- BatchProcessNew.lua by Egaltech s.r.l. 2022/01/07 -- Gestione calcolo batch disposizione e lavorazioni per Travi -- 2021/01/07 Per nuova interfaccia Egt. -- 2021/01/15 CREATE_BAR ora FLAG = 6 (prima 5). @@ -7,6 +7,7 @@ -- 2021/02/25 Aggiunta gestione tipo scarico (standard, lav. incomplete, a caduta). -- 2021/06/16 Se disponibile si aggiunge la versione dell'eseguibile alle info del programma CN. -- 2021/08/04 Direzione vista simulazione da BD.SIMUL_VIEW_DIR se esiste. +-- 2022/01/07 Per CUTID/TASKID senza ToProcess si verificano anche eventuali Duplo. -- Intestazioni require( 'EgtBase') @@ -195,7 +196,7 @@ if bToProcess then EgtCopyFile( BEAM.FILE, sDir..sTitle..'.ori'..sExt) -- Aggiorno eventuali dati ausiliari - UpdateAuxData( sBtmFile) + --UpdateAuxData( sBtmFile) -- Se già presente un gruppo di lavoro if EgtGetFirstMachGroup() then @@ -520,27 +521,33 @@ else -- Dichiaro nessun errore local nPartId = EgtGetFirstPart() while nPartId do - local nCutId = EgtGetInfo( nPartId, 'CUTID', 'i') - if nCutId then - local nProcId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( nPartId, 'Processings') or GDB_ID.NULL) - while nProcId do - local bIsFea = EgtExistsInfo( nProcId, 'GRP') and EgtExistsInfo( nProcId, 'PRC') - local nTaskId = EgtGetInfo( nProcId, 'TASKID', 'i') - if bIsFea and nTaskId then - BEAM.ERR = 0 - BEAM.MSG = '---' - BEAM.ROT = 0 - BEAM.CUTID = nCutId - BEAM.TASKID = nTaskId - WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID) + local vDup = EgtDuploList( nPartId) + if not vDup or #vDup == 0 then + vDup = { nPartId} + end + for i = 1, #vDup do + local nCutId = EgtGetInfo( vDup[i], 'CUTID', 'i') + if nCutId then + local nProcId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( vDup[i], 'Processings') or GDB_ID.NULL) + while nProcId do + local bIsFea = EgtExistsInfo( nProcId, 'GRP') and EgtExistsInfo( nProcId, 'PRC') + local nTaskId = EgtGetInfo( nProcId, 'TASKID', 'i') + if bIsFea and nTaskId then + BEAM.ERR = 0 + BEAM.MSG = '---' + BEAM.ROT = 0 + BEAM.CUTID = nCutId + BEAM.TASKID = nTaskId + WriteErrToLogFile( BEAM.ERR, BEAM.MSG, BEAM.ROT, BEAM.CUTID, BEAM.TASKID) + end + nProcId = EgtGetNext( nProcId) end - nProcId = EgtGetNext( nProcId) end end nPartId = EgtGetNextPart( nPartId) end -- Aggiorno eventuali dati ausiliari - UpdateAuxData( sBtmFile) + --UpdateAuxData( sBtmFile) -- Passo in modalità lavora EgtSetCurrMachGroup( EgtGetLastMachGroup()) -- Se necessario eseguo aggiornamento con setup corrente e ricalcolo delle lavorazioni @@ -552,9 +559,6 @@ else EgtSaveFile( sNgeFile) -- copio come originale (per dichiarare progetto ricalcolato) EgtCopyFile( sNgeFile, sOriFile) - else - -- Salvo il progetto - EgtSaveFile( sNgeFile) end end From 3138c6ffbc0e4f83ae99922050702630573f6100 Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 11 Jan 2022 15:03:19 +0100 Subject: [PATCH 5/5] DataBeam : - modifiche a GetNearestParalOpposite e GetNearestOrthoOpposite. --- LuaLibs/BeamLib.lua | 11 ++++++----- LuaLibs/FacesBySaw.lua | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 99f5294..a3af060 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -1,4 +1,4 @@ --- BeamLib.lua by Egaltech s.r.l. 2021/11/26 +-- BeamLib.lua by Egaltech s.r.l. 2022/01/11 -- 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. @@ -8,6 +8,7 @@ -- 2021/07/01 In GetNearestOrthoOpposite premio direzioni destra/sinistra. -- 2021/07/15 Aggiunta GetFaceElevationFromPointDir. -- 2021/09/12 Aggiustamenti in GetNearestParalOpposite e GetNearestOrthoOpposite. +-- 2022/01/11 In GetNearest*Opposite ridotto vantaggio XY rispetto a Z da 1 -> 0.9 a 1 -> 0.99. -- Tabella per definizione modulo local BeamLib = {} @@ -262,8 +263,8 @@ function BeamLib.GetNearestParalOpposite( vtRef, vtNorm) vtMyRef = vtMyRef - ( vtMyRef * vtNorm) * vtNorm vtMyRef:normalize() end - -- se prevalente una componente orizzontale (con piccolo vantaggio) - if abs( vtMyRef:getX()) > 0.9 * abs( vtMyRef:getZ()) or abs( vtMyRef:getY()) > 0.9 * abs( vtMyRef:getZ()) then + -- se prevalente una componente orizzontale (con piccolissimo vantaggio) + if abs( vtMyRef:getX()) > 0.99 * abs( vtMyRef:getZ()) or abs( vtMyRef:getY()) > 0.99 * abs( vtMyRef:getZ()) then if abs( vtMyRef:getX()) > abs( vtMyRef:getY()) - GEO.EPS_SMALL then if vtMyRef:getX() > -GEO.EPS_SMALL then return MCH_MILL_FU.PARAL_LEFT @@ -296,8 +297,8 @@ function BeamLib.GetNearestOrthoOpposite( vtRef, vtNorm) vtMyRef = vtMyRef - ( vtMyRef * vtNorm) * vtNorm vtMyRef:normalize() end - -- se prevalente una componente orizzontale (con piccolo vantaggio) - if abs( vtMyRef:getX()) > 0.9 * abs( vtMyRef:getZ()) or abs( vtMyRef:getY()) > 0.9 * abs( vtMyRef:getZ()) then + -- se prevalente una componente orizzontale (con piccolissimo vantaggio) + if abs( vtMyRef:getX()) > 0.99 * abs( vtMyRef:getZ()) or abs( vtMyRef:getY()) > 0.99 * abs( vtMyRef:getZ()) then -- se prevale la componente destra/sinistra (con piccolo vantaggio) if abs( vtMyRef:getX()) > 0.9 * abs( vtMyRef:getY()) then if vtMyRef:getX() > -GEO.EPS_SMALL then diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index 554368e..a45175b 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -206,7 +206,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, EgtOutLog( sErr) return false, sErr end - -- verifico il numero di facce della tacca + -- verifico il numero di facce if Proc.Fct < 2 then local sErr = 'Error : TwoFacesBySaw facet number not supported' EgtOutLog( sErr)