Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a21d93cc6b | |||
| 89f553a49f | |||
| 577362c6d2 | |||
| de14fb91ce | |||
| 564de1d22d | |||
| 2051a327a5 | |||
| 4237f50b5f | |||
| c01fa1f08a | |||
| a0bd97e7aa |
@@ -13,6 +13,7 @@
|
||||
-- 2022/08/05 Aggiunta segnalazione aree vietate non gestite.
|
||||
-- 2022/08/29 Corretta gestione tipo Pocket senza fondo (sono lavorabili da entrambe le parti con fresatura).
|
||||
-- 2022/12/13 Aggiunta la funzione Is3EdgesApprox per riconoscere come 3 lati anche facce con lati aggiuntivi molto corti (<15 mm)
|
||||
-- 2022/12/14 Aggiunto l'accorciamento della lama in caso di facce vicine orientate verso il basso
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPF = {}
|
||||
@@ -1281,13 +1282,19 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
||||
dMaxDepth = EgtIf( WD.MILL_MAX_DEPTH_AS_MAT, EgtTdbGetCurrToolParam( MCH_TP.MAXMAT), dFreeLen) or dMaxDepth
|
||||
end
|
||||
end
|
||||
-- verifico se la facce hanno alcuni lati molto corti e possono quindi essere approssimate a 3 lati
|
||||
for currentFace = 1, #vFace do
|
||||
if Is3EdgesApprox( Proc, vFace[currentFace].Fac, nAddGrpId) then
|
||||
vFace[currentFace].Is3EdgesApprox = true
|
||||
end
|
||||
end
|
||||
-- verifico se ciclo chiuso
|
||||
local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
|
||||
-- ciclo di inserimento delle fresate sulle facce del contorno in esame
|
||||
local i = 1
|
||||
-- se faccia finale con fine non lavorato, forzo partenza da prima faccia non tutta saltata (tipo 4)
|
||||
if bClosed and ( ( vFace[#vFace].Type == 4 and vFace[#vFace].Edges > 3) or ( vFace[#vFace].Type & 2) ~= 0) then
|
||||
while i <= #vFace and vFace[i].Type == 4 and vFace[i].Edges > 3 and abs( vFace[i].SideAng) < 0.1 do
|
||||
if bClosed and ( ( vFace[#vFace].Type == 4 and ( vFace[#vFace].Edges > 3 and not vFace[#vFace].Is3EdgesApprox)) or ( vFace[#vFace].Type & 2) ~= 0) then
|
||||
while i <= #vFace and vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox) and abs( vFace[i].SideAng) < 0.1 do
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
@@ -1350,6 +1357,10 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
||||
end
|
||||
end
|
||||
local dEal = vFace[i].Whisk - vFace[i].Len
|
||||
-- se faccia precedente inclinata verso il basso prolungo il finale per adeguarmi all percorso della lama
|
||||
if j and vFace[j].Norm:getZ() < -0.017 then
|
||||
dEal = dEal - vFace[j].Width * vFace[j].Norm:getZ()
|
||||
end
|
||||
-- se angolo interno prima e faccia precedente inclinata verso l'alto oltre 16.1deg
|
||||
if vFace[i].PrevAng < -30 and j and vFace[j].Norm:getZ() < 0.96078 and vFace[j].Norm:getZ() > 0 then
|
||||
dEal = dEal + vFace[j].Width * vFace[j].Norm:getZ()
|
||||
@@ -1386,10 +1397,8 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
||||
return 0, sErr
|
||||
end
|
||||
end
|
||||
-- verifico se la faccia ha alcuni lati molto corti e può essere approssimata ad una 3 lati
|
||||
local bIs3EdgesApprox = Is3EdgesApprox( Proc, vFace[i].Fac, nAddGrpId)
|
||||
-- se tutta la faccia o la sua fine senza taglio, inserisco una fresatura
|
||||
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not bIs3EdgesApprox)) then
|
||||
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox)) then
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
||||
local nMchId = EgtAddMachining( sName, sMilling)
|
||||
@@ -1430,7 +1439,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
||||
local LastJ
|
||||
i = i + 1
|
||||
local j = EgtIf( i <= #vFace, i, EgtIf( bAllType4 or not bClosed, nil, 1))
|
||||
while j and ( ( vFace[j].Type & 1) ~= 0 or ( vFace[j].Type == 4 and vFace[j].Edges > 3)) and abs( vFace[j].SideAng) < 0.1 and abs( vFace[OrigI].SideAng) < 0.1 do
|
||||
while j and ( ( vFace[j].Type & 1) ~= 0 or ( vFace[j].Type == 4 and ( vFace[j].Edges > 3 and not vFace[j].Is3EdgesApprox))) and abs( vFace[j].SideAng) < 0.1 and abs( vFace[OrigI].SideAng) < 0.1 do
|
||||
table.insert( vGeom, { Proc.Id, vFace[j].Fac})
|
||||
LastJ = j
|
||||
dEal = EgtIf( ( vFace[j].Type & 1) ~= 0, vFace[j].Whisk - vFace[j].Len, 0)
|
||||
@@ -1441,13 +1450,13 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
||||
j = EgtIf( j + 1 <= #vFace, j + 1, EgtIf( bAllType4 or not bClosed, nil, 1))
|
||||
end
|
||||
-- se faccia singola è da fare tutta senza oltrepassare estremi
|
||||
if #vFace == 1 and vFace[OrigI].Type == 4 and vFace[OrigI].Edges > 3 then
|
||||
if #vFace == 1 and vFace[OrigI].Type == 4 and ( vFace[OrigI].Edges > 3 and not vFace[OrigI].Is3EdgesApprox) then
|
||||
dSal = -dMillDiam / 2
|
||||
dEal = -dMillDiam / 2
|
||||
-- altrimenti va verificato
|
||||
else
|
||||
-- se lavorazione completa su faccia iniziale
|
||||
if vFace[OrigI].Type == 4 and vFace[OrigI].Edges > 3 then
|
||||
if vFace[OrigI].Type == 4 and ( vFace[OrigI].Edges > 3 and not vFace[OrigI].Is3EdgesApprox) then
|
||||
-- se angolo interno prima
|
||||
if vFace[OrigI].PrevAng < -30 then
|
||||
local dSinA = -sin( vFace[OrigI].PlPrevAng + 90)
|
||||
@@ -1468,7 +1477,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
||||
-- se lavorazione completa o finale su faccia finale
|
||||
local LastFace = ( LastJ or OrigI)
|
||||
local OrigK = EgtIf( LastFace < #vFace, LastFace + 1, EgtIf( bClosed, 1, nil))
|
||||
if ( vFace[LastFace].Type == 4 and vFace[LastFace].Edges > 3) or ( LastFace == OrigI and ( vFace[LastFace].Type & 2) ~= 0) then
|
||||
if ( vFace[LastFace].Type == 4 and ( vFace[LastFace].Edges > 3 and not vFace[LastFace].Is3EdgesApprox)) or ( LastFace == OrigI and ( vFace[LastFace].Type & 2) ~= 0) then
|
||||
-- se angolo interno dopo
|
||||
if OrigK and vFace[OrigK].PrevAng < -30 then
|
||||
local dSinA = -sin( vFace[OrigK].PlPrevAng + 90)
|
||||
@@ -1730,7 +1739,7 @@ local function AddSawings( sSawing, vFace, Proc, nRawId, b3Raw)
|
||||
end
|
||||
end
|
||||
-- se fine faccia non tagliato completamente o faccia non tagliata completamente e abbastanza lunga, inserisco un ripasso con sega a catena
|
||||
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and vFace[i].Edges > 3 and vFace[i].Len > dSawDiam + 1) then
|
||||
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and ( vFace[i].Edges > 3 and not vFace[i].Is3EdgesApprox) and vFace[i].Len > dSawDiam + 1) then
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
||||
local nMchId = EgtAddMachining( sName, sSawing)
|
||||
@@ -1791,6 +1800,8 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
||||
-- verifico se ciclo chiuso
|
||||
local bClosed = ( abs( vFace[1].PrevAng) > 0.1)
|
||||
-- ciclo di inserimento dei tagli sulle facce del contorno in esame
|
||||
for i = 1, #vFace do
|
||||
-- verifico se faccia da saltare, perchè macchina travi e faccia su bordo longitudinale esterno già finito
|
||||
@@ -1799,6 +1810,8 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
||||
if not bToSkip and vFace[i].Type ~= 4 then
|
||||
-- indice del successivo
|
||||
local j = EgtIf( i < #vFace, i + 1, 1)
|
||||
-- indice del precedente
|
||||
local h = EgtIf( i > 1, i - 1, EgtIf( bClosed, #vFace, nil))
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Cut_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId)) .. '_' .. tostring( i)
|
||||
local nMchId = EgtAddMachining( sName, sCutting)
|
||||
@@ -1842,7 +1855,14 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, nLeadIn)
|
||||
local dSal = 0
|
||||
if ( not bInvert and vFace[i].PrevAng < -0.1) or ( bInvert and vFace[j].PrevAng < -0.1) then
|
||||
dSal = -WHISK_SAFE
|
||||
-- se faccia precedente inclinata verso il basso
|
||||
if not bInvert and h and vFace[h].Norm:getZ() < -0.017 then
|
||||
dSal = vFace[h].Width * vFace[h].Norm:getZ() - WHISK_SAFE
|
||||
elseif bInvert and j and vFace[j].Norm:getZ() < -0.017 then
|
||||
dSal = vFace[j].Width * vFace[j].Norm:getZ() - WHISK_SAFE
|
||||
else
|
||||
dSal = -WHISK_SAFE
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)
|
||||
-- assegno i dati di uscita (sicurezza solo se angolo interno)
|
||||
@@ -1853,7 +1873,14 @@ local function AddCuts( sCutting, vFace, Proc, nRawId, b3Raw, dSawThick)
|
||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, nLeadOut)
|
||||
local dEal = 0
|
||||
if ( not bInvert and vFace[j].PrevAng < -0.1) or ( bInvert and vFace[i].PrevAng < -0.1) then
|
||||
dEal = -WHISK_SAFE
|
||||
-- se faccia precedente inclinata verso il basso
|
||||
if not bInvert and j and vFace[j].Norm:getZ() < -0.017 then
|
||||
dEal = vFace[j].Width * vFace[j].Norm:getZ() - WHISK_SAFE
|
||||
elseif bInvert and h and vFace[h].Norm:getZ() < -0.017 then
|
||||
dEal = vFace[h].Width * vFace[h].Norm:getZ() - WHISK_SAFE
|
||||
else
|
||||
dEal = -WHISK_SAFE
|
||||
end
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dEal)
|
||||
-- posizione braccio porta testa
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- WProcessLapJoint.lua by Egaltech s.r.l. 2022/11/15
|
||||
-- WProcessLapJoint.lua by Egaltech s.r.l. 2022/12/22
|
||||
-- Gestione calcolo mezzo-legno per Pareti
|
||||
-- 2021/08/27 DS Se tre o più facce con flag PCKT=1 forzo svuotatura con fresa (per Variant).
|
||||
-- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli.
|
||||
@@ -10,8 +10,10 @@
|
||||
-- 2022/02/03 DS Gorge larga come gambo più sicurezza.
|
||||
-- 2022/02/04 DS In svuotatura aggiunta gestione WD.MAXDIAM_POCK_CORNER in presenza di almeno un angolo interno.
|
||||
-- 2022/09/30 In MakeSideGrooveByMill sistemato il calcolo del massimo sottosquadro dell'utensile per determinare la fattibilità della tasca.
|
||||
-- 2022/10/05 In MakeSideGrooveByMill implementata l'inversione dello step se la tasca guarda verso il basso
|
||||
-- 2022/11/15 DS Con lama massima inclinazione 60deg.
|
||||
-- 2022/12/01 Per 2 facce con angolo > 90° implementata lavorazione principale verticale. Se da sopra, aggiunta ripresa del lato inclinato.
|
||||
-- 2022/12/14 Nel caso di 2 facce piccola correzione al modo di ordinare le facce.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPL = {}
|
||||
@@ -1803,6 +1805,12 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
end
|
||||
end
|
||||
|
||||
-- se la groove è rivolta verso il basso (-85°) lavoro a salire con step negativo
|
||||
local bUpwardMilling = false
|
||||
if Proc.Fct == 2 and vtN2:getZ() < -0.996 then
|
||||
bUpwardMilling = true
|
||||
end
|
||||
|
||||
local dStepOri
|
||||
if not bExcludeSideMill then
|
||||
-- inserisco la lavorazione di ribasso o gola
|
||||
@@ -1843,6 +1851,9 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat)
|
||||
end
|
||||
end
|
||||
if bUpwardMilling then
|
||||
dStep = -dStep
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STEP, dStep)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';')
|
||||
-- setto il lato di lavoro standard
|
||||
@@ -1955,6 +1966,9 @@ local function MakeSideGrooveByMill( Proc, nFacet, nRawId, b3Raw, sCustomMach, d
|
||||
dMaxElev = max( ( nStepOtherFace + 1) * dStepOtherFace - GEO.EPS_SMALL, 0)
|
||||
dDepthOtherFace = dElevOtherFacet
|
||||
end
|
||||
if bUpwardMilling then
|
||||
dStepOtherFace = -dStepOtherFace
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.STEP, dStepOtherFace)
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, 'MaxElev=' .. EgtNumToString( dMaxElev, 3) .. ';')
|
||||
if bMachFromDn then
|
||||
@@ -2233,7 +2247,8 @@ local function MakeTwoFaces( Proc, nRawId, b3Raw)
|
||||
-- se equivalente ad un contorno
|
||||
if abs( ptP1:getZ() - ptP2:getZ()) > 0.9 * b3Raw:getDimZ() then
|
||||
-- verifico ordinamento (esterno a destra)
|
||||
if ( vtN[1] ^ ( ptP1 - ptC[1])) * Z_AX() < 0 then
|
||||
local ptPM = ( ptP1 + ptP2) / 2
|
||||
if ( vtN[1] ^ ( ptPM - ptC[1])) * Z_AX() < 0 then
|
||||
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
|
||||
end
|
||||
-- applico lavorazione di contorno libero
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
-- WProcessMark.lua by Egaltech s.r.l. 2021/04/20
|
||||
-- Gestione calcolo marcatura per Pareti
|
||||
-- 2023/01/05 Permesse le marcature laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPMK = {}
|
||||
@@ -33,8 +34,13 @@ function WPMK.Classify( Proc, b3Raw)
|
||||
if not vtN then
|
||||
return false
|
||||
end
|
||||
-- verifico se la marcatura è lavorabile (solo da sopra)
|
||||
return ( vtN:getZ() > WD.NZ_MINA)
|
||||
-- verifico se la marcatura è lavorabile (solo da sopra o dal lato se con offset Z)
|
||||
local dMinZRaw = b3Raw:getMin():getZ()
|
||||
local b3Tab = EgtGetTableArea()
|
||||
local dMaxZTable = b3Tab:getMax():getZ()
|
||||
local dDeltaZ = dMinZRaw - dMaxZTable
|
||||
local MIN_Z_OFFSET = 100
|
||||
return EgtIf( dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL, vtN:getZ() > WD.NZ_MINA, vtN:getZ() > -0.1)
|
||||
end
|
||||
|
||||
----------------------------------------------------------------------
|
||||
@@ -79,11 +85,18 @@ function WPMK.Make( Proc, nRawId, b3Raw)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- verifico che la marcatura non sia orientata verso il basso
|
||||
if vtExtr:getZ() < WD.NZ_MINA then
|
||||
local sErr = 'Error : Mark from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
-- verifico se la marcatura è lavorabile (solo da sopra o dal lato se con offset Z)
|
||||
local dMinZRaw = b3Raw:getMin():getZ()
|
||||
local b3Tab = EgtGetTableArea()
|
||||
local dMaxZTable = b3Tab:getMax():getZ()
|
||||
local dDeltaZ = dMinZRaw - dMaxZTable
|
||||
local MIN_Z_OFFSET = 100
|
||||
if vtExtr:getZ() < WD.NZ_MINA then
|
||||
if dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL or vtExtr:getZ() <= -0.1 then
|
||||
local sErr = 'Error : Mark from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sMilling = WM.FindMilling( 'Text')
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
-- WProcessMortise.lua by Egaltech s.r.l. 2021/07/30
|
||||
-- Gestione calcolo mortase per Pareti
|
||||
-- 2023/01/05 Permesse le mortase laterali in presenza di offset Z, tra grezzo e tavola, di almeno 100 mm
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPM = {}
|
||||
@@ -45,8 +46,13 @@ function WPM.Classify( Proc, b3Raw)
|
||||
return true
|
||||
-- altrimenti è chiusa
|
||||
else
|
||||
-- verifico se la mortasa è lavorabile da sopra
|
||||
return ( vtN:getZ() > WD.NZ_MINA)
|
||||
-- verifico se la mortasa è lavorabile da sopra o dal lato se con offset Z
|
||||
local dMinZRaw = b3Raw:getMin():getZ()
|
||||
local b3Tab = EgtGetTableArea()
|
||||
local dMaxZTable = b3Tab:getMax():getZ()
|
||||
local dDeltaZ = dMinZRaw - dMaxZTable
|
||||
local MIN_Z_OFFSET = 100
|
||||
return EgtIf( dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL, vtN:getZ() > WD.NZ_MINA, vtN:getZ() > -0.1)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -182,11 +188,18 @@ function WPM.Make( Proc, nRawId, b3Raw)
|
||||
local bForceOneSide
|
||||
local bRevertSide
|
||||
if bClosedBtm then
|
||||
-- verifico che la mortasa non sia orientata verso il basso (limite -5 deg)
|
||||
if vtN:getZ() < WD.NZ_MINA then
|
||||
local sErr = 'Error : Mortise from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
-- verifico se la mortasa è lavorabile da sopra o dal lato se con offset Z
|
||||
local dMinZRaw = b3Raw:getMin():getZ()
|
||||
local b3Tab = EgtGetTableArea()
|
||||
local dMaxZTable = b3Tab:getMax():getZ()
|
||||
local dDeltaZ = dMinZRaw - dMaxZTable
|
||||
local MIN_Z_OFFSET = 100
|
||||
if vtExtr:getZ() < WD.NZ_MINA then
|
||||
if dDeltaZ < MIN_Z_OFFSET - GEO.EPS_SMALL or vtExtr:getZ() <= -0.1 then
|
||||
local sErr = 'Error : Mortise from bottom impossible'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
-- altrimenti passante
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user