- in LapJoint si contempla Q13 per forzare la non rotazione. In questo caso, per sega a catena con groove 4 lati, si accetta di entrare di lato (Plunge=10)

This commit is contained in:
luca.mazzoleni
2025-06-24 17:19:47 +02:00
parent b6e904845e
commit 2430b4e787
+69 -17
View File
@@ -192,6 +192,7 @@ 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
@@ -965,6 +966,12 @@ 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
@@ -3089,8 +3096,14 @@ 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
-- continuo di testa se fessura con tre facce o non è tunnel
bGoFromHead = (( bIs3Faces and dMaxElev) or not bOrthoFaces)
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
end
-- se continuo a lavorare di testa
if bGoFromHead then
@@ -3187,16 +3200,34 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
return false, sWarn
end
end
-- altrimenti sega a catena di fianco
-- altrimenti sega a catena di fianco
-- si arriva qui anche per groove 4 lati con rotazione esclusa
else
-- verifico se posso farlo con la sega-catena
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
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)
@@ -3223,21 +3254,42 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
-- imposto offset radiale
local dOffs = ( i - 1) * dStep
EgtSetMachiningParam( MCH_MP.OFFSR, dOffs)
-- 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)
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)
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