diff --git a/LuaLibs/DiceCut.lua b/LuaLibs/DiceCut.lua index f37640e..1f75292 100644 --- a/LuaLibs/DiceCut.lua +++ b/LuaLibs/DiceCut.lua @@ -129,7 +129,7 @@ end -- vtO: il versore dei piani ortogonali -- dOffsetEff: offset della distanza dal punto centrale -- Verifica se l'asse X del box costruito sopra la superficie è più grande di un certo offset -local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff) +local function GetOrtoCutCenter( FacetId, ptC, vtN, vtO, dOffsetEff, dNzLimDwnUp) local FrameLocal = Frame3d( EgtSurfTmFacetCenter( FacetId, 0, GDB_ID.ROOT)) EgtSetGridFrame(FrameLocal) local IdAuxLocal = EgtGroup(EgtGetParent( FacetId), FrameLocal) @@ -148,7 +148,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() > dNzLimDwnUp then return nil, nil, nil end @@ -255,7 +255,7 @@ end -- OffsetP: offset della distanza dal punto centrale -- BBoxRawPart: il grezzo della barra -- Verifica se l'asse X del box costruito sopra le 2 facce è più piccolo di un certo offset e quindi la faccia O è superflua -local function VerifyFirstOrthoCut( CutTable, OffsetP, BBoxRawPart) +local function VerifyFirstOrthoCut( CutTable, OffsetP, BBoxRawPart, dNzLimDwnUp) if not CutTable[1] or not CutTable[2] then return end @@ -285,7 +285,7 @@ local function VerifyFirstOrthoCut( CutTable, OffsetP, BBoxRawPart) -- lunghezza totale faccia local dLongSize = x1 + x2 -- se faccia piccola e non orientata verso il basso, elimino ortogonale e unisco le due parti - if dLongSize <= OffsetP + 1.0 and vtN1:getZ() > -0.5 then + if dLongSize <= OffsetP + 1.0 and vtN1:getZ() > dNzLimDwnUp then local nParent = EgtGetParent( Cut1Id) local SurfId = EgtSurfTmBySewing( nParent, { Cut1Id, Cut2Id}) EgtSetColor( SurfId, Color3d( FUCHSIA(), 60)) @@ -482,7 +482,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl -- CopyPlane: 0 => crea la prima faccia direttamente sul punto passato -- CopyPlane: 1 => crea la prima faccia e tutte le altre con l'offset passato -- CopyPlane: 0.5 => crea la prima faccia a metà offset e tutte le altre con l'offest intero - local OffsetRel, CopyPlane, dCenOffs, ptCStart = GetOrtoCutCenter( TabellaTmSurfP[PlnInd], ptCInner, vtNInner, vtO, OffsetO) + local OffsetRel, CopyPlane, dCenOffs, ptCStart = GetOrtoCutCenter( TabellaTmSurfP[PlnInd], ptCInner, vtNInner, vtO, OffsetO, dNzLimDwnUp) if OffsetRel and CopyPlane and dCenOffs then ptCInner = ptCInner + dCenOffs * vtO @@ -531,7 +531,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl -- Se esiste la superficie limitante (nFacet == 2) verifica se il taglio più esterno è superfluo e quindi viene eliminato if not bGetOrtoPlanes then - VerifyFirstOrthoCut( UltimateTable, originalOffsetP, BBoxRawPart) + VerifyFirstOrthoCut( UltimateTable, originalOffsetP, BBoxRawPart, dNzLimDwnUp) end return UltimateTable diff --git a/LuaLibs/ProcessDrill.lua b/LuaLibs/ProcessDrill.lua index eabcd4e..e4c1832 100644 --- a/LuaLibs/ProcessDrill.lua +++ b/LuaLibs/ProcessDrill.lua @@ -1,4 +1,4 @@ --- ProcessDrill.lua by Egaltech s.r.l. 2020/03/04 +-- ProcessDrill.lua by Egaltech s.r.l. 2020/03/06 -- Gestione calcolo forature per Travi -- Tabella per definizione modulo @@ -13,10 +13,6 @@ EgtOutLog( ' ProcessDrill started', 1) local BD = require( 'BeamData') local ML = require( 'MachiningLib') --- Costanti -local TH_RAD = 35 -- raggio portautensile -local COS_SLANT_LIM = 0.866 -- 30deg da piano - --------------------------------------------------------------------- -- Riconoscimento della feature function ProcessDrill.Identify( Proc) @@ -117,7 +113,7 @@ function ProcessDrill.Classify( Proc, b3Raw) ptCen = ptCen + vtExtr * dLen end -- verifico se troppo inclinato e quindi non lavorabile - if not ( Proc.Fcs == 5 or Proc.Fcs == 6 or Proc.Fce == 5 or Proc.Fce == 6) and abs( vtExtr:getX()) > COS_SLANT_LIM then + if not ( Proc.Fcs == 5 or Proc.Fcs == 6 or Proc.Fce == 5 or Proc.Fce == 6) and abs( vtExtr:getX()) > BD.DRILL_VX_MAX then return false, false end local bOpen = ( Proc.Fce ~= 0) @@ -163,6 +159,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) end -- recupero i dati dell'utensile local dMaxDepth = 20 + local dDiamTh = 35 if EgtMdbSetCurrMachining( sDrilling) then local bIsDrilling = ( EgtMdbGetCurrMachiningParam( MCH_MP.TYPE) == MCH_MY.DRILLING) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) @@ -172,14 +169,15 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId) else dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth end + dDiamTh = EgtTdbGetCurrToolThDiam() end end -- se foro intermedio e inclinato, limito il massimo affondamento if not ( ( Proc.Fcs == 5 or Proc.Fcs == 6) or ( bToInvert and ( Proc.Fce == 5 or Proc.Fce == 6))) then local CosB = abs( vtExtr:getX()) - if CosB < COS_SLANT_LIM then + if CosB < BD.DRILL_VX_MAX then local TgA = CosB / sqrt( 1 - CosB * CosB) - dMaxDepth = dMaxDepth - TH_RAD * TgA + dMaxDepth = dMaxDepth - dDiamTh / 2 * TgA else dMaxDepth = 0 end diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 8e83194..1dd95d1 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2020/03/04 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/03/06 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. @@ -765,9 +765,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV end --------------------------------------------------------------------- -local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiam) +local function ChoseCorner( Proc, nFacInd) -- Recupero le facce adiacenti alla principale - local sMyWarn local vAdj = EgtSurfTmFacetAdjacencies( Proc.Id, nFacInd)[1] local tFacAdj = {} for i = 1, #vAdj do @@ -803,6 +802,180 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, dMaxLen = tFacAdj[i][3] end end + + return dMaxLen, nIdLine, tFacAdj +end + +--------------------------------------------------------------------- +local function MakeCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiam) + + local sMyWarn + local pAuxId = {} + local nAuxId + local AuxId + local ptApPoint + local dLenTrimExt + local sMilling + local dMaxDepth = 0 + + -- ottengo l'angolo di riferimento dove applicare il percorso di pulitura + local dMaxLen, nIdLine, tFacAdj = ChoseCorner( Proc, nFacInd) + -- prendo il primo versore + local _, vtN1 = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT) + local _, vtN2 = EgtSurfTmFacetCenter( Proc.Id, tFacAdj[nIdLine][1], GDB_ID.ROOT) + local _, vtN3 = EgtSurfTmFacetCenter( Proc.Id, tFacAdj[nIdLine][2], GDB_ID.ROOT) + + if not tFacAdj then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' geometry not found for clean corner' + EgtOutLog( sErr) + return false, sErr + end + -- trovo il punto sulla superfice di riferimento + local _, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( Proc.Id, nFacInd, tFacAdj[nIdLine][1], GDB_ID.ROOT) + local nIdIniPoint + local nIdEndPoint + if ptLocP1 and ptLocP2 then + if ( dist( ptLocP1, tFacAdj[nIdLine][4]) < GEO.EPS_SMALL) or ( dist( ptLocP2, tFacAdj[nIdLine][4]) < GEO.EPS_SMALL) then + nIdEndPoint = 4 + nIdIniPoint = 5 + elseif ( dist( ptLocP1, tFacAdj[nIdLine][5]) < GEO.EPS_SMALL) or ( dist( ptLocP2, tFacAdj[nIdLine][5]) < GEO.EPS_SMALL) then + nIdEndPoint = 5 + nIdIniPoint = 4 + end + end + -- versore direzione + local vtExtr = tFacAdj[nIdLine][nIdIniPoint] - tFacAdj[nIdLine][nIdEndPoint] + vtExtr:normalize() + -- inserisco le prime tre linee + if nIdIniPoint and nIdEndPoint then + -- se fresatura da sotto salto la lavorazione + if vtExtr:getZ() < BD.DRILL_VZ_MIN then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' clean corner milling from bottom impossible' + EgtOutLog( sErr) + return false, sErrLX + end + -- sommo i tre versori per avre una direzione media + vtExtr = vtN1 + vtN2 + vtN3 + vtExtr:normalize() + -- recupero la lavorazione + sMilling = ML.FindMilling( 'CleanCorner', (dDiam * 0.6)) + if not sMilling then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' clean corner milling not found in library' + EgtOutLog( sErr) + return false, sErr + end + -- recupero i dati dell'utensile ( temporaneo, per compensare errore nella lavorazione) + if EgtMdbSetCurrMachining( sMilling) then + local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) + dMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxDepth + end + nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdLine][nIdIniPoint], tFacAdj[nIdLine][nIdEndPoint], GDB_RT.GLOB) + table.insert( pAuxId, nAuxId) + -- se il punto finale corrisponde con il punto utilizzato in precedenza, uso l'altro + if dist( tFacAdj[nIdLine][nIdEndPoint], ptLocP1) < 10 * GEO.EPS_SMALL then + ptApPoint = ptLocP2 + else + ptApPoint = ptLocP1 + end + nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdLine][nIdEndPoint], ptApPoint, GDB_RT.GLOB) + dLenTrimExt = dist( tFacAdj[nIdLine][nIdEndPoint], ptApPoint) - (( dDiam/2) + 2) + -- se la distanza dei due punti della linea è maggiore dal raggio fresa + delta, trimmo al raggio fresa + delta + if dLenTrimExt > 10 * GEO.EPS_SMALL then + EgtTrimExtendCurveByLen( nAuxId , -dLenTrimExt, ptApPoint , GDB_RT.GLOB) + -- prendo il nuovo punto finale + ptApPoint = EgtEP( nAuxId, GDB_RT.GLOB) + end + table.insert( pAuxId, nAuxId) + -- creo linea di ritorno + nAuxId = EgtLine( nAddGrpId, ptApPoint, tFacAdj[nIdLine][nIdEndPoint], GDB_RT.GLOB) + table.insert( pAuxId, nAuxId) + end + -- inserisco le ultime tre linee + -- trovo il secondo punto sulla superfice di riferimento + _, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( Proc.Id, nFacInd, tFacAdj[nIdLine][2], GDB_ID.ROOT) + if ptLocP1 and ptLocP2 then + -- se il punto finale corrisponde con il punto utilizzato in precedenza, uso l'altro + if dist( tFacAdj[nIdLine][nIdEndPoint], ptLocP1) < 10 * GEO.EPS_SMALL then + ptApPoint = ptLocP2 + else + ptApPoint = ptLocP1 + end + nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdLine][nIdEndPoint], ptApPoint, GDB_RT.GLOB) + dLenTrimExt = dist( tFacAdj[nIdLine][nIdEndPoint], ptApPoint) - (( dDiam/2) + 2) + -- se la distanza dei due punti della linea è maggiore dal raggio fresa + delta, trimmo al raggio fresa + delta + if dLenTrimExt > 10 * GEO.EPS_SMALL then + EgtTrimExtendCurveByLen( nAuxId , -dLenTrimExt, ptApPoint , GDB_RT.GLOB) + -- prendo il nuovo punto finale + ptApPoint = EgtEP( nAuxId, GDB_RT.GLOB) + end + table.insert( pAuxId, nAuxId) + -- creo linea di ritorno + nAuxId = EgtLine( nAddGrpId, ptApPoint, tFacAdj[nIdLine][nIdEndPoint], GDB_RT.GLOB) + table.insert( pAuxId, nAuxId) + -- ultima linea di risalita + nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdLine][nIdEndPoint], tFacAdj[nIdLine][nIdIniPoint], GDB_RT.GLOB) + table.insert( pAuxId, nAuxId) + end + -- trasformo in percorso + if #pAuxId > 0 then + AuxId = EgtCurveCompo( nAddGrpId, pAuxId, true) + end + -- se non c'é il percorso do errore + if not AuxId then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' impossible make clean corner path' + EgtOutLog( sErr) + return false, sErr + end + -- modifico versore direzione + EgtModifyCurveExtrusion( AuxId, vtExtr, GDB_RT.GLOB) + -- inserisco la lavorazione + local sName = 'Clean_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) + local nMchId = EgtAddMachining( sName, sMilling) + if not nMchId then + local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling + EgtOutLog( sErr) + return false, sErr + end + -- aggiungo geometria + EgtSetMachiningGeometry( {{ AuxId, -1}}) + -- imposto posizione braccio porta testa + local nSCC = MCH_SCC.ADIR_YM + if vtExtr:getY() > 100 * GEO.EPS_ZERO then + nSCC = MCH_SCC.ADIR_YP + end + EgtSetMachiningParam( MCH_MP.SCC, nSCC) + EgtSetMachiningParam( MCH_MP.DEPTH, 0) + -- Note utente con dichiarazione nessuna generazione sfridi per Vmill + local sUserNotes = 'VMRS=0;' + -- aggiungo alle note massima elevazione + sUserNotes = sUserNotes .. 'MaxElev=' .. EgtNumToString( dMaxDepth, 1) .. ';' + EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) + if not EgtApplyMachining( true, false) then + local _, sErr = EgtGetLastMachMgrError() + EgtSetOperationMode( nMchId, false) + return false, sErr + else + local _, sWarn = EgtGetMachMgrWarning( 0) + if EgtIsMachiningEmpty() then + EgtSetOperationMode( nMchFId, false) + return false, sWarn + else + return true, ( sMyWarn or sWarn) + end + end + + return true, sMyWarn +end +--------------------------------------------------------------------- +local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiam) + local sMyWarn + -- ottengo l'angolo dove applicare il foro + local dMaxLen, nIdLine, tFacAdj = ChoseCorner( Proc, nFacInd) + if not tFacAdj then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' geometry not found for drilling' + EgtOutLog( sErr) + return false, sErr + end -- trovo il punto sulla superfice di riferimento local _, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( Proc.Id, nFacInd, tFacAdj[nIdLine][1], GDB_ID.ROOT) local nIdIniPoint @@ -820,7 +993,7 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, if nIdIniPoint and nIdEndPoint then -- versore direzione local vtExtr = tFacAdj[nIdLine][nIdIniPoint] - tFacAdj[nIdLine][nIdEndPoint] - vtExtr:normalize() + vtExtr:normalize() -- se foratura da sotto salto la lavorazione if vtExtr:getZ() < BD.DRILL_VZ_MIN then local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' drilling from bottom impossible' @@ -837,6 +1010,7 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, -- recupero i dati dell'utensile local dMaxDepth = 20 local dDiamTool = 20 + local dDiamTh = 35 local bIsDrilling if EgtMdbSetCurrMachining( sDrilling) then bIsDrilling = ( EgtMdbGetCurrMachiningParam( MCH_MP.TYPE) == MCH_MY.DRILLING) @@ -848,8 +1022,17 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth end dDiamTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) + dDiamTh = EgtTdbGetCurrToolThDiam() end end + -- se foro inclinato, limito il massimo affondamento + local CosB = abs( vtExtr:getX()) + if CosB < BD.DRILL_VX_MAX then + local TgA = CosB / sqrt( 1 - CosB * CosB) + dMaxDepth = dMaxDepth - dDiamTh / 2 * TgA + else + dMaxDepth = 0 + end -- setto griglia EgtSetGridFrame( Frame3d( tFacAdj[nIdLine][nIdIniPoint], vtExtr)) -- creo geometria @@ -1121,6 +1304,7 @@ end local function EvaluateQParam( Proc, nRawId, bMakeVertCham, sDephtCham, sOnlyCham, sUseBlade) local nChamfer = 0 local bForceUseBlade = false + local sErr -- verifico che lo smusso sia richiesto local dDepth = EgtGetInfo( Proc.Id, sDephtCham, 'd') or 0 if dDepth > 0 then @@ -1132,7 +1316,7 @@ local function EvaluateQParam( Proc, nRawId, bMakeVertCham, sDephtCham, sOnlyCha nChamfer = nChamfer + 1 -- altrimenti se non ho l'affondamento esco else - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' no chamfer depth' + sErr = 'Error on process ' .. tostring( Proc.Id) .. ' no chamfer depth' EgtOutLog( sErr) return -1, dDepth, sErr end @@ -1141,15 +1325,8 @@ local function EvaluateQParam( Proc, nRawId, bMakeVertCham, sDephtCham, sOnlyCha if EgtGetInfo( Proc.Id, sUseBlade, 'i') == 1 then bForceUseBlade = true end - -- recupero la lavorazione - local sMilling = ML.FindMilling( 'Mark') - if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' - EgtOutLog( sErr) - return -1, 0, sErr - end - return nChamfer, dDepth, sMilling, bForceUseBlade + return nChamfer, dDepth, sErr, bForceUseBlade end --------------------------------------------------------------------- @@ -1185,17 +1362,24 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId) end -- verifico se sono presenti i parametri Q per la profondità smusso e -- per eseguire in esclusiva solo lo smusso - local nChamfer, dDepthCham, sChamfer, bForceUseBlade = EvaluateQParam( Proc, nRawId, false, sDepthChamferMill, sPreemptiveChamfer, sForceUseBlade) + local nChamfer, dDepthCham, sErrCham, bForceUseBlade = EvaluateQParam( Proc, nRawId, false, sDepthChamferMill, sPreemptiveChamfer, sForceUseBlade) -- se non posso lavorare la feature perché condizionata dall'esecuzione del solo chamfer -- genero errore e non faccio nulla if nChamfer < 0 then - return false, sChamfer + return false, sErrCham end if bClosedOrthoFaces then -- se tunnel provo a vedere se è possibile lavorarlo di con la svuotatura o con la sega catena -- ottengo le dimensioni del tunnel local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = GetTunnelDimension( Proc, nPartId) -- se devo inserire il chamfer if nChamfer > 0 then + -- recupero la lavorazione + local sMilling = ML.FindMilling( 'Mark') + if not sMilling then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' + EgtOutLog( sErr) + return false, sErr + end -- ottengo le curve di contorno libero local nAuxId1, nNumIdAux = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId) if nAuxId1 then @@ -1209,9 +1393,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId) if vtExtr:getZ() > -0.707 and ( abs(vtOrtho:getX()) > 0.99 or abs(vtOrtho:getY()) > 0.99 or abs(vtOrtho:getZ()) > 0.99) then -- inserisco la lavorazione local sNameCh = 'Cham_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( i) - local nMchId = EgtAddMachining( sNameCh, sChamfer) + local nMchId = EgtAddMachining( sNameCh, sMilling) if not nMchId then - local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sChamfer + local sErr = 'Error adding machining ' .. sNameCh .. '-' .. sMilling EgtOutLog( sErr) return false, sErr end @@ -1610,6 +1794,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId) if EgtGetInfo( Proc.Id, sInsertBoreOnCorner, 'i') == 1 then local bOk, sWarn = MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiamTool) if not bOk then return false, sWarn end + elseif EgtGetInfo( Proc.Id, sInsertBoreOnCorner, 'i') == 2 then + local bOk, sWarn = MakeCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiamTool) + if not bOk then return false, sWarn end end end end diff --git a/LuaLibs/ProcessProfCamb.lua b/LuaLibs/ProcessProfCamb.lua index bff7b7c..63f2c18 100644 --- a/LuaLibs/ProcessProfCamb.lua +++ b/LuaLibs/ProcessProfCamb.lua @@ -132,11 +132,14 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly end end -- recupero la lavorazione - local sMilling = ML.FindMilling( 'Mark') - if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' - EgtOutLog( sErr) - return -1, 0, sErr + local sMilling + if nChamfer > 0 then + sMilling = ML.FindMilling( 'Mark') + if not sMilling then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' + EgtOutLog( sErr) + return -1, 0, sErr + end end return nChamfer, dDepth, sMilling diff --git a/LuaLibs/ProcessProfConcave.lua b/LuaLibs/ProcessProfConcave.lua index 7adbc46..32f5830 100644 --- a/LuaLibs/ProcessProfConcave.lua +++ b/LuaLibs/ProcessProfConcave.lua @@ -131,11 +131,14 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly end end -- recupero la lavorazione - local sMilling = ML.FindMilling( 'Mark') - if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' - EgtOutLog( sErr) - return -1, 0, sErr + local sMilling + if nChamfer > 0 then + sMilling = ML.FindMilling( 'Mark') + if not sMilling then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' + EgtOutLog( sErr) + return -1, 0, sErr + end end return nChamfer, dDepth, sMilling diff --git a/LuaLibs/ProcessProfConvex.lua b/LuaLibs/ProcessProfConvex.lua index ff0e0d2..fc9390b 100644 --- a/LuaLibs/ProcessProfConvex.lua +++ b/LuaLibs/ProcessProfConvex.lua @@ -131,11 +131,14 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly end end -- recupero la lavorazione - local sMilling = ML.FindMilling( 'Mark') - if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' - EgtOutLog( sErr) - return -1, 0, sErr + local sMilling + if nChamfer > 0 then + sMilling = ML.FindMilling( 'Mark') + if not sMilling then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' + EgtOutLog( sErr) + return -1, 0, sErr + end end return nChamfer, dDepth, sMilling diff --git a/LuaLibs/ProcessProfFront.lua b/LuaLibs/ProcessProfFront.lua index 5a918db..3cedf7d 100644 --- a/LuaLibs/ProcessProfFront.lua +++ b/LuaLibs/ProcessProfFront.lua @@ -122,11 +122,14 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly end end -- recupero la lavorazione - local sMilling = ML.FindMilling( 'Mark') - if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' - EgtOutLog( sErr) - return -1, 0, sErr + local sMilling + if nChamfer > 0 then + sMilling = ML.FindMilling( 'Mark') + if not sMilling then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' + EgtOutLog( sErr) + return -1, 0, sErr + end end return nChamfer, dDepth, sMilling diff --git a/LuaLibs/ProcessProfHead.lua b/LuaLibs/ProcessProfHead.lua index 9c08756..ca10bf9 100644 --- a/LuaLibs/ProcessProfHead.lua +++ b/LuaLibs/ProcessProfHead.lua @@ -123,11 +123,14 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly end end -- recupero la lavorazione - local sMilling = ML.FindMilling( 'Mark') - if not sMilling then - local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' - EgtOutLog( sErr) - return -1, 0, sErr + local sMilling + if nChamfer > 0 then + sMilling = ML.FindMilling( 'Mark') + if not sMilling then + local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' chamfer not found in library' + EgtOutLog( sErr) + return -1, 0, sErr + end end return nChamfer, dDepth, sMilling