diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 422c072..f66ad94 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -5,7 +5,7 @@ -- 2019/09/25 Aggiunta gestione StepJoint e StepJointNotch -- 2020/01/21 Aggiunta gestione ScarfJoint -- 2020/02/10 Aggiunta gestione FrenchRidgeLap --- 2020/02/11 Aggiunta gestione BlockHouseFront +-- 2020/02/11 Aggiunta gestione BlockHausFront -- Tabella per definizione modulo local BeamExec = {} @@ -55,8 +55,8 @@ _G.package.loaded.ProcessDrill = nil local Drill = require( 'ProcessDrill') _G.package.loaded.ProcessFrenchRidgeLap = nil local FrenchRidgeLap = require( 'ProcessFrenchRidgeLap') -_G.package.loaded.ProcessBlockHouseFront = nil -local BlockHouseFront = require( 'ProcessBlockHouseFront') +_G.package.loaded.ProcessBlockHausFront = nil +local BlockHausFront = require( 'ProcessBlockHausFront') _G.package.loaded.ProcessTenon = nil local Tenon = require( 'ProcessTenon') _G.package.loaded.ProcessMortise = nil @@ -530,8 +530,8 @@ local function ClassifyFeatures( vProc, b3Raw, Stats) elseif FrenchRidgeLap.Identify( Proc) then bOk, bDown = FrenchRidgeLap.Classify( Proc) -- se block house front - elseif BlockHouseFront.Identify( Proc) then - bOk, bDown = BlockHouseFront.Classify( Proc) + elseif BlockHausFront.Identify( Proc) then + bOk, bDown = BlockHausFront.Classify( Proc) -- se mortasa (anche frontale) elseif Mortise.Identify( Proc) then bOk, bDown = Mortise.Classify( Proc) @@ -686,9 +686,9 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3 -- esecuzione giunzione francese bOk, sErr = FrenchRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- se block house front ( 3/4-038-X) - elseif BlockHouseFront.Identify( Proc) then + elseif BlockHausFront.Identify( Proc) then -- esecuzione giunzione francese - bOk, sErr = BlockHouseFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) + bOk, sErr = BlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) -- se tenone ( 1/2-050-X) elseif Tenon.Identify( Proc) then -- esecuzione tenone diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 50fd21d..bd01567 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -1,4 +1,4 @@ --- BeamLib.lua by Egaltech s.r.l. 2020/02/19 +-- BeamLib.lua by Egaltech s.r.l. 2020/02/26 -- Libreria globale per Travi -- Tabella per definizione modulo @@ -685,10 +685,12 @@ function BeamLib.MakeOneFaceBySaw( nSurfId, nFacet, sCutting, dSawDiam, Par5, dV local b3Box = BBox3d( b3Raw) b3Box:expand( dCutSic) local dLiTang, dLiPerp, dLoTang, dLoPerp + local ptP1act = ptP1 + vtN * dCutOffset + local ptP2act = ptP2 + vtN * dCutOffset if ( vtV1:getZ() > -0.1 or vtV2:getZ() > -0.1) and ( abs( vtV1:getY()) > 0.707 or abs( vtV2:getY()) > 0.707 or vtN:getZ() < 0.95) then - dLiTang, dLiPerp, dLoTang, dLoPerp = BeamLib.CalcLeadInOutGeom( ptP1, ptP2, vtV1, vtV2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box) + dLiTang, dLiPerp, dLoTang, dLoPerp = BeamLib.CalcLeadInOutGeom( ptP1act, ptP2act, vtV1, vtV2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box) else - dLiTang, dLiPerp, dLoTang, dLoPerp = BeamLib.CalcLeadInOutTangGeom( ptP1, ptP2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box) + dLiTang, dLiPerp, dLoTang, dLoPerp = BeamLib.CalcLeadInOutTangGeom( ptP1act, ptP2act, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box) end -- posizione braccio EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3) diff --git a/LuaLibs/DiceCut.lua b/LuaLibs/DiceCut.lua index 5d8ca2e..f37640e 100644 --- a/LuaLibs/DiceCut.lua +++ b/LuaLibs/DiceCut.lua @@ -1,4 +1,4 @@ --- DiceCut.lua by Egaltech s.r.l. 2019/10/28 +-- DiceCut.lua by Egaltech s.r.l. 2020/02/26 -- Gestione dei piano paralleli nei tagli lunghi: equidistanziamento dei piani paralleli -- Tabella per definizione modulo @@ -466,6 +466,10 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl -- 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() > dNzLimDwnUp then vtO:rotate( vtNInner, 90) + -- se faccia principale verso il basso (almeno -3deg), lo inverto per iniziare da sopra + if vtNInner:getZ() < -0.05 then + vtO = -vtO + end else if ptCInner:getX() > BBoxRawPart:getCenter():getX() then if vtO:getX() < 0 then vtO = - vtO end diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 1dd8674..f7b253d 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -1,4 +1,4 @@ --- MachiningLib.lua by Egaltech s.r.l. 2020/02/14 +-- MachiningLib.lua by Egaltech s.r.l. 2020/02/26 -- Libreria ricerca lavorazioni per Travi -- Tabella per definizione modulo @@ -38,11 +38,14 @@ function MachiningLib.FindCutting( sType) end --------------------------------------------------------------------- -function MachiningLib.FindMilling( sType) +function MachiningLib.FindMilling( sType, dDepth) for i = 1, #Millings do local Milling = Millings[i] if Milling.On and Milling.Type == sType and SetCurrMachiningAndTool( Milling.Name) then - return Milling.Name + local dTMaxDepth = EgtTdbGetCurrToolMaxDepth() + if not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL then + return Milling.Name + end end end end diff --git a/LuaLibs/ProcessBlockHouseFront.lua b/LuaLibs/ProcessBlockHausFront.lua similarity index 95% rename from LuaLibs/ProcessBlockHouseFront.lua rename to LuaLibs/ProcessBlockHausFront.lua index 15ad588..93b53db 100644 --- a/LuaLibs/ProcessBlockHouseFront.lua +++ b/LuaLibs/ProcessBlockHausFront.lua @@ -1,8 +1,8 @@ --- ProcessBlockHouseFront.lua by Egaltech s.r.l. 2020/02/11 +-- ProcessBlockHausFront.lua by Egaltech s.r.l. 2020/02/11 -- Gestione calcolo giunzione block house in testa -- Tabella per definizione modulo -local ProcessBlockHouseFront = {} +local ProcessBlockHausFront = {} -- Include require( 'EgtBase') @@ -10,7 +10,7 @@ local BL = require( 'BeamLib') local DC = require( 'DiceCut') local Cut = require( 'ProcessCut') -EgtOutLog( ' ProcessBlockHouseFront started', 1) +EgtOutLog( ' ProcessBlockHausFront started', 1) -- Dati local BD = require( 'BeamData') @@ -18,13 +18,13 @@ local ML = require( 'MachiningLib') --------------------------------------------------------------------- -- Riconoscimento della feature -function ProcessBlockHouseFront.Identify( Proc) +function ProcessBlockHausFront.Identify( Proc) return (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 38) end --------------------------------------------------------------------- -- Classificazione della feature -function ProcessBlockHouseFront.Classify( Proc) +function ProcessBlockHausFront.Classify( Proc) -- verifico le normali delle facce local nFacetCnt = EgtSurfTmFacetCount( Proc.Id) for i = 1, nFacetCnt do @@ -42,7 +42,7 @@ end --------------------------------------------------------------------- -- Applicazione della lavorazione -function ProcessBlockHouseFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) +function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) -- recupero l'ingombro del grezzo di appartenenza local b3Raw = EgtGetRawPartBBox( nRawId) -- ingombro del pezzo @@ -300,4 +300,4 @@ function ProcessBlockHouseFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end --------------------------------------------------------------------- -return ProcessBlockHouseFront +return ProcessBlockHausFront diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index d563d3b..9975afa 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,4 +1,4 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2020/02/20 +-- ProcessDrill.lua by Egaltech s.r.l. 2020/02/26 -- Gestione calcolo forature per Travi -- Tabella per definizione modulo @@ -26,7 +26,27 @@ end --------------------------------------------------------------------- -- Classificazione della feature function ProcessDrill.IsHeadFeature( Proc, b3Raw, dCurrOvmH) - return false + -- verifico se è in testa + if Proc.Box:getMax():getX() < b3Raw:getMax():getX() - dCurrOvmH - BD.MAX_DIST_HTFEA then + return false + end + -- recupero e verifico l'entità foro + local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0 + if AuxId then AuxId = AuxId + Proc.Id end + if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then + return false + end + local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) + -- se entrata principale + if Proc.Flg > 0 then + local nFcs = EgtGetInfo( Proc.Id, 'FCS', 'i') or 0 + return ( ( nFcs == 5 or nFcs == 6) and vtExtr:getX() > 0.5) + -- altrimenti entrata opposta + else + local nFce = EgtGetInfo( Proc.Id, 'FCE', 'i') or 0 + return ( ( nFce == 5 or nFce == 6) and vtExtr:getX() < -0.5) + end + end --------------------------------------------------------------------- @@ -101,7 +121,7 @@ function ProcessDrill.Classify( Proc, b3Raw) return false, false end local bOpen = ( Proc.Fce ~= 0) - local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + dDiam) + local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + dDiam / 2 and not Proc.Head and not Proc.Tail) -- verifico se il foro è fattibile solo da sotto local bDown = (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) return true, bDown diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 1c997ab..a9fdd69 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,5 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2020/02/18 --- Gestione calcolo mezzo-legno per Travi +-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/02/26 -- 2019/10/08 Agg. gestione OpenPocket. -- Tabella per definizione modulo @@ -705,7 +704,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacAdj, GDB_ID.ROOT) local ptP1, ptP2 = EgtSurfTmFacetOppositeSide( Proc.Id, nFacAdj, rfFac:getVersZ(), GDB_ID.ROOT) local vtT = vtN ^ (ptP2 - ptP1) - local d3RotAng = EgtIf( abs( vtT:getZ()) < GEO.EPS_SMALL, 0, 90) + vtT:normalize() + local d3RotAng = EgtIf( abs( vtT:getZ()) < 0.1, 0, 90) -- Recupero la lavorazione local sSawing = ML.FindSawing( 'Sawing') if not sSawing then diff --git a/LuaLibs/ProcessTenon.lua b/LuaLibs/ProcessTenon.lua index 162fdbd..a314e1b 100644 --- a/LuaLibs/ProcessTenon.lua +++ b/LuaLibs/ProcessTenon.lua @@ -1,4 +1,4 @@ --- ProcessTenon.lua by Egaltech s.r.l. 2020/02/07 +-- ProcessTenon.lua by Egaltech s.r.l. 2020/02/26 -- Gestione calcolo tenone per Travi -- Tabella per definizione modulo @@ -168,7 +168,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end end -- recupero la lavorazione - local sMilling = ML.FindMilling( 'Tenon') + local sMilling = ML.FindMilling( 'Tenon', dTenH) or ML.FindMilling( 'Tenon') if not sMilling then local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library' EgtOutLog( sErr)