From 1eec76b233c13a556efc6fa62b441c4d31d1de11 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 25 Sep 2019 06:29:40 +0000 Subject: [PATCH] DataBeam : - migliorata gestione ingombri testa e coda - correzioni varie. --- LuaLibs/DiceCut.lua | 4 +-- LuaLibs/FacesBySaw.lua | 15 ++++++--- LuaLibs/ProcessCut.lua | 57 ++++++++++++++++------------------ LuaLibs/ProcessDoubleCut.lua | 8 +++-- LuaLibs/ProcessDtTenon.lua | 10 +++++- LuaLibs/ProcessFreeContour.lua | 10 +++++- LuaLibs/ProcessLapJoint.lua | 2 ++ LuaLibs/ProcessProfCamb.lua | 11 +++++-- LuaLibs/ProcessProfConcave.lua | 13 ++++++-- LuaLibs/ProcessProfConvex.lua | 13 ++++++-- LuaLibs/ProcessProfFront.lua | 11 +++++-- LuaLibs/ProcessProfHead.lua | 13 ++++++-- LuaLibs/ProcessRidgeLap.lua | 4 +-- LuaLibs/ProcessRoundArch.lua | 10 +++++- LuaLibs/ProcessSimpleScarf.lua | 4 +-- LuaLibs/ProcessTenon.lua | 2 +- Process.lua | 2 +- 17 files changed, 127 insertions(+), 62 deletions(-) diff --git a/LuaLibs/DiceCut.lua b/LuaLibs/DiceCut.lua index 6476cc3..1e3f8f1 100644 --- a/LuaLibs/DiceCut.lua +++ b/LuaLibs/DiceCut.lua @@ -132,7 +132,7 @@ local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff) local dWidth = Box:getDimY() -- se faccia con un lato piccolo e non diretta troppo verso il basso, non servono dice - if ( dLen < dOffsetEff + 1.0 or dWidth < dOffsetEff + 1.0) and vtN:getZ() > -0.5 then + if ( dLen < dOffsetEff + 1.0 or dWidth < dOffsetEff + 1.0) and vtN:getZ() > -0.5 then return nil, nil, nil end @@ -359,7 +359,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl end -- calcolo la direzione dei piani ortogonali local vtO = VectorFromUprightOrtho( vtNInner) - if vtNInner:getZ() > 0.05 or vtNInner:getZ() < -0.5 then + if vtNInner:getZ() > 0.05 or vtNInner:getZ() < -0.5 or abs( vtNInner:getY()) > 0.866 then vtO:rotate( vtNInner, 90) -- se diretto troppo ortogonalmente all'asse trave e taglio non da sotto, lo ruoto ulteriormente if abs( vtO:getY()) > abs( vtO:getX()) and vtNInner:getZ() > -0.5 then diff --git a/LuaLibs/FacesBySaw.lua b/LuaLibs/FacesBySaw.lua index b04fa8f..092db79 100644 --- a/LuaLibs/FacesBySaw.lua +++ b/LuaLibs/FacesBySaw.lua @@ -1,4 +1,4 @@ --- FacesBySaw.lua by Egaltech s.r.l. 2019/09/04 +-- FacesBySaw.lua by Egaltech s.r.l. 2019/09/20 -- Gestione taglio con lama di feature con una, due o tre facce -- Tabella per definizione modulo @@ -131,10 +131,15 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutName) end end -- eventuale segnalazione ingombro di testa o coda - if Proc.Head then - BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()) - elseif Proc.Tail then - BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Raw:getMin():getX()) + local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ()) + if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then + if Proc.Head then + local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() + BL.UpdateHCING( nRawId, dOffs) + elseif Proc.Tail then + local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX() + BL.UpdateTCING( nRawId, dOffs) + end end return true end diff --git a/LuaLibs/ProcessCut.lua b/LuaLibs/ProcessCut.lua index 82a1719..1fbbf58 100644 --- a/LuaLibs/ProcessCut.lua +++ b/LuaLibs/ProcessCut.lua @@ -1,4 +1,4 @@ --- ProcessCut.lua by Egaltech s.r.l. 2019/09/04 +-- ProcessCut.lua by Egaltech s.r.l. 2019/09/19 -- Gestione calcolo singoli tagli di lama per Travi -- Tabella per definizione modulo @@ -102,36 +102,28 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId) end end - -- recupero la normale dei tagli ortogonali - local vtO - for i = 1, #vCuts, 2 do - for j = 1, #vCuts[i] do - _, vtO = EgtSurfTmFacetCenter( vCuts[i][j], 0, GDB_ID.ROOT) - break - end - if vtO then break end - end -- eseguo for i = 1, #vCuts do -- determino il modo di tagliare local vtOrthoO - if vtO then - if i % 2 == 1 then - vtOrthoO = vtN - else - if #vCuts[i-1] > 0 then - vtOrthoO = vtO - else - vtOrthoO = Z_AX() - end - end + if i % 2 == 1 then + vtOrthoO = Vector3d( vtN) else - if bHorizCut then - vtOrthoO = Z_AX() - elseif vtN:getY() > -0.02 then - vtOrthoO = Y_AX() + local vtO + for j = 1, #vCuts[i-1] do + _, vtO = EgtSurfTmFacetCenter( vCuts[i-1][j], 0, GDB_ID.ROOT) + break + end + if vtO then + vtOrthoO = Vector3d( vtO) else - vtOrthoO = -Y_AX() + if bHorizCut then + vtOrthoO = Z_AX() + elseif vtN:getY() > -0.02 then + vtOrthoO = Y_AX() + else + vtOrthoO = -Y_AX() + end end end -- lavoro la faccia @@ -141,11 +133,13 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- se strato pari composto da 1 o 2 elementi if i % 2 == 0 and #vCuts[i] <= 2 then -- il primo elemento prende la direzione prevista, il secondo quella opposta - local vtNewOrthoO = vtOrthoO + local vtNewOrthoO = Vector3d( vtOrthoO) + local dVzLimDwnUp = -0.5 if j ~= 1 then vtNewOrthoO = -vtOrthoO + dVzLimDwnUp = -0.72 end - local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, nil, 0.1, BD.CUT_SIC, 0, 0, nil, b3Raw) + local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, 0.1, BD.CUT_SIC, 0, 0, nil, b3Raw) if not bOk then return bOk, sErr end @@ -177,16 +171,17 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end end -- eventuale segnalazione ingombro di testa o coda - if abs( vtN:getY()) > 0.1 or ( b3Raw:getDimZ() - Proc.Box:getDimZ()) < BD.MIN_HEIGHT then + local dMinHIng = min( 0.5 * BD.VICE_MINH, 0.5 * b3Raw:getDimZ()) + if Proc.Box:getDimZ() > dMinHIng and Proc.Box:getMin():getZ() < b3Raw:getMin():getZ() + dMinHIng then if Proc.Head then local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() - if vtN:getZ() > 0.5 then + if abs( vtN:getZ()) > 0.5 then dOffs = dOffs / 2 end BL.UpdateHCING( nRawId, dOffs) elseif Proc.Tail then - local dOffs = Proc.Box:getMax():getX() - b3Raw:getMin():getX() - if vtN:getZ() > 0.5 then + local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX() + if abs( vtN:getZ()) > 0.5 then dOffs = dOffs / 2 end BL.UpdateTCING( nRawId, dOffs) diff --git a/LuaLibs/ProcessDoubleCut.lua b/LuaLibs/ProcessDoubleCut.lua index 31dcb58..5d3a1a6 100644 --- a/LuaLibs/ProcessDoubleCut.lua +++ b/LuaLibs/ProcessDoubleCut.lua @@ -1,4 +1,4 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2019/09/09 +-- ProcessDrill.lua by Egaltech s.r.l. 2019/09/17 -- Gestione calcolo doppi tagli di lama per Travi -- Tabella per definizione modulo @@ -195,12 +195,16 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() if vtNm:getZ() > 0.5 then dOffs = 0.5 * dOffs + elseif abs( vtNm:getZ()) > 0.35 then + dOffs = 0.75 * dOffs end BL.UpdateHCING( nRawId, dOffs) elseif Proc.Tail then - local dOffs = Proc.Box:getMax():getX() - b3Raw:getMin():getX() + local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX() if vtNm:getZ() > 0.5 then dOffs = 0.5 * dOffs + elseif abs( vtNm:getZ()) > 0.35 then + dOffs = 0.75 * dOffs end BL.UpdateTCING( nRawId, dOffs) end diff --git a/LuaLibs/ProcessDtTenon.lua b/LuaLibs/ProcessDtTenon.lua index 3016ab7..d8d2252 100644 --- a/LuaLibs/ProcessDtTenon.lua +++ b/LuaLibs/ProcessDtTenon.lua @@ -39,6 +39,14 @@ end function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) + -- ingombro del pezzo + local Ls = EgtGetFirstNameInGroup( nPartId, 'Box') + local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) + if not b3Solid then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + EgtOutLog( sErr) + return false, sErr + end -- recupero e verifico l'entità curva local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') if AuxId then AuxId = AuxId + Proc.Id end @@ -156,7 +164,7 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) if Proc.Head then BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()) elseif Proc.Tail then - BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Raw:getMin():getX()) + BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Solid:getMin():getX()) end return true end diff --git a/LuaLibs/ProcessFreeContour.lua b/LuaLibs/ProcessFreeContour.lua index 7172f0f..5a5d55f 100644 --- a/LuaLibs/ProcessFreeContour.lua +++ b/LuaLibs/ProcessFreeContour.lua @@ -112,6 +112,14 @@ end local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) -- recupero l'ingombro del grezzo di appartenenza local b3Raw = EgtGetRawPartBBox( nRawId) + -- ingombro del pezzo + local Ls = EgtGetFirstNameInGroup( nPartId, 'Box') + local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) + if not b3Solid then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + EgtOutLog( sErr) + return false, sErr + end -- recupero e verifico l'entità curva local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0 if AuxId then AuxId = AuxId + Proc.Id end @@ -243,7 +251,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) if Proc.Head then BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()) elseif Proc.Tail then - BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Raw:getMin():getX()) + BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Solid:getMin():getX()) end return true end diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index c018e23..25e1c23 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -622,6 +622,8 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) return LongCut.Make( Proc, nPhase, nRawId, nPartId) -- due facce elseif Proc.Fct == 2 then + -- determino se due facce lunghe oppure una lunga e l'altra terminale + return Long2Cut.Make( Proc, nPhase, nRawId, nPartId) -- tre facce elseif Proc.Fct == 3 then diff --git a/LuaLibs/ProcessProfCamb.lua b/LuaLibs/ProcessProfCamb.lua index ad847aa..4678318 100644 --- a/LuaLibs/ProcessProfCamb.lua +++ b/LuaLibs/ProcessProfCamb.lua @@ -67,6 +67,14 @@ end function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) + -- ingombro del pezzo + local Ls = EgtGetFirstNameInGroup( nPartId, 'Box') + local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) + if not b3Solid then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + EgtOutLog( sErr) + return false, sErr + end -- recupero e verifico l'entità curva local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') if AuxId then AuxId = AuxId + Proc.Id end @@ -101,7 +109,6 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- aggiungo taglio di lama di sgrossatura e lo lavoro local ptStart, vtNP = GetSawCutData( AuxId, vtNF) - local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) local AddId = EgtSurfTmPlaneInBBox( EgtGetParent( Proc.Id), ptStart, vtNP, b3Solid, GDB_RT.GLOB) if AddId then EgtRelocate( AddId, nAddGrpId) @@ -243,7 +250,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) if bHead then BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMin():getX()) else - BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Raw:getMin():getX()) + BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Solid:getMin():getX()) end end return true diff --git a/LuaLibs/ProcessProfConcave.lua b/LuaLibs/ProcessProfConcave.lua index 41af4dd..0365bab 100644 --- a/LuaLibs/ProcessProfConcave.lua +++ b/LuaLibs/ProcessProfConcave.lua @@ -47,6 +47,14 @@ end function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) + -- ingombro del pezzo + local Ls = EgtGetFirstNameInGroup( nPartId, 'Box') + local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) + if not b3Solid then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + EgtOutLog( sErr) + return false, sErr + end -- recupero e verifico l'entità curva local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') if AuxId then AuxId = AuxId + Proc.Id end @@ -85,7 +93,6 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- aggiungo taglio di lama di sgrossatura e lo lavoro local ptStart, vtNP = GetSawCutData( AuxId, vtN) - local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) local AddId = EgtSurfTmPlaneInBBox( EgtGetParent( Proc.Id), ptStart, vtNP, b3Solid, GDB_RT.GLOB) if AddId then EgtRelocate( AddId, nAddGrpId) @@ -259,13 +266,13 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) if bHead then BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMin():getX()) else - BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Raw:getMin():getX()) + BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Solid:getMin():getX()) end else if bHead then BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMax():getX()) else - BL.UpdateTCING( nRawId, Proc.Box:getMin():getX() - b3Raw:getMin():getX()) + BL.UpdateTCING( nRawId, Proc.Box:getMin():getX() - b3Solid:getMin():getX()) end end return true diff --git a/LuaLibs/ProcessProfConvex.lua b/LuaLibs/ProcessProfConvex.lua index ea1f5f9..530c88e 100644 --- a/LuaLibs/ProcessProfConvex.lua +++ b/LuaLibs/ProcessProfConvex.lua @@ -47,6 +47,14 @@ end function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) + -- ingombro del pezzo + local Ls = EgtGetFirstNameInGroup( nPartId, 'Box') + local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) + if not b3Solid then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + EgtOutLog( sErr) + return false, sErr + end -- recupero e verifico l'entità curva local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') if AuxId then AuxId = AuxId + Proc.Id end @@ -85,7 +93,6 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- aggiungo taglio di lama di sgrossatura e lo lavoro local ptStart, vtNP = GetSawCutData( AuxId, vtN) - local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) local AddId = EgtSurfTmPlaneInBBox( EgtGetParent( Proc.Id), ptStart, vtNP, b3Solid, GDB_RT.GLOB) if AddId then EgtRelocate( AddId, nAddGrpId) @@ -259,13 +266,13 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) if bHead then BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMin():getX()) else - BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Raw:getMin():getX()) + BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Solid:getMin():getX()) end else if bHead then BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMax():getX()) else - BL.UpdateTCING( nRawId, Proc.Box:getMin():getX() - b3Raw:getMin():getX()) + BL.UpdateTCING( nRawId, Proc.Box:getMin():getX() - b3Solid:getMin():getX()) end end return true diff --git a/LuaLibs/ProcessProfFront.lua b/LuaLibs/ProcessProfFront.lua index ad64293..70b459d 100644 --- a/LuaLibs/ProcessProfFront.lua +++ b/LuaLibs/ProcessProfFront.lua @@ -38,6 +38,14 @@ end function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) + -- ingombro del pezzo + local Ls = EgtGetFirstNameInGroup( nPartId, 'Box') + local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) + if not b3Solid then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + EgtOutLog( sErr) + return false, sErr + end -- recupero e verifico l'entità curva local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') if AuxId then AuxId = AuxId + Proc.Id end @@ -74,7 +82,6 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- aggiungo taglio di lama di sgrossatura e lo lavoro local ptStart, vtNP = GetSawCutData( AuxId, vtN) - local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) local AddId = EgtSurfTmPlaneInBBox( EgtGetParent( Proc.Id), ptStart, vtNP, b3Solid, GDB_RT.GLOB) if AddId then EgtRelocate( AddId, nAddGrpId) @@ -219,7 +226,7 @@ function ProcessProfFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) if bHead then BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMin():getX()) else - BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Raw:getMin():getX()) + BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Solid:getMin():getX()) end end return true diff --git a/LuaLibs/ProcessProfHead.lua b/LuaLibs/ProcessProfHead.lua index 61d29e6..130a046 100644 --- a/LuaLibs/ProcessProfHead.lua +++ b/LuaLibs/ProcessProfHead.lua @@ -39,6 +39,14 @@ end function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) + -- ingombro del pezzo + local Ls = EgtGetFirstNameInGroup( nPartId, 'Box') + local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) + if not b3Solid then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + EgtOutLog( sErr) + return false, sErr + end -- recupero e verifico l'entità curva local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') if AuxId then AuxId = AuxId + Proc.Id end @@ -82,7 +90,6 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end -- aggiungo taglio di lama di sgrossatura e lo lavoro local ptStart, vtNP = GetSawCutData( AuxId, vtN) - local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) local AddId = EgtSurfTmPlaneInBBox( EgtGetParent( Proc.Id), ptStart, vtNP, b3Solid, GDB_RT.GLOB) if AddId then EgtRelocate( AddId, nAddGrpId) @@ -280,13 +287,13 @@ function ProcessProfHead.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) if bHead then BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMin():getX()) else - BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Raw:getMin():getX()) + BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Solid:getMin():getX()) end else if bHead then BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dCurrOvmH - Proc.Box:getMax():getX()) else - BL.UpdateTCING( nRawId, Proc.Box:getMin():getX() - b3Raw:getMin():getX()) + BL.UpdateTCING( nRawId, Proc.Box:getMin():getX() - b3Solid:getMin():getX()) end end return true diff --git a/LuaLibs/ProcessRidgeLap.lua b/LuaLibs/ProcessRidgeLap.lua index 0e36d87..26af5a9 100644 --- a/LuaLibs/ProcessRidgeLap.lua +++ b/LuaLibs/ProcessRidgeLap.lua @@ -192,9 +192,9 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local dTCI = 0 if abs( vtN[vFaceOrd[3]]:getZ()) > 0.1 then local b3Fac1 = BL.GetFaceBox( Proc.Id, vFaceOrd[1] - 1) - if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Raw:getMin():getX() end + if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end else - dTCI = Proc.Box:getMax():getX() - b3Raw:getMin():getX() + dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX() end BL.UpdateTCING( nRawId, dTCI) end diff --git a/LuaLibs/ProcessRoundArch.lua b/LuaLibs/ProcessRoundArch.lua index b68dc91..22ae7d9 100644 --- a/LuaLibs/ProcessRoundArch.lua +++ b/LuaLibs/ProcessRoundArch.lua @@ -82,6 +82,14 @@ end function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- recupero l'ingombro del grezzo di appartenenza local b3Raw = EgtGetRawPartBBox( nRawId) + -- ingombro del pezzo + local Ls = EgtGetFirstNameInGroup( nPartId, 'Box') + local b3Solid = EgtGetBBoxGlob( Ls or GDB_ID.NULL, GDB_BB.STANDARD) + if not b3Solid then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' part box not found' + EgtOutLog( sErr) + return false, sErr + end -- recupero e verifico l'entità curva local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') if AuxId then AuxId = AuxId + Proc.Id end @@ -197,7 +205,7 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) if Proc.Head then BL.UpdateHCING( nRawId, b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()) elseif Proc.Tail then - BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Raw:getMin():getX()) + BL.UpdateTCING( nRawId, Proc.Box:getMax():getX() - b3Solid:getMin():getX()) end return true end diff --git a/LuaLibs/ProcessSimpleScarf.lua b/LuaLibs/ProcessSimpleScarf.lua index 9252e41..175db49 100644 --- a/LuaLibs/ProcessSimpleScarf.lua +++ b/LuaLibs/ProcessSimpleScarf.lua @@ -201,9 +201,9 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) local dTCI = 0 if abs( vtRef:getZ()) > 0.1 then local b3Fac1 = BL.GetFaceBox( Proc.Id, vFaceOrd[1] - 1) - if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Raw:getMin():getX() end + if b3Fac1 then dTCI = b3Fac1:getMax():getX() - b3Solid:getMin():getX() end else - dTCI = Proc.Box:getMax():getX() - b3Raw:getMin():getX() + dTCI = Proc.Box:getMax():getX() - b3Solid:getMin():getX() end BL.UpdateTCING( nRawId, dTCI) end diff --git a/LuaLibs/ProcessTenon.lua b/LuaLibs/ProcessTenon.lua index 67ae8cd..cae9204 100644 --- a/LuaLibs/ProcessTenon.lua +++ b/LuaLibs/ProcessTenon.lua @@ -174,7 +174,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end BL.UpdateHCING( nRawId, dOffs) elseif Proc.Tail then - local dOffs = Proc.Box:getMax():getX() - b3Raw:getMin():getX() + local dOffs = Proc.Box:getMax():getX() - b3Solid:getMin():getX() if abs( vtN:getY()) < 0.1 and vtN:getZ() > 0.5 then dOffs = dOffs / 2 end diff --git a/Process.lua b/Process.lua index 1cd3315..264b485 100644 --- a/Process.lua +++ b/Process.lua @@ -5,7 +5,7 @@ -- Intestazioni require( 'EgtBase') _ENV = EgtProtectGlobal() -EgtEnableDebug( false) +EgtEnableDebug( true) -- Imposto direttorio libreria specializzata per Travi local sBaseDir = EgtGetSourceDir()