Compare commits

..

1 Commits

2 changed files with 31 additions and 71 deletions
+17 -69
View File
@@ -192,7 +192,6 @@ local function AssignQIdent( Proc)
Q_STAIRCASE = ''
Q_SAW_PLUS_CHAIN = 'Q11'
Q_FORCE_CHAINSAW = 'Q12'
Q_NO_ROTATION = 'Q13'
if ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16 then
Q_FORCE_BLADE = 'Q01' -- i
@@ -966,12 +965,6 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
bDown = ( vtN2:getZ() < BD.NZ_MINB)
end
end
local bNoRotation = ( EgtGetInfo( Proc.Id, Q_NO_ROTATION, 'i') or 0) == 1
if bDown and bNoRotation then
bDown = false
end
return true, bDown
end
end
@@ -3096,14 +3089,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
local bGoFromHead = true
-- se la lunghezza utensile non riesce ad arrivare sul fondo assegno la possibilità di lavorare di fianco (se possibile)
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
local bNoRotation = EgtGetInfo( Proc.Id, Q_NO_ROTATION, 'i')
-- se forzata no rotazione, si entra dal lato se possibile
if bNoRotation and ( Proc.Fct == 4) and ( Proc.Topology == 'Groove') then
bGoFromHead = false
else
-- continuo di testa se fessura con tre facce o non è tunnel
bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces)
end
-- continuo di testa se fessura con tre facce o non è tunnel
bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces)
end
-- se continuo a lavorare di testa
if bGoFromHead then
@@ -3200,34 +3187,16 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
return false, sWarn
end
end
-- altrimenti sega a catena di fianco
-- si arriva qui anche per groove 4 lati con rotazione esclusa
-- altrimenti sega a catena di fianco
else
local vtRef = Vector3d( vtOrtho)
if vtRef and ( vtRef:getY() > 0.5 or vtRef:getZ() < -0.1) then
vtRef = -vtRef
end
if not ( Proc.Topology == 'Tunnel') 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
local nFaceZ
if not vtRef then
if Proc.AffectedFaces.Top then
vtRef = Z_AX()
nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, Z_AX())
else
vtRef = -Z_AX()
nFaceZ = BL.FindFaceBestOrientedAsAxis( Proc, -Z_AX())
end
end
dDepth = Proc.Face[ nFaceZ + 1].Elevation
end
-- verifico se posso farlo con la sega-catena
local bMakeChainSaw, sSawing2, dMaxMat2, dSawCornerRad2, dSawThick2 = VerifyChainSaw( Proc, dDimMin, dDimMax, dDepth)
if bMakeChainSaw then
-- Calcolo normale faccia da lavorare
local vtNL = EgtSurfTmFacetNormVersor( Proc.Id, nLundIdFace, GDB_ID.ROOT)
-- Calcolo uso faccia
local vtRef = Vector3d( vtOrtho)
if vtRef:getY() > 0.5 or vtRef:getZ() < -0.1 then vtRef = -vtRef end
local nFaceUse = BL.GetNearestParalOpposite( vtRef, vtNL)
-- Verifico se necessarie più passate
local nStep = ceil( ( dDimMin - 100 * GEO.EPS_SMALL) / dSawThick2)
@@ -3254,42 +3223,21 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
-- imposto offset radiale
local dOffs = ( i - 1) * dStep
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
if Proc.Topology == 'Tunnel' then
-- se possibile aumento l'affondamento pari al raggio corner + 1
if dMaxMat2 > ( dDepth + dSawCornerRad2 + 1) then
EgtSetMachiningParam( MCH_MP.DEPTH, (dDepth + dSawCornerRad2 + 1))
-- se massimo affondamento supera altezza fessura, uso massimo affondamento
elseif dMaxMat2 > (dDepth + 1) then
EgtSetMachiningParam( MCH_MP.DEPTH, (dMaxMat2 - 1))
-- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning
elseif dMaxMat2 < dDepth then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat2)
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
else
-- se possibile si lavora tutta la profondità
if dMaxMat2 > (dDepth - 100 * GEO.EPS_SMALL) then
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
-- in alternativa si arriva al massimo materiale
else
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat2)
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSawWidth / 2 + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) + EgtMdbGetGeneralParam( MCH_GP.SAFEAGGRBOTTZ))
EgtSetMachiningParam( MCH_MP.ENDADDLEN, - dSawWidth / 2)
-- se possibile aumento l'affondamento pari al raggio corner + 1
if dMaxMat2 > ( dDepth + dSawCornerRad2 + 1) then
EgtSetMachiningParam( MCH_MP.DEPTH, (dDepth + dSawCornerRad2 + 1))
-- se massimo affondamento supera altezza fessura, uso massimo affondamento
elseif dMaxMat2 > (dDepth + 1) then
EgtSetMachiningParam( MCH_MP.DEPTH, (dMaxMat2 - 1))
-- se massimo affondamento utensile inferiore fessura, setto affondamento ed emetto warning
elseif dMaxMat2 < dDepth then
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxMat2)
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
-- considero estremi inizio/fine chiusi
-- imposto massima elevazione
if not ( Proc.Topology == 'Tunnel') then
local dLongitudinalStep = EgtGetMachiningParam( MCH_MP.STEP)
dElev = dLongitudinalStep + 0.1
end
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
if not ( Proc.Topology == 'Tunnel') then
sNotes = EgtSetValInNotes( sNotes, 'Plunge', 10)
end
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
-- eseguo
if not ML.ApplyMachining( true, false) then
+14 -2
View File
@@ -1306,6 +1306,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end
-- ciclo sulle parti
local nM = 0
local bInverted = false
for j = 1, nC do
-- su entrambe le facce
for i = nIni, nFin do
@@ -1349,8 +1350,19 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- controllo se lavorazione completa
local dMachDepth = vElevation[vOrd[i]]
if dMachDepth > dMaxDepth - 10 * GEO.EPS_ANG_SMALL then
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
-- 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
vOrd[1], vOrd[2] = vOrd[2], vOrd[1]
dLargh = vWidth[vOrd[i]]
dSal, dEal = dEal, dSal
bInverted = true
else
sWarn = 'Warning : elevation bigger than max tool depth'
EgtOutLog( sWarn)
end
elseif bInverted then
dSal, dEal = dEal, dSal
end
if not bSide and dLargh > 0.8 * dToolDiam then
nO = ceil( dLargh / ( 0.6 * dToolDiam))