- Aggiunti smussi se intestatura orizzontale

- In BCS aggiunta lettura parametri Q
This commit is contained in:
andrea.villa
2025-09-19 16:51:35 +02:00
parent ed1de946c1
commit 9ed6cf8c30
2 changed files with 143 additions and 29 deletions
+42 -4
View File
@@ -430,7 +430,7 @@ end
-- funzione che recupera i parametri custom della strategia. Per cliente Essetre, vengono salvati dei valori 'Q' sul processing del file NGE per modificare il comportamento delle macro
local function GetParameters_Essetre( Proc, sStrategyIdToGet)
local Parameters = {}
--###---###---###---###---###---###---###---###---###---###---###---###---###--
-- Feature : HeadCut (1-340)
if ID.IsHeadCut( Proc) then
-- Per Essetre non esiste il taglio di testa, quindi si leggono le variabili Q sul processing che coincide con il taglio di testa
@@ -447,6 +447,7 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet)
table.insert( Parameters, { sName = 'bFinishWithMill', sValue = bFinishWithMill, sType = 'b'})
end
end
--###---###---###---###---###---###---###---###---###---###---###---###---###--
-- Feature : Cut (1-10)
elseif ID.IsCut( Proc) then
local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q06', 'd') or 0
@@ -464,6 +465,7 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet)
table.insert( Parameters, { sName = 'sCuttingStrategy', sValue = sCuttingStrategy, sType = 's'})
end
end
--###---###---###---###---###---###---###---###---###---###---###---###---###--
-- Feature : Drill (1-40)
elseif ID.IsDrill( Proc) then
if sStrategyIdToGet == 'STR0011' then
@@ -476,6 +478,25 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet)
local bDrillFromOneSide = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 'd') or 0) == 1
local sDrillingMode = EgtIf( bDrillFromOneSide, 'PREFER_ONE', 'AUTO')
table.insert( Parameters, { sName = 'sDrillingMode', sValue = sDrillingMode, sType = 's'})
--###---###---###---###---###---###---###---###---###---###---###---###---###--
-- Feature : Head Concave Profile (0-101)
elseif ID.IsHeadConcaveProfile( Proc) then
local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q01', 'd') or 0
local dOverMaterial = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 'd') or 0
local bOnlyChamfer = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q04', 'd') or 0) == 1
table.insert( Parameters, { sName = 'dDepthChamfer' , sValue = dDepthChamfer, sType = 'd'})
table.insert( Parameters, { sName = 'bOnlyChamfer' , sValue = bOnlyChamfer, sType = 'b'})
table.insert( Parameters, { sName = 'dOverMaterial' , sValue = dOverMaterial, sType = 'd'})
--###---###---###---###---###---###---###---###---###---###---###---###---###--
-- Feature : Head Convex Profile (0-102)
elseif ID.IsHeadConvexProfile( Proc) then
local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 'd') or 0
local dOverMaterial = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q04', 'd') or 0
local bOnlyChamfer = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q01', 'd') or 0) == 1
table.insert( Parameters, { sName = 'dDepthChamfer' , sValue = dDepthChamfer, sType = 'd'})
table.insert( Parameters, { sName = 'bOnlyChamfer' , sValue = bOnlyChamfer, sType = 'b'})
table.insert( Parameters, { sName = 'dOverMaterial' , sValue = dOverMaterial, sType = 'd'})
--###---###---###---###---###---###---###---###---###---###---###---###---###--
-- Feature : Head Cambered Profile (0-103)
elseif ID.IsHeadCamberedProfile( Proc) then
local sUpperFaceStrategy = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q01', 's') or '' -- Q01 = forza fresa
@@ -483,13 +504,27 @@ local function GetParameters_Essetre( Proc, sStrategyIdToGet)
table.insert( Parameters, { sName = 'sUpperFaceStrategy' , sValue = sUpperFaceStrategy, sType = 's'})
local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q03', 'd') or 0
--TODO RIMUOVERE!!!!
dDepthChamfer = 3
local dOverMaterial = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q04', 'd') or 0
local bOnlyChamfer = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q05', 'd') or 0) == 1
table.insert( Parameters, { sName = 'dDepthChamfer' , sValue = dDepthChamfer, sType = 'd'})
table.insert( Parameters, { sName = 'bOnlyChamfer' , sValue = bOnlyChamfer, sType = 'b'})
table.insert( Parameters, { sName = 'dOverMaterial' , sValue = dOverMaterial, sType = 'd'})
--###---###---###---###---###---###---###---###---###---###---###---###---###--
-- Feature : Round Arch (0-104)
elseif ID.IsRoundArch( Proc) then
local dDepthChamfer = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q03', 'd') or 0
local dOverMaterial = EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q01', 'd') or 0
local dStripWidth = ( EgtGetInfo( Proc.id or GDB_ID.NULL, 'Q02', 'd') or 0) == 1
table.insert( Parameters, { sName = 'dDepthChamfer' , sValue = dDepthChamfer, sType = 'd'})
table.insert( Parameters, { sName = 'dStripWidth' , sValue = dStripWidth, sType = 'b'})
table.insert( Parameters, { sName = 'dOverMaterial' , sValue = dOverMaterial, sType = 'd'})
end
-------------------------------------------------------------------------------
return Parameters
end
@@ -558,11 +593,14 @@ local function GetTools_Essetre( Proc, sMachiningCategory)
end
ToolList = GetToolsFromMachDataFile( DrillData, TagList)
end
elseif sMachiningCategory == 'Milling' or sMachiningCategory == 'MillingFinish' or sMachiningCategory == 'MillingAntiSplint' or sMachiningCategory == 'MillingChamfer' then
elseif sMachiningCategory == 'Milling' or sMachiningCategory == 'MillingFinish' or sMachiningCategory == 'MillingAntiSplint' or sMachiningCategory == 'MillingChamfer' or
sMachiningCategory == 'MillingSmooth' then
if EgtExistsFile( sMachDir .. '\\Beam\\MillingData.lua') then
local MillingData = dofile( sMachDir .. '\\Beam\\MillingData.lua')
-- si cercano TAG esclusivi
if sMachiningCategory == 'MillingAntiSplint' then
if sMachiningCategory == 'MillingSmooth' then
TagList = { 'Mark', 'Text', 'Decor01', 'CleanCorner'}
elseif sMachiningCategory == 'MillingAntiSplint' then
TagList = { 'AntiSplintMillCut'}
elseif ID.IsTenon( Proc) then
TagList = { 'Tenon'}
@@ -587,7 +625,7 @@ local function GetTools_Essetre( Proc, sMachiningCategory)
elseif ID.IsMarking( Proc) then
TagList = { 'Mark'}
elseif sMachiningCategory == 'MillingChamfer' then
TagList = { 'Chamfer', 'Mark'}
TagList = { 'Chamfer'}
elseif ID.IsText( Proc) then
TagList = { 'Text'}
elseif ID.IsTyroleanDovetail( Proc) or ID.IsDovetail( Proc) then
+101 -25
View File
@@ -143,8 +143,77 @@ end
local function GetChamferStrategy( Proc, Part)
local Machining = {}
local Result = {}
local dExtraDepth = 2
local vtExtr = EgtCurveExtrusion( Proc.idAddAuxGeom, GDB_RT.GLOB)
local bIsHorizontal = abs( vtExtr:getZ()) < 10 * GEO.EPS_SMALL
local bToolInvert = ( vtExtr:getZ() < -0.1)
if Strategy.Parameters.dDepthChamfer > 100 * GEO.EPS_SMALL then
-- controllo conformità affondamento smussi
Strategy.Parameters.dDepthChamfer = EgtClamp( Strategy.Parameters.dDepthChamfer, 0.1, 5)
-- se lavorazione orizzontale
if bIsHorizontal then
local Milling = MachiningLib.InitMachiningParameters( MCH_MY.MILLING)
ToolSearchParameters = {}
ToolSearchParameters.sMillShape = 'VMILL'
ToolSearchParameters.dElevation = Strategy.Parameters.dDepthChamfer
ToolSearchParameters.vtToolDirection = EgtIf( bToolInvert, -vtExtr, vtExtr)
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sMillingList, 'MillingSmooth')
Milling.ToolInfo = {}
Milling.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
-- se posso lavorare in una passata, ma utensile trovato non completa la lavorazione,
-- allora provo a cercare utensile con massimo materiale sufficiente per fare le due passate, magari trova un utensile più prestante
if Milling.ToolInfo.nToolIndex then
Milling.vtToolDirection = ToolSearchParameters.vtToolDirection
Milling.Geometry = {{ Proc.idAddAuxGeom, -1}}
Milling.nToolIndex = Milling.ToolInfo.nToolIndex
Milling.nType = MCH_MY.MILLING
Milling.sDepth = Strategy.Parameters.dDepthChamfer + dExtraDepth
Milling.dRadialOffset = dExtraDepth * cos( TOOLS[Milling.nToolIndex].dSideAngle)
-- LeadIn / LeadOut
Milling.LeadIn.nType = MCH_MILL_LI.NONE
Milling.LeadOut.nType = MCH_MILL_LI.NONE
Milling.LeadIn.dStartAddLength = 5
Milling.LeadOut.dEndAddLength = 5
if Proc.AffectedFaces.bLeft and Strategy.bCanMoveAfterSplit then
Milling.sStage = 'AfterTail'
end
-- sistemo il lato e la direzione di lavoro
if Milling.bOtherDirection then
Milling.bToolInvert = true
Milling.bInvert = EgtIf( TOOLS[Milling.nToolIndex].bIsCCW, true, false)
Milling.nWorkside = EgtIf( TOOLS[Milling.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
else
Milling.bInvert = EgtIf( TOOLS[Milling.nToolIndex].bIsCCW, false, true)
Milling.nWorkside = EgtIf( TOOLS[Milling.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
end
Milling.ptEdge1 = EgtSP( Proc.idAddAuxGeom, GDB_ID.ROOT)
Milling.ptEdge2 = EgtEP( Proc.idAddAuxGeom, GDB_ID.ROOT)
Milling.dEdgeLength = EgtCurveLength( Proc.idAddAuxGeom)
Milling.vtEdgeDirection = EgtSV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtMV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtEV( Proc.idAddAuxGeom, GDB_ID.ROOT)
Milling.dLengthOnX = Proc.b3Box:getDimX()
Milling.bInvert = EgtIf( TOOLS[Milling.nToolIndex].bIsCCW, false, true)
Milling.nWorkside = EgtIf( TOOLS[Milling.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
table.insert( Machining, Milling)
local Milling2 = BeamLib.TableCopyDeep( Milling)
Milling2.bToolInvert = true
Milling2.bInvert = EgtIf( TOOLS[Milling2.nToolIndex].bIsCCW, true, false)
Milling2.nWorkside = EgtIf( TOOLS[Milling2.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
table.insert( Machining, Milling2)
end
-- TODO LAVORAZIONE VERTICALE DA FARE!!!!
-- se lavorazione verticale
else
-- prendere stessi controlli da 'GetArcStrategy' per lavorazione verticale
end
end
return Machining, Result
@@ -446,31 +515,43 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters)
-- lavorazione degli smussi
if Strategy.Chamfer.Machinings then
end
-- lavorazione di sgrezzatura di lama
if Strategy.Parameters.bExecRough and Strategy.RoughCut.Machinings then
-- se cutting da fare come svuotatura
if Strategy.RoughCut.Machinings.bCuttingWithMill then
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.RoughCut.Machinings)
-- taglio di lama
else
for i = 1, #Strategy.RoughCut.Machinings do
if Proc.AffectedFaces.bLeft and Strategy.bCanMoveAfterSplit then
Strategy.RoughCut.Machinings[i].sStage = 'AfterTail'
end
local bIsMachiningAdded = MachiningLib.AddMachinings( Proc, Strategy.RoughCut.Machinings[i])
if not bIsMachiningAdded then
bAreAllMachiningsAdded = false
end
for i = 1, #Strategy.Chamfer.Machinings do
local MachiningToSplit = {}
table.insert( MachiningToSplit, Strategy.Chamfer.Machinings[i])
local MachiningResult = MachiningLib.GetSplitMachinings( MachiningToSplit, FeatureSplittingPoints, Part)
-- aggiunge lavorazione
for j = 1, #MachiningResult do
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, MachiningResult[j])
end
end
end
-- lavorazione degli angoli interni
if Strategy.EdgeWithCorner.Machinings then
end
-- per tutti tranne che per feature RoundArc
if not ID.IsRoundArch( Proc) then
-- lavorazione di sgrezzatura di lama
if Strategy.Parameters.bExecRough and Strategy.RoughCut.Machinings then
-- se cutting da fare come svuotatura
if Strategy.RoughCut.Machinings.bCuttingWithMill then
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.RoughCut.Machinings)
-- taglio di lama
else
for i = 1, #Strategy.RoughCut.Machinings do
if Proc.AffectedFaces.bLeft and Strategy.bCanMoveAfterSplit then
Strategy.RoughCut.Machinings[i].sStage = 'AfterTail'
end
local bIsMachiningAdded = MachiningLib.AddMachinings( Proc, Strategy.RoughCut.Machinings[i])
if not bIsMachiningAdded then
bAreAllMachiningsAdded = false
end
end
end
end
-- lavorazione degli angoli interni
if Strategy.EdgeWithCorner.Machinings then
end
end
-- lavorazione del profilo
if Strategy.Profile.Machinings then
for i = 1, #Strategy.Profile.Machinings do
@@ -478,14 +559,11 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters)
Strategy.Profile.Machinings[i].Geometry = {{ Proc.idAddAuxGeom, -1}}
Strategy.Profile.Machinings[i].nToolIndex = Strategy.Profile.Machinings[i].ToolInfo.nToolIndex
Strategy.Profile.Machinings[i].nType = MCH_MY.MILLING
Strategy.Profile.Machinings[i].dStartSafetyLength = 0
Strategy.Profile.Machinings[i].Steps = {}
Strategy.Profile.Machinings[i].Steps.dStep = TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].dStep
Strategy.Profile.Machinings[i].Steps = MachiningLib.GetMachiningSteps( tonumber( Strategy.Profile.Machinings[i].sDepth), TOOLS[Strategy.Profile.Machinings[i].nToolIndex].dStep)
-- LeadIn / LeadOut
Strategy.Profile.Machinings[i].LeadIn = {}
Strategy.Profile.Machinings[i].LeadOut = {}
Strategy.Profile.Machinings[i].LeadIn.nType = MCH_MILL_LI.TANGENT
Strategy.Profile.Machinings[i].LeadOut.nType = MCH_MILL_LI.TANGENT
Strategy.Profile.Machinings[i].LeadIn.dTangentDistance = TOOLS[Strategy.Profile.Machinings[i].ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
@@ -495,8 +573,6 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters)
Strategy.Profile.Machinings[i].LeadOut.dPerpDistance = 0
Strategy.Profile.Machinings[i].LeadOut.dEndAddLength = 0
local dLengthOnX = Proc.b3Box:getDimX()
Strategy.bCanMoveAfterSplit = MachiningLib.CanMoveAfterSplitcut( dLengthOnX, Part)
if Proc.AffectedFaces.bLeft and Strategy.bCanMoveAfterSplit then
Strategy.Profile.Machinings[i].sStage = 'AfterTail'
end