- in PresimulationLib e BLADETOWASTE pulizia parziale superfici create nel TempGroup

This commit is contained in:
luca.mazzoleni
2026-07-02 18:24:25 +02:00
parent 06a4316efa
commit cb3cf7f31a
2 changed files with 24 additions and 19 deletions
+22 -19
View File
@@ -41,20 +41,11 @@ local function LogOutstroke( sToolName, ptOnToolTipCenter, vtHead, OptionalParam
local LinearAxesValues = OptionalParameters.LinearAxesValues
local RotativeAxesValues = OptionalParameters.RotativeAxesValues
-- gruppo per geometrie temporanee
local idTempGroup = BeamLib.GetTempGroup()
-- si disegnano punto e vettore
local idPoint = EgtPoint( idTempGroup, ptOnToolTipCenter, GDB_RT.GLOB)
local idVector = EgtVector( idTempGroup, vtHead, ptOnToolTipCenter, GDB_RT.GLOB)
EgtSetColor( idPoint, RED())
EgtSetColor( idVector, RED())
-- nome utensile
EgtOutLog( 'Tool ' .. sToolName)
-- si loggano valori di punto e vettore
EgtOutLog( ' Presimulation : OutStroke, Tip Point = ' .. tostring( ptOnToolTipCenter) .. ', id = ' .. idPoint .. ', vtHead = ' .. tostring( vtHead) .. ', id = ' .. idVector)
EgtOutLog( ' Presimulation : OutStroke, Tip Point = ' .. tostring( ptOnToolTipCenter) .. ', vtHead = ' .. tostring( vtHead))
-- se disponibili, si loggano anche i valori calcolati degli assi
if LinearAxesValues then
@@ -348,20 +339,23 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
if not type( bCollisionFoundPiece) == "boolean" then
error( 'Presimulation fail')
end
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
EgtSetColor( CollisionSurfTmId[i], RED())
end
if bCollisionFoundPiece then
break
end
end
-- se trovata collisione con pezzo è inutile procedere con il grezzo
if bCollisionFoundPiece then
-- se trovata collisione con pezzo è inutile procedere con il grezzo
if bCollisionFoundPiece then
return true
for i = 1, #CollisionSurfTmId do
if CollisionSurfTmId[i] ~= idAddedCollisionSurfTm then
EgtErase( CollisionSurfTmId[i])
end
end
return true
end
-- check collisione con grezzo restante, se con il pezzo non c'è collisione e non è un taglio di testa o coda
local bCollisionFoundRestLength = false
if not ( bCollisionFoundPiece or bCannotSplitRestLength) then
@@ -372,14 +366,19 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
if not type( bCollisionFoundRestLength) == "boolean" then
error( 'Presimulation fail')
end
if EgtGetDebugLevel() >= 3 and bCollisionFoundRestLength then
EgtSetColor( CollisionSurfTmId[i], ORANGE())
end
if bCollisionFoundRestLength then
EgtErase( idRestLengthSurfFr)
break
end
end
end
EgtErase( idRestLengthSurfFr)
end
for i = 1, #CollisionSurfTmId do
if CollisionSurfTmId[i] ~= idAddedCollisionSurfTm then
EgtErase( CollisionSurfTmId[i])
end
end
return false, bCollisionFoundRestLength
@@ -429,6 +428,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
if Tool.sType == 'SAW_FLAT' then
local ptCenterFlange = PointsOnToolTipCenter[i] + vtHead * Tool.dThickness
local frHead = Frame3d( ptCenterFlange, vtHead)
EgtErase( ptCenterFlange)
local dExtraSafety = 2 -- valore empirico che serve nei casi molto inclinati, ci potrebbero essere casi in cui va aumentato
local idFlangeCurve = EgtCircle( Part.idTempGroup, ORIG(), dExtraSafety + Tool.dDiameter / 2 - Tool.dMaxDepth, GDB_RT.GLOB)
EgtTransform( idFlangeCurve, frHead, GDB_RT.GLOB)
@@ -440,10 +440,13 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
local vtExtrusion = 15 * vtHead
idAddedCollisionSurfTm = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idFlangeCurve, vtExtrusion, 0.05, GDB_RT.GLOB)
EgtErase( idFlangeCurve)
end
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm)
EgtErase( idAddedCollisionSurfTm)
-- se trovata collisione con pezzo è inutile controllare gli altri punti
if bCollisionFoundPiece then