DataWall :
- aggiunto controllo attrezzaggio - aggiunta gestione fori inclinati grandi e passanti da fare con contornatura inclinata - aggiunta gestione facce triangolari in FreeContour - aggiunto gorge con lama anche se non passante - migliorato calcolo ingombro lavorazioni inclinate per nesting.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/02/21
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/02/25
|
||||
-- Gestione calcolo profilo libero per Pareti
|
||||
-- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto.
|
||||
-- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
|
||||
@@ -257,6 +257,8 @@ local function ReorderFaces( nIdSurf, nNumFacet)
|
||||
nIdFace = i
|
||||
end
|
||||
end
|
||||
-- se è presente una faccia isolata non faccio riordino
|
||||
if nAdjMin == 0 then return nIdSurf end
|
||||
-- se il numero faccia minore con minori adiacenze è <> 1 faccio lo scambio
|
||||
if nIdFace and nIdFace ~= 1 then
|
||||
EgtSurfTmSwapFacets( nIdSurf, nIdFace-1, 0)
|
||||
@@ -365,12 +367,12 @@ local function GetFacesData( Proc, bOpposite, bCalclForBlade, dToolDiam, dToolMa
|
||||
local dLenY = dLen * abs( vFace[i].Norm:getX()) / sqrt( 1 - vFace[i].Norm:getZ() * vFace[i].Norm:getZ())
|
||||
local nType = 0
|
||||
if vFace[i].PrevAng < -0.1 or
|
||||
( WD.BEAM_MACHINE and not IsPointOnRawLongEdges( vFace[i].Cen, b3Raw) and ( dLen > 0.5 * WD.CUT_MAX_LENGTH or dLenY > 0.9 * b3Raw:getDimY())) then
|
||||
( WD.BEAM_MACHINE and not IsPointOnRawLongEdges( vFace[i].Cen, b3Raw) and ( dLen > 0.5 * WD.CUT_MAX_LENGTH or dLenY > 0.4 * b3Raw:getDimY())) then
|
||||
dLen = dLen - EgtIf( bCalclForBlade, dWhisk, 0)
|
||||
nType = nType + 1
|
||||
end
|
||||
if vFace[EgtIf( i < nNumFacet, i + 1, 1)].PrevAng < -0.1 or
|
||||
( WD.BEAM_MACHINE and not IsPointOnRawLongEdges( vFace[i].Cen, b3Raw) and ( dLen > 0.5 * WD.CUT_MAX_LENGTH or dLenY > 0.9 * b3Raw:getDimY())) then
|
||||
( WD.BEAM_MACHINE and not IsPointOnRawLongEdges( vFace[i].Cen, b3Raw) and ( dLen > 0.5 * WD.CUT_MAX_LENGTH or dLenY > 0.4 * b3Raw:getDimY())) then
|
||||
dLen = dLen - EgtIf( bCalclForBlade, dWhisk, 0)
|
||||
nType = nType + 2
|
||||
end
|
||||
@@ -378,9 +380,13 @@ local function GetFacesData( Proc, bOpposite, bCalclForBlade, dToolDiam, dToolMa
|
||||
if dLen < MIN_LEN_CUT then
|
||||
nType = 4
|
||||
end
|
||||
-- numero dei lati
|
||||
local nEdges = #(EgtSurfTmFacetAdjacencies( nNewProc, i - 1)[1])
|
||||
-- assegno i nuovi dati
|
||||
vFace[i].Depth = dDepth
|
||||
vFace[i].Whisk = dWhisk
|
||||
vFace[i].Type = nType
|
||||
vFace[i].Edges = nEdges
|
||||
end
|
||||
-- recupero le regioni degli altri pezzi
|
||||
local vOthers = GetOtherRegions( Proc.PartId)
|
||||
@@ -463,12 +469,14 @@ local function GetFacesData( Proc, bOpposite, bCalclForBlade, dToolDiam, dToolMa
|
||||
vFace[nInd3].Type = 4
|
||||
end
|
||||
end
|
||||
|
||||
-- eventuali stampe
|
||||
for i = 1, #vFace do
|
||||
local Face = vFace[i]
|
||||
local sOut = 'Face '..tostring( Face.Fac)..' C'..tostring( Face.Cen)..' N'..tostring( Face.Norm)..
|
||||
' L='..EgtNumToString( Face.Len, 1)..' W='..EgtNumToString( Face.Width, 1)..' Ap='..EgtNumToString( Face.PrevAng, 1)..' App='..EgtNumToString( Face.PlPrevAng, 1)..
|
||||
' D='..EgtNumToString( Face.Depth, 1)..' B='..EgtNumToString( Face.Whisk, 1).. ' As='..EgtNumToString( Face.SideAng, 1)..' T='..tostring( Face.Type)
|
||||
' L='..EgtNumToString( Face.Len, 1)..' W='..EgtNumToString( Face.Width, 1)..' Ap='..EgtNumToString( Face.PrevAng, 1)..
|
||||
' App='..EgtNumToString( Face.PlPrevAng, 1)..' D='..EgtNumToString( Face.Depth, 1)..' B='..EgtNumToString( Face.Whisk, 1)..
|
||||
' As='..EgtNumToString( Face.SideAng, 1)..' T='..tostring( Face.Type)..' E='..tostring( Face.Edges)
|
||||
EgtOutLog( sOut)
|
||||
end
|
||||
|
||||
@@ -1182,8 +1190,8 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
||||
-- 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 or ( vFace[#vFace].Type & 2) ~= 0) then
|
||||
while i <= #vFace and vFace[i].Type == 4 and abs( vFace[i].SideAng) < 0.1 do
|
||||
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
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
@@ -1193,7 +1201,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
||||
while i <= #vFace do
|
||||
-- se inizio faccia senza taglio e non è successiva di senza taglio, inserisco una fresatura
|
||||
local j = EgtIf( i > 1, i - 1, EgtIf( bClosed, #vFace, nil))
|
||||
if ( vFace[i].Type & 1) ~= 0 and ( not j or ( vFace[j].Type == 0 or vFace[j].Type == 1) or abs( vFace[j].SideAng - vFace[i].SideAng) > 0.1) then
|
||||
if ( vFace[i].Type & 1) ~= 0 and ( not j or ( vFace[j].Type == 0 or vFace[j].Type == 1) or abs( vFace[i].SideAng) > 0.1) then
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
||||
local nMchId = EgtAddMachining( sName, sMilling)
|
||||
@@ -1282,7 +1290,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
||||
end
|
||||
end
|
||||
-- se tutta la faccia o la sua fine senza taglio, inserisco una fresatura
|
||||
if ( vFace[i].Type & 2) ~= 0 or vFace[i].Type == 4 then
|
||||
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and vFace[i].Edges > 3) then
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Free_' .. ( EgtGetName( Proc.PartId) or tostring( Proc.PartId))
|
||||
local nMchId = EgtAddMachining( sName, sMilling)
|
||||
@@ -1323,7 +1331,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 abs( vFace[j].SideAng - 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 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)
|
||||
@@ -1334,13 +1342,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 then
|
||||
if #vFace == 1 and vFace[OrigI].Type == 4 and vFace[OrigI].Edges > 3 then
|
||||
dSal = -dMillDiam / 2
|
||||
dEal = -dMillDiam / 2
|
||||
-- altrimenti va verificato
|
||||
else
|
||||
-- se lavorazione completa su faccia iniziale
|
||||
if vFace[OrigI].Type == 4 then
|
||||
if vFace[OrigI].Type == 4 and vFace[OrigI].Edges > 3 then
|
||||
-- se angolo interno prima
|
||||
if vFace[OrigI].PrevAng < -30 then
|
||||
local dSinA = -sin( vFace[OrigI].PlPrevAng + 90)
|
||||
@@ -1361,7 +1369,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 or ( vFace[LastFace].Type & 2) ~= 0 then
|
||||
if ( vFace[LastFace].Type == 4 and vFace[LastFace].Edges > 3) 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)
|
||||
@@ -1380,7 +1388,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
|
||||
end
|
||||
end
|
||||
-- per sola lavorazione finale
|
||||
if ( vFace[LastFace].Type & 2) ~= 0 then
|
||||
if LastFace == OrigI and ( vFace[LastFace].Type & 2) ~= 0 then
|
||||
-- se angolo interno dopo e faccia successiva inclinata verso l'alto oltre 16.1 deg
|
||||
if OrigK and vFace[OrigK].PrevAng < -30 and vFace[OrigK].Norm:getZ() < 0.96078 and vFace[OrigK].Norm:getZ() > 0 then
|
||||
dSal = dSal + vFace[OrigK].Width * vFace[OrigK].Norm:getZ()
|
||||
@@ -1622,7 +1630,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].Len > dSawDiam + 1) then
|
||||
if ( vFace[i].Type & 2) ~= 0 or ( vFace[i].Type == 4 and vFace[i].Edges > 3 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)
|
||||
|
||||
Reference in New Issue
Block a user