Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b8d3cd461b | |||
| c506486585 | |||
| a73c0c85ac | |||
| fb3a5ec0be | |||
| e3e7537f8f | |||
| eec6b50985 | |||
| b5cb706ad5 | |||
| 053755e583 | |||
| c7045499f4 | |||
| 44478b91f0 | |||
| 1f4aa15af4 | |||
| a5d606b225 | |||
| c4697fbd6f | |||
| f58004dfeb | |||
| 7c485360de |
@@ -388,6 +388,15 @@ if bToProcess then
|
|||||||
else
|
else
|
||||||
PARTS[i].b3PartOriginal = b3Solid
|
PARTS[i].b3PartOriginal = b3Solid
|
||||||
end
|
end
|
||||||
|
if BeamData.MAX_LENGTH and BeamData.MAX_LENGTH > 10 and b3Solid:getDimX() > BeamData.MAX_LENGTH then
|
||||||
|
local sOut = 'Piece-Length (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
|
||||||
|
'out of machine limits (' .. EgtNumToString( BeamData.MAX_LENGTH, 2) .. ') '
|
||||||
|
BEAM.ERR = 17
|
||||||
|
BEAM.MSG = sOut
|
||||||
|
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
|
||||||
|
PostErrView( BEAM.ERR, BEAM.MSG)
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- Assegno lunghezza della barra
|
-- Assegno lunghezza della barra
|
||||||
dBarLen = PARTS[1].b3PartOriginal:getDimX() + 10
|
dBarLen = PARTS[1].b3PartOriginal:getDimX() + 10
|
||||||
@@ -447,6 +456,15 @@ if bToProcess then
|
|||||||
else
|
else
|
||||||
PARTS[i].b3PartOriginal = b3Solid
|
PARTS[i].b3PartOriginal = b3Solid
|
||||||
end
|
end
|
||||||
|
if BeamData.MAX_LENGTH and BeamData.MAX_LENGTH > 10 and b3Solid:getDimX() > BeamData.MAX_LENGTH then
|
||||||
|
local sOut = 'Piece-Length (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
|
||||||
|
'out of machine limits (' .. EgtNumToString( BeamData.MAX_LENGTH, 2) .. ') '
|
||||||
|
BEAM.ERR = 17
|
||||||
|
BEAM.MSG = sOut
|
||||||
|
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
|
||||||
|
PostErrView( BEAM.ERR, BEAM.MSG)
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,11 @@ function BeamExec.GetToolsFromDB()
|
|||||||
Tool.nDouble = EgtGetValInNotes( Tool.sUserNotes, 'DOUBLE', 'd')
|
Tool.nDouble = EgtGetValInNotes( Tool.sUserNotes, 'DOUBLE', 'd')
|
||||||
Tool.bIsProfiledTool = not EgtTdbIsCurrToolStandardDraw()
|
Tool.bIsProfiledTool = not EgtTdbIsCurrToolStandardDraw()
|
||||||
|
|
||||||
|
-- TODO per capire se ToolHolder è flottante bisogna leggere nota TYPE='Float' su ToolHolder. Serve funzione
|
||||||
|
-- info per utensile su ToolHolder flottante
|
||||||
|
Tool.dOverHang = EgtGetValInNotes( Tool.sUserNotes, 'TOOL_OVERHANG', 'd') or 0
|
||||||
|
Tool.bToolOnFloatingTH = Tool.dOverHang > 0
|
||||||
|
|
||||||
-- lettura parametri non comuni ( famiglia DRILLBIT non ha parametri specifici)
|
-- lettura parametri non comuni ( famiglia DRILLBIT non ha parametri specifici)
|
||||||
if sToolFamily ~= 'DRILLBIT' then
|
if sToolFamily ~= 'DRILLBIT' then
|
||||||
Tool.dThickness = EgtTdbGetCurrToolParam( MCH_TP.THICK)
|
Tool.dThickness = EgtTdbGetCurrToolParam( MCH_TP.THICK)
|
||||||
|
|||||||
+8
-7
@@ -788,14 +788,15 @@ function BeamLib.BinaryToDecimal( dNumber)
|
|||||||
|
|
||||||
for i = #sNumberToConvert, 1, -1 do
|
for i = #sNumberToConvert, 1, -1 do
|
||||||
k = k + 1
|
k = k + 1
|
||||||
local n = string.sub(sNumberToConvert, k, k)
|
local n = string.sub( sNumberToConvert, k, k)
|
||||||
dResult = dResult + n*(2^(i-1))
|
dResult = dResult + n * ( 2^( i-1))
|
||||||
end
|
end
|
||||||
|
|
||||||
return dResult
|
return dResult
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
-- TODO si può sostituire con funzione EgtNumToBitString
|
||||||
function BeamLib.DecimalToBinary( dNumber)
|
function BeamLib.DecimalToBinary( dNumber)
|
||||||
local sNumberToConvert = tostring( dNumber)
|
local sNumberToConvert = tostring( dNumber)
|
||||||
local n = sNumberToConvert
|
local n = sNumberToConvert
|
||||||
@@ -803,12 +804,12 @@ function BeamLib.DecimalToBinary( dNumber)
|
|||||||
local sResult = ""
|
local sResult = ""
|
||||||
|
|
||||||
for i = sNumberToConvert, 0, -1 do
|
for i = sNumberToConvert, 0, -1 do
|
||||||
local q = math.modf(n)
|
local q = math.modf( n)
|
||||||
n = n/2
|
n = n / 2
|
||||||
local b = q%2
|
local b = q % 2
|
||||||
table.insert(tmp, b)
|
table.insert( tmp, b)
|
||||||
|
|
||||||
if (q == 1) then
|
if ( q == 1) then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
-- lavorazione in collisione con il pezzo: non fattibile
|
-- lavorazione in collisione con il pezzo: non fattibile
|
||||||
local bCollisionFound, bMoveAfterSplit = PreSimulationLib.CheckCollision( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters)
|
local bCollisionFound, bMoveAfterSplit = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
|
||||||
if bCollisionFound then
|
if bCollisionFound then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@@ -373,7 +373,7 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
|
|||||||
CheckCollisionOptionalParameters.PointsToCheck = {}
|
CheckCollisionOptionalParameters.PointsToCheck = {}
|
||||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadIn.ptPoint)
|
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadIn.ptPoint)
|
||||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadOut.ptPoint)
|
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadOut.ptPoint)
|
||||||
local bCollisionFoundPerpendicular, bMoveAfterSplitPerpendicular = PreSimulationLib.CheckCollision( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters)
|
local bCollisionFoundPerpendicular, bMoveAfterSplitPerpendicular = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
|
||||||
-- attacco perpendicolare possibile
|
-- attacco perpendicolare possibile
|
||||||
if not bCollisionFoundPerpendicular then
|
if not bCollisionFoundPerpendicular then
|
||||||
LeadInOut.Perpendicular = PerpendicularLeadInOut
|
LeadInOut.Perpendicular = PerpendicularLeadInOut
|
||||||
@@ -403,7 +403,7 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
|
|||||||
CheckCollisionOptionalParameters.PointsToCheck = {}
|
CheckCollisionOptionalParameters.PointsToCheck = {}
|
||||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadIn.ptPoint)
|
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadIn.ptPoint)
|
||||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadOut.ptPoint)
|
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadOut.ptPoint)
|
||||||
local bCollisionFoundTangent, bMoveAfterSplitTangent = PreSimulationLib.CheckCollision( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters)
|
local bCollisionFoundTangent, bMoveAfterSplitTangent = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
|
||||||
-- attacco tangenziale possibile
|
-- attacco tangenziale possibile
|
||||||
if not bCollisionFoundTangent then
|
if not bCollisionFoundTangent then
|
||||||
LeadInOut.Tangent = TangentLeadInOut
|
LeadInOut.Tangent = TangentLeadInOut
|
||||||
@@ -628,7 +628,7 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
|||||||
local bForceLongcutBlade = ToolSearchParameters.bForceLongcutBlade or false
|
local bForceLongcutBlade = ToolSearchParameters.bForceLongcutBlade or false
|
||||||
local EdgeToMachine = ToolSearchParameters.EdgeToMachine
|
local EdgeToMachine = ToolSearchParameters.EdgeToMachine
|
||||||
local Part = ToolSearchParameters.Part
|
local Part = ToolSearchParameters.Part
|
||||||
local bIsDicing = ToolSearchParameters.bIsDicing or false
|
local idCheckCollisionTm = ToolSearchParameters.idCheckCollisionTm
|
||||||
local sRestLengthSideForPreSimulation = ToolSearchParameters.sRestLengthSideForPreSimulation or 'Tail'
|
local sRestLengthSideForPreSimulation = ToolSearchParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||||
local bCannotSplitRestLength = ToolSearchParameters.bCannotSplitRestLength or false
|
local bCannotSplitRestLength = ToolSearchParameters.bCannotSplitRestLength or false
|
||||||
local bDisableRealElevationCheck = ToolSearchParameters.bDisableRealElevationCheck or false
|
local bDisableRealElevationCheck = ToolSearchParameters.bDisableRealElevationCheck or false
|
||||||
@@ -663,7 +663,7 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
|||||||
dDepthToMachine = min( dElevation, TOOLS[i].dMaxDepth)
|
dDepthToMachine = min( dElevation, TOOLS[i].dMaxDepth)
|
||||||
}
|
}
|
||||||
local BladeEngagementOptionalParameters = {
|
local BladeEngagementOptionalParameters = {
|
||||||
bIsDicing = bIsDicing,
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength,
|
bCannotSplitRestLength = bCannotSplitRestLength,
|
||||||
bDisableRealElevationCheck = bDisableRealElevationCheck
|
bDisableRealElevationCheck = bDisableRealElevationCheck
|
||||||
|
|||||||
@@ -301,16 +301,14 @@ local function MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
|
|||||||
EgtSetAxisPos( AxesNames[6], dRotative3)
|
EgtSetAxisPos( AxesNames[6], dRotative3)
|
||||||
end
|
end
|
||||||
|
|
||||||
return dTHome - dLinear1, AxesNames
|
return dLinear1 - dTHome
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, bCheckOnlyRestlength)
|
local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm)
|
||||||
|
|
||||||
-- spostamento assi macchina in posizione
|
-- spostamento assi macchina in posizione
|
||||||
local dDeltaXBeamOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
|
local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
|
||||||
-- spostamento trave in posizione macchina (è da riportare in posizione originale prima di return)
|
|
||||||
EgtMove( Part.idRaw, Vector3d( dDeltaXBeamOffset, 0, 0), GDB_RT.GLOB)
|
|
||||||
|
|
||||||
-- si recuperano gli id delle geometrie dell'asse con cui controllare la collisione
|
-- si recuperano gli id delle geometrie dell'asse con cui controllare la collisione
|
||||||
local idCollisionGroup = EgtGetFirstNameInGroup( EgtGetAxisId( sAxis), 'COLLISION')
|
local idCollisionGroup = EgtGetFirstNameInGroup( EgtGetAxisId( sAxis), 'COLLISION')
|
||||||
@@ -321,54 +319,55 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
|
|||||||
local CollisionSurfTmId = {}
|
local CollisionSurfTmId = {}
|
||||||
for i = 1, #CollisionGroupEntitiesId do
|
for i = 1, #CollisionGroupEntitiesId do
|
||||||
if EgtGetType( CollisionGroupEntitiesId[i]) == GDB_TY.SRF_MESH then
|
if EgtGetType( CollisionGroupEntitiesId[i]) == GDB_TY.SRF_MESH then
|
||||||
table.insert( CollisionSurfTmId, CollisionGroupEntitiesId[i])
|
local idCollisionSurfTmCopy = EgtCopyGlob( CollisionGroupEntitiesId[i], Part.idTempGroup)
|
||||||
|
EgtMove( idCollisionSurfTmCopy, Vector3d( dDeltaXHeadOffset, 0, 0), GDB_RT.GLOB)
|
||||||
|
table.insert( CollisionSurfTmId, idCollisionSurfTmCopy)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se presenti geometrie nel gruppo other si aggiungono anche quelle
|
-- se presenti geometrie nel gruppo other si aggiungono anche quelle
|
||||||
if CollisionGroupOtherEntitiesId and #CollisionGroupOtherEntitiesId > 0 then
|
if CollisionGroupOtherEntitiesId and #CollisionGroupOtherEntitiesId > 0 then
|
||||||
for i = 1, #CollisionGroupEntitiesId do
|
for i = 1, #CollisionGroupOtherEntitiesId do
|
||||||
if EgtGetType( CollisionGroupEntitiesId[i]) == GDB_TY.SRF_MESH then
|
if EgtGetType( CollisionGroupOtherEntitiesId[i]) == GDB_TY.SRF_MESH then
|
||||||
table.insert( CollisionSurfTmId, CollisionGroupEntitiesId[i])
|
local idCollisionOtherSurfTmCopy = EgtCopyGlob( CollisionGroupOtherEntitiesId[i], Part.idTempGroup)
|
||||||
|
EgtMove( idCollisionOtherSurfTmCopy, Vector3d( dDeltaXHeadOffset, 0, 0), GDB_RT.GLOB)
|
||||||
|
table.insert( CollisionSurfTmId, idCollisionOtherSurfTmCopy)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- check collisione con pezzo
|
-- check collisione con pezzo
|
||||||
local bCollisionFoundPiece = false
|
local bCollisionFoundPiece = false
|
||||||
if not bCheckOnlyRestlength then
|
if not idCheckCollisionTm then
|
||||||
local idCheckCollisionTm = Part.idBoxTm
|
idCheckCollisionTm = Part.idBoxTm
|
||||||
-- se testa o coda attaccate, si considerano nella superficie di collisione
|
-- se testa o coda attaccate, si considerano nella superficie di collisione
|
||||||
if bCannotSplitRestLength then
|
if bCannotSplitRestLength then
|
||||||
local b3CheckCollision = BeamLib.GetPartBoxWithHeadTail( Part, sRestLengthSideForPreSimulation)
|
local b3CheckCollision = BeamLib.GetPartBoxWithHeadTail( Part, sRestLengthSideForPreSimulation)
|
||||||
idCheckCollisionTm = EgtSurfTmBBox( Part.idTempGroup, b3CheckCollision, false, GDB_RT.GLOB)
|
idCheckCollisionTm = EgtSurfTmBBox( Part.idTempGroup, b3CheckCollision, false, GDB_RT.GLOB)
|
||||||
end
|
end
|
||||||
for i = 1, #CollisionSurfTmId do
|
end
|
||||||
bCollisionFoundPiece = EgtCDeSolidSolid( idCheckCollisionTm, CollisionSurfTmId[i], BeamData.COLL_SIC)
|
for i = 1, #CollisionSurfTmId do
|
||||||
if not type( bCollisionFoundPiece) == "boolean" then
|
bCollisionFoundPiece = EgtCDeSolidSolid( idCheckCollisionTm, CollisionSurfTmId[i], BeamData.COLL_SIC)
|
||||||
error( 'Presimulation fail')
|
if not type( bCollisionFoundPiece) == "boolean" then
|
||||||
end
|
error( 'Presimulation fail')
|
||||||
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
|
|
||||||
EgtSetColor( CollisionSurfTmId[i], RED())
|
|
||||||
end
|
|
||||||
if bCollisionFoundPiece then
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
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
|
-- se trovata collisione con pezzo è inutile procedere con il grezzo
|
||||||
if bCollisionFoundPiece then
|
if bCollisionFoundPiece then
|
||||||
-- si riporta la trave in posizione originale
|
|
||||||
EgtMove( Part.idRaw, Vector3d( -dDeltaXBeamOffset, 0, 0), GDB_RT.GLOB)
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- check collisione con grezzo restante, se con il pezzo non c'è collisione e non è un taglio di testa o coda
|
-- check collisione con grezzo restante, se con il pezzo non c'è collisione e non è un taglio di testa o coda
|
||||||
local bCollisionFoundRestLength = false
|
local bCollisionFoundRestLength = false
|
||||||
if not ( bCollisionFoundPiece or bCannotSplitRestLength) then
|
if not ( bCollisionFoundPiece or bCannotSplitRestLength) then
|
||||||
local idRestLengthSurfFr = GetRestlengthSurfTm( Part, sRestLengthSideForPreSimulation)
|
local idRestLengthSurfFr = GetRestlengthSurfTm( Part, sRestLengthSideForPreSimulation)
|
||||||
EgtMove( idRestLengthSurfFr, Vector3d( dDeltaXBeamOffset, 0, 0), GDB_RT.GLOB)
|
|
||||||
if idRestLengthSurfFr then
|
if idRestLengthSurfFr then
|
||||||
for i = 1, #CollisionSurfTmId do
|
for i = 1, #CollisionSurfTmId do
|
||||||
bCollisionFoundRestLength = EgtCDeSolidSolid( idRestLengthSurfFr, CollisionSurfTmId[i], BeamData.COLL_SIC)
|
bCollisionFoundRestLength = EgtCDeSolidSolid( idRestLengthSurfFr, CollisionSurfTmId[i], BeamData.COLL_SIC)
|
||||||
@@ -385,9 +384,6 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- si riporta la trave in posizione originale
|
|
||||||
EgtMove( Part.idRaw, Vector3d( -dDeltaXBeamOffset, 0, 0), GDB_RT.GLOB)
|
|
||||||
|
|
||||||
return false, bCollisionFoundRestLength
|
return false, bCollisionFoundRestLength
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -405,7 +401,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
|
|||||||
|
|
||||||
-- parametri opzionali
|
-- parametri opzionali
|
||||||
OptionalParameters = OptionalParameters or {}
|
OptionalParameters = OptionalParameters or {}
|
||||||
local bCheckOnlyRestlength = OptionalParameters.bCheckOnlyRestlength or false
|
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||||
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||||
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
||||||
local vtAux = OptionalParameters.vtAux
|
local vtAux = OptionalParameters.vtAux
|
||||||
@@ -430,7 +426,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
|
|||||||
-- se non si trova collisione si ritorna se è necessario separare prima di effettuare la lavorazione (ossia non c'è collisione con il pezzo ma c'è con il grezzo restante)
|
-- se non si trova collisione si ritorna se è necessario separare prima di effettuare la lavorazione (ossia non c'è collisione con il pezzo ma c'è con il grezzo restante)
|
||||||
for i = 1, #PointsOnToolTipCenter do
|
for i = 1, #PointsOnToolTipCenter do
|
||||||
|
|
||||||
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, bCheckOnlyRestlength)
|
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm)
|
||||||
|
|
||||||
-- se trovata collisione con pezzo è inutile controllare gli altri punti
|
-- se trovata collisione con pezzo è inutile controllare gli altri punti
|
||||||
if bCollisionFoundPiece then
|
if bCollisionFoundPiece then
|
||||||
@@ -449,7 +445,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
|
|||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
function PreSimulationLib.CheckCollision( sBladeEngagement, Parameters, OptionalParameters)
|
function PreSimulationLib.CheckCollision( Parameters, OptionalParameters)
|
||||||
|
|
||||||
local bCollisionFound
|
local bCollisionFound
|
||||||
local bMoveAfterSplitL3, bMoveAfterSplitR3, bMoveAfterSplitR2, bMoveAfterSplitR1
|
local bMoveAfterSplitL3, bMoveAfterSplitR3, bMoveAfterSplitR2, bMoveAfterSplitR1
|
||||||
@@ -463,24 +459,19 @@ function PreSimulationLib.CheckCollision( sBladeEngagement, Parameters, Optional
|
|||||||
OptionalParameters = OptionalParameters or {}
|
OptionalParameters = OptionalParameters or {}
|
||||||
|
|
||||||
local OptionalParametersCheckCollisionWithAxis = {}
|
local OptionalParametersCheckCollisionWithAxis = {}
|
||||||
OptionalParametersCheckCollisionWithAxis.bCheckOnlyRestlength = false
|
|
||||||
OptionalParametersCheckCollisionWithAxis.PointsToCheck = OptionalParameters.PointsToCheck or nil
|
OptionalParametersCheckCollisionWithAxis.PointsToCheck = OptionalParameters.PointsToCheck or nil
|
||||||
OptionalParametersCheckCollisionWithAxis.sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
OptionalParametersCheckCollisionWithAxis.sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||||
OptionalParametersCheckCollisionWithAxis.bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
OptionalParametersCheckCollisionWithAxis.bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
||||||
OptionalParametersCheckCollisionWithAxis.sBlockedAxis = OptionalParameters.sBlockedAxis
|
OptionalParametersCheckCollisionWithAxis.sBlockedAxis = OptionalParameters.sBlockedAxis
|
||||||
OptionalParametersCheckCollisionWithAxis.vtAux = OptionalParameters.vtAux
|
OptionalParametersCheckCollisionWithAxis.vtAux = OptionalParameters.vtAux
|
||||||
|
OptionalParametersCheckCollisionWithAxis.idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||||
|
|
||||||
local sBlockedAxis = OptionalParameters.sBlockedAxis
|
local sBlockedAxis = OptionalParameters.sBlockedAxis
|
||||||
local bIsDicing = OptionalParameters.bIsDicing or false
|
|
||||||
local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false
|
local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false
|
||||||
local bCheckOnlyRestlengthForAxisABC = false
|
|
||||||
|
|
||||||
-- se cubetti in modalità standard (no DownUp) gli assi AB e C si controllano solo con grezzo (ci sarebbe collisione con il materiale già rimosso controllando AB e C con pezzo)
|
|
||||||
if bIsDicing and ( sBladeEngagement == 'Standard') then
|
|
||||||
bCheckOnlyRestlengthForAxisABC = true
|
|
||||||
-- se l'elevazione reale (rispetto al pezzo + eventuale materiale in testa/coda) è maggiore del massimo materiale è sempre collisione
|
-- se l'elevazione reale (rispetto al pezzo + eventuale materiale in testa/coda) è maggiore del massimo materiale è sempre collisione
|
||||||
-- TODO rifare con funzione
|
-- TODO rifare con funzione
|
||||||
elseif not bDisableRealElevationCheck then
|
if not bDisableRealElevationCheck then
|
||||||
local Edge = Parameters.Edge
|
local Edge = Parameters.Edge
|
||||||
local vtNFace = Parameters.vtNFace
|
local vtNFace = Parameters.vtNFace
|
||||||
local dDepthToMachine = Parameters.dDepthToMachine
|
local dDepthToMachine = Parameters.dDepthToMachine
|
||||||
@@ -527,9 +518,6 @@ function PreSimulationLib.CheckCollision( sBladeEngagement, Parameters, Optional
|
|||||||
-- ultimo asse lineare prima dei rotativi (solitamente Z) si controlla sempre
|
-- ultimo asse lineare prima dei rotativi (solitamente Z) si controlla sempre
|
||||||
bCollisionFound, bMoveAfterSplitL3 = CheckCollisionWithAxis( sL3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
bCollisionFound, bMoveAfterSplitL3 = CheckCollisionWithAxis( sL3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
||||||
|
|
||||||
-- assi rotativi: se richiesto si controlla la collisione solo col grezzo
|
|
||||||
OptionalParametersCheckCollisionWithAxis.bCheckOnlyRestlength = bCheckOnlyRestlengthForAxisABC
|
|
||||||
|
|
||||||
if sR3 and not bCollisionFound then
|
if sR3 and not bCollisionFound then
|
||||||
bCollisionFound, bMoveAfterSplitR3 = CheckCollisionWithAxis( sR3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
bCollisionFound, bMoveAfterSplitR3 = CheckCollisionWithAxis( sR3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -131,6 +131,14 @@ local function MyProcessInputData()
|
|||||||
else
|
else
|
||||||
PARTS[i].b3PartOriginal = b3Solid
|
PARTS[i].b3PartOriginal = b3Solid
|
||||||
end
|
end
|
||||||
|
if BeamData.MAX_LENGTH and BeamData.MAX_LENGTH > 10 and b3Solid:getDimX() > BeamData.MAX_LENGTH then
|
||||||
|
local sOut = 'Lunghezza (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
|
||||||
|
'oltre i limiti della macchina (' .. EgtNumToString( BeamData.MAX_LENGTH, 2) .. ') '
|
||||||
|
EgtOutLog( sOut)
|
||||||
|
EgtOutBox( sOut, 'Lavora Travi', 'WARNING')
|
||||||
|
EgtDraw()
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
dRawW = PARTS[1].b3PartOriginal:getDimY()
|
dRawW = PARTS[1].b3PartOriginal:getDimY()
|
||||||
dRawH = PARTS[1].b3PartOriginal:getDimZ()
|
dRawH = PARTS[1].b3PartOriginal:getDimZ()
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ local function GetTenonStrategy( Proc, Part)
|
|||||||
ToolSearchParameters.dElevation = EgtSurfTmFacetElevationInBBox( Strategy.idTenonCutPlane, 0, Part.b3Part, true, GDB_ID.ROOT)
|
ToolSearchParameters.dElevation = EgtSurfTmFacetElevationInBBox( Strategy.idTenonCutPlane, 0, Part.b3Part, true, GDB_ID.ROOT)
|
||||||
|
|
||||||
ToolSearchParameters.vtToolDirection = Proc.FeatureInfo.vtTenonN
|
ToolSearchParameters.vtToolDirection = Proc.FeatureInfo.vtTenonN
|
||||||
|
ToolSearchParameters.sMillShape = 'STANDARD'
|
||||||
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing')
|
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing')
|
||||||
Machining.Cutting.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
Machining.Cutting.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ local function GetSCC( Machining)
|
|||||||
|
|
||||||
if TOOLS[Machining.nToolIndex].SetupInfo.bToolOnAggregate then
|
if TOOLS[Machining.nToolIndex].SetupInfo.bToolOnAggregate then
|
||||||
nSCC = MCH_SCC.ADIR_NEAR
|
nSCC = MCH_SCC.ADIR_NEAR
|
||||||
|
elseif TOOLS[Machining.nToolIndex].SetupInfo.nBlockedSCC then
|
||||||
|
nSCC = TOOLS[Machining.nToolIndex].SetupInfo.nBlockedSCC
|
||||||
elseif Machining.vtToolDirection:getY() <= 0 then
|
elseif Machining.vtToolDirection:getY() <= 0 then
|
||||||
nSCC = MCH_SCC.ADIR_YM
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
else
|
else
|
||||||
@@ -96,7 +98,7 @@ function STR0014.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
Strategy.Machining.nSCC = GetSCC( Strategy.Machining)
|
Strategy.Machining.nSCC = GetSCC( Strategy.Machining)
|
||||||
|
|
||||||
Strategy.Machining.nType = MCH_MY.MILLING
|
Strategy.Machining.nType = MCH_MY.MILLING
|
||||||
Strategy.Machining.sDepth = EgtClamp( Strategy.Parameters.dMachiningDepth, -1, 5)
|
Strategy.Machining.sDepth = EgtClamp( Strategy.Parameters.dMachiningDepth, -1, TOOLS[Strategy.Machining.nToolIndex].dMaxMaterial)
|
||||||
Strategy.Machining.nWorkside = MCH_MILL_WS.CENTER
|
Strategy.Machining.nWorkside = MCH_MILL_WS.CENTER
|
||||||
|
|
||||||
-- LeadIn / LeadOut
|
-- LeadIn / LeadOut
|
||||||
@@ -105,6 +107,18 @@ function STR0014.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
Strategy.Machining.LeadIn.nType = MCH_MILL_LI.NONE
|
Strategy.Machining.LeadIn.nType = MCH_MILL_LI.NONE
|
||||||
Strategy.Machining.LeadOut.nType = MCH_MILL_LI.NONE
|
Strategy.Machining.LeadOut.nType = MCH_MILL_LI.NONE
|
||||||
|
|
||||||
|
-- se è una penna, si limita la lavorazione per evitare di partire fuori dal grezzo
|
||||||
|
if ToolSearchParameters.sMillShape == 'PEN' then
|
||||||
|
Strategy.Machining.LeadIn.dStartAddLength = -20
|
||||||
|
Strategy.Machining.LeadOut.dEndAddLength = -20
|
||||||
|
end
|
||||||
|
|
||||||
|
-- TODO gestire meglio
|
||||||
|
-- se utensile montato su aggregato flottante
|
||||||
|
if TOOLS[Strategy.Machining.nToolIndex].bToolOnFloatingTH then
|
||||||
|
Strategy.Machining.dMaxElev = Strategy.Parameters.dMachiningDepth
|
||||||
|
Strategy.Machining.dLongitudinalOffset = -5
|
||||||
|
end
|
||||||
-- stessi parametri cambia solo al geometria
|
-- stessi parametri cambia solo al geometria
|
||||||
for i = 1, #Proc.FeatureInfo.AdditionalGeometries do
|
for i = 1, #Proc.FeatureInfo.AdditionalGeometries do
|
||||||
local AuxId = Proc.id + Proc.FeatureInfo.AdditionalGeometries[i]
|
local AuxId = Proc.id + Proc.FeatureInfo.AdditionalGeometries[i]
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
|
|||||||
local dShortPartLength = OptionalParameters.dShortPartLength or BeamData.LEN_SHORT_PART
|
local dShortPartLength = OptionalParameters.dShortPartLength or BeamData.LEN_SHORT_PART
|
||||||
local EdgeToMachineTop = OptionalParameters.EdgeToMachineTop
|
local EdgeToMachineTop = OptionalParameters.EdgeToMachineTop
|
||||||
local EdgeToMachineBottom = OptionalParameters.EdgeToMachineBottom
|
local EdgeToMachineBottom = OptionalParameters.EdgeToMachineBottom
|
||||||
local bIsDicing = OptionalParameters.bIsDicing
|
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||||
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation
|
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation
|
||||||
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength
|
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength
|
||||||
-- TODO qui sarebbe meglio avere dExtra come OptionalParameter???
|
-- TODO qui sarebbe meglio avere dExtra come OptionalParameter???
|
||||||
@@ -289,7 +289,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
|
|||||||
FaceToMachine = Face,
|
FaceToMachine = Face,
|
||||||
EdgeToMachine = EdgeToMachineTop,
|
EdgeToMachine = EdgeToMachineTop,
|
||||||
Part = Part,
|
Part = Part,
|
||||||
bIsDicing = bIsDicing,
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
})
|
})
|
||||||
@@ -304,7 +304,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
|
|||||||
FaceToMachine = Face,
|
FaceToMachine = Face,
|
||||||
EdgeToMachine = EdgeToMachineBottom,
|
EdgeToMachine = EdgeToMachineBottom,
|
||||||
Part = Part,
|
Part = Part,
|
||||||
bIsDicing = bIsDicing,
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
})
|
})
|
||||||
@@ -371,7 +371,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
|
|||||||
local bReduceBladePath = OptionalParameters.bReduceBladePath or false
|
local bReduceBladePath = OptionalParameters.bReduceBladePath or false
|
||||||
local bAllowFastCuts = OptionalParameters.bAllowFastCuts or false
|
local bAllowFastCuts = OptionalParameters.bAllowFastCuts or false
|
||||||
local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1]
|
local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1]
|
||||||
local bIsDicing = OptionalParameters.bIsDicing or false
|
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||||
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||||
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
||||||
-- lati da lavorare in base al tipo di lama
|
-- lati da lavorare in base al tipo di lama
|
||||||
@@ -390,7 +390,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
|
|||||||
EdgeToMachineTop = EdgeToMachineList.Top,
|
EdgeToMachineTop = EdgeToMachineList.Top,
|
||||||
EdgeToMachineBottom = EdgeToMachineList.Bottom,
|
EdgeToMachineBottom = EdgeToMachineList.Bottom,
|
||||||
nToolIndex = nToolIndex,
|
nToolIndex = nToolIndex,
|
||||||
bIsDicing = bIsDicing,
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
}
|
}
|
||||||
@@ -442,7 +442,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
|
|||||||
FaceToMachine = FaceToMachine,
|
FaceToMachine = FaceToMachine,
|
||||||
EdgeToMachine = EdgeToMachineList.TopGuillotine,
|
EdgeToMachine = EdgeToMachineList.TopGuillotine,
|
||||||
Part = Part,
|
Part = Part,
|
||||||
bIsDicing = bIsDicing,
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
})
|
})
|
||||||
@@ -475,7 +475,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
|||||||
OptionalParameters = OptionalParameters or {}
|
OptionalParameters = OptionalParameters or {}
|
||||||
local nToolIndex = OptionalParameters.nToolIndex
|
local nToolIndex = OptionalParameters.nToolIndex
|
||||||
local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1]
|
local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1]
|
||||||
local bIsDicing = OptionalParameters.bIsDicing or false
|
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||||
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||||
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
||||||
|
|
||||||
@@ -499,7 +499,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
|||||||
FaceToMachine = FaceToMachine,
|
FaceToMachine = FaceToMachine,
|
||||||
EdgeToMachine = EdgeToMachine,
|
EdgeToMachine = EdgeToMachine,
|
||||||
Part = Part,
|
Part = Part,
|
||||||
bIsDicing = bIsDicing,
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
})
|
})
|
||||||
@@ -512,7 +512,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
|||||||
FaceToMachine = FaceToMachine,
|
FaceToMachine = FaceToMachine,
|
||||||
EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN),
|
EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN),
|
||||||
Part = Part,
|
Part = Part,
|
||||||
bIsDicing = bIsDicing,
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
})
|
})
|
||||||
@@ -534,7 +534,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
|||||||
FaceToMachine = FaceToMachine,
|
FaceToMachine = FaceToMachine,
|
||||||
EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN),
|
EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN),
|
||||||
Part = Part,
|
Part = Part,
|
||||||
bIsDicing = bIsDicing,
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
})
|
})
|
||||||
@@ -553,7 +553,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
|||||||
FaceToMachine = FaceToMachine,
|
FaceToMachine = FaceToMachine,
|
||||||
EdgeToMachine = EdgeToMachine,
|
EdgeToMachine = EdgeToMachine,
|
||||||
Part = Part,
|
Part = Part,
|
||||||
bIsDicing = bIsDicing,
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
})
|
})
|
||||||
@@ -589,7 +589,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
|||||||
FaceToMachine = FaceToMachine,
|
FaceToMachine = FaceToMachine,
|
||||||
EdgeToMachine = EdgeToMachine,
|
EdgeToMachine = EdgeToMachine,
|
||||||
Part = Part,
|
Part = Part,
|
||||||
bIsDicing = bIsDicing,
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
})
|
})
|
||||||
@@ -607,7 +607,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
|||||||
dDepthToMachine = dDepthToMachine
|
dDepthToMachine = dDepthToMachine
|
||||||
}
|
}
|
||||||
local BladeEngagementOptionalParameters = {
|
local BladeEngagementOptionalParameters = {
|
||||||
bIsDicing = bIsDicing,
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
}
|
}
|
||||||
@@ -782,6 +782,52 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part, MainFace, OtherFace)
|
||||||
|
|
||||||
|
-- frame solidale alla feature
|
||||||
|
local vtZ = MainFace.vtN
|
||||||
|
local vtX = OtherFace and OtherFace.vtN or nil
|
||||||
|
local frMainFace = Frame3d( MainFace.ptCenter, vtZ, vtX)
|
||||||
|
|
||||||
|
-- box del cubetto in riferimento feature
|
||||||
|
local b3Surf = EgtGetBBoxRef( idParallelTm, GDB_BB.STANDARD, frMainFace)
|
||||||
|
if idPerpendicularTm then
|
||||||
|
local b3SurfPerpendicular = EgtGetBBoxRef( idPerpendicularTm, GDB_BB.STANDARD, frMainFace)
|
||||||
|
b3Surf:Add( b3SurfPerpendicular)
|
||||||
|
else
|
||||||
|
-- se non arriva la superficie perpendicolare è un solo taglio parallelo: si estende il box in Z in modo da uscire dal pezzo
|
||||||
|
local ptDeltaZ = b3Surf:getMax() + vtZ * ( MainFace.dElevation + 5)
|
||||||
|
b3Surf:Add( ptDeltaZ)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- estensione box per non avere problemi nella sottrazione booleana
|
||||||
|
if OtherFace and idPerpendicularTm then
|
||||||
|
local vtY = vtZ ^ vtX
|
||||||
|
local ptDeltaX = b3Surf:getMax() + vtX * 1
|
||||||
|
local ptDeltaZ = b3Surf:getMax() + vtZ * 1
|
||||||
|
local ptDeltaYplus = b3Surf:getMax() + vtY * 1
|
||||||
|
local ptDeltaYminus = b3Surf:getMin() - vtY * 1
|
||||||
|
b3Surf:Add( ptDeltaX)
|
||||||
|
b3Surf:Add( ptDeltaZ)
|
||||||
|
b3Surf:Add( ptDeltaYplus)
|
||||||
|
b3Surf:Add( ptDeltaYminus)
|
||||||
|
else
|
||||||
|
b3Surf:expand( 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- si porta il box in riferimento globale
|
||||||
|
b3Surf:toGlob( frMainFace)
|
||||||
|
|
||||||
|
-- conversione box cubetto in superficie
|
||||||
|
local idSurfTmToSubtract = EgtSurfTmBBox( Part.idTempGroup, b3Surf, false, GDB_RT.GLOB)
|
||||||
|
|
||||||
|
-- sottrazione del cubetto dal grezzo
|
||||||
|
EgtSurfTmSubtract( idRaw, idSurfTmToSubtract)
|
||||||
|
|
||||||
|
return idRaw
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local function CalculateDiceMachinings( vCuts, Parameters)
|
local function CalculateDiceMachinings( vCuts, Parameters)
|
||||||
local Machinings = {}
|
local Machinings = {}
|
||||||
local bMoveAfterSplit = false
|
local bMoveAfterSplit = false
|
||||||
@@ -789,6 +835,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
|||||||
local Proc = Parameters.Proc
|
local Proc = Parameters.Proc
|
||||||
local Part = Parameters.Part
|
local Part = Parameters.Part
|
||||||
local MainFace = Parameters.MainFace
|
local MainFace = Parameters.MainFace
|
||||||
|
local OtherFace = next( Parameters.OtherFace) and Parameters.OtherFace or nil
|
||||||
local Tool = Parameters.Tool
|
local Tool = Parameters.Tool
|
||||||
local sChosenBladeType = Parameters.sChosenBladeType
|
local sChosenBladeType = Parameters.sChosenBladeType
|
||||||
local dExtendAfterTail = Parameters.dExtendAfterTail
|
local dExtendAfterTail = Parameters.dExtendAfterTail
|
||||||
@@ -797,21 +844,15 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
|||||||
local bCannotSplitRestLength = Parameters.bCannotSplitRestLength
|
local bCannotSplitRestLength = Parameters.bCannotSplitRestLength
|
||||||
local bReduceDiceDepth = Parameters.bReduceDiceDepth
|
local bReduceDiceDepth = Parameters.bReduceDiceDepth
|
||||||
|
|
||||||
|
-- trimesh con RestLength
|
||||||
|
local b3CheckCollision = BeamLib.GetPartBoxWithHeadTail( Part, sRestLengthSideForPreSimulation)
|
||||||
|
local idCheckCollisionTm = EgtSurfTmBBox( Part.idTempGroup, b3CheckCollision, false, GDB_RT.GLOB)
|
||||||
|
|
||||||
-- eventuale inversione tagli ortogonali e aggiunta informazioni alla geometria
|
-- eventuale inversione tagli ortogonali e aggiunta informazioni alla geometria
|
||||||
local bAreOrthogonalCutsInverted = false
|
local bAreOrthogonalCutsInverted = false
|
||||||
for i = 1, #vCuts do
|
for i = 1, #vCuts do
|
||||||
for j = 1, #vCuts[i] do
|
for j = 1, #vCuts[i] do
|
||||||
SetDiceFaceInfo( Proc, vCuts[i][j])
|
SetDiceFaceInfo( Proc, vCuts[i][j])
|
||||||
-- TODO vedere se questa parte serve ancora; in teoria no perchè il taglio è girato automaticamente nella FaceByBlade
|
|
||||||
-- if ( i % 2) == 1 then
|
|
||||||
-- local vtO = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
|
|
||||||
-- if MachiningLib.IsFaceZOutOfRange( vtO, Tool) then
|
|
||||||
-- EgtInvertSurf( vCuts[i][j])
|
|
||||||
-- local vtCurrentFaceNormal = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
|
|
||||||
-- EgtMove( vCuts[i][j], -vtCurrentFaceNormal * Tool.dThickness, GDB_RT.GLOB)
|
|
||||||
-- bAreOrthogonalCutsInverted = true
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- calcolo lavorazioni
|
-- calcolo lavorazioni
|
||||||
@@ -852,19 +893,17 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
|||||||
end
|
end
|
||||||
-- calcolo lavorazione della singola faccia
|
-- calcolo lavorazione della singola faccia
|
||||||
-- per tagli paralleli e faccia aperta si prova a tagliare come se fosse una faccia singola, accorpando i tagli
|
-- 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 bCanMergeParallelCuts = ( ( i % 2) == 0) and ( Proc.nFct == 1)
|
||||||
local bIsDicingOk = true
|
local bIsDicingOk = true
|
||||||
if bCanMergeParallelCuts then
|
if bCanMergeParallelCuts then
|
||||||
local nAddGrpId = BeamLib.GetAddGroup( Part.id)
|
local nAddGrpId = BeamLib.GetAddGroup( Part.id)
|
||||||
local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
|
local idSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
|
||||||
local ProcTrimesh = FeatureLib.GetProcFromTrimesh( nSurfToCut, Part)
|
local ProcTrimesh = FeatureLib.GetProcFromTrimesh( idSurfToCut, Part)
|
||||||
|
|
||||||
local OptionalParametersCutWholeWaste = {
|
local OptionalParametersCutWholeWaste = {
|
||||||
nToolIndex = Tool.nIndex,
|
nToolIndex = Tool.nIndex,
|
||||||
dExtendAfterTail = dExtendAfterTail,
|
dExtendAfterTail = dExtendAfterTail,
|
||||||
bReduceBladePath = bReduceBladePath,
|
bReduceBladePath = bReduceBladePath,
|
||||||
bIsDicing = false,
|
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
}
|
}
|
||||||
@@ -877,8 +916,12 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
|||||||
bMoveAfterSplit = true
|
bMoveAfterSplit = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- aggiornamento grezzo dinamico
|
||||||
|
if i % 2 == 0 then
|
||||||
|
UpdateDiceRaw( idCheckCollisionTm, idSurfToCut, vCuts[i-1][#vCuts[i-1]], Part, MainFace, OtherFace)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
EgtErase( nSurfToCut)
|
EgtErase( idSurfToCut)
|
||||||
bIsDicingOk = false
|
bIsDicingOk = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -919,9 +962,10 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
|||||||
dRadialStepSpan = 0,
|
dRadialStepSpan = 0,
|
||||||
dExtendAfterTail = dExtendAfterTail,
|
dExtendAfterTail = dExtendAfterTail,
|
||||||
bIsDicing = true,
|
bIsDicing = true,
|
||||||
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength,
|
bCannotSplitRestLength = bCannotSplitRestLength,
|
||||||
bDisableRealElevationCheck = ( i % 2) > 0 -- se taglio perpendicolare non si deve mai considerare il materiale precedente
|
bDisableRealElevationCheck = true
|
||||||
}
|
}
|
||||||
Cutting = FaceByBlade.Make( ProcTrimesh, Part, FaceToMachine, EdgeToMachine, OptionalParametersFaceByBlade)
|
Cutting = FaceByBlade.Make( ProcTrimesh, Part, FaceToMachine, EdgeToMachine, OptionalParametersFaceByBlade)
|
||||||
Cutting.ptCenter = Point3d( ProcTrimesh.Faces[1].ptCenter:getX(), 0, 0)
|
Cutting.ptCenter = Point3d( ProcTrimesh.Faces[1].ptCenter:getX(), 0, 0)
|
||||||
@@ -936,6 +980,10 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
|||||||
if Cutting.sStage == 'AfterTail' then
|
if Cutting.sStage == 'AfterTail' then
|
||||||
bMoveAfterSplit = true
|
bMoveAfterSplit = true
|
||||||
end
|
end
|
||||||
|
-- aggiornamento grezzo dinamico
|
||||||
|
if i % 2 == 0 then
|
||||||
|
UpdateDiceRaw( idCheckCollisionTm, vCuts[i][j], vCuts[i-1][j], Part, MainFace, OtherFace)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1013,6 +1061,7 @@ local function CutWithDicing( Proc, Part, OptionalParameters)
|
|||||||
Proc = Proc,
|
Proc = Proc,
|
||||||
Part = Part,
|
Part = Part,
|
||||||
MainFace = Face1,
|
MainFace = Face1,
|
||||||
|
OtherFace = Face2,
|
||||||
Tool = TOOLS[nToolIndex],
|
Tool = TOOLS[nToolIndex],
|
||||||
sChosenBladeType = sChosenBladeType,
|
sChosenBladeType = sChosenBladeType,
|
||||||
dExtendAfterTail = dExtendAfterTail,
|
dExtendAfterTail = dExtendAfterTail,
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
|||||||
local dRadialStepSpan = OptionalParameters.dRadialStepSpan
|
local dRadialStepSpan = OptionalParameters.dRadialStepSpan
|
||||||
local sUserNotes = OptionalParameters.sUserNotes or ''
|
local sUserNotes = OptionalParameters.sUserNotes or ''
|
||||||
local bIsDicing = OptionalParameters.bIsDicing or false
|
local bIsDicing = OptionalParameters.bIsDicing or false
|
||||||
|
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||||
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||||
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
||||||
local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false
|
local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false
|
||||||
@@ -232,8 +233,12 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
|||||||
Tool = TOOLS[Cutting.nToolIndex],
|
Tool = TOOLS[Cutting.nToolIndex],
|
||||||
dDepthToMachine = dDepthToMachine
|
dDepthToMachine = dDepthToMachine
|
||||||
}
|
}
|
||||||
|
if OppositeToolDirectionMode == 'Enabled' then
|
||||||
|
BladeEngagementParameters.Edge = EdgeToMachineOpposite
|
||||||
|
end
|
||||||
local BladeEngagementOptionalParameters = {
|
local BladeEngagementOptionalParameters = {
|
||||||
bIsDicing = bIsDicing,
|
bIsDicing = bIsDicing,
|
||||||
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength,
|
bCannotSplitRestLength = bCannotSplitRestLength,
|
||||||
bDisableRealElevationCheck = bDisableRealElevationCheck
|
bDisableRealElevationCheck = bDisableRealElevationCheck
|
||||||
@@ -357,6 +362,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
|||||||
}
|
}
|
||||||
local BladeEngagementOptionalParameters = {
|
local BladeEngagementOptionalParameters = {
|
||||||
bIsDicing = bIsDicing,
|
bIsDicing = bIsDicing,
|
||||||
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength,
|
bCannotSplitRestLength = bCannotSplitRestLength,
|
||||||
bDisableRealElevationCheck = bDisableRealElevationCheck
|
bDisableRealElevationCheck = bDisableRealElevationCheck
|
||||||
@@ -475,6 +481,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
|||||||
}
|
}
|
||||||
local BladeEngagementOptionalParameters = {
|
local BladeEngagementOptionalParameters = {
|
||||||
bIsDicing = bIsDicing,
|
bIsDicing = bIsDicing,
|
||||||
|
idCheckCollisionTm = idCheckCollisionTm,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength,
|
bCannotSplitRestLength = bCannotSplitRestLength,
|
||||||
bDisableRealElevationCheck = bDisableRealElevationCheck
|
bDisableRealElevationCheck = bDisableRealElevationCheck
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
==== Beam Update Log ====
|
==== Beam Update Log ====
|
||||||
|
|
||||||
Versione 2.6-- (--/--/2024)
|
Versione 3.1e1 (29/05/2026)
|
||||||
- Primo commit creazione nuovo automatismo BEAM con strategie
|
- Primo commit nuovo automatismo a strategie
|
||||||
+2
-2
@@ -2,5 +2,5 @@
|
|||||||
-- Gestione della versione di Beam
|
-- Gestione della versione di Beam
|
||||||
|
|
||||||
NAME = 'Beam'
|
NAME = 'Beam'
|
||||||
VERSION = '2.8a1'
|
VERSION = '3.1e1'
|
||||||
MIN_EXE = '2.7j2'
|
MIN_EXE = '3.1e1'
|
||||||
|
|||||||
Reference in New Issue
Block a user