- correzioni varie per cubetti, in particolare sui tagli di testa e coda

This commit is contained in:
luca.mazzoleni
2026-01-29 15:46:10 +01:00
parent 0f20358607
commit 19f62cdc90
4 changed files with 23 additions and 7 deletions
+3 -3
View File
@@ -280,7 +280,7 @@ end
-------------------------------------------------------------------------------------------------------------
-- in base a tipo testa e angolo soglia, verifica se la faccia è troppo inclinata per la lavorazione scelta (per DownUp passare vtNFace opposta)
local function IsFaceZOutOfRange( vtNFace, Tool)
function MachiningLib.IsFaceZOutOfRange( vtNFace, Tool)
-- lama sopra: angolo negativo troppo basso
if Tool.SetupInfo.HeadType.bTop and vtNFace:getZ() < Tool.SetupInfo.GetMinNz( vtNFace, Tool) - GEO.EPS_ZERO then
@@ -315,7 +315,7 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
end
-- se l'angolo non può essere raggiunto dall'utensile la lavorazione non è fattibile
if IsFaceZOutOfRange( vtHead, Tool) then
if MachiningLib.IsFaceZOutOfRange( vtHead, Tool) then
return false
end
@@ -645,7 +645,7 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
-- se si ha solo la faccia si può verificare se questa è orientata correttamente
elseif FaceToMachine then
if IsFaceZOutOfRange( FaceToMachine.vtN, TOOLS[i]) then
if MachiningLib.IsFaceZOutOfRange( FaceToMachine.vtN, TOOLS[i]) then
bIsToolCompatible = false
end
end
+2 -2
View File
@@ -400,8 +400,8 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( ToolExitPoints[i], vtC, vtHead, PreCollisionData, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, bCheckOnlyRestlength)
-- se trovata collisione con pezzo oppure non possibile separazione, è inutile controllare gli altri punti
if bCollisionFoundPiece or ( bCannotSplitRestLength and bCollisionFoundRestLength) then
-- se trovata collisione con pezzo è inutile controllare gli altri punti
if bCollisionFoundPiece then
return true
+2
View File
@@ -60,6 +60,8 @@ function TAILCUT.Make( bAddMachining, Proc, Part, CustomParameters)
OptionalParameters.dOffset = 0
else
Strategy.bIsPreCut = true
-- TODO questo dOffset è errato, va creata una nuova faccia oppure usare dLongitudinalOffset e farlo transitare per tutti, anche Engagement
-- TODO a dRestLength va anche aggiunto lo spessore lama se c'è a fine grezzo?
OptionalParameters.dOffset = Part.dRestLength
end
OptionalParameters.bDisableDicing = true
+16 -2
View File
@@ -260,6 +260,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
local dShortPartLength = OptionalParameters.dShortPartLength or BeamData.LEN_SHORT_PART
local EdgeToMachineTop = OptionalParameters.EdgeToMachineTop
local EdgeToMachineBottom = OptionalParameters.EdgeToMachineBottom
local bIsDicing = OptionalParameters.bIsDicing
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength
-- TODO qui sarebbe meglio avere dExtra come OptionalParameter???
@@ -288,6 +289,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
FaceToMachine = Face,
EdgeToMachine = EdgeToMachineTop,
Part = Part,
bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength
})
@@ -302,6 +304,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
FaceToMachine = Face,
EdgeToMachine = EdgeToMachineBottom,
Part = Part,
bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength
})
@@ -368,6 +371,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
local bReduceBladePath = OptionalParameters.bReduceBladePath or false
local bAllowFastCuts = OptionalParameters.bAllowFastCuts or false
local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1]
local bIsDicing = OptionalParameters.bIsDicing or false
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
-- lati da lavorare in base al tipo di lama
@@ -386,6 +390,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
EdgeToMachineTop = EdgeToMachineList.Top,
EdgeToMachineBottom = EdgeToMachineList.Bottom,
nToolIndex = nToolIndex,
bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength
}
@@ -437,6 +442,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine,
EdgeToMachine = EdgeToMachineList.TopGuillotine,
Part = Part,
bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength
})
@@ -469,6 +475,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
OptionalParameters = OptionalParameters or {}
local nToolIndex = OptionalParameters.nToolIndex
local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1]
local bIsDicing = OptionalParameters.bIsDicing or false
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
@@ -492,6 +499,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine,
EdgeToMachine = EdgeToMachine,
Part = Part,
bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength
})
@@ -504,6 +512,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine,
EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN),
Part = Part,
bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength
})
@@ -525,6 +534,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine,
EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN),
Part = Part,
bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength
})
@@ -543,6 +553,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine,
EdgeToMachine = EdgeToMachine,
Part = Part,
bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength
})
@@ -578,6 +589,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine,
EdgeToMachine = EdgeToMachine,
Part = Part,
bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength
})
@@ -595,6 +607,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
dDepthToMachine = dDepthToMachine
}
local BladeEngagementOptionalParameters = {
bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength
}
@@ -790,8 +803,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
SetDiceFaceInfo( Proc, vCuts[i][j])
if ( i % 2) == 1 then
local vtO = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
if ( MainFace.vtN:getY() > 0.766 and vtO:getY() < -0.05) or
( MainFace.vtN:getY() < -0.766 and vtO:getY() > 0.05) then
if MachiningLib.IsFaceZOutOfRange( vtO, Tool) then
EgtInvertSurf( vCuts[i][j])
bAreOrthogonalCutsInverted = true
end
@@ -836,6 +848,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
end
-- calcolo lavorazione della singola faccia
-- per tagli paralleli e faccia aperta si prova a tagliare come se fosse una faccia singola, accorpando i tagli
-- TODO bIsDicing è da mettere a true?
local bCanMergeParallelCuts = ( ( i % 2) == 0) and ( Proc.nFct == 1)
local bIsDicingOk = true
if bCanMergeParallelCuts then
@@ -847,6 +860,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
nToolIndex = Tool.nIndex,
dExtendAfterTail = dExtendAfterTail,
bReduceBladePath = bReduceBladePath,
bIsDicing = false,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength
}