diff --git a/LuaLibs/ProcessFreeContour.lua b/LuaLibs/ProcessFreeContour.lua index 5df276e..ae576ab 100644 --- a/LuaLibs/ProcessFreeContour.lua +++ b/LuaLibs/ProcessFreeContour.lua @@ -1,4 +1,4 @@ --- ProcessFreeContour.lua by Egaltech s.r.l. 2020/11/20 +-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/01/29 -- Gestione calcolo profilo libero per Travi -- Tabella per definizione modulo @@ -15,9 +15,10 @@ local BD = require( 'BeamData') local ML = require( 'MachiningLib') -- variabili assegnazione parametri Q -local sDepthChamferMill = 'Q02' -- d -local sOverMaterialForFinish = 'Q03' -- d -local sPreemptiveChamfer = 'Q00' -- i +local Q_DIM_STRIP = 'Q01' -- d +local Q_DEPTH_CHAMFER = 'Q02' -- d +local Q_OVERMAT_FOR_FINISH = 'Q03' -- d +local Q_ONLY_CHAMFER = 'Q00' -- i --------------------------------------------------------------------- -- Riconoscimento della feature @@ -115,17 +116,17 @@ function ProcessFreeContour.Classify( Proc, b3Raw) end --------------------------------------------------------------------- -local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnlyCham) +local function VerifyChamfer( Proc, AuxId, nRawId, bMakeVertCham) local nChamfer = 0 -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) -- verifico che lo smusso sia richiesto - local dDepth = EgtGetInfo( Proc.Id, sDephtCham, 'd') or 0 + local dDepth = EgtGetInfo( Proc.Id, Q_DEPTH_CHAMFER, 'd') or 0 if dDepth > 0 then nChamfer = 1 end -- verifico se posso fare solo lo smusso - if EgtGetInfo( Proc.Id, sOnlyCham, 'i') == 1 then + if EgtGetInfo( Proc.Id, Q_ONLY_CHAMFER, 'i') == 1 then if dDepth > 0 then nChamfer = nChamfer + 1 -- altrimenti se non ho l'affondamento esco @@ -219,9 +220,8 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) local bDown = ( b3Aux:getMin():getZ() < b3Raw:getMin():getZ() + 5) -- verifico se in testa o coda local bHead = Proc.Head - -- verifico se sono presenti i parametri Q per la profondità smusso e - -- per eseguire in esclusiva solo lo smusso - local nChamfer, dDepthCham, sChamfer = VerifyCham( Proc, AuxId, nRawId, true, sDepthChamferMill, sPreemptiveChamfer) + -- verifico i parametri Q per profondità smusso e per eseguirlo in esclusiva + local nChamfer, dDepthCham, sChamfer = VerifyChamfer( Proc, AuxId, nRawId, true) -- recupero la lavorazione local sMilling = ML.FindMilling( 'FreeContour') if not sMilling then @@ -273,12 +273,16 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) end local dOriDepth = dDepth local nDouble = 1 - local bCanDouble = abs( vtExtr:getY()) > 0.707 and bCross + local bCanDouble = ( abs( vtExtr:getY()) > 0.707 and bCross) + local dDimStrip = BD.DIM_STRIP + if dDimStrip < 0 then + dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 0 + end local bStripOnSide = false if bCross then - if nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX()) then + if dDimStrip > 10 * GEO.EPS_SMALL and ( nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX())) then -- devo lasciare un codolo - dDepth = dDepth - BD.DIM_STRIP + dDepth = dDepth - dDimStrip bStripOnSide = true else -- devo affondare un poco oltre @@ -289,7 +293,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and nStep > 1 and bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then nDouble = 2 - dDepth = min( ( b3Raw:getDimY() - BD.DIM_STRIP) * 0.5, dMaxDepth) + dDepth = min( ( b3Raw:getDimY() - dDimStrip) * 0.5, dMaxDepth) else -- se altezza geometria supera capacità taglio utensile ed è orizzontale setto per eseguire codolo in centro if dDepth > dMaxDepth then @@ -445,7 +449,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead) end end -- verifico se devo fare sgrossatura più finitura - local dOffsetPar = EgtGetInfo( Proc.Id, sOverMaterialForFinish, 'i') or 0 + local dOffsetPar = EgtGetInfo( Proc.Id, Q_OVERMAT_FOR_FINISH, 'i') or 0 -- eseguo for i = 1, nStep do for j = 1, nDouble do diff --git a/LuaLibs/ProcessRoundArch.lua b/LuaLibs/ProcessRoundArch.lua index ae56a22..08a30a5 100644 --- a/LuaLibs/ProcessRoundArch.lua +++ b/LuaLibs/ProcessRoundArch.lua @@ -1,4 +1,4 @@ --- ProcessRoundArch.lua by Egaltech s.r.l. 2020/09/03 +-- ProcessRoundArch.lua by Egaltech s.r.l. 2021/01/29 -- Gestione calcolo archi per Travi -- Tabella per definizione modulo @@ -14,6 +14,9 @@ EgtOutLog( ' ProcessRoundArch started', 1) local BD = require( 'BeamData') local ML = require( 'MachiningLib') +-- variabili assegnazione parametri Q +local Q_DIM_STRIP = 'Q02' -- d + --------------------------------------------------------------------- -- Riconoscimento della feature function ProcessRoundArch.Identify( Proc) @@ -143,12 +146,16 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) end end local nDouble = 1 - local bCanDouble = abs( vtExtr:getY()) > 0.707 and bCross + local bCanDouble = ( abs( vtExtr:getY()) > 0.707 and bCross) + local dDimStrip = BD.DIM_STRIP + if dDimStrip < 0 then + dDimStrip = EgtGetInfo( Proc.Id, Q_DIM_STRIP, 'd') or 0 + end local bStripOnSide = false if bCross then - if nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX()) then + if dDimStrip > 10 * GEO.EPS_SMALL and ( nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX())) then -- devo lasciare un codolo - dDepth = dDepth - BD.DIM_STRIP + dDepth = dDepth - dDimStrip bStripOnSide = true else -- devo affondare un poco oltre @@ -159,7 +166,7 @@ function ProcessRoundArch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead) if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and nStep > 1 and bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then nDouble = 2 - dDepth = min( ( b3Raw:getDimY() - BD.DIM_STRIP) * 0.5, dMaxDepth) + dDepth = min( ( b3Raw:getDimY() - dDimStrip) * 0.5, dMaxDepth) else -- se altezza geometria supera capacità taglio utensile ed è orizzontale setto per eseguire codolo in centro if dDepth > dMaxDepth then