|
|
|
@@ -151,6 +151,8 @@ local Q_SAW_PLUS_CHAIN = '' -- i
|
|
|
|
|
local Q_FORCE_CHAINSAW = '' -- i
|
|
|
|
|
local Q_CHAINSAW_FROM_SIDE = '' -- i
|
|
|
|
|
local Q_MILL_AS_BLADE_CONVENTIONAL = '' -- i
|
|
|
|
|
local Q_CLEAN_CORNER = '' -- 1
|
|
|
|
|
local Q_FLOATING_AGGREGATE = '' -- i
|
|
|
|
|
|
|
|
|
|
-- variabile smussi
|
|
|
|
|
local bMadeChamfer
|
|
|
|
@@ -201,6 +203,7 @@ local function AssignQIdent( Proc)
|
|
|
|
|
Q_CHAINSAW_FROM_SIDE = 'Q999'
|
|
|
|
|
Q_MILL_AS_BLADE_CONVENTIONAL = ''
|
|
|
|
|
Q_CLEAN_CORNER = ''
|
|
|
|
|
Q_FLOATING_AGGREGATE = ''
|
|
|
|
|
|
|
|
|
|
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
|
|
|
|
|
Q_FORCE_BLADE = 'Q01' -- i
|
|
|
|
@@ -229,6 +232,7 @@ local function AssignQIdent( Proc)
|
|
|
|
|
Q_DEPTH_CHAMFER = 'Q07' -- d
|
|
|
|
|
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
|
|
|
|
Q_CLEAN_CORNER = 'Q15' -- i
|
|
|
|
|
Q_FLOATING_AGGREGATE = 'Q16' -- i
|
|
|
|
|
elseif ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 30 then
|
|
|
|
|
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
|
|
|
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32 then
|
|
|
|
@@ -6026,6 +6030,9 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nAdd
|
|
|
|
|
nIdEndPoint = 5
|
|
|
|
|
nIdIniPoint = 4
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
local sErr = 'Error : Impossible insert clean corner from bottom'
|
|
|
|
|
return false, sErr
|
|
|
|
|
end
|
|
|
|
|
-- versore direzione
|
|
|
|
|
local vtExtr = tFacAdj[nIdIniPoint] - tFacAdj[nIdEndPoint]
|
|
|
|
@@ -6894,8 +6901,77 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
if dH * dV < 0.9 * ( bBoxF:getDimX() * bBoxF:getDimY()) and nFacInd2 and dFacElev2 < 1.5 * dFacElev and not ( Proc.Topology == 'Groove' and Proc.Fct == 2) then
|
|
|
|
|
bSpecial3faces = true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local bPocketFloatingAggregate = false
|
|
|
|
|
-- se abilitata lavorazione con aggregato flottante
|
|
|
|
|
local sMillingFloatingAggregate
|
|
|
|
|
if Proc.Topology == 'Groove' and Proc.Fct == 4 and EgtGetInfo( Proc.Id, Q_FLOATING_AGGREGATE, 'i') == 1 then
|
|
|
|
|
-- verifico se è possibile lavorare con utensile su aggregato flottante
|
|
|
|
|
sMillingFloatingAggregate = ML.FindMilling( 'FloatingAggregate', dFacElev, nil, min( dH , dV))
|
|
|
|
|
if sMillingFloatingAggregate then
|
|
|
|
|
if EgtMdbSetCurrMachining( sMillingFloatingAggregate) then
|
|
|
|
|
local sTuuidPk = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
|
|
|
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidPk) or '') then
|
|
|
|
|
local dToolDiameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
|
|
|
|
-- la larghezza della tasca non può superare il doppio del diametro, la lavorazione deve essere fatta con una passata di contornatura
|
|
|
|
|
if min( dH , dV) < dToolDiameter * 1.9 then
|
|
|
|
|
bPocketFloatingAggregate = true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- se posso in effetti fare fresatura con aggregato flottante
|
|
|
|
|
if bPocketFloatingAggregate then
|
|
|
|
|
-- inserisco la lavorazione di svuotatura
|
|
|
|
|
local sName = 'Float_Mill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
|
|
|
local nMchFId = EgtAddMachining( sName, sMillingFloatingAggregate)
|
|
|
|
|
if not nMchFId then
|
|
|
|
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sMillingFloatingAggregate
|
|
|
|
|
EgtOutLog( sErr)
|
|
|
|
|
return false, sErr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- aggiungo geometria
|
|
|
|
|
local Geometry = {}
|
|
|
|
|
for Index = 1, Proc.Fct do
|
|
|
|
|
if nFacInd ~= Index-1 then
|
|
|
|
|
table.insert( Geometry, { Proc.Id, Index-1})
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningGeometry( Geometry)
|
|
|
|
|
|
|
|
|
|
-- imposto uso faccia
|
|
|
|
|
local nFaceUse = BL.GetNearestParalOpposite( vtN)
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
|
|
|
|
-- piccolo offser radiale per essere sicuri di lavorare anche con tasca larga come diametro fresa
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.OFFSR, -0.01)
|
|
|
|
|
|
|
|
|
|
-- imposto posizione braccio porta testa
|
|
|
|
|
local nSCC = MCH_SCC.NONE
|
|
|
|
|
if not BD.C_SIMM then
|
|
|
|
|
if AreSameVectorApprox( vtN, Z_AX()) then
|
|
|
|
|
nSCC = MCH_SCC.ADIR_YM
|
|
|
|
|
elseif abs( vtN:getX()) < 0.1 then
|
|
|
|
|
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
|
|
|
|
elseif vtN:getY() < GEO.EPS_SMALL then
|
|
|
|
|
nSCC = MCH_SCC.ADIR_YP
|
|
|
|
|
else
|
|
|
|
|
nSCC = MCH_SCC.ADIR_YM
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
|
|
|
|
|
|
|
|
|
-- eseguo
|
|
|
|
|
if not ML.ApplyMachining( true, false) then
|
|
|
|
|
local _, sErr = EgtGetLastMachMgrError()
|
|
|
|
|
EgtSetOperationMode( nMchFId, false)
|
|
|
|
|
return false, sErr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- se riconosciuta gestione 3 facce (limitatamente per ora alla feature 20)
|
|
|
|
|
if bSpecial3faces and Proc.Prc == 20 then
|
|
|
|
|
elseif bSpecial3faces and Proc.Prc == 20 then
|
|
|
|
|
-- se smusso non è esclusivo
|
|
|
|
|
if nChamfer < 2 then
|
|
|
|
|
-- entrambe le facce non devono essere orientate verso il basso
|
|
|
|
@@ -7690,7 +7766,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|
|
|
|
end
|
|
|
|
|
local nBoreOnCorner = EgtGetInfo( Proc.Id, Q_BORE_ON_CORNER, 'i') or 0
|
|
|
|
|
local nContourSmallTool = EgtGetInfo( Proc.Id, Q_CONTOUR_SMALL_TOOL, 'i') or 0
|
|
|
|
|
local nCleanCorner = EgtGetInfo( Proc.Id, Q_CLEAN_CORNER, 'i') or 1
|
|
|
|
|
local nCleanCorner = EgtGetInfo( Proc.Id, Q_CLEAN_CORNER, 'i') or 0
|
|
|
|
|
-- se abilitato dal parametro Q inserisco foro sullo spigolo
|
|
|
|
|
if nBoreOnCorner == 1 then
|
|
|
|
|
local bOk, sWarn2
|
|
|
|
@@ -8209,7 +8285,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|
|
|
|
end
|
|
|
|
|
-- se lunghezza richiede spezzatura
|
|
|
|
|
if ( Proc.Box:getDimX() > BD.LONGCUT_MAXLEN) or
|
|
|
|
|
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and ( b3Solid:getDimX() > ( BD.LEN_VERY_SHORT_PART or BD.LEN_SHORT_PART))) or
|
|
|
|
|
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and ( Proc.DistanceToNextPart > 1000 or Proc.Box:getDimX() > BD.LONGCUT_ENDLEN)) or
|
|
|
|
|
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then
|
|
|
|
|
-- una faccia
|
|
|
|
|
if Proc.Fct == 1 then
|
|
|
|
|