Compare commits
109 Commits
Ticket#2393
...
2.7k1
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c4d7224f0 | |||
| bd956281e2 | |||
| d4b7fe1910 | |||
| b05d1aa7b8 | |||
| b775610125 | |||
| 9e284d509b | |||
| dd7a1e80b2 | |||
| 919b32ca8d | |||
| fef5db6046 | |||
| 0d5dd4d348 | |||
| e526502177 | |||
| 325f30c61b | |||
| f824cde2d0 | |||
| a61b27f292 | |||
| e582f7a38b | |||
| a813d5d742 | |||
| 93e92da027 | |||
| d862e8a2c5 | |||
| d79151c1d3 | |||
| 3d62e41811 | |||
| c796a5351f | |||
| 00d7dd2970 | |||
| eb09d0b65d | |||
| 0c7a7daba4 | |||
| 6f14e4f2c2 | |||
| 950060f4dc | |||
| 1007e08e9d | |||
| 04acc25535 | |||
| 38e26b9e48 | |||
| 72b7cbac1b | |||
| 5f1b863013 | |||
| 250802048a | |||
| a8d0bcfec4 | |||
| 459eff5610 | |||
| a749895229 | |||
| 04489421e7 | |||
| 0c16b5e969 | |||
| 9193924fbd | |||
| adbd5e944e | |||
| f76797cbd8 | |||
| 09e93d600d | |||
| 63f4df2a7d | |||
| 80c5035c74 | |||
| c9451e65e1 | |||
| 19706d6264 | |||
| 46ca7c793f | |||
| e26540193c | |||
| af107a780e | |||
| 4befa4eee3 | |||
| 07db2da825 | |||
| a4e6600510 | |||
| cb8465d977 | |||
| e867e1decf | |||
| 1cd697cf80 | |||
| 729143ce45 | |||
| 3f707396bb | |||
| 2b3a36a496 | |||
| d9e4285748 | |||
| 91d5b0ac84 | |||
| db5334217b | |||
| 54c835f717 | |||
| 86e2324856 | |||
| 36f4014969 | |||
| 7248c44406 | |||
| 044a074b76 | |||
| c0e3dab107 | |||
| 2b2157c971 | |||
| 8c697d73ac | |||
| c35d032da8 | |||
| 7447d3cc1b | |||
| bfdf80a44a | |||
| 3755521d2e | |||
| 104663a89a | |||
| e322c15099 | |||
| 5f55bc2f42 | |||
| 6c3a16d59c | |||
| 8218fcc438 | |||
| 6a83320321 | |||
| b8b5ab2a65 | |||
| e27998599b | |||
| a386c74516 | |||
| bb9dc261c1 | |||
| 0e2067e802 | |||
| 3008196992 | |||
| 876e45e1a4 | |||
| fa4d3ab9f6 | |||
| 4e6c38d82c | |||
| d3e1ac5805 | |||
| bc017d0de7 | |||
| 18e180cd12 | |||
| 6d8d32c9fb | |||
| 20074c6ea0 | |||
| 806864e360 | |||
| 052407a9be | |||
| b5660a8431 | |||
| 103d8d7eec | |||
| df47842888 | |||
| 5db475bcf7 | |||
| 010e1421c7 | |||
| e908562ab6 | |||
| aba4ebecc4 | |||
| a022ecbb7d | |||
| 605f0fcaf1 | |||
| 2676d67737 | |||
| a996d4beb3 | |||
| 919f71481c | |||
| d0283d7885 | |||
| ccf88745aa | |||
| b5145d4e99 |
+137
-25
@@ -442,7 +442,7 @@ local function CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
|
||||
local b3TailBox
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
if Proc.Box and not Proc.Box:isEmpty() then
|
||||
if Proc.Box and not Proc.Box:isEmpty() then
|
||||
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
|
||||
if Proc.Head and Proc.Box:getCenter():getX() < dHeadX then
|
||||
dHeadX = Proc.Box:getCenter():getX()
|
||||
@@ -467,6 +467,7 @@ end
|
||||
local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
local nReplacedFeatureId = nil
|
||||
local bHeadFinishingNeeded = true
|
||||
local nCuttingFeatureId = nil
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
-- controllo se esiste già una feature taglio di testa
|
||||
@@ -481,15 +482,19 @@ local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
if Proc.Head and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 340 then
|
||||
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
|
||||
bHeadFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||
if not bHeadFinishingNeeded and ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10) and ( Proc.Flg > 0) then
|
||||
nCuttingFeatureId = Proc.Id
|
||||
end
|
||||
end
|
||||
end
|
||||
return bHeadFinishingNeeded, nReplacedFeatureId
|
||||
return bHeadFinishingNeeded, nReplacedFeatureId, nCuttingFeatureId
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
local nReplacedFeatureId = nil
|
||||
local bTailFinishingNeeded = true
|
||||
local nCuttingFeatureId = nil
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
-- controllo se esistè già una feature taglio di coda
|
||||
@@ -504,9 +509,12 @@ local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
if Proc.Tail and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 350 then
|
||||
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
|
||||
bTailFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||
if not bTailFinishingNeeded and ( ( Proc.Grp == 1 or Proc.Grp == 2) and Proc.Prc == 10) and ( Proc.Flg > 0) then
|
||||
nCuttingFeatureId = Proc.Id
|
||||
end
|
||||
end
|
||||
end
|
||||
return bTailFinishingNeeded, nReplacedFeatureId
|
||||
return bTailFinishingNeeded, nReplacedFeatureId, nCuttingFeatureId
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
@@ -600,6 +608,22 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
|
||||
local b3Part = EgtGetBBoxGlob( Pz or GDB_ID.NULL, GDB_BB.EXACT)
|
||||
local b3Solid = vBeam[i].Box
|
||||
if b3Part:isEmpty() or b3Solid:isEmpty() then break end
|
||||
-- creo o pulisco gruppo geometrie aggiuntive
|
||||
if not BL.CreateOrEmptyAddGroup( Pz) then
|
||||
local sOut = 'Error creating Additional Group in Part ' .. tostring( Pz)
|
||||
return false, sOut
|
||||
end
|
||||
-- analizzo le features per valutare l'esistenza di feature head/tail che renderebbero inutili le rispettive finiture o di tagli di testa/coda sostituiti da cui leggere il parametro Q05
|
||||
local vProc = CollectFeatures( Pz, b3Solid, 0)
|
||||
local bSFinishingNeeded, nReplacedHeadCutFeatureId, nHeadCuttingFeatureId = AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
local bEFinishingNeeded, nReplacedTailCutFeatureId, nTailCuttingFeatureId = AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
-- Scrivo gli di delle facce di taglio custom: serviranno dopo per calcolare l'elevazione rispetto a queste
|
||||
if nHeadCuttingFeatureId then
|
||||
EgtSetInfo( vBeam[i].Id, 'HEADCUTFEATUREID', nHeadCuttingFeatureId)
|
||||
end
|
||||
if nTailCuttingFeatureId then
|
||||
EgtSetInfo( vBeam[i].Id, 'TAILCUTFEATUREID', nTailCuttingFeatureId)
|
||||
end
|
||||
if bBigSectionCut then
|
||||
-- lascio in coda solo il materiale necessario; il resto verrà tolto nell'head cut successivo
|
||||
local lastB3Solid = nil
|
||||
@@ -612,9 +636,6 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
|
||||
dOffset = dOvmMid
|
||||
end
|
||||
end
|
||||
-- analizzo le features per valutare l'esistenza di feature head/tail che renderebbero inutili le rispettive finiture o di tagli di testa/coda sostituiti da cui leggere il parametro Q05
|
||||
local vProc = CollectFeatures( Pz, b3Solid, 0)
|
||||
local bSFinishingNeeded, nReplacedHeadCutFeatureId = AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
local iSQ05Value = nil
|
||||
if nReplacedHeadCutFeatureId then
|
||||
iSQ05Value = EgtGetInfo( nReplacedHeadCutFeatureId, 'Q05', 'i')
|
||||
@@ -624,7 +645,6 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
|
||||
else
|
||||
DeltaSMin = BD.OVM_BLADE_HBEAM
|
||||
end
|
||||
local bEFinishingNeeded, nReplacedTailCutFeatureId = AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
|
||||
local iEQ05Value = nil
|
||||
if nReplacedTailCutFeatureId then
|
||||
iEQ05Value = EgtGetInfo( nReplacedTailCutFeatureId, 'Q05', 'i')
|
||||
@@ -662,11 +682,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b
|
||||
-- assegno ordine in lavorazione
|
||||
Cnt = Cnt + 1
|
||||
EgtSetInfo( nRaw, 'ORD', Cnt)
|
||||
-- creo o pulisco gruppo geometrie aggiuntive
|
||||
if not BL.CreateOrEmptyAddGroup( Pz) then
|
||||
local sOut = 'Error creating Additional Group in Part ' .. tostring( Pz)
|
||||
return false, sOut
|
||||
end
|
||||
|
||||
-- aggiungo faccia per taglio iniziale al pezzo
|
||||
BL.AddPartStartFace( Pz, b3Solid)
|
||||
-- se sovramateriale di testa, lo notifico
|
||||
@@ -780,7 +796,82 @@ local function PrintFeatures( vProc, b3Raw)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function OrderFeatures( vProc, b3Raw)
|
||||
-- mi assicuro che i tagli di testa e coda troncanti (usati per ridurre i percorsi utensile in testa e coda) siano sempre fatti per primi
|
||||
local function ReorderTruncatingCuts( vProc, nPartId)
|
||||
if not nPartId or #vProc == 0 then return end
|
||||
|
||||
local nHeadCuttingFeatureId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i')
|
||||
local nTailCuttingFeatureId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i')
|
||||
|
||||
-- tagli di testa
|
||||
-- 1: si trovano gli indici del taglio di testa e del rispettivo taglio troncante
|
||||
local nHeadCutIndex, nHeadCuttingFeatureIndex
|
||||
for index, value in ipairs( vProc) do
|
||||
if value.Prc == 340 then
|
||||
nHeadCutIndex = index
|
||||
end
|
||||
if value.Id == nHeadCuttingFeatureId then
|
||||
nHeadCuttingFeatureIndex = index
|
||||
end
|
||||
end
|
||||
|
||||
-- 2: se non c'è il taglio di testa, il taglio troncante è il primo. Se c'è il taglio di testa, il taglio troncante lo deve seguire.
|
||||
if not nHeadCutIndex and nHeadCuttingFeatureIndex then
|
||||
local HeadCuttingFeature = vProc[ nHeadCuttingFeatureIndex]
|
||||
table.remove( vProc, nHeadCuttingFeatureIndex)
|
||||
table.insert( vProc, 1, HeadCuttingFeature)
|
||||
elseif nHeadCutIndex and nHeadCuttingFeatureIndex then
|
||||
if abs( nHeadCutIndex - nHeadCuttingFeatureIndex) ~= 1 then
|
||||
local HeadCut = vProc[ nHeadCutIndex]
|
||||
local HeadCuttingFeature = vProc[ nHeadCuttingFeatureIndex]
|
||||
|
||||
table.remove( vProc, nHeadCutIndex)
|
||||
-- rimuovere il primo potrebbe aver cambiato l'indice del secondo
|
||||
if nHeadCutIndex < nHeadCuttingFeatureIndex then
|
||||
nHeadCuttingFeatureIndex = nHeadCuttingFeatureIndex - 1
|
||||
end
|
||||
table.remove( vProc, nHeadCuttingFeatureIndex)
|
||||
|
||||
table.insert( vProc, nHeadCutIndex, HeadCut)
|
||||
table.insert( vProc, nHeadCutIndex + 1, HeadCuttingFeature)
|
||||
end
|
||||
end
|
||||
|
||||
-- tagli di coda
|
||||
-- 1: si trovano gli indici del taglio di coda e del rispettivo taglio troncante
|
||||
local nTailCutIndex, nTailCuttingFeatureIndex
|
||||
for index, value in ipairs( vProc) do
|
||||
if value.Prc == 350 then
|
||||
nTailCutIndex = index
|
||||
end
|
||||
if value.Id == nTailCuttingFeatureId then
|
||||
nTailCuttingFeatureIndex = index
|
||||
end
|
||||
end
|
||||
|
||||
-- 2: il taglio di coda c'è sempre. Il taglio troncante lo deve seguire.
|
||||
if nTailCutIndex and nTailCuttingFeatureIndex then
|
||||
if abs( nTailCutIndex - nTailCuttingFeatureIndex) ~= 1 then
|
||||
local TailCut = vProc[ nTailCutIndex]
|
||||
local TailCuttingFeature = vProc[ nTailCuttingFeatureIndex]
|
||||
|
||||
table.remove( vProc, nTailCutIndex)
|
||||
-- rimuovere il primo potrebbe aver cambiato l'indice del secondo
|
||||
if nTailCutIndex < nTailCuttingFeatureIndex then
|
||||
nTailCuttingFeatureIndex = nTailCuttingFeatureIndex - 1
|
||||
end
|
||||
table.remove( vProc, nTailCuttingFeatureIndex)
|
||||
|
||||
table.insert( vProc, nTailCutIndex, TailCut)
|
||||
table.insert( vProc, nTailCutIndex + 1, TailCuttingFeature)
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function OrderFeatures( vProc, b3Raw, nPartId)
|
||||
|
||||
local dDrillPenalty = EgtIf( BD.PRESS_ROLLER, 200, 100)
|
||||
local dSmallDrillRange = EgtIf( b3Raw:getDimX() < BD.LEN_SHORT_PART, BD.DRILL_RANGE_SP or 200, BD.DRILL_RANGE or 600)
|
||||
@@ -901,12 +992,12 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
if abs( B2.Box:getDimX() - b3Raw:getDimX()) < 0.2 * b3Raw:getDimX() then
|
||||
return not ( B1.Tail or B2.Box:getMin():getX() + 20 > B1.Box:getCenter():getX())
|
||||
end
|
||||
-- se primo è foro e l'altro no, lo penalizzo
|
||||
if Drill.Identify(B1) and not Drill.Identify(B2) then
|
||||
return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty)
|
||||
-- se primo è foro e l'altro no, lo penalizzo (a patto che il foro non attraversi nessuna feature)
|
||||
if Drill.Identify(B1) and not B1.Dependency and not Drill.Identify(B2) then
|
||||
return ( B1.Box:getCenter():getX() > B2.Box:getMax():getX() + dDrillPenalty)
|
||||
end
|
||||
-- se primo è altro e secondo è foro, lo premio
|
||||
if not Drill.Identify(B1) and Drill.Identify(B2) then
|
||||
-- se primo è altro e secondo è foro, lo premio (a patto che il foro non attraversi nessuna feature)
|
||||
if not Drill.Identify(B1) and not B2.Dependency and Drill.Identify(B2) then
|
||||
return ( B1.Box:getMax():getX() + dDrillPenalty > B2.Box:getCenter():getX())
|
||||
end
|
||||
-- se prima è mortasa coda di rondine sul fianco e secondo taglio longitudinale, la coda di rondine va sempre prima
|
||||
@@ -1099,6 +1190,8 @@ local function OrderFeatures( vProc, b3Raw)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ReorderTruncatingCuts( vProc, nPartId)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
@@ -1852,7 +1945,9 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
|
||||
-- recupero la lunghezza della parte inclinata della punta
|
||||
local dToolDoubleTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||
-- se foratura splittata, verifico che la distanza minima tra le due punte sia rispettata
|
||||
if abs( Proc.Flg) == 2 and not ( ( ( 2 * dDrillingStep - dToolTipLength - dToolDoubleTipLength) - MIRROR_DRILLINGS_MIN_DISTANCE) > 10 * GEO.EPS_SMALL) then
|
||||
local dTipDistance = 2 * dDrillingStep - dToolTipLength - dToolDoubleTipLength
|
||||
if abs( Proc.Flg) == 2 and not ( ( dTipDistance - MIRROR_DRILLINGS_MIN_DISTANCE) > 10 * GEO.EPS_SMALL) then
|
||||
EgtOutLog( 'Double drilling skipped, tip distance too small ( ' .. dTipDistance .. ' mm) ')
|
||||
return
|
||||
end
|
||||
-- verifico se in doppio
|
||||
@@ -2021,7 +2116,7 @@ local function AreDrillingsMirrored( Proc, ProcMirror, b3Raw)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function GetFeatureInfoAndDependency( vProc, b3Raw)
|
||||
function GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
|
||||
-- ciclo tutte le feature
|
||||
for i = 1, #vProc do
|
||||
local Proc = vProc[i]
|
||||
@@ -2046,7 +2141,8 @@ function GetFeatureInfoAndDependency( vProc, b3Raw)
|
||||
end
|
||||
end
|
||||
-- verifico se feature tipo LapJoint è attraversata da almeno una mortasa a coda di rondine
|
||||
if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove') and DtMortise.SideIdentify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then
|
||||
if ( Proc.Topology == 'Pocket' or Proc.Topology == 'Tunnel' or Proc.Topology == 'Groove')
|
||||
and DtMortise.SideIdentify( ProcB) and Overlaps( Proc.Box, ProcB.Box) and DtMortise.IsDeeper( ProcB, b3Raw) then
|
||||
Proc.PassedByDtMortise = true
|
||||
end
|
||||
-- se tenone è attraversato da foro allora il foro deve essere fatto prima
|
||||
@@ -2062,6 +2158,22 @@ function GetFeatureInfoAndDependency( vProc, b3Raw)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- verifiche per tagli troncanti testa e coda: devono sempre essere subito dopo il taglio di testa e il taglio di coda, rispettivamente
|
||||
local nHeadCuttingFeatureId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i')
|
||||
local nTailCuttingFeatureId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i')
|
||||
if Proc.Prc == 340 and ProcB == nHeadCuttingFeatureId then
|
||||
Proc.Dependency = {}
|
||||
Proc.Dependency.ExecBefore = ProcB
|
||||
elseif Proc == nHeadCuttingFeatureId and ProcB.Prc == 340 then
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecBefore = Proc
|
||||
elseif Proc.Prc == 350 and ProcB == nTailCuttingFeatureId then
|
||||
Proc.Dependency = {}
|
||||
Proc.Dependency.ExecBefore = ProcB
|
||||
elseif Proc == nTailCuttingFeatureId and ProcB.Prc == 350 then
|
||||
ProcB.Dependency = {}
|
||||
ProcB.Dependency.ExecBefore = Proc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -2073,13 +2185,13 @@ function BeamExec.ProcessFeatures()
|
||||
end
|
||||
-- costanti per doppio
|
||||
MIRROR_DRILLINGS_MIN_DISTANCE = 40
|
||||
MIRROR_POCKETS_MIN_DISTANCE = 50
|
||||
MIRROR_POCKETS_MIN_DISTANCE = EgtIf( BD.DOWN_HEAD, 35, 50)
|
||||
-- verifica se possibile rotazione di 90 gradi
|
||||
BD.ROT90 = BD.ROT90 and Verify90DegRotation( EgtGetFirstRawPart())
|
||||
-- ciclo sui pezzi
|
||||
local nTotErr = 0
|
||||
local Stats = {}
|
||||
local nOrd = 1
|
||||
local nOrd = 1
|
||||
local nRawId = EgtGetFirstRawPart()
|
||||
while nRawId do
|
||||
-- verifico che il grezzo contenga pezzi oppure sia abbastanza lungo da essere scaricato coi carrelli
|
||||
@@ -2103,7 +2215,7 @@ function BeamExec.ProcessFeatures()
|
||||
-- recupero le feature di lavorazione della trave
|
||||
local vProc = CollectFeatures( nPartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||
-- recupero informazioni ausiliarie feature e dipendenze tra feature stesse
|
||||
GetFeatureInfoAndDependency( vProc, b3Raw)
|
||||
GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
|
||||
|
||||
-- verifica presenza forature influenzate da lavorazioni di testa o coda
|
||||
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
|
||||
@@ -2115,7 +2227,7 @@ function BeamExec.ProcessFeatures()
|
||||
SetMirroredFeatures( vProc, b3Raw)
|
||||
end
|
||||
-- le ordino lungo X
|
||||
OrderFeatures( vProc, b3Raw)
|
||||
OrderFeatures( vProc, b3Raw, nPartId)
|
||||
-- le classifico
|
||||
local bAllOk, bSomeDown, bSomeSide, bSplitRot = ClassifyFeatures( vProc, b3Raw, Stats)
|
||||
if not bAllOk then
|
||||
|
||||
+35
-12
@@ -551,7 +551,7 @@ function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
|
||||
local nAddGrpId = BeamLib.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
EgtOutLog( 'Error : missing AddGroup')
|
||||
return 0, 0, 0
|
||||
return 0, 0, 0, 0
|
||||
end
|
||||
-- verifico eventuale intersezione tra la faccia i-1 esima e la proiezione dell'altra sulla stessa
|
||||
local nShadowFacetId = EgtCopySurfTmFacet( nSurfId, j - 1, nAddGrpId)
|
||||
@@ -698,17 +698,19 @@ function BeamLib.GetFaceHvRefDim( nSurfId, nFacet, b3Raw)
|
||||
local b3HV = EgtSurfTmGetFacetBBoxRef( nSurfId, nFacet, GDB_BB.STANDARD, frHV)
|
||||
local dDimH = b3HV:getDimX()
|
||||
local dDimV = b3HV:getDimY()
|
||||
|
||||
-- Si mantiene rettangolo minimo perchè in alcuni casi andava in collisione. Lascio il calcolo in caso si debba ripristinare.
|
||||
-- se definito grezzo (o solido), applico eventuali limiti
|
||||
if b3Raw then
|
||||
local dCoeffY = abs( frHV:getVersX():getY())
|
||||
if dCoeffY > GEO.EPS_SMALL then
|
||||
dDimH = min( dDimH, b3Raw:getDimY() / dCoeffY)
|
||||
end
|
||||
local dCoeffZ = abs( frHV:getVersY():getZ())
|
||||
if dCoeffZ > GEO.EPS_SMALL then
|
||||
dDimV = min( dDimV, b3Raw:getDimZ() / dCoeffZ)
|
||||
end
|
||||
end
|
||||
-- if b3Raw then
|
||||
-- local dCoeffY = abs( frHV:getVersX():getY())
|
||||
-- if dCoeffY > GEO.EPS_SMALL then
|
||||
-- dDimH = min( dDimH, b3Raw:getDimY() / dCoeffY)
|
||||
-- end
|
||||
-- local dCoeffZ = abs( frHV:getVersY():getZ())
|
||||
-- if dCoeffZ > GEO.EPS_SMALL then
|
||||
-- dDimV = min( dDimV, b3Raw:getDimZ() / dCoeffZ)
|
||||
-- end
|
||||
-- end
|
||||
-- restituisco i valori calcolati
|
||||
return frHV, dDimH, dDimV
|
||||
end
|
||||
@@ -899,6 +901,27 @@ function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
|
||||
return nFaceIndMax, ptC, vtN
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrtho)
|
||||
local _, EdgesEgt = EgtSurfTmGetFacetOutlineInfo( nSurfId, nFacet, GDB_ID.ROOT)
|
||||
|
||||
local nEdgeIndMax = 0
|
||||
local dMaxComp = - GEO.INFINITO
|
||||
for i = 1, #EdgesEgt do
|
||||
local vtN = EdgesEgt[i].Norm
|
||||
if EdgesEgt[i].Open then
|
||||
vtN = -vtN
|
||||
end
|
||||
local dComp = vtN * vtOrtho
|
||||
if dComp > dMaxComp then
|
||||
nEdgeIndMax = i -1
|
||||
dMaxComp = dComp
|
||||
end
|
||||
end
|
||||
|
||||
return nEdgeIndMax
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function BeamLib.GetTunnelDimension( Proc, nPartId)
|
||||
-- sono necessarie almeno due facce
|
||||
@@ -1168,7 +1191,7 @@ end
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H
|
||||
function BeamLib.IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH)
|
||||
return ((abs(b3Proc:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or b3Proc:getDimY() > dRawW) and (abs(b3Proc:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or b3Proc:getDimZ() > dRawH))
|
||||
return ( b3Proc:getDimY() > ( dRawW - 500 * GEO.EPS_SMALL) and b3Proc:getDimZ() > ( dRawH - 500 * GEO.EPS_SMALL))
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -83,8 +83,8 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
|
||||
if BD.KIOTP then Ktp = BD.KIOTP end
|
||||
if ( sLeadInOutType == 'PerpendicularOutraw') then
|
||||
bLioTang = false
|
||||
dLiCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra
|
||||
dLoCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + dCutExtra
|
||||
dLiCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)
|
||||
dLoCompLength = dActualElevation + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)
|
||||
dLiTang = 1
|
||||
dLoTang = 1
|
||||
dLiPerp = 0
|
||||
|
||||
@@ -80,7 +80,7 @@ end
|
||||
-- setta ultimi testa e utensile utilizzati se compatibili con ottimizzazione testa
|
||||
local function ConfirmNextMachining()
|
||||
-- utensile corrente
|
||||
local sToolUuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
local sToolUuid = EgtGetMachiningParam( MCH_MP.TUUID)
|
||||
local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '')
|
||||
EgtTdbSetCurrTool( sToolName or '')
|
||||
-- testa dell'utensile corrente
|
||||
@@ -331,7 +331,7 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion)
|
||||
local bOptimizeHeads = BEAM and BEAM.BW and ( not sSortingCriterion or sSortingCriterion == '')
|
||||
local bOptimizeHeads = ( not sSortingCriterion or sSortingCriterion == '')
|
||||
if bTopHead == nil and bDownHead == nil then
|
||||
bTopHead = true
|
||||
bDownHead = false
|
||||
|
||||
+12
-7
@@ -65,11 +65,14 @@ function ProcessCut.Classify( Proc, b3Raw)
|
||||
end
|
||||
-- recupero i dati del taglio
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
if vtN:getZ() <= - 0.5 and abs( vtN:getY()) > 0.1 or ( vtN:getZ() <= - 0.174 and abs( vtN:getY()) > 0.866) then
|
||||
-- calcolo le massime estensioni lineari orizzontale e verticale della faccia
|
||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
-- calcolo le massime estensioni lineari orizzontale e verticale della faccia
|
||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
if ( vtN:getZ() <= - 0.5 and abs( vtN:getY()) > 0.1) or
|
||||
( vtN:getZ() <= - 0.174 and abs( vtN:getY()) > 0.866) or
|
||||
( vtN:getZ() <= - 0.174 and abs( vtN:getZ()) * DimV > BD.MAX_DIM_DICE)
|
||||
then
|
||||
-- confronto queste estensioni con la massima dimensione del DiceCut (impossibile lavorare se entrambe maggiori)
|
||||
if DimH > BD.MAX_DIM_DICE and DimV > BD.MAX_DIM_DICE then
|
||||
if DimH > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL and DimV > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL then
|
||||
return true, true
|
||||
end
|
||||
end
|
||||
@@ -90,7 +93,7 @@ function ProcessCut.Classify( Proc, b3Raw)
|
||||
end
|
||||
end
|
||||
-- calcolo l'ingombro orizzontale della faccia
|
||||
local _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||
_, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale)
|
||||
if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and ( abs( vtN:getY()) > 0.1) and dMaxMat < DimH + BD.CUT_EXTRA) then
|
||||
return true, true
|
||||
@@ -379,7 +382,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
local vCuts = {}
|
||||
local dDicingOffsetP
|
||||
local dDicingOffsetO
|
||||
if ( ( not Proc.AdvTail) or bForceDicing) and ( dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then
|
||||
if ( ( not Proc.AdvTail) or bForceDicing) and
|
||||
( dCutH - 100 * GEO.EPS_SMALL > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or
|
||||
dCutV - 100 * GEO.EPS_SMALL > dMaxVertDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC) then
|
||||
local ptExtra, vtExtra
|
||||
local bAutoCalcSurf = true
|
||||
if Proc.AdvTail then
|
||||
@@ -627,7 +632,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
||||
local vtOrthoO
|
||||
if bFromBottom and dCutV < dMaxDepth - BD.CUT_EXTRA and vtN:getZ() > 0 then
|
||||
vtOrthoO = -Z_AX()
|
||||
elseif ( bHorizCut or ( dCutV < dMaxDepth - BD.CUT_EXTRA and not bVertCutOk)) and
|
||||
elseif ( bHorizCut and not bVertCutOk) and
|
||||
( not bVertCutOk or b3Solid:getDimX() > BD.LEN_SHORT_PART or Proc.AdvTail or ( vtN:getX() > 0 and vtN:getZ() <= 0.708) or ( abs( vtN:getY()) < 0.1 and vtN:getZ() <= 0)) then
|
||||
vtOrthoO = Z_AX()
|
||||
elseif b3Solid:getDimX() < BD.LEN_SHORT_PART and not Proc.AdvTail and abs( vtN:getY()) > 0.259 and
|
||||
|
||||
@@ -475,13 +475,36 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- dati delle facce
|
||||
local ptC = {}
|
||||
local vtN = {}
|
||||
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
ptC[2], vtN[2] = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
|
||||
local idFirstFace, idSecondFace
|
||||
|
||||
-- se ci sono più di due face (caso insolito), si prendono le facce più grandi
|
||||
if Proc.Fct > 2 then
|
||||
local Area = {}
|
||||
-- si prendono le due più grandi, potrebbero essercene più di due
|
||||
for i = 1, Proc.Fct do
|
||||
local _, dL, dW = EgtSurfTmFacetMinAreaRectangle( Proc.Id, i - 1)
|
||||
table.insert( Area, { nIndex = i-1, dArea = dL*dW})
|
||||
end
|
||||
-- ordina 'Area' in ordine decrescente
|
||||
table.sort( Area, function( A, B)
|
||||
return A.dArea > B.dArea
|
||||
end
|
||||
)
|
||||
idFirstFace = Area[1].nIndex
|
||||
idSecondFace = Area[2].nIndex
|
||||
else
|
||||
idFirstFace = 0
|
||||
idSecondFace = 1
|
||||
end
|
||||
|
||||
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, idFirstFace, GDB_ID.ROOT)
|
||||
ptC[2], vtN[2] = EgtSurfTmFacetCenter( Proc.Id, idSecondFace, GDB_ID.ROOT)
|
||||
|
||||
-- normale media per capire se taglio di testa o di coda
|
||||
local vtNm = ( vtN[1] + vtN[2]) ; vtNm:normalize()
|
||||
local bHead = ( vtNm:getX() > 0)
|
||||
-- angolo diedro per stabilire se taglio convesso
|
||||
local bAdj, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
|
||||
local bAdj, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, idFirstFace, idSecondFace, GDB_ID.ROOT)
|
||||
local bConvex = true
|
||||
local bOnY = true
|
||||
local ptPs = ( ptC[1] + ptC[2]) / 2
|
||||
@@ -492,8 +515,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
bConvex = ( dAng > 0)
|
||||
end
|
||||
-- determino quale faccia è più grande
|
||||
local _, dB1, dH1 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0)
|
||||
local _, dB2, dH2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 1)
|
||||
local _, dB1, dH1 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, idFirstFace)
|
||||
local _, dB2, dH2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, idSecondFace)
|
||||
local nBigInd = EgtIf( dB1 * dH1 >= dB2 * dH2, 1, 2)
|
||||
local nSmaInd = 3 - nBigInd
|
||||
-- inserimento smussi
|
||||
@@ -560,8 +583,8 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
end
|
||||
end
|
||||
local _, _, dDimV1 = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
||||
local _, _, dDimV2 = BL.GetFaceHvRefDim( Proc.Id, 1, b3Raw)
|
||||
local _, _, dDimV1 = BL.GetFaceHvRefDim( Proc.Id, idFirstFace, b3Raw)
|
||||
local _, _, dDimV2 = BL.GetFaceHvRefDim( Proc.Id, idSecondFace, b3Raw)
|
||||
local bFace1TooLongForBlade, bFace2TooLongForBlade = ( dDimV1 >= dMaxDepth), ( dDimV2 >= dMaxDepth)
|
||||
local dFace1Ang, dFace2Ang = vtN[1]:getZ(), vtN[2]:getZ()
|
||||
if bFace1TooLongForBlade and dFace1Ang < ( BD.CUT_VZ_MIN or -0.484) or bFace2TooLongForBlade and dFace2Ang < ( BD.CUT_VZ_MIN or -0.484) then
|
||||
|
||||
@@ -638,16 +638,6 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
end
|
||||
-- se lavorazione in doppio
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
-- calcolo gli step reali
|
||||
local dStep = EgtGetMachiningParam( MCH_MP.STEP)
|
||||
local nNumStep = ceil( dDepth/dStep)
|
||||
local dRealStep = dDepth / nNumStep
|
||||
-- Se nel penultimo step le punte si trovano più vicine del minimo ( MinDistX1X2 + Puntina centraggio H1 + puntina centraggio H2) ricalcolo facendo uno step in meno
|
||||
if ( ( dLen / 2) - ( dRealStep * (nNumStep - 1))) * 2 < ( 40 + 10 + 10) then
|
||||
dRealStep = ceil( dDepth / (nNumStep - 1))
|
||||
EgtSetMachiningParam( MCH_MP.STEP, dRealStep)
|
||||
sMyWarn ='Warning in drill-double : step changed to ' .. tostring(dRealStep) .. 'mm'
|
||||
end
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
if Proc.Double ~= Proc.PrevDouble then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||
|
||||
+228
-90
@@ -51,6 +51,23 @@ function ProcessDtMortise.FrontIdentify( Proc)
|
||||
return (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 56)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature profonda, non sulla faccia della trave
|
||||
function ProcessDtMortise.IsDeeper( Proc, b3Raw)
|
||||
-- recupero i dati della curva di contorno della faccia di fondo
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||
if not AuxId then return false end
|
||||
AuxId = AuxId + Proc.Id
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
if ( AreSameVectorApprox( vtExtr, -Y_AX()) and Proc.Box:getMin():getY() > b3Raw:getMin():getY() + 100 * GEO.EPS_SMALL) or
|
||||
( AreSameVectorApprox( vtExtr, Y_AX()) and Proc.Box:getMax():getY() < b3Raw:getMax():getY() - 100 * GEO.EPS_SMALL) or
|
||||
( AreSameVectorApprox( vtExtr, -Z_AX()) and Proc.Box:getMin():getZ() > b3Raw:getMin():getZ() + 100 * GEO.EPS_SMALL) or
|
||||
( AreSameVectorApprox( vtExtr, Z_AX()) and Proc.Box:getMax():getZ() < b3Raw:getMax():getZ() - 100 * GEO.EPS_SMALL) then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Verifica se feature di coda
|
||||
function ProcessDtMortise.IsTailFeature( Proc, b3Raw)
|
||||
@@ -104,7 +121,7 @@ function ProcessDtMortise.GetCutPlane( Proc)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
|
||||
local function CalcPathAtHeight( nProcId, AuxId, nAddGrpId, dHeight, dSideAng, b3Solid)
|
||||
-- copio la curva di base
|
||||
local NewAuxId = EgtCopyGlob( AuxId, nAddGrpId)
|
||||
if not NewAuxId then return end
|
||||
@@ -112,7 +129,7 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
|
||||
EgtAddCurveCompoLineTg( NewAuxId, 100, false)
|
||||
EgtAddCurveCompoLineTg( NewAuxId, 100, true)
|
||||
EgtMergeCurvesInCurveCompo( NewAuxId)
|
||||
local dOffset = dAltMort * tan( dSideAng)
|
||||
local dOffset = dHeight * tan( dSideAng)
|
||||
if not EgtOffsetCurve( NewAuxId, dOffset) then return end
|
||||
-- la limito entro la trave
|
||||
local refBox = Frame3d( b3Solid:getMin())
|
||||
@@ -120,7 +137,7 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
|
||||
local nCount
|
||||
NewAuxId, nCount = EgtTrimFlatCurveWithBox( NewAuxId, refBox, vtBoxDiag, true, true, GDB_RT.GLOB)
|
||||
-- eseguo traslazione e offset per portarla sul top
|
||||
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dAltMort - 10 * GEO.EPS_SMALL)
|
||||
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dHeight - 10 * GEO.EPS_SMALL)
|
||||
EgtMove( NewAuxId, vtMove, GDB_RT.GLOB)
|
||||
-- se divisa in più parti, le unisco congiungendole con segmenti
|
||||
if nCount > 1 then
|
||||
@@ -137,6 +154,23 @@ local function CalcTopPath( nProcId, AuxId, nAddGrpId, dAltMort, dSideAng, b3Sol
|
||||
return NewAuxId
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetVerticalSteps( dMachiningDepth, dStep )
|
||||
local MachiningSteps = {}
|
||||
MachiningSteps.StepLength = 0
|
||||
|
||||
if dMachiningDepth <= 0 then
|
||||
MachiningSteps.Count = 0
|
||||
return MachiningSteps
|
||||
end
|
||||
|
||||
MachiningSteps.Count = ceil( (dMachiningDepth - 10 * GEO.EPS_SMALL) / dStep )
|
||||
|
||||
MachiningSteps.StepLength = dMachiningDepth / MachiningSteps.Count
|
||||
|
||||
return MachiningSteps
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- verifica che il box includa il punto in XY
|
||||
function EnclosesPoint( b3Box, ptP)
|
||||
@@ -155,6 +189,8 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local sWarn
|
||||
bMakeAntiSplitPath = true
|
||||
-- ingombro del pezzo
|
||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||
if not b3Solid then
|
||||
@@ -289,12 +325,56 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
bCW = ( dSpeed >= 0)
|
||||
end
|
||||
end
|
||||
-- verifico che la profondità non superi il massimo materiale dell'utensile
|
||||
local bMultipleZPasses = false
|
||||
-- se necessario, cerco un utensile più lungo
|
||||
if dAltMort > dMaxMat + 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Error : DtMortise Depth bigger than Tool Cutting edge'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
-- recupero la lavorazione : prima ricerca per sola tipologia
|
||||
sMilling = ML.FindMilling( sMillType..sMchExt, nil, nil, nil, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
|
||||
if not sMilling and bMillUp then
|
||||
sMilling = ML.FindMilling( sMillType, nil, nil, nil, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Milling not found in library : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero la lavorazione : seconda ricerca con tipologia e diametro massimo
|
||||
sMilling = ML.FindMilling( sMillType..sMchExt, nil, nil, 2 * dMinRad, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
|
||||
if not sMilling and bMillUp then
|
||||
sMilling = ML.FindMilling( sMillType, nil, nil, 2 * dMinRad, nil, bMillUp, bMillDown, bExcludeH2, nil, 'Longest')
|
||||
sMchExt = ''
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Radius too small : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : DtMortise Depth bigger than Tool Cutting edge'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- riassegno dati utensile
|
||||
dToolDiam = 100
|
||||
dMaxMat = 30
|
||||
dSideAng = 0
|
||||
bCW = true
|
||||
bMillOnAggregate = sMchExt == '_AT'
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
dToolDiam = max( dToolDiam, 10)
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
dSideAng = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAng
|
||||
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
|
||||
bCW = ( dSpeed >= 0)
|
||||
end
|
||||
end
|
||||
|
||||
bMultipleZPasses = true
|
||||
end
|
||||
|
||||
|
||||
-- tastatura se richiesta
|
||||
local Info = { vtProbe = vtExtr, ptProbe = ptBC, sType = 'DTMortise', sHead = sHeadTool}
|
||||
@@ -382,93 +462,101 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
end
|
||||
-- calcolo il percorso top mortise
|
||||
local nAuxId1 = CalcTopPath( Proc.Id, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
|
||||
local nAuxId1 = CalcPathAtHeight( Proc.Id, AuxId, nAddGrpId, dAltMort, dSideAng, b3Solid)
|
||||
-- se esiste il percorso
|
||||
if nAuxId1 then
|
||||
-- creo percorso sulla parte alta della mortasa
|
||||
local dToolRadDelta = dAltMort * tan( dSideAng)
|
||||
local dTopDiam = dToolDiam + 2 * dToolRadDelta
|
||||
-- recupero punto iniziale e finale del percorso
|
||||
local ptStart = EgtSP( nAuxId1, GDB_RT.GLOB)
|
||||
local ptEnd = EgtEP( nAuxId1, GDB_RT.GLOB)
|
||||
if ptStart and ptEnd then
|
||||
local nId1
|
||||
-- se richiesti due segmenti di linea
|
||||
if not bMakeAsByArc then
|
||||
-- determino il punto comune dei due segmenti
|
||||
local vtDelta = ( ptEnd - ptStart) / 4
|
||||
vtDelta:rotate( vtExtr, -90)
|
||||
local ptMid = ( ptStart + ptEnd) / 2 + vtDelta
|
||||
-- creo la spezzata formata dai due segmenti
|
||||
nId1 = EgtCurveCompoFromPoints( nAddGrpId, { ptStart, ptMid, ptEnd}, GDB_RT.GLOB)
|
||||
-- altrimenti richiesto arco
|
||||
if EgtCurveIsFlat( nAuxId1) then
|
||||
-- creo percorso sulla parte alta della mortasa
|
||||
local dToolRadDelta = dAltMort * tan( dSideAng)
|
||||
local dTopDiam = dToolDiam + 2 * dToolRadDelta
|
||||
-- recupero punto iniziale e finale del percorso
|
||||
local ptStart = EgtSP( nAuxId1, GDB_RT.GLOB)
|
||||
local ptEnd = EgtEP( nAuxId1, GDB_RT.GLOB)
|
||||
if ptStart and ptEnd then
|
||||
local nId1
|
||||
-- se richiesti due segmenti di linea
|
||||
if not bMakeAsByArc then
|
||||
-- determino il punto comune dei due segmenti
|
||||
local vtDelta = ( ptEnd - ptStart) / 4
|
||||
vtDelta:rotate( vtExtr, -90)
|
||||
local ptMid = ( ptStart + ptEnd) / 2 + vtDelta
|
||||
-- creo la spezzata formata dai due segmenti
|
||||
nId1 = EgtCurveCompoFromPoints( nAddGrpId, { ptStart, ptMid, ptEnd}, GDB_RT.GLOB)
|
||||
-- altrimenti richiesto arco
|
||||
else
|
||||
-- direzione del segmento
|
||||
local vtDir = ptEnd - ptStart ;
|
||||
local dLen = vtDir:len()
|
||||
vtDir:normalize()
|
||||
-- direzioni tangenti iniziale e finale
|
||||
local vtStart = EgtSV( nAuxId1, GDB_RT.GLOB)
|
||||
local vtEnd = EgtEV( nAuxId1, GDB_RT.GLOB)
|
||||
-- angoli
|
||||
local dAngStart = acos( vtStart * vtDir)
|
||||
local dAngEnd = acos( vtEnd * vtDir)
|
||||
local dMaxAng = min( 30, dAngStart, dAngEnd)
|
||||
if dLen < dTopDiam then
|
||||
dMaxAng = min( dMaxAng, asin( dLen / dTopDiam))
|
||||
end
|
||||
local vtTg = vtDir ; vtTg:rotate( vtExtr, -dMaxAng)
|
||||
-- creo l'arco
|
||||
nId1 = EgtArc2PV( nAddGrpId, ptStart, ptEnd, vtTg, GDB_RT.GLOB)
|
||||
end
|
||||
if not nId1 then
|
||||
local sErr = 'Wrong geometry : Error on DtMortise '
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
EgtModifyCurveExtrusion( nId1, vtExtr, GDB_RT.GLOB)
|
||||
-- inserisco la lavorazione di contornatura anti splint
|
||||
local sNameF = 'DtMtAS_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sNameF, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nId1, -1}})
|
||||
-- setto affondamento pari all'altezza della mortsasa
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dAltMort)
|
||||
-- setto offset radiale con aggiunto un ulteriore allargamento di 1mm
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dToolRadDelta - 1)
|
||||
-- antischeggia sempre con una passata
|
||||
if bMultipleZPasses then
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
end
|
||||
-- sistemo il lato e la direzione di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
|
||||
-- se necessario, imposto SCC
|
||||
if nSCC then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
end
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
local sUserNotes = 'MaxElev='.. EgtNumToString( dAltMort, 1) .. '; VMRS=0;'
|
||||
-- se lavorazione in doppio
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
if Proc.Double ~= nMyPrevDouble then
|
||||
nMyPrevDouble = Proc.Double
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return false, sErr
|
||||
end
|
||||
else
|
||||
-- direzione del segmento
|
||||
local vtDir = ptEnd - ptStart ;
|
||||
local dLen = vtDir:len()
|
||||
vtDir:normalize()
|
||||
-- direzioni tangenti iniziale e finale
|
||||
local vtStart = EgtSV( nAuxId1, GDB_RT.GLOB)
|
||||
local vtEnd = EgtEV( nAuxId1, GDB_RT.GLOB)
|
||||
-- angoli
|
||||
local dAngStart = acos( vtStart * vtDir)
|
||||
local dAngEnd = acos( vtEnd * vtDir)
|
||||
local dMaxAng = min( 30, dAngStart, dAngEnd)
|
||||
if dLen < dTopDiam then
|
||||
dMaxAng = min( dMaxAng, asin( dLen / dTopDiam))
|
||||
end
|
||||
local vtTg = vtDir ; vtTg:rotate( vtExtr, -dMaxAng)
|
||||
-- creo l'arco
|
||||
nId1 = EgtArc2PV( nAddGrpId, ptStart, ptEnd, vtTg, GDB_RT.GLOB)
|
||||
end
|
||||
if not nId1 then
|
||||
local sErr = 'Wrong geometry : Error on DtMortise '
|
||||
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
EgtModifyCurveExtrusion( nId1, vtExtr, GDB_RT.GLOB)
|
||||
-- inserisco la lavorazione di contornatura anti splint
|
||||
local sNameF = 'DtMtAS_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sNameF, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nId1, -1}})
|
||||
-- setto affondamento pari all'altezza della mortsasa
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dAltMort)
|
||||
-- setto offset radiale con aggiunto un ulteriore allargamento di 1mm
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dToolRadDelta - 1)
|
||||
-- sistemo il lato e la direzione di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
|
||||
-- se necessario, imposto SCC
|
||||
if nSCC then
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
end
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
local sUserNotes = 'MaxElev='.. EgtNumToString( dAltMort, 1) .. '; VMRS=0;'
|
||||
-- se lavorazione in doppio
|
||||
if Proc.Double and Proc.Double > 0 then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', Proc.Double)
|
||||
if Proc.Double ~= nMyPrevDouble then
|
||||
nMyPrevDouble = Proc.Double
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', 2)
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return false, sErr
|
||||
end
|
||||
else
|
||||
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
sWarn = 'Warning : skipped DoveTail mortise antisplint'
|
||||
end
|
||||
else
|
||||
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
@@ -484,6 +572,23 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
local nPass = ceil( dDist / ( 1.9 * dToolDiam))
|
||||
local dStep = 0
|
||||
if nPass > 1 then dStep = max( ( dDist - 2 * dToolDiam) / ( 2 * nPass - 2), 0.25 * dToolDiam) end
|
||||
|
||||
local dVerticalStep = 0
|
||||
if bMultipleZPasses then
|
||||
local dToolVerticalStep = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
dToolVerticalStep = EgtMdbGetCurrMachiningParam( MCH_MP.STEP) or 0
|
||||
end
|
||||
if dToolVerticalStep < 10 * GEO.EPS_SMALL then
|
||||
dToolVerticalStep = dMaxMat / 3
|
||||
else
|
||||
dToolVerticalStep = min( dToolVerticalStep, dMaxMat / 3)
|
||||
end
|
||||
local VerticalSteps = GetVerticalSteps( dAltMort, dToolVerticalStep)
|
||||
dVerticalStep = VerticalSteps.StepLength
|
||||
nPass = VerticalSteps.Count
|
||||
end
|
||||
|
||||
for i = nPass, 1, -1 do
|
||||
-- inserisco la lavorazione di contornatura
|
||||
local sNameF = 'DtMt_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. '_' .. tostring( nPass)
|
||||
@@ -494,10 +599,39 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
local GeomId = AuxId
|
||||
if ( i > 1) and bMultipleZPasses then
|
||||
local dCurrentHeight = dAltMort - ( ( nPass - i + 1) * dVerticalStep)
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error : missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
local b3MortiseNoPocket = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
|
||||
GeomId = CalcPathAtHeight( Proc.Id, AuxId, nAddGrpId, dCurrentHeight, dSideAng, b3MortiseNoPocket)
|
||||
if not GeomId then
|
||||
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
EgtSetMachiningGeometry( {{ GeomId, -1}})
|
||||
-- imposto offset
|
||||
local dOffs = ( i - 1) * dStep
|
||||
if bMultipleZPasses then
|
||||
if i > 1 then
|
||||
dOffs = 1
|
||||
else
|
||||
dOffs = 0
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
|
||||
-- in caso di passate in Z già calcolate lo step deve essere nullo per garantire passate singole
|
||||
if bMultipleZPasses then
|
||||
EgtSetMachiningParam( MCH_MP.STEP, 0)
|
||||
end
|
||||
-- sistemo il lato e la direzione di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, false, true))
|
||||
@@ -534,7 +668,11 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
end
|
||||
-- dichiaro massima elevazione e assenza sfridi per VMill
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';'
|
||||
local dMaxElev = dMaxMat
|
||||
if bMultipleZPasses then
|
||||
dMaxElev = dVerticalStep
|
||||
end
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1)) .. ';' .. EgtSetVal( 'VMRS', 0) .. ';'
|
||||
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
|
||||
if bPocket then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'OutRaw', 3)
|
||||
@@ -559,7 +697,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
return true
|
||||
return true, sWarn
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
|
||||
+143
-10
@@ -64,14 +64,14 @@ local function VerifyOrientation( Proc, vtN, b3Raw)
|
||||
-- se tenone praticamente in asse, accetto fino a -22 deg
|
||||
if abs( vtN:getY()) < 0.088 then
|
||||
return ( vtN:getZ() >= -0.375)
|
||||
-- altrimenti, accetto fino a -10 deg
|
||||
-- altrimenti, accetto fino a -12.5 deg
|
||||
else
|
||||
return ( vtN:getZ() >= -0.174)
|
||||
return ( vtN:getZ() >= -0.216)
|
||||
end
|
||||
-- altrimenti
|
||||
else
|
||||
-- accetto fino a -7deg
|
||||
return ( vtN:getZ() >= -0.122)
|
||||
-- accetto fino a -12.5 deg
|
||||
return ( vtN:getZ() >= -0.216)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -209,7 +209,20 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg,
|
||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId, PartId = Proc.PartId}
|
||||
CutProc.AffectedFaces = BL.GetProcessAffectedFaces( CutProc)
|
||||
local bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
|
||||
|
||||
-- se esiste grezzo successivo non serve tagliare dal basso
|
||||
local bFromBottom
|
||||
local dTotalLength = 0
|
||||
local nNextRawId = EgtGetNextRawPart( nRawId)
|
||||
while nNextRawId do
|
||||
dTotalLength = dTotalLength + EgtGetRawPartBBox( nNextRawId):getDimX()
|
||||
nNextRawId = EgtGetNextRawPart( nNextRawId)
|
||||
end
|
||||
if dTotalLength > BD.MinRaw and not Proc.Tail then
|
||||
bFromBottom = false
|
||||
else
|
||||
bFromBottom = ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtExtr:getZ() > 0.25)
|
||||
end
|
||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
@@ -236,11 +249,32 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
bCW = ( dSpeed >= 0)
|
||||
end
|
||||
end
|
||||
-- verifico che l'altezza non superi il massimo materiale dell'utensile
|
||||
-- se necessario, cerco un utensile più lungo
|
||||
if dDtTenH > dMaxMat + 10 * GEO.EPS_SMALL then
|
||||
local sErr = 'Error : DtTenon Height bigger than Tool Cutting edge'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown and not bMillUp, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown, nil, nil, 'Longest')
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
if not sMilling then
|
||||
local sErr = 'Error : DtTenon Height bigger than Tool Cutting edge'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- riassegno dati utensile
|
||||
dTDiam = 50
|
||||
dMaxMat = 30
|
||||
bCW = true
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
|
||||
bCW = ( dSpeed >= 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
-- calcolo distanza massima della curva dal punto più lontano della base tenone Dt (facet 0)
|
||||
local dMaxDist
|
||||
@@ -331,8 +365,107 @@ function ProcessDtTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
BL.UpdateTCING( nRawId, dOffs)
|
||||
end
|
||||
end
|
||||
|
||||
-- si controllano le ultime 5 facce della feature
|
||||
local nIndFace = -1
|
||||
for i = 1, 5 do
|
||||
if abs( vtExtr * EgtSurfTmFacetNormVersor( Proc.Id, Proc.Fct-i, GDB_ID.ROOT)) < GEO.EPS_ANG_SMALL then
|
||||
nIndFace = Proc.Fct-i
|
||||
end
|
||||
end
|
||||
-- controllo se serve passaggio di finitura in caso il tenone non cominci dal bordo della trave (P14 > 0)
|
||||
if nIndFace > 0 then
|
||||
-- verifico se almeno uno dei punti iniziale e finale della curva giace in uno dei piani limite del pezzo, quindi se è un lato aperto
|
||||
local bOpen = false
|
||||
local ptIni = EgtSP( AuxId, GDB_RT.GLOB)
|
||||
local ptFin = EgtEP( AuxId, GDB_RT.GLOB)
|
||||
if ( abs( ptIni:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL or abs( ptFin:getX() - b3Solid:getMax():getX()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL or abs( ptFin:getX() - b3Solid:getMin():getX()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL or abs( ptFin:getY() - b3Solid:getMax():getY()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL or abs( ptFin:getY() - b3Solid:getMin():getY()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL or abs( ptFin:getZ() - b3Solid:getMax():getZ()) < 100 * GEO.EPS_SMALL) or
|
||||
( abs( ptIni:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL or abs( ptFin:getZ() - b3Solid:getMin():getZ()) < 100 * GEO.EPS_SMALL) then
|
||||
bOpen = true
|
||||
end
|
||||
-- se entrambi i punti non sono sul limite pezzo
|
||||
if not bOpen then
|
||||
-- recupero la lavorazione
|
||||
sMillType = 'Tenon'
|
||||
sMilling = ML.FindMilling( sMillType .. EgtIf( bMillDown and not bMillUp, '_H2', ''), nil, nil, nil, nil, bMillUp, bMillDown)
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling to finish the tenon not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
local dSpeed = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) or 0
|
||||
bCW = ( dSpeed >= 0)
|
||||
end
|
||||
|
||||
-- inserisco la passata finale della lavorazione
|
||||
local sNameF = 'TenF_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sNameF, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nIndFace}})
|
||||
-- sistemo i parametri
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH_STR, 'TH')
|
||||
-- sistemo il lato e la direzione di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, EgtIf( bCW, MCH_MILL_WS.LEFT, MCH_MILL_WS.RIGHT))
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, EgtIf( bCW, true, false))
|
||||
EgtSetMachiningParam( MCH_MP.LITANG, 0.7 * dTDiam)
|
||||
EgtSetMachiningParam( MCH_MP.LIPERP, 20)
|
||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0.7 * dTDiam)
|
||||
EgtSetMachiningParam( MCH_MP.LOPERP, 20)
|
||||
|
||||
local nFaceUse
|
||||
if vtExtr:getX() > -GEO.EPS_SMALL then
|
||||
nFaceUse = MCH_MILL_FU.PARAL_LEFT
|
||||
else
|
||||
nFaceUse = MCH_MILL_FU.PARAL_RIGHT
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||
|
||||
-- imposto elevazione
|
||||
local sUserNotes = EgtSetVal( 'MaxElev', EgtNumToString( dDtTenH, 1)) .. ';'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.NONE
|
||||
if BD.TURN then
|
||||
if abs( vtAx:getY()) > abs( vtAx:getZ()) then
|
||||
nSCC = EgtIf( vtAx:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||
else
|
||||
nSCC = EgtIf( vtAx:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||
end
|
||||
elseif not BD.C_SIMM then
|
||||
nSCC = MCH_SCC.ADIR_YM
|
||||
if abs( vtExtr:getY()) > 0.088 then
|
||||
nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
return ProcessDtTenon
|
||||
|
||||
@@ -159,6 +159,105 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
return true, nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- smussi in testa
|
||||
local function MakeHeadChamfer( idProc, nPartId)
|
||||
local dDepthHeadChamfer = EgtGetInfo( idProc, 'Q08', 'd') or 0
|
||||
-- se non attivo esco subito
|
||||
if dDepthHeadChamfer < 100 * GEO.EPS_SMALL then
|
||||
return
|
||||
end
|
||||
|
||||
-- recupero gruppo per geometria aggiuntiva
|
||||
local AddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not AddGrpId then
|
||||
local sErr = 'Error on process StartFace impossible to find AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- recupero la lavorazione
|
||||
local sMilling = ML.FindMilling( 'Mark')
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( idProc, 0, AddGrpId)
|
||||
if not nLoopId or nLoopCnt > 1 then
|
||||
local sErr = 'Error MakeHeadChamfer : too many loops'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- setto direzione estrusione corretta
|
||||
EgtModifyCurveExtrusion( nLoopId, X_AX())
|
||||
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.RIGHT))
|
||||
|
||||
local dQ09Value = EgtGetInfo( idProc, 'Q09', 'd')
|
||||
local bChamferedEdge = dQ09Value > 0
|
||||
|
||||
local nIdFirstEntity, nEntityCnt = EgtExplodeCurveCompo( nLoopId)
|
||||
local p3MidPoint = EgtMP( nIdFirstEntity, GDB_ID.GRID)
|
||||
|
||||
for i = 0, nEntityCnt - 1 do
|
||||
if EgtCurveLength( nIdFirstEntity + i) - 10 < abs( dQ09Value) * 2 then
|
||||
local sErr = 'Error MakeHeadChamfer : Q09 too high'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
|
||||
-- creo raccordo o fillet
|
||||
for i = 0, nEntityCnt - 1 do
|
||||
local idFirst = nIdFirstEntity + i
|
||||
local idSecond = EgtIf( i == nEntityCnt - 1, nIdFirstEntity, idFirst + 1)
|
||||
local ptEndPointFirst = EgtEP( idFirst, GDB_ID.GRID) - ( abs( dQ09Value) * EgtEV( idFirst, GDB_ID.GRID))
|
||||
local ptStartPointSecond = EgtSP( idSecond, GDB_ID.GRID) + ( abs( dQ09Value) * EgtEV( idSecond, GDB_ID.GRID))
|
||||
|
||||
if bChamferedEdge then
|
||||
EgtCurveChamfer( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID)
|
||||
else
|
||||
EgtCurveFillet( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID)
|
||||
end
|
||||
end
|
||||
|
||||
EgtSelectPathObjs( nIdFirstEntity, true)
|
||||
local idGeom, idGeomCnt = EgtCurveCompoByChain( AddGrpId, GDB_ID.SEL, {0,0,0}, true)
|
||||
if not idGeom or idGeomCnt > 1 then
|
||||
local sErr = 'Error MakeHeadChamfer : too many loops'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
EgtChangeClosedCurveStartPoint( idGeom, p3MidPoint, GDB_RT.GRID)
|
||||
|
||||
-- Inserisco la lavorazione del lato standard
|
||||
local dExtra = 2
|
||||
local sName1 = 'HeadCham_' .. ( EgtGetName( idProc) or tostring( idProc))
|
||||
local nMch1Id = EgtAddMachining( sName1, sMilling)
|
||||
if not nMch1Id then
|
||||
local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ idGeom, -1}})
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthHeadChamfer + dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
-- assegno lato di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
return true, nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- tagli verticali aggiuntivi
|
||||
local function AddVerticalPreCuts( Proc, sCutting, dCutXOffset, b3Raw, dOffsetBetweenCuts)
|
||||
@@ -533,6 +632,16 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
||||
|
||||
local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, HeadCutType, Cutting1Data, Cutting2Data, nil, dOvmHead)
|
||||
|
||||
|
||||
-- alla fine del taglio si aggiungono gli smussi in testa
|
||||
local _, sErrHeadChamfer = MakeHeadChamfer( nOriId or Proc.Id, nPartId)
|
||||
if sErr then
|
||||
sErr = sErr..'\n'..sErrHeadChamfer
|
||||
else
|
||||
sErr = sErrHeadChamfer
|
||||
end
|
||||
|
||||
|
||||
return bOk, sErr
|
||||
end
|
||||
|
||||
|
||||
+142
-45
@@ -145,7 +145,8 @@ local Q_BLADE_ON_ALONG_FACE = '' -- i
|
||||
local Q_MAX_ELEVATION = '' -- d
|
||||
local Q_SAW_PLUS_CHAIN = '' -- i
|
||||
local Q_FORCE_CHAINSAW = '' -- i
|
||||
|
||||
local Q_CHAINSAW_FROM_SIDE = '' -- i
|
||||
local Q_MILL_AS_BLADE_CONVENTIONAL = '' -- i
|
||||
|
||||
-- variabile smussi
|
||||
local bMadeChamfer
|
||||
@@ -192,12 +193,15 @@ local function AssignQIdent( Proc)
|
||||
Q_STAIRCASE = ''
|
||||
Q_SAW_PLUS_CHAIN = 'Q11'
|
||||
Q_FORCE_CHAINSAW = 'Q12'
|
||||
Q_NO_ROTATION = 'Q13'
|
||||
-- TODO da riportare a Q13 quando è sistemata la gestione del movimento in macchina nell'attacco laterale
|
||||
Q_CHAINSAW_FROM_SIDE = 'Q999'
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = ''
|
||||
|
||||
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
|
||||
Q_FORCE_BLADE = 'Q01' -- i
|
||||
Q_DEPTH_CHAMFER = 'Q04' -- d
|
||||
Q_ONLY_CHAMFER = 'Q05' -- i
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17 then
|
||||
Q_DEPTH_CHAMFER = 'Q01' -- d
|
||||
Q_ONLY_CHAMFER = 'Q02' -- i
|
||||
@@ -218,6 +222,7 @@ local function AssignQIdent( Proc)
|
||||
Q_BLADE_ON_ALONG_FACE = 'Q04' -- i
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
Q_DEPTH_CHAMFER = 'Q07' -- d
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- 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
|
||||
@@ -226,19 +231,23 @@ local function AssignQIdent( Proc)
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33 then
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34 then
|
||||
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
|
||||
Q_USE_MILL = 'Q02' -- i
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
elseif ( Proc.Grp == 4) and Proc.Prc == 37 then
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
||||
elseif ( Proc.Grp == 4) and Proc.Prc == 39 then
|
||||
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
|
||||
Q_USE_MILL = 'Q02' -- i
|
||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90 then
|
||||
Q_ANTISPLINT_TYPE = 'Q03' -- i
|
||||
Q_SIDE_ROUGH_TOOL = 'Q04' -- i
|
||||
Q_MILL_AS_BLADE_CONVENTIONAL = 'Q14' -- i
|
||||
end
|
||||
-- le altre features gestite non hanno parametri Q
|
||||
end
|
||||
@@ -792,9 +801,10 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
||||
-- verifico se è in coda
|
||||
local dEndDist = Proc.Box:getMin():getX() - b3Solid:getMin():getX()
|
||||
if ( dEndDist > BD.MAX_DIST_HTFEA) or bUseBHSideMill then
|
||||
if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 then
|
||||
if not( BD.BH_MACHINE) and bUseBHSideMill and ( Proc.Box:getMax():getX() - b3Solid:getMin():getX()) < 400 and b3Solid:getDimX() > BD.LEN_VERY_SHORT_PART then
|
||||
return true
|
||||
else
|
||||
-- se Front Slot e pezzo abbastanza lungo si rimanda la decisione a più avanti
|
||||
elseif not ( ( Proc.Prc == 17) and ( b3Solid:getDimX() > ( BD.LEN_VERY_SHORT_PART or BD.LEN_SHORT_PART))) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
@@ -967,7 +977,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
||||
end
|
||||
end
|
||||
|
||||
local bNoRotation = ( EgtGetInfo( Proc.Id, Q_NO_ROTATION, 'i') or 0) == 1
|
||||
local bNoRotation = ( EgtGetInfo( Proc.Id, Q_CHAINSAW_FROM_SIDE, 'i') or 0) == 1
|
||||
if bDown and bNoRotation then
|
||||
bDown = false
|
||||
end
|
||||
@@ -2853,7 +2863,13 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
for i = 1, nStep do
|
||||
local dOffs = ( i - 1) * dStep
|
||||
if vtN:getZ() < dVzLimDwnUp then dOffs = dOffs + dSawThick end
|
||||
local bOk, sErr, nMchId = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, 0, BD.CUT_SIC, dOffs, dStartDist, dEndDist, nil, b3Raw)
|
||||
-- forzatura lavorazione discorde in base a parametro Q su feature
|
||||
local nQ14Param = EgtGetInfo( Proc.Id, Q_MILL_AS_BLADE_CONVENTIONAL, 'd') or 0
|
||||
local bForceInvert = nQ14Param == 1 or ( nQ14Param == 2 and vtN:getX() < 0.1 and Proc.AffectedFaces.Bottom)
|
||||
if bForceInvert and i == 1 then
|
||||
dStartDist, dEndDist = dEndDist, dStartDist
|
||||
end
|
||||
local bOk, sErr, nMchId = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, dVzLimDwnUp, 0, BD.CUT_SIC, dOffs, dStartDist, dEndDist, nil, b3Raw, bForceInvert)
|
||||
if not bOk then return bOk, sErr end
|
||||
-- setto l'elevazione
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( 0, 1) .. ';'
|
||||
@@ -3094,7 +3110,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
return false, sErr
|
||||
end
|
||||
local bGoFromHead = true
|
||||
local bAttackFromSide = ( ( EgtGetInfo( Proc.Id, Q_NO_ROTATION, 'i') or 0) == 1)
|
||||
local bAttackFromSide = ( ( EgtGetInfo( Proc.Id, Q_CHAINSAW_FROM_SIDE, '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
|
||||
@@ -3211,7 +3227,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
if vtRef and ( vtRef:getY() > 0.5 or vtRef:getZ() < -0.1) then
|
||||
vtRef = -vtRef
|
||||
end
|
||||
if not ( Proc.Topology == 'Tunnel') then
|
||||
if bAttackFromSide 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
|
||||
@@ -3224,6 +3240,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
vtRef = -Z_AX()
|
||||
nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, -Z_AX())
|
||||
end
|
||||
else
|
||||
nFaceZ = nFacInd
|
||||
end
|
||||
dDepth = Proc.Face[ nFaceZ + 1].Elevation
|
||||
end
|
||||
@@ -3259,7 +3277,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
local dOffs = ( i - 1) * dStep
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
|
||||
local dMachiningDepth = dDepth
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
if not bAttackFromSide then
|
||||
-- se possibile aumento l'affondamento pari al raggio corner + 1
|
||||
if dMaxMat2 > ( dDepth + dSawCornerRad2 + 1) then
|
||||
dMachiningDepth = ( dDepth + dSawCornerRad2 + 1)
|
||||
@@ -3284,24 +3302,33 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
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
|
||||
-- si decidono lato di lavoro, inversione e estensione in base al lato aperto
|
||||
local nEdgeIndex = BL.GetEdgeToMachineFromVector( Proc.Id, nFacAdj, vtRef)
|
||||
local EdgesEgt = BL.GetEdgesInfo( Proc, Proc.Face[nFacAdj+1])
|
||||
local CurrentEdge = EdgesEgt[nEdgeIndex+1]
|
||||
local dStartAddLen = 0
|
||||
local dEndAddLen = 0
|
||||
if CurrentEdge.IsStartOpen then
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MORTISE_WS.RIGHT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, false)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MORTISE_WS.LEFT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
end
|
||||
dStartAddLen = dSawWidth / 2 + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + EgtMdbGetGeneralParam( MCH_GP.SAFEAGGRBOTTZ)
|
||||
dEndAddLen = - dSawWidth / 2
|
||||
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
|
||||
if bAttackFromSide then
|
||||
local dMachiningStep = EgtGetMachiningParam( MCH_MP.STEP) or 0
|
||||
-- TODO qui sostituire con valore preciso da GetSetupInfo
|
||||
if BD.C_SIMM then
|
||||
dMachiningStep = 165
|
||||
dMachiningStep = 175
|
||||
if vtRef:getZ() < - 10 * GEO.EPS_SMALL then
|
||||
dMachiningStep = 250
|
||||
dMachiningStep = 260
|
||||
end
|
||||
end
|
||||
local dActualStep = ( dMachiningDepth - dMachiningStep) / ( 2 + 1)
|
||||
@@ -3316,7 +3343,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
||||
EgtSetMachiningParam( MCH_MP.FEED, dFeed)
|
||||
end
|
||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||
if not ( Proc.Topology == 'Tunnel') then
|
||||
if bAttackFromSide then
|
||||
sNotes = EgtSetValInNotes( sNotes, 'Plunge', 10)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||
@@ -3385,6 +3412,10 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
||||
end
|
||||
end
|
||||
local dExtraOffs = 0
|
||||
-- se il taglio è praticamente verticale, riduto massimo materiale lama
|
||||
if BD.DECR_VERT_CUT and vtN:getZ() > 0.985 then
|
||||
dMaxDepth = dMaxDepth - BD.DECR_VERT_CUT - BD.COLL_SIC
|
||||
end
|
||||
-- se profondità superiore al massimo lama modifico elevazione
|
||||
if dDepth > dMaxDepth then
|
||||
dExtraOffs = dMaxDepth - dDepth
|
||||
@@ -3420,7 +3451,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng, bOpenOutRaw, bLapJointAngTrasm, nPhase, nRawId)
|
||||
local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng, bOpenOutRaw, bLapJointAngTrasm, nPhase, nRawId, dCustomMaxElev)
|
||||
-- distanza dal pezzo successivo
|
||||
local dDistToNextPiece = BL.GetDistanceToNextPart( nRawId, nPhase)
|
||||
-- calcolo l'elevazione dal punto medio
|
||||
@@ -3523,11 +3554,10 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
end
|
||||
end
|
||||
end
|
||||
-- eventuale massima elevazione imposta dall'utente
|
||||
local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
|
||||
if dMaxElev and dMaxElev < 1 then dMaxElev = nil end
|
||||
-- eventuale massima elevazione forzata
|
||||
if dCustomMaxElev and dCustomMaxElev < 1 then dCustomMaxElev = nil end
|
||||
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
||||
dElev = dMaxElev or dElev
|
||||
dElev = dCustomMaxElev or dElev
|
||||
local sWarn
|
||||
local dDepth = dElev
|
||||
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
@@ -3548,6 +3578,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
-- provo ad allargare leggermente la tasca
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, -0.1)
|
||||
-- se percorso a Zig-Zag, provo a cambiarlo in spirale
|
||||
local nPocketSubType = EgtGetMachiningParam( MCH_MP.SUBTYPE)
|
||||
if nPocketSubType == MCH_POCK_SUB.ZIGZAG then
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||
end
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
@@ -3704,7 +3739,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
else
|
||||
sWarn = 'Warning : lapjoint chamfer angle machined with different tool'
|
||||
sWarn = 'Warning : lapjoint angled face machined with different tool'
|
||||
end
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
@@ -3715,6 +3750,15 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
||||
dTDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dTDiam
|
||||
end
|
||||
end
|
||||
-- se utensile troppo più grande dell'originale salto la lavorazione
|
||||
if sTuuidPk and EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidPk) or '') then
|
||||
local dTDiamOriginalTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or 0
|
||||
if dTDiam > 2 * dTDiamOriginalTool then
|
||||
sWarn = 'Warning : lapjoint angled face skipped (no compatible tool)'
|
||||
EgtOutLog( sWarn)
|
||||
return true, sWarn
|
||||
end
|
||||
end
|
||||
-- Calcolo uso faccia
|
||||
local nFaceUse = BL.GetNearestParalOpposite( tDimAndRef[1][3]:getVersZ())
|
||||
-- inserisco la lavorazione di fresatura
|
||||
@@ -5066,6 +5110,7 @@ function SawPlusChain.GetBottomFaceEdges( Proc, Face)
|
||||
CurrentEdge.IsOpen = vEdges[j].Open
|
||||
CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open)
|
||||
CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open)
|
||||
CurrentEdge.Id = j - 1
|
||||
|
||||
if CurrentEdge.AdjacentFaceId == Proc.MainFaces.LongFace.Id then
|
||||
table.insert( Edges.LongEdges, CurrentEdge)
|
||||
@@ -5111,6 +5156,7 @@ function SawPlusChain.GetLongFaceEdges( Proc, Face)
|
||||
CurrentEdge.IsOpen = vEdges[j].Open
|
||||
CurrentEdge.IsStartOpen = ( vEdges[nPreviousEdgeIndex].Open)
|
||||
CurrentEdge.IsEndOpen = ( vEdges[nNextEdgeIndex].Open)
|
||||
CurrentEdge.Id = j - 1
|
||||
|
||||
if Proc.Topology == 'Tunnel' then
|
||||
if CurrentEdge.AdjacentFaceId > -1 then
|
||||
@@ -5260,6 +5306,9 @@ function SawPlusChain.ApplyMachining( Machining, b3Raw)
|
||||
if Machining.MaxElev then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', Machining.MaxElev)
|
||||
end
|
||||
if Machining.nEdgeFaceUse then
|
||||
sUserNotes = EgtSetValInNotes( sUserNotes, 'EdgesFaceUse', EgtNumToString( Machining.nEdgeFaceUse))
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
|
||||
local bIsApplyOk = ML.ApplyMachining( true, false)
|
||||
@@ -5438,6 +5487,7 @@ function SawPlusChain.Saw.CalculateMachiningParameters( Proc, FaceToMachine, Edg
|
||||
else
|
||||
Cutting.Faceuse = BL.GetNearestOrthoOpposite( -EdgeToMachine.ToolDirection)
|
||||
end
|
||||
Cutting.nEdgeFaceUse = EdgeToMachine.Id
|
||||
-- SCC
|
||||
Cutting.SCC = SawPlusChain.Saw.GetSCC( EdgeToMachine.ToolDirection)
|
||||
-- asse bloccato
|
||||
@@ -5478,6 +5528,7 @@ end
|
||||
|
||||
function SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
|
||||
local bIsCuttingOk = false
|
||||
local sCuttingOriginalMessage = Cutting.Message or ''
|
||||
local sCuttingApplyMessage = ''
|
||||
|
||||
local dOriginalRadialOffset = Cutting.RadialOffset
|
||||
@@ -5492,7 +5543,9 @@ function SawPlusChain.Saw.ApplyAllSteps( Cutting, b3Raw)
|
||||
bIsCuttingOk, sCuttingApplyMessage = SawPlusChain.ApplyMachining( Cutting, b3Raw)
|
||||
-- update messaggi
|
||||
if sCuttingApplyMessage and #sCuttingApplyMessage > 0 then
|
||||
sCuttingApplyMessage = sCuttingApplyMessage .. 'Apply : ' .. sCuttingApplyMessage .. '\n'
|
||||
sCuttingApplyMessage = sCuttingOriginalMessage .. '\n' .. sCuttingApplyMessage .. 'Apply : ' .. sCuttingApplyMessage .. '\n'
|
||||
else
|
||||
sCuttingApplyMessage = sCuttingOriginalMessage
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5749,7 +5802,7 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
return bIsCuttingOk, Cutting.Message
|
||||
end
|
||||
end
|
||||
else
|
||||
elseif Proc.IsParallel then
|
||||
-- se la lama non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
|
||||
if Cutting.CanApply and Cutting.RadialOffset > 10 * GEO.EPS_SMALL then
|
||||
-- eventuale lavorazione di lama - lato della tasca da cui inizia la lavorazione
|
||||
@@ -5809,7 +5862,7 @@ function SawPlusChain.Make( bOnlySaw, Proc, nRawId)
|
||||
return bIsMortisingOk, Mortising.Message
|
||||
end
|
||||
end
|
||||
else
|
||||
elseif Proc.IsParallel then
|
||||
-- se la sega a catena non è arrivata sul fondo e c'è almeno un lato aperto va lavorato
|
||||
if Mortising.LongitudinalOffset > 10 * GEO.EPS_SMALL then
|
||||
-- eventuale lavorazione di sega a catena - lato della tasca da cui inizia la lavorazione
|
||||
@@ -5852,6 +5905,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if not BD.MAXDIAM_POCK_CORNER then
|
||||
BD.MAXDIAM_POCK_CORNER = 30
|
||||
end
|
||||
local nMGrpId = EgtGetCurrMachGroup()
|
||||
local sWarn
|
||||
-- recupero l'ingombro del grezzo di appartenenza
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
@@ -6438,6 +6492,35 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
dMaxTotLen = BD.GetBottomToolMaxTotLen( vtN)
|
||||
end
|
||||
local dUserMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd')
|
||||
local dCustomMaxElev
|
||||
-- se esistono tagli troncanti in testa o in coda, si calcola il MaxElev da applicare
|
||||
if not dUserMaxElev then
|
||||
local nTailCutId = EgtGetInfo( nPartId, 'TAILCUTFEATUREID', 'i')
|
||||
local nHeadCutId = EgtGetInfo( nPartId, 'HEADCUTFEATUREID', 'i')
|
||||
if nHeadCutId or nTailCutId then
|
||||
local nSurfPartId = EgtCopyGlob( EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, 'Box'), nAddGrpId)
|
||||
if nHeadCutId then
|
||||
local ptCCutSurf, vtNCutSurf = EgtSurfTmFacetCenter( nHeadCutId, 0, GDB_ID.ROOT)
|
||||
EgtCutSurfTmPlane( nSurfPartId, ptCCutSurf, vtNCutSurf, false, GDB_RT.GLOB)
|
||||
local nSurfPartIdOld = nSurfPartId
|
||||
nSurfPartId = EgtSurfTmBySewing( nAddGrpId, { nSurfPartId, nHeadCutId}, false)
|
||||
EgtErase( nSurfPartIdOld)
|
||||
end
|
||||
-- in coda si usa il troncante solo se la feature è settata da lavorare dopo separazione (Tail), altrimenti si rischia che venga fatta prima del taglio
|
||||
if nTailCutId and Proc.Tail then
|
||||
local ptCCutSurf, vtNCutSurf = EgtSurfTmFacetCenter( nTailCutId, 0, GDB_ID.ROOT)
|
||||
EgtCutSurfTmPlane( nSurfPartId, ptCCutSurf, vtNCutSurf, false, GDB_RT.GLOB)
|
||||
local nSurfPartIdOld = nSurfPartId
|
||||
nSurfPartId = EgtSurfTmBySewing( nAddGrpId, { nSurfPartId, nTailCutId}, false)
|
||||
EgtErase( nSurfPartIdOld)
|
||||
end
|
||||
dCustomMaxElev = EgtSurfTmFacetElevationInClosedSurfTm( Proc.Id, nFacInd, nSurfPartId, true)
|
||||
if dCustomMaxElev then
|
||||
dCustomMaxElev = dCustomMaxElev + dCollSic
|
||||
end
|
||||
EgtErase( nSurfPartId)
|
||||
end
|
||||
end
|
||||
-- ricerca lavorazione
|
||||
local sPocketing
|
||||
local _, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown)
|
||||
@@ -6445,14 +6528,20 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
_, sMyPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind)
|
||||
bMillDown = false
|
||||
end
|
||||
-- se l'utente ha definito un'elevazione custom dUserMaxElev si lavora sempre la faccia standard
|
||||
if sMyPocketing and
|
||||
( dMyTMaxDepth > dFacElev + dCollSic - 10 * GEO.EPS_SMALL or ( dMyTMaxDepth > 0.8 * dFacElev + dCollSic and not bIsU) or
|
||||
( bIsL and nUseRoughTool == 0) or
|
||||
( bIsL and Proc.Prc == 20) or
|
||||
( Proc.Prc == 25 and not bIsU and not bIsL)) or
|
||||
( dUserMaxElev and dUserMaxElev > 10 * GEO.EPS_SMALL) then
|
||||
sPocketing = sMyPocketing
|
||||
-- se è presente un'elevazione custom dCustomMaxElev si lavora sempre la faccia standard
|
||||
if sMyPocketing then
|
||||
if dUserMaxElev then
|
||||
dCustomMaxElev = dUserMaxElev
|
||||
elseif dCustomMaxElev and ( dMyTMaxDepth < dCustomMaxElev + dCollSic - 10 * GEO.EPS_SMALL) then
|
||||
dCustomMaxElev = nil
|
||||
end
|
||||
if ( dMyTMaxDepth > dFacElev + dCollSic - 10 * GEO.EPS_SMALL or ( dMyTMaxDepth > 0.8 * dFacElev + dCollSic and not bIsU) or
|
||||
( bIsL and nUseRoughTool == 0) or
|
||||
( bIsL and Proc.Prc == 20) or
|
||||
( Proc.Prc == 25 and not bIsU and not bIsL)) or
|
||||
( dCustomMaxElev and dCustomMaxElev > 10 * GEO.EPS_SMALL) then
|
||||
sPocketing = sMyPocketing
|
||||
end
|
||||
end
|
||||
if bMillDown then
|
||||
sMchFind = sMchFind ..'_H2'
|
||||
@@ -6678,7 +6767,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
dToolMaxDiam = dToolTargetDiam
|
||||
end
|
||||
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap, nil, nPhase, nRawId)
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap, nil, nPhase, nRawId, dCustomMaxElev)
|
||||
if not bOk then return false, sWarn2 end
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
@@ -6857,6 +6946,12 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
nil, nil, nil, b3Solid)
|
||||
if not bOk then return false, sWarn2 end
|
||||
end
|
||||
-- dopo aver applicato gli antischeggia ricerco la svuotatura perchè l'ottimizzazione teste deve sapere quale è la lavorazione precedente
|
||||
_, sPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind, bMillUp, bMillDown)
|
||||
if not sPocketing and bMillUp then
|
||||
_, sPocketing, dMyTMaxDepth, dMyTDiam = VerifyPocket( Proc, dDiam, dFacElev + dCollSic, dMaxTotLen, sMchFind)
|
||||
bMillDown = false
|
||||
end
|
||||
-- se smusso non esclusivo
|
||||
if nChamfer < 2 then
|
||||
-- eseguo la svuotatura della faccia principale, mi restituisce id utensile, il diametro utensile per il foro opzionale
|
||||
@@ -6894,7 +6989,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
||||
if ( Proc.Fct == 4 and bTailOnSide) and ( dDistToNextPiece > dToolDiameter + 10 * GEO.EPS_SMALL) then
|
||||
sMchFind = EgtIf( bMillDown, 'OpenPocket_H2', 'OpenPocket')
|
||||
end
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap, bLapJointAngTrasm, nPhase, nRawId)
|
||||
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap, bLapJointAngTrasm, nPhase, nRawId, dCustomMaxElev)
|
||||
if not bOk then return false, sWarn2 end
|
||||
if sWarn2 then
|
||||
if not sWarn then sWarn = '' end
|
||||
@@ -7079,11 +7174,11 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
nCapIdLeftSide = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
|
||||
if not nCapIdLeftSide then bAllWithEndCap = false end
|
||||
end
|
||||
if nFirstId then
|
||||
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
|
||||
EgtErase( nId)
|
||||
end
|
||||
end
|
||||
if nFirstId then
|
||||
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
|
||||
EgtErase( nId)
|
||||
end
|
||||
end
|
||||
end
|
||||
if i > 1 then
|
||||
-- taglio della superficie lato sinistro
|
||||
@@ -7175,7 +7270,7 @@ local function TestTwoFacesDownHead( Proc)
|
||||
end
|
||||
-- recupero le caratteristiche della feature e delle facce
|
||||
local vtRes = Proc.Face[1].VtN ^ Proc.Face[2].VtN
|
||||
Proc.IsTopDownRabbet = abs( vtRes:getZ()) > 10 * GEO.EPS_SMALL
|
||||
Proc.IsTopDownRabbet = Proc.AffectedFaces.Top and abs( vtRes:getZ()) > 10 * GEO.EPS_SMALL
|
||||
for i = 1, Proc.Fct do
|
||||
Proc.Face[i].IsTooDownwardForTopBlade = Proc.Face[i].VtN:getZ() < ( BD.CUT_VZ_MIN or -0.484) - 10 * GEO.EPS_SMALL
|
||||
Proc.Face[i].IsTooWideForTopBlade = Proc.Face[i].WidthTrimmed > dTopBladeMaxDepth
|
||||
@@ -7184,9 +7279,11 @@ local function TestTwoFacesDownHead( Proc)
|
||||
if not ( Proc.Face[1].IsTooDownwardForTopBlade or Proc.Face[2].IsTooDownwardForTopBlade) then
|
||||
bDownHeadBlade = false
|
||||
else
|
||||
if ( Proc.Face[1].IsTooDownwardForTopBlade and Proc.Face[2].IsTooWideForTopBlade) or
|
||||
( Proc.Face[2].IsTooDownwardForTopBlade and Proc.Face[1].IsTooWideForTopBlade) then
|
||||
bDownHeadBlade = true
|
||||
for i = 1, Proc.Fct do
|
||||
if Proc.Face[i].IsTooDownwardForTopBlade and ( not Proc.IsTopDownRabbet or Proc.Face[i].IsTooWideForTopBlade) then
|
||||
bDownHeadBlade = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -7443,7 +7540,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 Proc.Box:getDimX() > BD.LONGCUT_ENDLEN) or
|
||||
( Proc.Box:getDimX() > 0.7 * b3Solid:getDimX() and ( b3Solid:getDimX() > ( BD.LEN_VERY_SHORT_PART or BD.LEN_SHORT_PART))) or
|
||||
( ( nForceUseBladeOnNotContinueFace and nForceUseBladeOnNotContinueFace > 0) and ( Proc.Box:getDimX() > ( BD.LEN_SHORT_PART or 1000))) then
|
||||
-- una faccia
|
||||
if Proc.Fct == 1 then
|
||||
|
||||
@@ -1280,10 +1280,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
nFin = 1
|
||||
else
|
||||
if vtN[vOrd[1]]:getZ() >= vtN[vOrd[2]]:getZ() then
|
||||
if vtN[vOrd[2]]:getZ() < dLimitAngle then
|
||||
nFin = 1
|
||||
else
|
||||
if vtN[vOrd[1]]:getZ() < dLimitAngle then
|
||||
nIni = 2
|
||||
else
|
||||
nFin = 1
|
||||
end
|
||||
else
|
||||
if vtN[vOrd[1]]:getZ() < dLimitAngle then
|
||||
@@ -1334,7 +1334,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
nSCC = EgtIf( nSide == -1, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
||||
end
|
||||
else
|
||||
local bFromZM = (( vtN[vOrd[i]]:getZ() < 0 and bConvex) or ( vtN[vOrd[i]]:getZ() > 0 and not bConvex))
|
||||
local bFromZM = (( vtN[vOrd[i]]:getZ() < 10 * GEO.EPS_ANG_SMALL and bConvex) or ( vtN[vOrd[i]]:getZ() > - 10 * GEO.EPS_ANG_SMALL and not bConvex))
|
||||
nSCC = EgtIf( bFromZM, MCH_SCC.ADIR_ZM, MCH_SCC.ADIR_ZP)
|
||||
end
|
||||
end
|
||||
@@ -1352,7 +1352,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
if dMachDepth > dMaxDepth - 10 * GEO.EPS_ANG_SMALL then
|
||||
-- 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
|
||||
if Proc.Fct == 2 and 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
|
||||
@@ -1432,7 +1432,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
||||
end
|
||||
end
|
||||
end
|
||||
if not Proc.bMoveAfterSplit and not bEndFixed and not bConvex then
|
||||
if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left then
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
|
||||
@@ -352,6 +352,69 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
if not bModif and not bOpenBtm then
|
||||
BL.SetOpenSide( AuxId, b3Solid)
|
||||
end
|
||||
|
||||
-- recupero il raggio minimo della mortasa
|
||||
local dMaxDiam = 1000
|
||||
local nSt, nEnd = EgtCurveDomain( AuxId)
|
||||
for i = nSt, nEnd - 1 do
|
||||
local dRad = EgtCurveCompoRadius( AuxId, i)
|
||||
-- se è un raggio, setto ed esco subito. Tutti i raggi sono uguali nella mortasa
|
||||
if dRad > 0 then
|
||||
dMaxDiam = dRad * 2
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
-- caso speciale feature trimmata diversamente in/out: si ricostruisce la curva non trimmata
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error : missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- estrazione loop trimesh: se 1 contorno ha il fondo, se due contorni è passante.
|
||||
-- se passante si deve discriminare se i due contorni sono uguali (passante standard, trimmata allo stesso modo in/out) oppure se un contorno è diverso dall'altro (e quindi non è trimmata in egual modo in/out)
|
||||
-- se più di 2 contorni si rimane nel caso standard
|
||||
local idCurve1, nIdCount = EgtExtractSurfTmLoops( Proc.Id, nAddGrpId)
|
||||
if nIdCount == 2 then
|
||||
local idCurve2 = idCurve1 + 1
|
||||
local dCurveLength1 = EgtCurveLength( idCurve1)
|
||||
local dCurveLength2 = EgtCurveLength( idCurve2)
|
||||
if abs( dCurveLength1 - dCurveLength2) > 100 * GEO.EPS_SMALL then
|
||||
-- riferimento curva ausiliaria
|
||||
local frAuxId = Frame3d( EgtGP( AuxId, GDB_RT.GLOB), vtExtr)
|
||||
-- box dei due contorni nel riferimento della faccia di fondo
|
||||
local b3Curve1 = EgtGetBBoxRef( idCurve1, GDB_BB.STANDARD, frAuxId)
|
||||
local b3Curve2 = EgtGetBBoxRef( idCurve2, GDB_BB.STANDARD, frAuxId)
|
||||
-- per creare la curva non trimmata si creerà un piano di intersezione con la trimesh appena sopra al contorno più vicino a AuxId, ossia a ptOffset
|
||||
local ptOffset = b3Curve1:getMax()
|
||||
if b3Curve1:getMin():getZ() > b3Curve2:getMin():getZ() + 10 * GEO.EPS_SMALL then
|
||||
ptOffset = b3Curve2:getMax()
|
||||
end
|
||||
-- ptOffset si sposta appena sopra per garantire l'intersezione
|
||||
ptOffset = ptOffset + Vector3d( 0, 0, 100 * GEO.EPS_SMALL)
|
||||
local ptOffsetGlob = Point3d( ptOffset)
|
||||
ptOffsetGlob:toGlob( frAuxId)
|
||||
EgtErase( { idCurve1, idCurve2} )
|
||||
-- intersezione piano a ptOffset con la trimesh: si ottiene la curva originale non trimmata
|
||||
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOffsetGlob, frAuxId:getVersZ(), Proc.Id, nAddGrpId, GDB_RT.GLOB)
|
||||
if nPnt == 0 and nCrv == 1 and nSrf == 0 then
|
||||
EgtCloseCurveCompo( nFirstId)
|
||||
local vtMove = -frAuxId:getVersZ() * ptOffset:getZ()
|
||||
EgtMove( nFirstId, vtMove, GDB_RT.GLOB)
|
||||
EgtErase( AuxId)
|
||||
EgtChangeId( nFirstId, AuxId)
|
||||
else
|
||||
if nFirstId then
|
||||
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
|
||||
EgtErase( nId)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if bOpenBtm then
|
||||
-- creo superficie chiusa
|
||||
local nFlat = EgtSurfTmByFlatContour( EgtGetParent( AuxId), AuxId, 0.05)
|
||||
@@ -435,6 +498,10 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
-- determino larghezza della mortasa
|
||||
if dL < dW then dL, dW = dW, dL end
|
||||
|
||||
-- si prende il minimo tra larghezza mortasa e il raggio minimo impostato da parametro
|
||||
dMaxDiam = min( dW, dMaxDiam)
|
||||
|
||||
-- abilitazione lavorazione da sotto
|
||||
local bPockUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
|
||||
local bPockDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.174)
|
||||
@@ -513,16 +580,16 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
local sPocketing
|
||||
if Proc.Prc ~= 53 then
|
||||
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2)
|
||||
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2)
|
||||
if not sPocketing and bPockUp then
|
||||
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, _, bExcludeH2)
|
||||
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, _, bExcludeH2)
|
||||
end
|
||||
end
|
||||
if not sPocketing then
|
||||
sPockType = 'Pocket'
|
||||
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2)
|
||||
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, bPockDown, bExcludeH2)
|
||||
if not sPocketing and bPockUp then
|
||||
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, _, bExcludeH2)
|
||||
sPocketing = ProcessMortise.VerifyMortiseOrPocket( Proc, dMaxDiam, dMorH, nil, sPockType..sMchExt, _, bExcludeH2)
|
||||
end
|
||||
end
|
||||
if not sPocketing then
|
||||
@@ -543,6 +610,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
bCW = ( dSpeed >= 0)
|
||||
end
|
||||
end
|
||||
|
||||
-- inserisco la lavorazione di svuotatura
|
||||
local sName = 'Mort_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sName, sPocketing)
|
||||
@@ -562,6 +630,11 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||
end
|
||||
|
||||
-- se diametro utensile esattamente uguale a larghezza tasca, e tasca tonda, si setta un offset radiale negativo
|
||||
if Proc.Fct > 6 and abs( dMillDiam - dW) < 100 * GEO.EPS_SMALL then
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, - 50 * GEO.EPS_SMALL)
|
||||
end
|
||||
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- sistemo la direzione di lavoro
|
||||
|
||||
+24
-32
@@ -33,7 +33,6 @@ local sEnableExtraBladeUpperFace = 'Q02' -- i
|
||||
local sDepthChamferMill = 'Q03' -- d
|
||||
local sOverMaterialForFinish = 'Q04' -- d
|
||||
local sPreemptiveChamfer = 'Q05' -- i
|
||||
local bUseSmallMill = 'Q06' -- i
|
||||
|
||||
-- abilitazioni extra
|
||||
local dMakeAntiSplintOnHead = 1 -- valore impronta antischeggia, per disattivare settare = nil o = 0
|
||||
@@ -208,36 +207,31 @@ local function VerifyCham( Proc, AuxId, nRawId, bMakeVertCham, sDephtCham, sOnly
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function VerifySmallMillCanFinish( dDiamCurrentTool, dDepthProfile, nSide)
|
||||
local dToolMaxDepthSmall, dToolDiamSmall
|
||||
function VerifyOtherMillCanFinish( dDepthProfile, nSide)
|
||||
local dToolMaxDepthFinish
|
||||
-- abilitazione lavorazione da sotto
|
||||
local sMillType = 'Prof'
|
||||
local sMillingSmall, _, _, bH2Small = ML.FindMilling( sMillType, nil, nil, nil, nil, true, nil, nil, nil, 'Smallest')
|
||||
if not sMillingSmall then
|
||||
local sMillType = 'Prof_end'
|
||||
local sMillingFinish, _, _, _ = ML.FindMilling( sMillType, nil, nil, nil, nil, true, nil, nil, nil)
|
||||
if not sMillingFinish then
|
||||
return false
|
||||
end
|
||||
-- Recupero i dati dell'utensile
|
||||
if EgtMdbSetCurrMachining( sMillingSmall) then
|
||||
if EgtMdbSetCurrMachining( sMillingFinish) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid)) then
|
||||
dToolMaxDepthSmall = EgtTdbGetCurrToolMaxDepth()
|
||||
dToolDiamSmall = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
-- se non ci sono almeno 5mm di differenza si fa con utensile standard
|
||||
if dDiamCurrentTool - 5 < dToolDiamSmall then
|
||||
return false
|
||||
end
|
||||
dToolMaxDepthFinish = EgtTdbGetCurrToolMaxDepth()
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
local bDouble = ( dDepthProfile + BD.CUT_EXTRA > dToolMaxDepthSmall)
|
||||
local bDouble = ( dDepthProfile + BD.CUT_EXTRA > dToolMaxDepthFinish)
|
||||
-- se lavorazione in doppio richiesta, si verifica se richiesta testa sotto
|
||||
if bDouble and nSide == 0 then
|
||||
return false -- TODO macchine con BD.DOWN_HEAD potrebbero lavorare in doppio in questo caso!
|
||||
end
|
||||
|
||||
if not bDouble or ( dDepthProfile + BD.MILL_OVERLAP < dToolMaxDepthSmall * 2) then
|
||||
return true, sMillingSmall, bDouble
|
||||
if not bDouble or ( dDepthProfile + BD.MILL_OVERLAP < dToolMaxDepthFinish * 2) then
|
||||
return true, sMillingFinish, bDouble
|
||||
end
|
||||
return false
|
||||
end
|
||||
@@ -506,17 +500,13 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
|
||||
|
||||
local bUseSmallMillOnFinish = EgtGetInfo( Proc.Id, bUseSmallMill, 'i') == 1
|
||||
local sMillingSmall, bDoubleSmall
|
||||
-- se serve fresa più piccola per finitura
|
||||
if bUseSmallMillOnFinish then
|
||||
bUseSmallMillOnFinish, sMillingSmall, bDoubleSmall = VerifySmallMillCanFinish( dMillDiam, dProfDepth, nSide)
|
||||
end
|
||||
-- se configurata fresa di finitura
|
||||
local bUseOtherMillOnFinish, sFinishMilling, bDoubleFinishMill = VerifyOtherMillCanFinish( dProfDepth, nSide)
|
||||
|
||||
-- se il chamfer non è esclusivo continuo con le altre lavorazioni
|
||||
if nChamfer < 2 then
|
||||
-- verifico se necessario lavorare in doppio
|
||||
local bDouble = ( dProfDepth + BD.CUT_EXTRA > dToolMaxDepth)
|
||||
local bDouble = ( dProfDepth + BD.CUT_EXTRA - 100 * GEO.EPS_SMALL > dToolMaxDepth)
|
||||
local dDepth = min( dToolMaxDepth, dProfDepth / 2 + BD.MILL_OVERLAP)
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
local sMillingDown
|
||||
@@ -608,7 +598,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
nMchId = nMch2Id
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish and not bUseSmallMillOnFinish then
|
||||
if bFinish and not bUseOtherMillOnFinish then
|
||||
-- inserisco la lavorazione
|
||||
local sNewName = 'ProfB_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
|
||||
@@ -723,7 +713,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
nMchId = nMch2Id
|
||||
end
|
||||
-- se abilitata, aggiungo lavorazione di finitura
|
||||
if bFinish and not bUseSmallMillOnFinish then
|
||||
if bFinish and not bUseOtherMillOnFinish then
|
||||
-- inserisco la lavorazione
|
||||
local sNewName = 'Prof_Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
|
||||
@@ -780,12 +770,12 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
end
|
||||
-- se finitura con fresa piccola
|
||||
if bFinish and bUseSmallMillOnFinish then
|
||||
local sDepthSmall = EgtIf( bDoubleSmall, ( dProfDepth+ BD.MILL_OVERLAP ) / 2, dProfDepth + BD.CUT_EXTRA)
|
||||
if bFinish and bUseOtherMillOnFinish then
|
||||
local sDepthFinishMill = EgtIf( bDoubleFinishMill, ( dProfDepth+ BD.MILL_OVERLAP ) / 2, dProfDepth + BD.CUT_EXTRA)
|
||||
local sMachName = 'Fin_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
nMchId = EgtAddMachining( sMachName, sMillingSmall)
|
||||
nMchId = EgtAddMachining( sMachName, sFinishMilling)
|
||||
if not nMchId then
|
||||
local sErr = 'Error adding machining ' .. sMachName .. '-' .. sMillingSmall
|
||||
local sErr = 'Error adding machining ' .. sMachName .. '-' .. sFinishMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
@@ -793,7 +783,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
|
||||
-- imposto l'affondamento
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, sDepthSmall)
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, sDepthFinishMill)
|
||||
-- posizione braccio porta testa
|
||||
EgtSetMachiningParam( MCH_MP.SCC, EgtIf( bHead, MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM))
|
||||
-- eseguo
|
||||
@@ -803,11 +793,13 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
if bDoubleSmall then
|
||||
if bDoubleFinishMill then
|
||||
local sNewName = 'FinB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
|
||||
-- ottengo l'inversione e setto il contrario
|
||||
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode)
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
|
||||
@@ -453,7 +453,7 @@ function ProcessProfConcave.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
end
|
||||
-- verifico se necessario lavorare in doppio
|
||||
local bDouble = ( dProfDepth + BD.CUT_EXTRA > dToolMaxDepth)
|
||||
local bDouble = ( dProfDepth + BD.CUT_EXTRA - 100 * GEO.EPS_SMALL > dToolMaxDepth)
|
||||
local dDepth = min( dToolMaxDepth, dProfDepth / 2 + BD.MILL_OVERLAP)
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
local sMillingDown
|
||||
|
||||
@@ -453,7 +453,7 @@ function ProcessProfConvex.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||
end
|
||||
end
|
||||
-- verifico se necessario lavorare in doppio
|
||||
local bDouble = ( dProfDepth + BD.CUT_EXTRA > dToolMaxDepth)
|
||||
local bDouble = ( dProfDepth + BD.CUT_EXTRA - 100 * GEO.EPS_SMALL > dToolMaxDepth)
|
||||
local dDepth = min( dToolMaxDepth, dProfDepth / 2 + BD.MILL_OVERLAP)
|
||||
-- se lavorazione da due parti, aggiungo la seconda
|
||||
local sMillingDown
|
||||
|
||||
@@ -176,15 +176,15 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
local vtRef2 = Vector3d( vtN[vFaceOrd[2]])
|
||||
-- eseguo
|
||||
for i = 1, #vCuts do
|
||||
local nOrthoOpposite
|
||||
local vtOrtho
|
||||
if i % 2 == 1 then
|
||||
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
|
||||
vtOrtho = vtRef
|
||||
else
|
||||
nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef2)
|
||||
vtOrtho = vtRef2
|
||||
end
|
||||
-- lavoro la faccia
|
||||
for j = 1, #vCuts[i] do
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrtho, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||
if not bOk then
|
||||
return bOk, sErr
|
||||
end
|
||||
|
||||
+131
-1
@@ -167,6 +167,99 @@ local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmTail)
|
||||
return true, nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- smussi in coda
|
||||
local function MakeTailChamfer( idProc, nPartId, dDepthTailChamfer)
|
||||
-- recupero gruppo per geometria aggiuntiva
|
||||
local AddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not AddGrpId then
|
||||
local sErr = 'Error on process StartFace impossible to find AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- recupero la lavorazione
|
||||
local sMilling = ML.FindMilling( 'Mark')
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( idProc, 0, AddGrpId)
|
||||
if not nLoopId or nLoopCnt > 1 then
|
||||
local sErr = 'Error MakeHeadChamfer : too many loops'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
-- setto direzione estrusione corretta
|
||||
EgtModifyCurveExtrusion( nLoopId, -X_AX())
|
||||
EgtSetGridFrame( Frame3d( 0,0,0, GDB_FR.LEFT))
|
||||
|
||||
local dQ09Value = EgtGetInfo( idProc, 'Q09', 'd')
|
||||
local bChamferedEdge = dQ09Value > 0
|
||||
|
||||
local nIdFirstEntity, nEntityCnt = EgtExplodeCurveCompo( nLoopId)
|
||||
local p3MidPoint = EgtMP( nIdFirstEntity, GDB_ID.GRID)
|
||||
|
||||
for i = 0, nEntityCnt - 1 do
|
||||
if EgtCurveLength( nIdFirstEntity + i) - 10 < abs( dQ09Value) * 2 then
|
||||
local sErr = 'Error MakeTailChamfer : Q09 too high'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
|
||||
-- creo raccordo o fillet
|
||||
for i = 0, nEntityCnt - 1 do
|
||||
local idFirst = nIdFirstEntity + i
|
||||
local idSecond = EgtIf( i == nEntityCnt - 1, nIdFirstEntity, idFirst + 1)
|
||||
local ptEndPointFirst = EgtEP( idFirst, GDB_ID.GRID) - ( abs( dQ09Value) * EgtEV( idFirst, GDB_ID.GRID))
|
||||
local ptStartPointSecond = EgtSP( idSecond, GDB_ID.GRID) + ( abs( dQ09Value) * EgtEV( idSecond, GDB_ID.GRID))
|
||||
|
||||
if bChamferedEdge then
|
||||
EgtCurveChamfer( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID)
|
||||
else
|
||||
EgtCurveFillet( AddGrpId, idFirst, ptEndPointFirst, idSecond, ptStartPointSecond, abs( dQ09Value), true, GDB_RT.GRID)
|
||||
end
|
||||
end
|
||||
|
||||
EgtSelectPathObjs( nIdFirstEntity, true)
|
||||
local idGeom, idGeomCnt = EgtCurveCompoByChain( AddGrpId, GDB_ID.SEL, {0,0,0}, true)
|
||||
if not idGeom or idGeomCnt > 1 then
|
||||
local sErr = 'Error MakeTailChamfer : too many loops'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
EgtChangeClosedCurveStartPoint( idGeom, p3MidPoint, GDB_RT.GRID)
|
||||
|
||||
-- Inserisco la lavorazione del lato standard
|
||||
local dExtra = 2
|
||||
local sName1 = 'TailCham_' .. ( EgtGetName( idProc) or tostring( idProc))
|
||||
local nMch1Id = EgtAddMachining( sName1, sMilling)
|
||||
if not nMch1Id then
|
||||
local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ idGeom, -1}})
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthTailChamfer + dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
-- assegno lato di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- eseguo
|
||||
if not ML.ApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMch1Id, false)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
return true, nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- lavorazione con sega a catena per sezioni alte e larghe
|
||||
local function MakeCutByChainSaw( nSurfId, sSawing, nFaceUse, dDepth, sNotes, dRadialOffset, bExtendStartEnd, bInvert)
|
||||
@@ -662,7 +755,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
local dMinTailScrapForAdditionalCuts = 10.123
|
||||
local bNeedVerticalAddedCuts = not bSplit and ( Proc.Face[1].WidthTrimmed > BD.MAX_LEN_DICE) and ( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL)
|
||||
local bNeedHorizontalAddedCuts = not bSplit and not bBigSectionCut and
|
||||
( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE)) and
|
||||
( Proc.Face[1].HeightTrimmed > ( BD.MIN_HEIGHT_ADDED_CUTS or BD.MAX_LEN_DICE) + 100 * GEO.EPS_SMALL) and
|
||||
( dLenEndRaw > dMinTailScrapForAdditionalCuts - 10 * GEO.EPS_SMALL) and
|
||||
dOffsL < BD.MAX_DIM_DICE
|
||||
-- dati lavorazioni sopra e sotto
|
||||
@@ -819,6 +912,43 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
||||
|
||||
local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, TailCutType, Cutting1Data, Cutting2Data, nil, dLenEndRaw)
|
||||
|
||||
-- se smussi in coda da aggiungere
|
||||
local dDepthTailChamfer = EgtGetInfo( nOriId or Proc.Id, 'Q08', 'd') or 0
|
||||
if dDepthTailChamfer > 100 * GEO.EPS_SMALL then
|
||||
-- creo subito nuova fase qui, a meno che non sia stata già creata
|
||||
if nNewPhase == 0 then
|
||||
BL.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, BD.RAW_OFFSET)
|
||||
nNewPhase = EgtGetCurrPhase()
|
||||
local nDispId = EgtGetPhaseDisposition( nNewPhase)
|
||||
if sDownOrSideOrStd == 'down' then
|
||||
EgtRotateRawPart( nRawId, X_AX(), 180)
|
||||
EgtSetInfo( nDispId, 'TYPE', 'MID2')
|
||||
EgtSetInfo( nDispId, 'ROT', -2)
|
||||
elseif sDownOrSideOrStd == 'side' then
|
||||
if bPreMove then EgtMoveRawPart( nRawId, vtMove) end
|
||||
EgtRotateRawPart( nRawId, X_AX(), EgtIf( BD.RIGHT_LOAD, -90, 90))
|
||||
if not bPreMove then EgtMoveRawPart( nRawId, vtMove) end
|
||||
EgtSetInfo( nDispId, 'TYPE', 'MID2')
|
||||
EgtSetInfo( nDispId, 'ROT', -1)
|
||||
else
|
||||
EgtSetInfo( nDispId, 'TYPE', 'END')
|
||||
end
|
||||
EgtSetInfo( nDispId, 'ORD', nOrd)
|
||||
-- se grezzo successivo senza pezzi e finale, va tolto
|
||||
local nNextRawId = EgtGetNextRawPart( nRawId)
|
||||
if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then
|
||||
EgtRemoveRawPartFromCurrPhase( nNextRawId)
|
||||
end
|
||||
end
|
||||
-- alla fine del taglio si aggiungono gli smussi in testa
|
||||
local _, sErrHeadChamfer = MakeTailChamfer( nOriId or Proc.Id, nPartId, dDepthTailChamfer)
|
||||
if sErr then
|
||||
sErr = sErr..'\n'..sErrHeadChamfer
|
||||
else
|
||||
sErr = sErrHeadChamfer
|
||||
end
|
||||
end
|
||||
|
||||
return bOk, sErr, nNewPhase
|
||||
end
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ local Fbs = require( 'FacesBySaw')
|
||||
local DC = require( 'DiceCut')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local Topology = require( 'FeatureTopology')
|
||||
local LapJoint = require( 'ProcessLapJoint')
|
||||
|
||||
EgtOutLog( ' ProcessStepJointNotch started', 1)
|
||||
|
||||
@@ -49,7 +50,7 @@ function ProcessStepJointNotch.Classify( Proc)
|
||||
-- numero delle facce
|
||||
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
|
||||
-- gestisco solo 2 o 4 facce
|
||||
if nFacetCnt ~= 2 and nFacetCnt ~= 4 and nFacetCnt ~= 6 and nFacetCnt ~= 8 then
|
||||
if nFacetCnt ~= 2 and nFacetCnt ~= 3 and nFacetCnt ~= 4 and nFacetCnt ~= 6 and nFacetCnt ~= 8 then
|
||||
return false, false
|
||||
end
|
||||
-- verifico le normali delle facce
|
||||
@@ -583,6 +584,9 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessStepJointNotch.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if Proc.Fct == 3 then
|
||||
return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
end
|
||||
-- esecuzione eventuale smusso
|
||||
-- ottengo anche il flag che indica che la feature è larga come la trave
|
||||
local bOkc, sErrC, nDiffWidth = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
|
||||
+69
-3
@@ -1,12 +1,78 @@
|
||||
==== Beam Update Log ====
|
||||
|
||||
Versione 2.7k1 (25/11/2024)
|
||||
- Added : in tagli di testa e coda aggiunti smussi con possibilità di raccordare o smussare spigoli
|
||||
- Added : in Lapjoint aggiunto Q14 per settare lavorazione discorde se longitudinale su faccia sotto
|
||||
- Modif : migliorati i tagli
|
||||
- Modif : migliorata lavorazione mortasa a coda di rondine
|
||||
- Fixed : in Lapjoint alcune svuotature forzate a spirale
|
||||
|
||||
Versione 2.7j2 (30/10/2025)
|
||||
- Fixed : in DoubleCut gestito il caso in cui si ha una terza faccia piccola da non lavorare
|
||||
|
||||
Versione 2.7j1 (28/10/2025)
|
||||
- Modif : migliorato ordinamento feature
|
||||
- Modif : in mortasa si considera ora il raggio minimo impostato da parametro P
|
||||
- Modif : migliorie in tenone a coda di rondine
|
||||
- Fixed : in mortasa corretto percorso errato in caso di diametro utensile uguale a larghezza tasca
|
||||
- Fixed : in profilo cambered (103) gestito correttamente inverti in lavorazione
|
||||
|
||||
Versione 2.7i2 (30/09/2025)
|
||||
- Modif : migliorie a mortasa e tenone a coda di rondine
|
||||
- Modif : migliorie a LongDoubleCut
|
||||
- Modif : migliorie ai tagli
|
||||
|
||||
Versione 2.7i1 (03/09/2025)
|
||||
- Added : in Tenone a coda di rondine aggiunto passaggio di finitura in caso di P14 > 0
|
||||
- Modif : in LapJoint migliorata la scelta lama in caso di due facce e altre piccole correzioni
|
||||
|
||||
Versione 2.7h3 (26/08/2025)
|
||||
- Added : in LapJoint, se possibile, si ricalcola l'elevazione in caso di feature troncanti testa/coda
|
||||
- Modif : eventuali feature troncanti testa/coda sono fatte sempre subito dopo i rispettivi tagli di testa/coda
|
||||
|
||||
Versione 2.7h2 (19/08/2025)
|
||||
- Modif : migliorata ottimizzazione teste
|
||||
- Modif : migliorate forature in doppio
|
||||
- Modif : in LapJoint migliorate lavorazioni lama + sega a catena
|
||||
- Modif : in LapJoint migliorata spezzatura per feature lunghe rispetto al pezzo
|
||||
- Modif : in LapJoint tipo BirdsMouth migliorata lavorazione faccia inclinata
|
||||
- Modif : in StepJointNotch, se 3 facce si riconduce a LapJoint
|
||||
|
||||
Versione 2.7h1 (05/08/2025)
|
||||
- Fixed : in Mortise migliorata la lavorazione in caso di feature trimmata
|
||||
- Modif : in LapJoint, riduzione massimo materiale lama per lavorazioni antischeggia di lama con direzione verticale
|
||||
- Modif : in LapJoint migliorie alla lavorazione tipo BlockHaus
|
||||
- Modif : nei profili si usa il tipo lavorazione Prof_end per la finitura
|
||||
|
||||
Versione 2.7g5 (14/07/2025)
|
||||
- Fixed : in tagli di testa e coda corretti attacchi
|
||||
|
||||
Versione 2.7g4 (11/07/2025)
|
||||
- Fixed : in LapJoint 2 facce correzione nella scelta lama da sotto
|
||||
|
||||
Versione 2.7g3 (11/07/2025)
|
||||
- Fixed : in RidgeLap corretta scelta del lato da lavorare
|
||||
|
||||
Versione 2.7g2 (10/07/2025)
|
||||
- Fixed : in LapJoint correzione per caso in cui la sega a catena lavorava la tasca in modo errato
|
||||
|
||||
Versione 2.7g1 (08/07/2025)
|
||||
- Added : in LapJoint, aggiunti smussi anche se lavorazione con truciolatore
|
||||
- Added : per profilo caudato aggiunta finitura con fresa piccola
|
||||
- Added : gestione tastatura
|
||||
- Modif : nei tagli di testa e coda, compresi quelli di spezzatura, la lama evita di arretrare se non necessario
|
||||
- Modif : in LongDoubleCut migliorie varie
|
||||
- Modif : in RidgeLap migliorie varie
|
||||
- Modif : nelle forature che attraversano un taglio ora si considera la profondità già lavorata
|
||||
- Fixed : in LongDoubleCut corretta lavorazione aggiunta erroneamente dopo separazione
|
||||
|
||||
Versione 2.7f3 (19/06/2025)
|
||||
- Modifx : in StepJointNotch corretta distanza attacco in/out
|
||||
- Modif : in StepJointNotch corretta distanza attacco in/out
|
||||
|
||||
Versione 2.7f2 (18/06/2025)
|
||||
- Modif : in LongDoubleCut aggiunto messaggio feature non completa se utensile non arriva sul fondo
|
||||
- Modif : in StepJointNotch, se si forza truciolatore, si prende utensile più grande
|
||||
- Fixed : in LapJoint, piccola correzione calcolo sovrapposizione trimesh per smuotatura
|
||||
- Fixed : in LapJoint, piccola correzione calcolo sovrapposizione trimesh per svuotatura
|
||||
- Fixed : in LapJoint, per sovrapposizione in spezzatura, corretto caso tipo Tunnel
|
||||
|
||||
Versione 2.7f1 (03/06/2025)
|
||||
@@ -20,10 +86,10 @@ Versione 2.7e2 (23/05/2025)
|
||||
- Fixed : in Scarf Joint correzione alla scelta faccia da lavorare
|
||||
|
||||
Versione 2.7e1 (05/05/2025)
|
||||
- Modif : in LapJoint se tunnel verticale lavorato solo da sopra e l'utensile non arriva, si restituisce warning
|
||||
- Fixed : in taglio di separazione si riduce percorso di taglio solo se il pezzo è effettivamente alto
|
||||
- Fixed : in foratura corretto caso in cui non si sceglieva l'utensile più lungo disponibile
|
||||
- Fixed : In BatchProcess (Ts7) corretta generazione in caso di progetto senza ricalcolo
|
||||
- Modif : in LapJoint se tunnel verticale lavorato solo da sopra e l'utensile non arriva, si restituisce warning
|
||||
|
||||
Versione 2.7d3 (22/04/2025)
|
||||
- Fixed : in LapJoint corretta gestione errata Q04
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '2.7f3'
|
||||
VERSION = '2.7k1'
|
||||
MIN_EXE = '2.7f2'
|
||||
|
||||
Reference in New Issue
Block a user