Compare commits

...

2 Commits

Author SHA1 Message Date
luca.mazzoleni 5779cab90a Merge branch 'develop' into EUROBOIS2026 2026-01-29 15:47:16 +01:00
andrea.villa d5b9612406 - STR0015 estesa anche a FreeContour. DA VERIFICARE: ora è controllato solo il caso simile a una feature di intestatura
- GetMachiningSteps migliorata, ora contempla il caso lavorazione di fresatura standard o di tipo slot
2026-01-27 12:21:29 +01:00
7 changed files with 35 additions and 37 deletions
+10 -6
View File
@@ -107,15 +107,19 @@ function MachiningLib.IsFeatureHinderingClamping( Proc, Part)
end
-------------------------------------------------------------------------------------------------------------
function MachiningLib.GetMachiningSteps( dMachiningDepth, dStep)
function MachiningLib.GetMachiningSteps( bIsSlot, dMachiningDepth, dStep)
local MachiningSteps = {}
MachiningSteps.dStep = 0
MachiningSteps.nCount = ceil( ( dMachiningDepth - 50 * GEO.EPS_SMALL) / dStep)
if MachiningSteps.nCount > 1 then
MachiningSteps.dStep = ( dMachiningDepth - dStep) / ( MachiningSteps.nCount - 1)
-- se è una slot, dMachiningDepth è l'altezza della tasca e nel calcolo step si deve considerare lo spessore dell'utensile
if bIsSlot then
if MachiningSteps.nCount > 1 then
MachiningSteps.dStep = ( dMachiningDepth - dStep) / ( MachiningSteps.nCount - 1)
else
MachiningSteps.dStep = dMachiningDepth
MachiningSteps.nCount = 1
end
else
MachiningSteps.dStep = dMachiningDepth
MachiningSteps.nCount = 1
MachiningSteps.dStep = dStep
end
return MachiningSteps
+2 -2
View File
@@ -841,8 +841,8 @@
"nGrp": 0,
"TopologyList" : [
{ "sName": "Feature",
"sImage": "",
"StrategyList" : [ ]
"sImage": "ConfigStrategy\\ProfileHead.png",
"StrategyList" : [ { "sStrategyId": "STR0015" } ]
}
]
},
+1 -2
View File
@@ -188,8 +188,7 @@ function STR0009.Make( bAddMachining, Proc, Part, CustomParameters)
Strategy.Machinings[i].nType = MCH_MY.MILLING
Strategy.Machinings[i].dStartSafetyLength = 0
Strategy.Machinings[i].Steps = {}
Strategy.Machinings[i].Steps.dStep = TOOLS[Strategy.Machinings[i].ToolInfo.nToolIndex].dStep
Strategy.Machinings[i].Steps = MachiningLib.GetMachiningSteps( tonumber( Strategy.Machinings[i].sDepth), TOOLS[Strategy.Machinings[i].nToolIndex].dStep)
Strategy.Machinings[i].Steps = MachiningLib.GetMachiningSteps( false, tonumber( Strategy.Machinings[i].sDepth), TOOLS[Strategy.Machinings[i].nToolIndex].dStep)
-- LeadIn / LeadOut
Strategy.Machinings[i].LeadIn = {}
+5 -8
View File
@@ -441,7 +441,7 @@ local function GetArcStrategy( Proc, Part)
local bExecStrip = false
-- se la lavorazione si trova nella parte inferiore o in battuta dietro, il codolo va sempre lasciato
if bIsFeatureDown or bIsFeatureBack or bForceStrip then
if ID.IsRoundArch( Proc) and ( bIsFeatureDown or bIsFeatureBack or bForceStrip) then
if bIsFeatureDown or bIsFeatureBack then
dDimStrip = dDimStrip or max( BeamData.DIM_STRIP or 5, 5)
else
@@ -639,7 +639,7 @@ local function GetFeatureResult( Proc)
-- se richieste anche le altre lavorazioni
if not Strategy.Parameters.bOnlyChamfer then
-- per tutti tranne che per feature RoundArc
if not ID.IsRoundArch( Proc) then
if not ID.IsRoundArch( Proc) and not ID.IsFreeContour( Proc) then
-- se sgrossatura da eseguire
if Strategy.Parameters.bExecRough then
if not Strategy.RoughCut.Machinings or #Strategy.RoughCut.Machinings == 0 then
@@ -720,7 +720,7 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters)
-- se non bisogna fare solo gli smussi, si calcolano le altre lavorazioni
if not Strategy.Parameters.bOnlyChamfer then
-- per tutti tranne che per feature RoundArc
if not ID.IsRoundArch( Proc) then
if not ID.IsRoundArch( Proc) and not ID.IsFreeContour( Proc) then
-- lavorazione taglio per sgrossare
if Strategy.Parameters.bExecRough then
Strategy.RoughCut = {}
@@ -762,7 +762,7 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters)
end
-- per tutti tranne che per feature RoundArc
if not ID.IsRoundArch( Proc) then
if not ID.IsRoundArch( Proc) and not ID.IsFreeContour( Proc) then
-- lavorazione di sgrezzatura di lama
if Strategy.Parameters.bExecRough and Strategy.RoughCut.Machinings then
-- se cutting da fare come svuotatura
@@ -799,10 +799,7 @@ 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].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)
Strategy.Profile.Machinings[i].Steps = MachiningLib.GetMachiningSteps( false, tonumber( Strategy.Profile.Machinings[i].sDepth), TOOLS[Strategy.Profile.Machinings[i].nToolIndex].dStep)
Strategy.Profile.Machinings[i].Steps.nStepType = MCH_MILL_ST.ONEWAY
-- LeadIn / LeadOut
+13 -13
View File
@@ -322,17 +322,17 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
-- TODO al momento commentato per trovare i casi in cui nei riposizionamenti scende sul pezzo; poi valutare se lasciare o togliere
-- se dicing, lato di lavoro e inversione per avere taglio sempre verso l'alto
-- if bIsDicing
-- and ( Cutting.bInvert and Cutting.vtEdgeDirection:getZ() > 100 * GEO.EPS_SMALL)
-- or ( ( not Cutting.bInvert) and Cutting.vtEdgeDirection:getZ() < -100 * GEO.EPS_SMALL) then
-- Cutting.bInvert = not Cutting.bInvert
-- if Cutting.nWorkside == MCH_MILL_WS.LEFT then
-- Cutting.nWorkside = MCH_MILL_WS.RIGHT
-- else
-- Cutting.nWorkside = MCH_MILL_WS.LEFT
-- end
-- end
if bIsDicing
and ( Cutting.bInvert and Cutting.vtEdgeDirection:getZ() > 100 * GEO.EPS_SMALL)
or ( ( not Cutting.bInvert) and Cutting.vtEdgeDirection:getZ() < -100 * GEO.EPS_SMALL) then
Cutting.bInvert = not Cutting.bInvert
if Cutting.nWorkside == MCH_MILL_WS.LEFT then
Cutting.nWorkside = MCH_MILL_WS.RIGHT
else
Cutting.nWorkside = MCH_MILL_WS.LEFT
end
end
-- analisi fattibilità lavorazione dal lato opposto
if OppositeToolDirectionMode ~= 'Disabled' then
@@ -490,7 +490,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
Cutting.dCompletionPercentage = ( 1 - Cutting.dResidualDepth / Cutting.dDepthToMachine) * 100
-- step verticale e offset longitudinale
Cutting.Steps = MachiningLib.GetMachiningSteps( dPocketHeight, TOOLS[Cutting.nToolIndex].dThickness)
Cutting.Steps = MachiningLib.GetMachiningSteps( true, dPocketHeight, TOOLS[Cutting.nToolIndex].dThickness)
Cutting.Steps.nStepType = MCH_MILL_ST.ONEWAY
Cutting.dMaxElev = Cutting.Steps.dStep * Cutting.Steps.nCount - 10 * GEO.EPS_SMALL
if Cutting.bToolInvert then
@@ -532,7 +532,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
dRadialStepSpan = Cutting.dDepthToMachine
end
if dRadialStepSpan > 10 * GEO.EPS_SMALL and TOOLS[Cutting.nToolIndex].dSideStep then
Cutting.CloneStepsRadial = MachiningLib.GetMachiningSteps( dRadialStepSpan, TOOLS[Cutting.nToolIndex].dSideStep)
Cutting.CloneStepsRadial = MachiningLib.GetMachiningSteps( true, dRadialStepSpan, TOOLS[Cutting.nToolIndex].dSideStep)
else
Cutting.CloneStepsRadial.nCount = 1
Cutting.CloneStepsRadial.dStep = Cutting.dDepthToMachine
+1 -1
View File
@@ -205,7 +205,7 @@ function FACEBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional
dLongitudinalStepSpan = dPocketHeight
end
if dLongitudinalStepSpan > 10 * GEO.EPS_SMALL then
Mortising.CloneStepsLongitudinal = MachiningLib.GetMachiningSteps( dLongitudinalStepSpan, TOOLS[Mortising.nToolIndex].dThickness)
Mortising.CloneStepsLongitudinal = MachiningLib.GetMachiningSteps( true, dLongitudinalStepSpan, TOOLS[Mortising.nToolIndex].dThickness)
else
Mortising.CloneStepsLongitudinal.nCount = 1
Mortising.CloneStepsLongitudinal.dStep = dPocketHeight
+3 -5
View File
@@ -329,13 +329,11 @@ function FACEBYMILL.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPara
Milling.dCompletionPercentage = ( 1 - Milling.dResidualDepth / Milling.dDepthToMachine) * 100
-- step verticale e offset longitudinale
if OptionalParameters.dPocketHeight then
Milling.Steps = MachiningLib.GetMachiningSteps( dPocketHeight, TOOLS[Milling.nToolIndex].dMaxMaterial)
Milling.Steps = MachiningLib.GetMachiningSteps( true, dPocketHeight, TOOLS[Milling.nToolIndex].dMaxMaterial)
Milling.Steps.nStepType = OptionalParameters.nStepType or MCH_MILL_ST.ONEWAY
Milling.dMaxElev = Milling.Steps.dStep * Milling.Steps.nCount - 10 * GEO.EPS_SMALL
else
Milling.Steps = {}
Milling.Steps.dStep = TOOLS[Milling.nToolIndex].dStep
Milling.Steps.nCount = ceil( ( FaceToMachine.dElevation - 50 * GEO.EPS_SMALL) / Milling.Steps.dStep)
Milling.Steps = MachiningLib.GetMachiningSteps( false, FaceToMachine.dElevation, TOOLS[Milling.nToolIndex].dStep)
Milling.Steps.nStepType = OptionalParameters.nStepType or MCH_MILL_ST.ZIGZAG
Milling.dMaxElev = FaceToMachine.dElevation
end
@@ -372,7 +370,7 @@ function FACEBYMILL.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPara
dRadialStepSpan = Milling.dDepthToMachine
end
if dRadialStepSpan > 10 * GEO.EPS_SMALL and TOOLS[Milling.nToolIndex].dSideStep then
Milling.CloneStepsRadial = MachiningLib.GetMachiningSteps( dRadialStepSpan, TOOLS[Milling.nToolIndex].dSideStep)
Milling.CloneStepsRadial = MachiningLib.GetMachiningSteps( true, dRadialStepSpan, TOOLS[Milling.nToolIndex].dSideStep)
else
Milling.CloneStepsRadial.nCount = 1
Milling.CloneStepsRadial.dStep = 0