diff --git a/Compile.bat b/Compile.bat index 9e11c86..4091878 100644 --- a/Compile.bat +++ b/Compile.bat @@ -45,6 +45,7 @@ REM Compilazione 32 e 64 bit \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessText.lua -s LuaLibs\ProcessText.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessTyroleanDovetail.lua -s LuaLibs\ProcessTyroleanDovetail.lua \EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessVariant.lua -s LuaLibs\ProcessVariant.lua +\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessProbing.lua -s LuaLibs\ProcessProbing.lua \EgtProg\Dll32\luac54 -o bin\BatchProcess.lua -s BatchProcess.lua \EgtProg\Dll32\luac54 -o bin\BatchProcessNew.lua -s BatchProcessNew.lua \EgtProg\Dll32\luac54 -o bin\GetBeamData.lua -s GetBeamData.lua diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 60afcc9..8efc44b 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -108,6 +108,7 @@ _G.package.loaded.ProcessScarfJoint = nil _G.package.loaded.ProcessSimpleScarf = nil _G.package.loaded.ProcessStepJoint = nil _G.package.loaded.ProcessStepJointNotch = nil +_G.package.loaded.ProcessProbing = nil _G.package.loaded.ProcessProfFront = nil _G.package.loaded.ProcessProfConcave = nil _G.package.loaded.ProcessProfConvex = nil diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 812ad32..098bf49 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -25,11 +25,14 @@ EgtOutLog( ' MachiningLib started', 1) -- Dati local BD = require( 'BeamData') -local Cuttings = require( 'CutData') -local Millings = require( 'MillingData') -local Pocketings = require( 'PocketingData') -local Sawings = require( 'SawingData') -local Drillings = require( 'DrillData') +-- librerie lavorazioni caricate con pcall perchè potrebbero non esserci +local Cuttings, Millings, Pocketings, Sawings, Drillings, Probing +if pcall( require, 'CutData') then Cuttings = require( 'CutData') end +if pcall( require, 'MillingData') then Millings = require( 'MillingData') end +if pcall( require, 'PocketingData') then Pocketings = require( 'PocketingData') end +if pcall( require, 'SawingData') then Sawings = require( 'SawingData') end +if pcall( require, 'DrillData') then Drillings = require( 'DrillData') end +if pcall( require, 'ProbingData') then Probing = require( 'ProbingData') end -- tipo di teste macchina local ONE_HEAD = 1 -- una testa (Fast, One, Turn1T) @@ -184,18 +187,32 @@ end --------------------------------------------------------------------- function GetMachinings( MachiningType, sType) - local Machinings + local Machinings = {} -- leggo le lavorazioni disponibili if MachiningType == MCH_MY.DRILLING then - Machinings = Drillings + if Drillings and type( Drillings) == "table" then + Machinings = Drillings + end elseif MachiningType == MCH_MY.SAWING then - Machinings = Cuttings + if Cuttings and type( Cuttings) == "table" then + Machinings = Cuttings + end elseif MachiningType == MCH_MY.MILLING then - Machinings = Millings + if Millings and type( Millings) == "table" then + Machinings = Millings + end elseif MachiningType == MCH_MY.POCKETING then - Machinings = Pocketings + if Pocketings and type( Pocketings) == "table" then + Machinings = Pocketings + end elseif MachiningType == MCH_MY.MORTISING then - Machinings = Sawings + if Sawings and type( Sawings) == "table" then + Machinings = Sawings + end + elseif MachiningType == MCH_MY.PROBING then + if Probing and type( Probing) == "table" then + Machinings = Probing + end end -- scrivo i parametri utensile nella lavorazione local validMachinings = {} @@ -208,27 +225,30 @@ function GetMachinings( MachiningType, sType) if Machining.Tool.Name then if EgtTdbSetCurrTool( Machining.Tool.Name) then table.insert( validMachinings, Machining) - if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then - Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth() - else - Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) - end - if MachiningType == MCH_MY.DRILLING then - if EgtStartsWith( Machining.Type, 'Drill') then - Machining.SubType = 'Drill' - elseif EgtStartsWith( Machining.Type, 'AngleDrill') then - Machining.SubType = 'AngleDrill' - elseif EgtStartsWith( Machining.Type, 'Pocket') then - Machining.SubType = 'DrillPocket' - elseif EgtStartsWith( Machining.Type, 'Predrill') then - Machining.SubType = 'Predrill' + -- se non è tastatura, recupero dati utensile + if MachiningType ~= MCH_MY.PROBING then + if ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then + Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth() + else + Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) end + if MachiningType == MCH_MY.DRILLING then + if EgtStartsWith( Machining.Type, 'Drill') then + Machining.SubType = 'Drill' + elseif EgtStartsWith( Machining.Type, 'AngleDrill') then + Machining.SubType = 'AngleDrill' + elseif EgtStartsWith( Machining.Type, 'Pocket') then + Machining.SubType = 'DrillPocket' + elseif EgtStartsWith( Machining.Type, 'Predrill') then + Machining.SubType = 'Predrill' + end + end + Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) + Machining.Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) + Machining.Tool.TotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) + Machining.Tool.ToolHolderDiameter = EgtTdbGetCurrToolThDiam() + Machining.Tool.ToolHolderLength = EgtTdbGetCurrToolThLength() or 72 end - Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) - Machining.Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) - Machining.Tool.TotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - Machining.Tool.ToolHolderDiameter = EgtTdbGetCurrToolThDiam() - Machining.Tool.ToolHolderLength = EgtTdbGetCurrToolThLength() or 72 end end end diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index d29dd7c..7856b25 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -546,7 +546,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) if bIntersectionOk then local dHoleToCutDistance = vDistance[1] -- se il taglio accorcia realmente il foro - if dHoleToCutDistance > 10 * GEO.EPS_SMALL and dHoleToCutDistance < dLen then + if ( dHoleToCutDistance > 10 * GEO.EPS_SMALL or Proc.AffectedFaces.Right) and dHoleToCutDistance < dLen then dMaxDepth = dMaxDepthOri dMaxElev = dLen - dHoleToCutDistance bTryDrill = true diff --git a/LuaLibs/ProcessDtMortise.lua b/LuaLibs/ProcessDtMortise.lua index 74992bc..2d44d8a 100644 --- a/LuaLibs/ProcessDtMortise.lua +++ b/LuaLibs/ProcessDtMortise.lua @@ -20,6 +20,7 @@ local ProcessDtMortise = {} require( 'EgtBase') local BL = require( 'BeamLib') local Cut = require( 'ProcessCut') +local Probe = require( 'ProcessProbing') EgtOutLog( ' ProcessDtMortise started', 1) @@ -291,6 +292,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) local dToolDiam = 100 local dMaxMat = 30 local dSideAng = 0 + local sHeadTool = 'H1' local bCW = true local bMillOnAggregate = sMchExt == '_AT' if EgtMdbSetCurrMachining( sMilling) then @@ -300,6 +302,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) dToolDiam = max( dToolDiam, 10) dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng + sHeadTool = EgtTdbGetCurrToolParam( MCH_TP.HEAD) local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0 bCW = ( dSpeed >= 0) end @@ -354,6 +357,11 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) bMultipleZPasses = true end + + -- tastatura se richiesta + local Info = { vtProbe = vtExtr, ptProbe = ptBC, sType = 'DTMortise', sHead = sHeadTool} + local bProbeExecuted, sErr = Probe.Make( Proc, nPartId, Info) + -- se con tasca, la lavoro (mai in doppio) if bPocket then -- recupero il contorno della tasca (seconda curva ausiliaria) @@ -634,7 +642,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) end end -- se necessario, imposto SCC - if nSCC then + if nSCC then EgtSetMachiningParam( MCH_MP.SCC, nSCC) end -- dichiaro massima elevazione e assenza sfridi per VMill @@ -655,6 +663,10 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2) end end + -- se c'è stata tastatura, si disattiva sull'ultima lavorazione + if bProbeExecuted and i == 1 then + sUserNotes = EgtSetValInNotes( sUserNotes, 'END-PROBE', true) + end EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) -- eseguo if not ML.ApplyMachining( true, false) then diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index a77efe3..56de528 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -192,6 +192,7 @@ local function AssignQIdent( Proc) Q_STAIRCASE = '' Q_SAW_PLUS_CHAIN = 'Q11' Q_FORCE_CHAINSAW = 'Q12' + Q_NO_ROTATION = 'Q13' if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then Q_FORCE_BLADE = 'Q01' -- i @@ -965,6 +966,12 @@ function ProcessLapJoint.Classify( Proc, b3Raw) bDown = ( vtN2:getZ() < BD.NZ_MINB) end end + + local bNoRotation = ( EgtGetInfo( Proc.Id, Q_NO_ROTATION, 'i') or 0) == 1 + if bDown and bNoRotation then + bDown = false + end + return true, bDown end end @@ -3087,10 +3094,20 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, return false, sErr end local bGoFromHead = true - -- se la lunghezza utensile non riesce ad arrivare sul fondo assegno la possibilità di lavorare di fianco (se possibile) - if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then + local bAttackFromSide = ( ( EgtGetInfo( Proc.Id, Q_NO_ROTATION, 'i') or 0) == 1) + and ( Proc.Fct == 4) and ( Proc.Topology == 'Groove') + -- se normale lungo Z è da sopra: si tenta attacco laterale se richiesto + if AreSameOrOppositeVectorApprox( Proc.Face[ nFacInd + 1].VtN, Z_AX()) then + if bAttackFromSide then + bGoFromHead = false + end + elseif dElev > dMaxDepth + 10 * GEO.EPS_SMALL then + if bAttackFromSide then + bGoFromHead = false -- continuo di testa se fessura con tre facce o non è tunnel - bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces) + else + bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces) + end end -- se continuo a lavorare di testa if bGoFromHead then @@ -3187,16 +3204,34 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, return false, sWarn end end - -- altrimenti sega a catena di fianco + -- altrimenti sega a catena di fianco + -- si arriva qui anche per groove 4 lati con rotazione esclusa else - -- verifico se posso farlo con la sega-catena + local vtRef = Vector3d( vtOrtho) + if vtRef and ( vtRef:getY() > 0.5 or vtRef:getZ() < -0.1) then + vtRef = -vtRef + end + if not ( Proc.Topology == 'Tunnel') then + dDimMin = min( Proc.Face[ nFacInd + 1].Width, Proc.Face[ nFacInd + 1].Height) + dDimMax = min( Proc.Face[ nFacAdj + 1].Width, Proc.Face[ nFacAdj + 1].Height) + nLundIdFace = nFacAdj + local nFaceZ + if not vtRef then + if Proc.AffectedFaces.Top then + vtRef = Z_AX() + nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, Z_AX()) + else + vtRef = -Z_AX() + nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, -Z_AX()) + end + end + dDepth = Proc.Face[ nFaceZ + 1].Elevation + end local bMakeChainSaw, sSawing2, dMaxMat2, dSawCornerRad2, dSawThick2 = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth) if bMakeChainSaw then -- Calcolo normale faccia da lavorare local vtNL = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT) -- Calcolo uso faccia - local vtRef = Vector3d( vtOrtho) - if vtRef:getY() > 0.5 or vtRef:getZ() < -0.1 then vtRef = -vtRef end local nFaceUse = BL.GetNearestParalOpposite( vtRef, vtNL) -- Verifico se necessarie più passate local nStep = ceil( ( dDimMin - 100 * GEO.EPS_SMALL) / dSawThick2) @@ -3223,21 +3258,67 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, -- imposto offset radiale local dOffs = ( i - 1) * dStep EgtSetMachiningParam( MCH_MP.OFFSR, dOffs) - -- se possibile aumento l'affondamento pari al raggio corner + 1 - if dMaxMat2 > ( dDepth + dSawCornerRad2 + 1) then - EgtSetMachiningParam( MCH_MP.DEPTH, (dDepth + dSawCornerRad2 + 1)) - -- se massimo affondamento supera altezza fessura, uso massimo affondamento - elseif dMaxMat2 > (dDepth + 1) then - EgtSetMachiningParam( MCH_MP.DEPTH, (dMaxMat2 - 1)) - -- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning - elseif dMaxMat2 < dDepth then - EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat2) - sWarn = 'Warning : elevation bigger than max tool depth' - EgtOutLog( sWarn) + local dMachiningDepth = dDepth + if Proc.Topology == 'Tunnel' then + -- se possibile aumento l'affondamento pari al raggio corner + 1 + if dMaxMat2 > ( dDepth + dSawCornerRad2 + 1) then + dMachiningDepth = ( dDepth + dSawCornerRad2 + 1) + -- se massimo affondamento supera altezza fessura, uso massimo affondamento + elseif dMaxMat2 > ( dDepth + 1) then + dMachiningDepth = (dMaxMat2 - 1) + -- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning + elseif dMaxMat2 < dDepth then + dMachiningDepth = dMaxMat2 + sWarn = 'Warning : elevation bigger than max tool depth' + EgtOutLog( sWarn) + end + EgtSetMachiningParam( MCH_MP.DEPTH, dMachiningDepth) + else + -- se possibile si lavora tutta la profondità + if dMaxMat2 > (dDepth - 100 * GEO.EPS_SMALL) then + dMachiningDepth = dDepth + -- in alternativa si arriva al massimo materiale + else + dMachiningDepth = dMaxMat2 + sWarn = 'Warning : elevation bigger than max tool depth' + EgtOutLog( sWarn) + end + EgtSetMachiningParam( MCH_MP.DEPTH, dMachiningDepth) + local dStartAddLen = dSawWidth / 2 + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + EgtMdbGetGeneralParam( MCH_GP.SAFEAGGRBOTTZ) + local dEndAddLen = - dSawWidth / 2 + if vtRef:getZ() > 10 * GEO.EPS_SMALL then + EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MORTISE_WS.LEFT) + EgtSetMachiningParam( MCH_MP.INVERT, true) + end + EgtSetMachiningParam( MCH_MP.STARTADDLEN, dStartAddLen) + EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEndAddLen) + end + -- in caso di attacco esterno si setta in modo da fare un primo step adeguato per evitare finecorsa + -- si riduce la feed opportunamente + if not ( Proc.Topology == 'Tunnel') then + local dMachiningStep = EgtGetMachiningParam( MCH_MP.STEP) or 0 + -- TODO qui sostituire con valore preciso da GetSetupInfo + if BD.C_SIMM then + dMachiningStep = 165 + if vtRef:getZ() < - 10 * GEO.EPS_SMALL then + dMachiningStep = 250 + end + end + local dActualStep = ( dMachiningDepth - dMachiningStep) / ( 2 + 1) + dElev = dMachiningDepth - dMachiningStep + dActualStep - 0.1 + if dActualStep < 0 then + dActualStep = 1 + dElev = 2 + end + EgtSetMachiningParam( MCH_MP.STEP, dActualStep) + + local dFeed = EgtGetMachiningParam( MCH_MP.FEED) / 2 + EgtSetMachiningParam( MCH_MP.FEED, dFeed) end - -- considero estremi inizio/fine chiusi - -- imposto massima elevazione local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';' + if not ( Proc.Topology == 'Tunnel') then + sNotes = EgtSetValInNotes( sNotes, 'Plunge', 10) + end EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) -- eseguo if not ML.ApplyMachining( true, false) then diff --git a/LuaLibs/ProcessLongDoubleCut.lua b/LuaLibs/ProcessLongDoubleCut.lua index f64cc41..5238263 100644 --- a/LuaLibs/ProcessLongDoubleCut.lua +++ b/LuaLibs/ProcessLongDoubleCut.lua @@ -1306,6 +1306,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster end -- ciclo sulle parti local nM = 0 + local bInverted = false for j = 1, nC do -- su entrambe le facce for i = nIni, nFin do @@ -1349,8 +1350,19 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster -- controllo se lavorazione completa local dMachDepth = vElevation[vOrd[i]] if dMachDepth > dMaxDepth - 10 * GEO.EPS_ANG_SMALL then - sWarn = 'Warning : elevation bigger than max tool depth' - EgtOutLog( sWarn) + -- verifico se posso lavorare la faccia 2 + local nOtherFace = EgtIf( i == 1, 2, 1) + if j == 1 and vtN[vOrd[nOtherFace]]:getZ() > dLimitAngle and vWidth[vOrd[i]] < dMaxDepth then + vOrd[1], vOrd[2] = vOrd[2], vOrd[1] + dLargh = vWidth[vOrd[i]] + dSal, dEal = dEal, dSal + bInverted = true + else + sWarn = 'Warning : elevation bigger than max tool depth' + EgtOutLog( sWarn) + end + elseif bInverted then + dSal, dEal = dEal, dSal end if not bSide and dLargh > 0.8 * dToolDiam then nO = ceil( dLargh / ( 0.6 * dToolDiam)) diff --git a/LuaLibs/ProcessProbing.lua b/LuaLibs/ProcessProbing.lua new file mode 100644 index 0000000..b90cfcd --- /dev/null +++ b/LuaLibs/ProcessProbing.lua @@ -0,0 +1,103 @@ +-- ProcessSplit.lua by Egaltech s.r.l. 2025/06/20 +-- Gestione tastatura + +-- Tabella per definizione modulo +local ProcessProbing = {} + +-- Include +require( 'EgtBase') +local BL = require( 'BeamLib') + +-- Dati +local ML = require( 'MachiningLib') + +--------------------------------------------------------------------- +local function GetProbingMachining( Machinings, sHead) + local sProbeMachining, sHeadTool + + -- TODO questa associazione "testa utensile"-"testa tastatore" dovrebbe essere spostata nella macchina. + -- Non è detto che se testa utensile inizia con "H2" allora bisogna prendere lavorazione con "_H2" + + -- se la testa utilizzata dalla lavorazione inizia con H2, dovrebbe essere la seconda testa + if EgtStartsWith( sHead, 'H2') then + sHeadTool = '_H2' + else + sHeadTool = '_H1' + end + + for i = 1, #Machinings do + if EgtEndsWith( Machinings[i].Name, sHeadTool) then + sProbeMachining = Machinings[i] + return sProbeMachining + end + end + sProbeMachining = Machinings[1] + return sProbeMachining +end + +--------------------------------------------------------------------- +local function MoveProbePointToRawFaces( ptProbe, vtProbe, nPartId) + local b3BoxPart = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) + -- si porta linea di tastatura su grezzo + if AreSameVectorApprox( vtProbe, Z_AX()) then + ptProbe[3] = b3BoxPart:getMax():getZ() + elseif AreSameVectorApprox( vtProbe, -Z_AX()) then + ptProbe[3] = b3BoxPart:getMin():getZ() + elseif AreSameVectorApprox( vtProbe, Y_AX()) then + ptProbe[2] = b3BoxPart:getMax():getY() + elseif AreSameVectorApprox( vtProbe, -Y_AX()) then + ptProbe[2] = b3BoxPart:getMin():getY() + end + return ptProbe +end + +--------------------------------------------------------------------- +-- Applicazione della lavorazione +function ProcessProbing.Make( Proc, nPartId, Info) + local bOk, sErr + + -- per eseguire tastatura servono tutti i dati, altriemnti impossibile + if Info.vtProbe and Info.ptProbe and Info.sType then + Info.ptProbe = MoveProbePointToRawFaces( Info.ptProbe, Info.vtProbe, nPartId) + -- recupero gruppo per geometria addizionale + local nAddGrpId = BL.GetAddGroup( nPartId) + local nIdLine = EgtLinePVL( nAddGrpId, Info.ptProbe, Info.vtProbe, 10, GDB_RT.GLOB) -- TODO lunghezza da portare fuori come parametro + local Machinings = GetMachinings( MCH_MY.PROBING, Info.sType) + -- se c'è almeno una lavorazione, allora devo fare tastatura + if Machinings and #Machinings > 0 then + local sProbing = GetProbingMachining( Machinings, Info.sHead) + -- se c'è la linea e la lavorazione, applico + if sProbing and nIdLine then + local sName = 'DtMtProbe_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMchFId = EgtAddMachining( sName, sProbing.Name) + -- si inverte la direzione della linea, deve essere entrante, oppostaa vettore estrusione + EgtInvertCurve( nIdLine) + -- aggiungo geometria + EgtSetMachiningGeometry( {{ nIdLine, -1}}) + + -- eseguo + if not ML.ApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchFId, false) + return false, sErr + else + bOk = true + end + else + bOk = false + sErr = 'Error on probing' + end + -- altrimenti tastatura non richiesta, esco + else + return true + end + else + bOk = false + sErr = 'Error on probing' + end + + return bOk, sErr +end + +--------------------------------------------------------------------- +return ProcessProbing diff --git a/LuaLibs/ProcessRidgeLap.lua b/LuaLibs/ProcessRidgeLap.lua index df34b2b..dbfc145 100644 --- a/LuaLibs/ProcessRidgeLap.lua +++ b/LuaLibs/ProcessRidgeLap.lua @@ -173,7 +173,7 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end -- calcolo riferimenti per facce inclinate local vtRef = Vector3d( vtN[vFaceOrd[3]]) - local vtRef2 = EgtIf( bHead, X_AX(), -X_AX()) + local vtRef2 = Vector3d( vtN[vFaceOrd[2]]) -- eseguo for i = 1, #vCuts do local nOrthoOpposite