DataBeam :
- aggiunta gestione feature senza geometria - migliorato calcolo attacchi/uscite lama con angoli 45deg - in foratura si tiene conto anche della profondità del foro per scegliere la punta più adatta - in tagli corretto problema con tagli orizzontali (da sotto o sopra) con taglio più alto dell'utile lama - in LapJoint e simili migliorati antischeggia con lama - in Tenoni migliorata lavorazione faccia di testa con fresa.
This commit is contained in:
+81
-25
@@ -1,4 +1,4 @@
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2020/07/27
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2020/09/16
|
||||
-- Gestione calcolo forature per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -184,38 +184,98 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
if Proc.Fcs == 0 then bToInvert = true end
|
||||
if bToInvert then vtExtr = - vtExtr end
|
||||
if Proc.Flg == -2 then bToInvert = true end
|
||||
-- recupero la lavorazione
|
||||
local sDrilling, nType = ML.FindDrilling( dDiam)
|
||||
if not sDrilling then
|
||||
local sErr = 'Error : drilling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
-- profondità geometria foro
|
||||
local dDepth = dLen
|
||||
if Proc.Flg == 2 or Proc.Flg == -2 then
|
||||
dDepth = dLen / 2 + BD.DRILL_OVERLAP
|
||||
end
|
||||
-- recupero i dati dell'utensile
|
||||
local dMaxDepth = 20
|
||||
local dDiamTh = 35
|
||||
if EgtMdbSetCurrMachining( sDrilling) then
|
||||
local bIsDrilling = ( EgtMdbGetCurrMachiningParam( MCH_MP.TYPE) == MCH_MY.DRILLING)
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
if bIsDrilling then
|
||||
dMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxDepth
|
||||
else
|
||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||
local dCheckDepth = dDepth
|
||||
-- se troppo inclinata sulla X e Y va troppo dietro e Z va in negativo e se il foro è splittato,
|
||||
-- annullo il valore della profondità nella ricerca utensile
|
||||
if abs(vtExtr:getX()) > 0.707 or vtExtr:getY() > 0.5 or vtExtr:getZ() < BD.DRILL_VZ_MIN or abs(Proc.Flg) == 2 then
|
||||
dCheckDepth = nil
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh = ML.FindDrilling( dDiam, dCheckDepth)
|
||||
if not sDrilling then
|
||||
-- se non ho passato altezza di taglio utensile allora non è stato trovato utensile
|
||||
if not dCheckDepth then
|
||||
local sErr = 'Error : drilling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
-- altrimenti rifaccio la ricerca foratura senza passare altezza uensile
|
||||
else
|
||||
dCheckDepth = nil
|
||||
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh = ML.FindDrilling( dDiam)
|
||||
if not sDrilling then
|
||||
local sErr = 'Error : drilling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
dDiamTh = EgtTdbGetCurrToolThDiam()
|
||||
end
|
||||
end
|
||||
-- se foro intermedio e inclinato, limito il massimo affondamento
|
||||
-- se la lunghezza utensile massima supera il valore limite del BeamData e la componente Z supera i 10 gradi
|
||||
-- allore ricerco un utensile senza lunghezza massima
|
||||
if dMaxToolLength > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then
|
||||
-- se non ho passato altezza di taglio utensile allora la lunghezza utensile non è idonea per il taglio
|
||||
if not dCheckDepth then
|
||||
local sErr = 'Error : tool too long to machine with big angle from vertical'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
-- rifaccio ricerca lavorazione senza specificare la profondità (dovrebbe trovare l'utensile più corto)
|
||||
else
|
||||
sDrilling, nType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh = ML.FindDrilling( dDiam)
|
||||
if not sDrilling then
|
||||
local sErr = 'Error : drilling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- ultimo controllo sulla lunghezza utensile
|
||||
if dMaxToolLength > ( BD.MAX_TOOL_LEN_FOR_HOR_MACH or 300) and abs( vtExtr:getZ()) < ( BD.DRILL_VZ_MIN_LONG_TOOL or cos(10)) then
|
||||
local sErr = 'Error : tool too long to machine with big angle from vertical'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local dSubL1 = 0
|
||||
local dSubL2 = 0
|
||||
local dSubL3 = 0
|
||||
-- se foro su testa o coda e inclinato, limito il massimo affondamento
|
||||
if not ( ( Proc.Fcs == 5 or Proc.Fcs == 6) or ( bToInvert and ( Proc.Fce == 5 or Proc.Fce == 6))) then
|
||||
local CosB = abs( vtExtr:getX())
|
||||
if CosB < BD.DRILL_VX_MAX then
|
||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
dMaxDepth = dMaxDepth - dDiamTh / 2 * TgA
|
||||
dSubL1 = ( dDiamTh - dToolDiam) / 2 * TgA
|
||||
else
|
||||
dMaxDepth = 0
|
||||
end
|
||||
end
|
||||
-- se foro davanti o dietro e inclinato, limito il massimo affondamento
|
||||
if dMaxDepth > 0 and abs( vtExtr:getY()) > abs( vtExtr:getZ()) then
|
||||
local CosB = abs( vtExtr:getZ())
|
||||
if CosB < BD.DRILL_VX_MAX then
|
||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
dSubL2 = ( dDiamTh - dToolDiam) / 2 * TgA
|
||||
else
|
||||
dMaxDepth = 0
|
||||
end
|
||||
end
|
||||
-- se foro sopra o sotto e inclinato, limito il massimo affondamento
|
||||
if dMaxDepth > 0 and abs( vtExtr:getZ()) > abs( vtExtr:getY()) then
|
||||
local CosB = abs( vtExtr:getY())
|
||||
if CosB < BD.DRILL_VX_MAX then
|
||||
local TgA = CosB / sqrt( 1 - CosB * CosB)
|
||||
dSubL3 = ( dDiamTh - dToolDiam) / 2 * TgA
|
||||
else
|
||||
dMaxDepth = 0
|
||||
end
|
||||
end
|
||||
local dSubL = max( dSubL1, dSubL2, dSubL3)
|
||||
if dMaxDepth > 0 then
|
||||
dMaxDepth = dMaxDepth - dSubL
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Drill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchId = EgtAddMachining( sName, sDrilling)
|
||||
@@ -240,10 +300,6 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- aggiusto l'affondamento
|
||||
local sMyWarn
|
||||
local dDepth = dLen
|
||||
if Proc.Flg == 2 or Proc.Flg == -2 then
|
||||
dDepth = dLen / 2 + BD.DRILL_OVERLAP
|
||||
end
|
||||
if dDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||
sMyWarn = 'Warning in drill : depth (' .. EgtNumToString( dDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
|
||||
dDepth = dMaxDepth
|
||||
|
||||
Reference in New Issue
Block a user