diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index c530a2e..3d3230f 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2019/11/14 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/11/24 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. @@ -578,9 +578,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, for i = 1, nStep do local dOffs = ( i - 1) * dStep local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, -0.01, 0, BD.CUT_SIC, dOffs, 0, nil, b3Raw) - if not bOk then - return bOk, sErr - end + if not bOk then return bOk, sErr end end -- altrimenti con sega a catena else @@ -664,6 +662,27 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, return true, sWarn end +--------------------------------------------------------------------- +local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw) + -- Recupero la lavorazione di lama + local sCutting = ML.FindCutting( 'HeadSide') + if not sCutting then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' cutting not found in library' + EgtOutLog( sErr) + return false, sErr + end + -- recupero i dati dell'utensile + local dSawDiam = 400 + if EgtMdbSetCurrMachining( sCutting) then + local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then + dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam + end + end + -- eseguo il taglio + return BL.MakeOneFaceBySaw( Proc.Id, nFacet, sCutting, dSawDiam, vtN, nil, 0, BD.CUT_SIC, 0, 0, nil, b3Raw) +end + --------------------------------------------------------------------- local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId) -- recupero l'ingombro del grezzo di appartenenza @@ -691,16 +710,16 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId) EgtOutLog( sErr) return false, sErr end + -- verifico se U + local bIsU = ( Proc.Fct == 3 and not TestElleShape3( Proc)) -- eventuali tagli preliminari do local bOk, sErr = MakePreCuts( Proc, nPhase, nRawId, nPartId, b3Raw) - if not bOk then - return false, sErr - end + if not bOk then return false, sErr end end -- recupero la lavorazione local sMchFind = 'Pocket' - if Proc.Fct <= 3 and not TestElleShape3( Proc) then sMchFind = 'OpenPocket' end + if Proc.Fct < 3 or bIsU then sMchFind = 'OpenPocket' end local dDiam = min( dH, dV) local dCollSic = 2 * BD.COLL_SIC if abs( vtN:getX()) > 0.996 or abs( vtN:getY()) > 0.996 or abs( vtN:getZ()) > 0.996 then dCollSic = BD.COLL_SIC end @@ -708,9 +727,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId) local sPocketing = ML.FindPocketing( sMchFind, dDiam, dFacElev + dCollSic) -- se non trova una svuotatura adatta if not sPocketing then - -- verifico se due o tre facce a L con una faccia di terminazione + -- verifico se due facce o L con una o due facce di terminazione local bIsL = ( Proc.Fct == 2 or TestElleShape3( Proc) or TestElleShape4( Proc) == 2) - -- se due facce o tre a L provo con contornatura + -- provo con contornatura if bIsL then return MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev) -- altrimenti provo con la sega a catena o lama @@ -728,6 +747,17 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId) end end end + -- se richiesti antischeggia con lama su U trasversale + if EgtGetInfo( Proc.Id, 'Q06', 'i') == 1 and bIsU and + ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1) then + -- va eseguito sulle facce diverse dalla principale + for nFacet = 0, 2 do + if nFacet ~= nFacInd then + local bOk, sErr = MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw) + if not bOk then return false, sErr end + end + end + end -- recupero i dati dell'utensile local dMaxDepth = 0 if EgtMdbSetCurrMachining( sPocketing) then diff --git a/LuaLibs/ProcessLongCut.lua b/LuaLibs/ProcessLongCut.lua index 7b85139..006e0a7 100644 --- a/LuaLibs/ProcessLongCut.lua +++ b/LuaLibs/ProcessLongCut.lua @@ -1,4 +1,4 @@ --- ProcessLongCut.lua by Egaltech s.r.l. 2019/11/07 +-- ProcessLongCut.lua by Egaltech s.r.l. 2019/11/24 -- Gestione calcolo taglio longitudinale per Travi -- Tabella per definizione modulo @@ -155,12 +155,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId) local nM = 0 for i = 1, nC do -- Posizione braccio portatesta - local nSCC - --if bFront then - nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) - --else - -- nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP) - --end + local nSCC = EgtIf( ( i == 1 or i == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) -- ciclo sulle passate local d local dOffset = ( dWidth + BD.DIM_STRIP) / 2 ; diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index 86fc121..8abecf2 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -1,4 +1,4 @@ --- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2019/09/04 +-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2019/11/24 -- Gestione calcolo doppio taglio longitudinale per Travi -- Tabella per definizione modulo @@ -53,12 +53,6 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) end end local dLen = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD):getDimX() - -- verifico che il doppio taglio longitudinale non sia orientato verso il basso - --if vtN[1]:getZ() < - 0.707 or vtN[2]:getZ() < - 0.707 then - -- local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' Longitudinal Double Cut from bottom impossible' - -- EgtOutLog( sErr) - -- return false, sErr - --end -- verifico posizione (+1=sopra, -1=sotto, 0=sui lati) local nSide = 0 if vtN[1]:getZ() > -10 * GEO.EPS_SMALL and vtN[2]:getZ() > -10 * GEO.EPS_SMALL then @@ -74,7 +68,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) if bInt then bConvex = ( dAng >= 0) bOrtho = ( abs( dAng + 90) < 1) - ptM = ( ptP1 + ptP2) / 2 + ptM = ( ptC[1] + ptC[2]) / 2 else bConvex = true bOrtho = false @@ -240,7 +234,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId) local dSal = EgtIf( nPos == 1, 0, - dEndLen - ( nPos - 2) * dC) local dEal = EgtIf( nPos == nC, 0, - dEndLen - ( nC - nPos - 1) * dC) -- Posizione braccio portatesta - local nSCC = EgtIf( ( j == 1 or j == nC - 1), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM) + local nSCC = MCH_SCC.ADIR_XP -- inserisco le parti di lavorazione nM = nM + 1 local sNameF = 'L2C_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nM) diff --git a/ShowSolid.lua b/ShowSolid.lua index 2663b15..d3cf516 100644 --- a/ShowSolid.lua +++ b/ShowSolid.lua @@ -44,7 +44,7 @@ local SolidId = EgtGetFirstNameInGroup( SolidLy, 'Solid') if not SolidId then SolidId = EgtCopyGlob( BoxId, SolidLy) EgtSetName( SolidId, 'Solid') - EgtSetAlpha( SolidId, 100) + EgtSetColor( SolidId, Color3d( 228, 196, 64)) Show( PartId, true) else Show( PartId, ( EgtGetStatus( SolidLy) == GDB_ST.OFF))