Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b8d3cd461b | |||
| c506486585 | |||
| a73c0c85ac | |||
| fb3a5ec0be | |||
| e3e7537f8f | |||
| eec6b50985 | |||
| b5cb706ad5 | |||
| 053755e583 | |||
| c7045499f4 | |||
| 44478b91f0 | |||
| 1f4aa15af4 | |||
| a5d606b225 | |||
| c4697fbd6f | |||
| f58004dfeb | |||
| 7c485360de | |||
| 967117cc23 | |||
| 64b2e86a2d | |||
| 89b342a564 | |||
| 117e475de5 | |||
| a7b817b211 | |||
| d8c6a8ad55 | |||
| 9026acd9ca | |||
| 204346326f | |||
| 5d6e4c397d | |||
| 64bde8924d | |||
| cb6115d23f | |||
| 771c1367b1 | |||
| 6092063daa | |||
| 44650c303c | |||
| 69fa0d741d | |||
| 8e55ddda1f | |||
| 7a8fb04ebe | |||
| 77c27d911c | |||
| 3a29f273c9 | |||
| bab5b07bd1 | |||
| 683ae78c65 | |||
| 06d9529b7b | |||
| 922a7ac846 | |||
| a21a3979f1 | |||
| fcbed252e1 | |||
| 28026358b9 |
@@ -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
|
||||||
|
|
||||||
@@ -492,6 +510,7 @@ if bToProcess then
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- TODO in caso di "GEN_sPiecesLoadingPosition = FULL_PRE_ROTATION" bisogna controllare anche sezione ribaltata di 90°
|
||||||
-- Verifico sezione barra non troppo grande
|
-- Verifico sezione barra non troppo grande
|
||||||
if not BeamData.MAX_WIDTH2 or not BeamData.MAX_HEIGHT2 then
|
if not BeamData.MAX_WIDTH2 or not BeamData.MAX_HEIGHT2 then
|
||||||
if ( dRawW > BeamData.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > BeamData.MAX_HEIGHT + 10 * GEO.EPS_SMALL) then
|
if ( dRawW > BeamData.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > BeamData.MAX_HEIGHT + 10 * GEO.EPS_SMALL) then
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
-- GetWallData.lua by Egaltech s.r.l. 2022/06/28
|
||||||
|
-- Recupero dati da file WallData.lua di macchina
|
||||||
|
|
||||||
|
-- Intestazioni
|
||||||
|
require( 'EgtBase')
|
||||||
|
_ENV = EgtProtectGlobal()
|
||||||
|
EgtEnableDebug( false)
|
||||||
|
|
||||||
|
-- Per test
|
||||||
|
--GWD = {}
|
||||||
|
--GWD.MACHINE = 'Essetre-90480019_MW'
|
||||||
|
|
||||||
|
local sLog = 'GetBeamData : ' .. GWD.MACHINE
|
||||||
|
EgtOutLog( sLog)
|
||||||
|
|
||||||
|
-- Imposto direttorio libreria specializzata per Travi
|
||||||
|
EgtAddToPackagePath( GWD.BASEDIR .. '\\LuaLibs\\?.lua')
|
||||||
|
|
||||||
|
-- Verifico che la macchina corrente sia abilitata per la lavorazione delle Travi
|
||||||
|
local sMachDir = EgtGetCurrMachineDir()
|
||||||
|
if not EgtExistsFile( sMachDir .. '\\Beam\\BeamDataNew.lua') then
|
||||||
|
GWD.ERR = 12
|
||||||
|
GWD.MSG = 'Error not configured for beam machine : ' .. GWD.MACHINE
|
||||||
|
WriteErrToLogFile( GWD.ERR, GWD.MSG)
|
||||||
|
PostErrView( GWD.ERR, GWD.MSG)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Elimino direttori altre macchine e imposto direttorio macchina corrente per ricerca librerie
|
||||||
|
EgtRemoveBaseMachineDirFromPackagePath()
|
||||||
|
EgtAddToPackagePath( sMachDir .. '\\Beam\\?.lua')
|
||||||
|
|
||||||
|
-- Carico i dati globali
|
||||||
|
_G.package.loaded.BeamData = nil
|
||||||
|
local BD = require( 'BeamDataNew')
|
||||||
|
|
||||||
|
-- Assegno valori di interesse
|
||||||
|
GWD.SIMUL_VIEW_DIR = BD.SIMUL_VIEW_DIR
|
||||||
|
GWD.OVM_MID = BD.OVM_MID
|
||||||
|
|
||||||
|
-- Tutto ok
|
||||||
|
GWD.ERR = 0
|
||||||
|
|
||||||
|
EgtOutLog( ' +++ GetBeamData completed')
|
||||||
+10
-9
@@ -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)
|
||||||
@@ -1772,8 +1777,9 @@ function BeamExec.ProcessMachinings( PARTS, bIsFlipRot)
|
|||||||
local nInitialPosition = MatrixResult.nInitialPosition
|
local nInitialPosition = MatrixResult.nInitialPosition
|
||||||
-- PREROTAZIONE PEZZO
|
-- PREROTAZIONE PEZZO
|
||||||
if MatrixResult.nInitialPosition ~= 1 or PARTS[nPart].bPartInCombiIsInverted then
|
if MatrixResult.nInitialPosition ~= 1 or PARTS[nPart].bPartInCombiIsInverted then
|
||||||
-- si toglie il pezzo dal grezzo per poter fare operazioni
|
-- si esce dalle lavorazioni e si torna in disegna
|
||||||
EgtRemovePartFromRawPart( PARTS[nPart].id)
|
local nCurrMachGroup = EgtGetCurrMachGroup()
|
||||||
|
EgtResetCurrMachGroup()
|
||||||
|
|
||||||
-- salvo situazione precedente su lista BEAM ( scrittura variabili globali per interfaccia)
|
-- salvo situazione precedente su lista BEAM ( scrittura variabili globali per interfaccia)
|
||||||
if bIsFlipRot then
|
if bIsFlipRot then
|
||||||
@@ -1795,11 +1801,8 @@ function BeamExec.ProcessMachinings( PARTS, bIsFlipRot)
|
|||||||
EgtRotate( PARTS[nPart].id, ptRot, X_AX(), nRotationDeg, GDB_RT.GLOB)
|
EgtRotate( PARTS[nPart].id, ptRot, X_AX(), nRotationDeg, GDB_RT.GLOB)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- si rimette il pezzo nel grezzo
|
-- si riattiva il MachGroup, i pezzi son rimasti dove erano
|
||||||
EgtAddPartToRawPart( PARTS[nPart].id, {0,0,0}, PARTS[nPart].idRaw)
|
EgtSetCurrMachGroup( nCurrMachGroup)
|
||||||
|
|
||||||
-- dico che il pezzo originale è nella posizione iniziale come arriva da BTL ( è stato appena ruotato qui sopra)
|
|
||||||
nInitialPosition = 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- salvo sul PART la posizione di partenza che è stata scelta
|
-- salvo sul PART la posizione di partenza che è stata scelta
|
||||||
@@ -1895,8 +1898,6 @@ function BeamExec.ProcessMachinings( PARTS, bIsFlipRot)
|
|||||||
if PARTS[nPart].bPartInCombiIsInverted then
|
if PARTS[nPart].bPartInCombiIsInverted then
|
||||||
BeamLib.InvertRawPart( PARTS[nPart], -2)
|
BeamLib.InvertRawPart( PARTS[nPart], -2)
|
||||||
end
|
end
|
||||||
-- ripristino anche eventuali pre-rotazioni
|
|
||||||
nInitialPosition = nInitialPosition + ( BEAM.PREROTATE90 or 0)
|
|
||||||
-- si ribalta il pezzo in posizione iniziale
|
-- si ribalta il pezzo in posizione iniziale
|
||||||
BeamLib.RotateRawPart( PARTS[nPart], 1 - nInitialPosition)
|
BeamLib.RotateRawPart( PARTS[nPart], 1 - nInitialPosition)
|
||||||
else
|
else
|
||||||
|
|||||||
+11
-10
@@ -785,17 +785,18 @@ function BeamLib.BinaryToDecimal( dNumber)
|
|||||||
local sNumberToConvert = tostring( dNumber)
|
local sNumberToConvert = tostring( dNumber)
|
||||||
local dResult = 0
|
local dResult = 0
|
||||||
local k = 0
|
local k = 0
|
||||||
|
|
||||||
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
|
||||||
@@ -816,7 +817,7 @@ function BeamLib.DecimalToBinary( dNumber)
|
|||||||
for i = #tmp, 1, -1 do
|
for i = #tmp, 1, -1 do
|
||||||
sResult = sResult..tmp[i]
|
sResult = sResult..tmp[i]
|
||||||
end
|
end
|
||||||
|
|
||||||
return tonumber( sResult)
|
return tonumber( sResult)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -453,7 +453,7 @@ function DiceCut.GetDice( Part, Face1, Face2, OptionalParameters)
|
|||||||
-- se piani non ortogonali, diminuisco la distanza di offset opportunamente
|
-- se piani non ortogonali, diminuisco la distanza di offset opportunamente
|
||||||
local dOffsetParallelOriginal = dOffsetParallel
|
local dOffsetParallelOriginal = dOffsetParallel
|
||||||
if not bGetOrtoPlanes then
|
if not bGetOrtoPlanes then
|
||||||
local dCoeff = ( vtNMainFace ^ vtNSubordinateFace):len()
|
local dCoeff = max( ( vtNMainFace ^ vtNSubordinateFace):len(), 0.5)
|
||||||
dOffsetParallel = dOffsetParallel * dCoeff
|
dOffsetParallel = dOffsetParallel * dCoeff
|
||||||
dOffsetOrthogonal = dOffsetOrthogonal * dCoeff
|
dOffsetOrthogonal = dOffsetOrthogonal * dCoeff
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -337,6 +337,9 @@ function FeatureLib.GetAdditionalInfo( Proc, Part)
|
|||||||
Proc.AdjacencyMatrix = FaceData.GetAdjacencyMatrix( Proc)
|
Proc.AdjacencyMatrix = FaceData.GetAdjacencyMatrix( Proc)
|
||||||
Proc.Faces = FaceData.GetFacesInfo( Proc, Part)
|
Proc.Faces = FaceData.GetFacesInfo( Proc, Part)
|
||||||
Proc.FeatureInfo, Proc.MainFaces = FeatureLib.GetRafterNotchData( Proc)
|
Proc.FeatureInfo, Proc.MainFaces = FeatureLib.GetRafterNotchData( Proc)
|
||||||
|
elseif ( ID.IsScarfJoint( Proc) or ID.IsScarfSimple( Proc)) then
|
||||||
|
Proc.AdjacencyMatrix = FaceData.GetAdjacencyMatrix( Proc)
|
||||||
|
Proc.Faces = FaceData.GetFacesInfo( Proc, Part)
|
||||||
end
|
end
|
||||||
|
|
||||||
return Proc
|
return Proc
|
||||||
|
|||||||
+36
-10
@@ -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
|
||||||
@@ -363,16 +363,22 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
|
|||||||
-- attacco perpendicolare
|
-- attacco perpendicolare
|
||||||
local PerpendicularLeadInOut = LeadInOutLib.CalculateLeadInOut( 'Perpendicular', Parameters, LeadInOutOptionalParameters)
|
local PerpendicularLeadInOut = LeadInOutLib.CalculateLeadInOut( 'Perpendicular', Parameters, LeadInOutOptionalParameters)
|
||||||
-- check extracorsa nei punti di attacco
|
-- check extracorsa nei punti di attacco
|
||||||
|
|
||||||
PointsOnToolTipCenter = {
|
PointsOnToolTipCenter = {
|
||||||
PreSimulationLib.GetPointOnToolTipCenter( PerpendicularLeadInOut.LeadIn.ptPoint, vtHead, Face.vtN, Edge.vtN, Tool),
|
PreSimulationLib.GetPointOnToolTipCenter( PerpendicularLeadInOut.LeadIn.ptPoint, vtHead, Face.vtN, Edge.vtN, Tool),
|
||||||
PreSimulationLib.GetPointOnToolTipCenter( PerpendicularLeadInOut.LeadOut.ptPoint, vtHead, Face.vtN, Edge.vtN, Tool)
|
PreSimulationLib.GetPointOnToolTipCenter( PerpendicularLeadInOut.LeadOut.ptPoint, vtHead, Face.vtN, Edge.vtN, Tool)
|
||||||
}
|
}
|
||||||
local bOutOfStrokePerpendicular = PreSimulationLib.CheckOutOfStrokeFromPoints( PointsOnToolTipCenter, vtHead, nSCC, Tool)
|
local bOutOfStrokePerpendicular = PreSimulationLib.CheckOutOfStrokeFromPoints( PointsOnToolTipCenter, vtHead, nSCC, Tool)
|
||||||
-- se non è in extracorsa si aggiunge come attacco possibile
|
-- attacco perpendicolare non in extracorsa: si verifica se è in collisione
|
||||||
if not bOutOfStrokePerpendicular then
|
if not bOutOfStrokePerpendicular then
|
||||||
LeadInOut.Perpendicular = PerpendicularLeadInOut
|
CheckCollisionOptionalParameters.PointsToCheck = {}
|
||||||
LeadInOut.Perpendicular.bMoveAfterSplit = bMoveAfterSplit
|
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadIn.ptPoint)
|
||||||
|
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadOut.ptPoint)
|
||||||
|
local bCollisionFoundPerpendicular, bMoveAfterSplitPerpendicular = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
|
||||||
|
-- attacco perpendicolare possibile
|
||||||
|
if not bCollisionFoundPerpendicular then
|
||||||
|
LeadInOut.Perpendicular = PerpendicularLeadInOut
|
||||||
|
LeadInOut.Perpendicular.bMoveAfterSplit = bMoveAfterSplitPerpendicular
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- se c'è almeno un lato chiuso l'unico attacco possibile è il perpendicolare
|
-- se c'è almeno un lato chiuso l'unico attacco possibile è il perpendicolare
|
||||||
if not ( Edge.bIsStartOpen and Edge.bIsEndOpen) then
|
if not ( Edge.bIsStartOpen and Edge.bIsEndOpen) then
|
||||||
@@ -397,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
|
||||||
@@ -468,6 +474,11 @@ end
|
|||||||
function MachiningLib.FindMill( Proc, ToolSearchParameters)
|
function MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||||
local ToolInfo = {}
|
local ToolInfo = {}
|
||||||
|
|
||||||
|
-- direzione utensile e fipo fresa obbligatori, altrimenti si esce
|
||||||
|
if not ToolSearchParameters.vtToolDirection or not ToolSearchParameters.sMillShape then
|
||||||
|
return ToolInfo
|
||||||
|
end
|
||||||
|
|
||||||
local nBestToolIndex
|
local nBestToolIndex
|
||||||
local dBestToolResidualDepth = 0
|
local dBestToolResidualDepth = 0
|
||||||
for i = 1, #TOOLS do
|
for i = 1, #TOOLS do
|
||||||
@@ -511,6 +522,18 @@ function MachiningLib.FindMill( Proc, ToolSearchParameters)
|
|||||||
bIsToolCompatible = false
|
bIsToolCompatible = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- TODO da sostituire con test collisione come lama
|
||||||
|
local bIsFromBottom = ToolSearchParameters.vtToolDirection:getZ() < - 10 * GEO.EPS_SMALL
|
||||||
|
local bIsFromTop = ToolSearchParameters.vtToolDirection:getZ() > 10 * GEO.EPS_SMALL
|
||||||
|
local bIsSlanted = abs( ToolSearchParameters.vtToolDirection:getY()) > 0.707
|
||||||
|
local bIsOnHeadOrTail = Proc.AffectedFaces.bLeft or Proc.AffectedFaces.bRight
|
||||||
|
if ( ( bIsFromBottom and TOOLS[i].SetupInfo.HeadType.bTop) or ( bIsFromTop and TOOLS[i].SetupInfo.HeadType.bBottom))
|
||||||
|
and ( not bIsSlanted)
|
||||||
|
and ( not bIsOnHeadOrTail) then
|
||||||
|
|
||||||
|
bIsToolCompatible = false
|
||||||
|
end
|
||||||
|
|
||||||
-- scelgo il migliore
|
-- scelgo il migliore
|
||||||
if bIsToolCompatible then
|
if bIsToolCompatible then
|
||||||
@@ -579,6 +602,7 @@ end
|
|||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
-- funzione per cercare utensile tipo LAMA con certe caratteristiche
|
-- funzione per cercare utensile tipo LAMA con certe caratteristiche
|
||||||
-- TODO da rivedere/completare
|
-- TODO da rivedere/completare
|
||||||
|
-- TODO per Engagement serviranno (opzionali) sBlockedAxis e vtAux
|
||||||
function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||||
local ToolInfo = {}
|
local ToolInfo = {}
|
||||||
|
|
||||||
@@ -604,9 +628,10 @@ 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 nBestToolIndex
|
local nBestToolIndex
|
||||||
local dBestToolResidualDepth = 0
|
local dBestToolResidualDepth = 0
|
||||||
@@ -638,9 +663,10 @@ 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
|
||||||
}
|
}
|
||||||
TIMER:startElapsed( 'GetBladeEngagement')
|
TIMER:startElapsed( 'GetBladeEngagement')
|
||||||
bIsBladeOk, CurrentEngagement = MachiningLib.GetBladeEngagement( BladeEngagementParameters, BladeEngagementOptionalParameters)
|
bIsBladeOk, CurrentEngagement = MachiningLib.GetBladeEngagement( BladeEngagementParameters, BladeEngagementOptionalParameters)
|
||||||
@@ -1443,7 +1469,7 @@ function MachiningLib.AddOperations( MACHININGS, Part, sRotation)
|
|||||||
local idDisp = EgtGetPhaseDisposition( nPhase)
|
local idDisp = EgtGetPhaseDisposition( nPhase)
|
||||||
|
|
||||||
-- posizione iniziale considerando eventuiali prerotazioni
|
-- posizione iniziale considerando eventuiali prerotazioni
|
||||||
local nRealInitialPosition = Part.nInitialPosition - ( BEAM.PREROTATE90 or 0)
|
local nRealInitialPosition = Part.nInitialPosition
|
||||||
if sRotation == 'DOWN' then
|
if sRotation == 'DOWN' then
|
||||||
local nRotation = EgtIf( nRealInitialPosition + 2 > 4, nRealInitialPosition + 2 - 4, nRealInitialPosition + 2) - 1
|
local nRotation = EgtIf( nRealInitialPosition + 2 > 4, nRealInitialPosition + 2 - 4, nRealInitialPosition + 2) - 1
|
||||||
BeamLib.RotateRawPart( Part, nRotation)
|
BeamLib.RotateRawPart( Part, nRotation)
|
||||||
|
|||||||
+135
-74
@@ -113,7 +113,7 @@ local function GetToolExitPoint( ptMachining, vtNEdge, vtHead, Tool, bIsDownUp)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
-- calcolo pivot in riferimento globale, datipunto sull'uscita utensile e direzioni
|
-- calcolo pivot in riferimento globale, dati punto sull'uscita utensile e direzioni
|
||||||
local function GetGlobalPivot( ptToolExit, vtC, vtHead, vtMovePivot)
|
local function GetGlobalPivot( ptToolExit, vtC, vtHead, vtMovePivot)
|
||||||
|
|
||||||
-- frame solidale all'utensile (lo stesso in cui vtMovePivot è definito)
|
-- frame solidale all'utensile (lo stesso in cui vtMovePivot è definito)
|
||||||
@@ -269,68 +269,117 @@ function PreSimulationLib.CheckOutOfStrokeFromGeometry( idGeometry, vtHead, nSCC
|
|||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
local function CheckCollisionPoint( ptToolExitToCheck, vtC, vtHead, PreCollisionData, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, bCheckOnlyRestlength)
|
local function MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
|
||||||
|
|
||||||
local ptPivot = GetGlobalPivot( ptToolExitToCheck, vtC, vtHead, PreCollisionData.vtMovePivot)
|
-- calcolo assi rotativi
|
||||||
|
local bOkAngles, nSolutionsAngles, RotativeAxesValues = EgtGetCalcAnglesEx( vtHead, vtAux)
|
||||||
|
local dRotative1 = RotativeAxesValues[1]
|
||||||
|
local dRotative2 = RotativeAxesValues[2]
|
||||||
|
local dRotative3 = RotativeAxesValues[3]
|
||||||
|
|
||||||
-- orientamento del riferimento locale
|
if not bOkAngles then
|
||||||
local vtDirectionX = PreCollisionData.Directions.vtDirectionX
|
error( ' MoveMachineAxesToPosition : error')
|
||||||
local vtDirectionY = PreCollisionData.Directions.vtDirectionY
|
end
|
||||||
local vtDirectionZ = PreCollisionData.Directions.vtDirectionZ
|
|
||||||
|
|
||||||
-- costruzione trimesh a partire dalla curva di collisione
|
-- calcolo assi lineari
|
||||||
-- recupero punti da macchina per costruire trimesh
|
local bOkPositions, _, dLinear1, dLinear2, dLinear3 = EgtGetCalcPositions( ptOnToolTipCenter, dRotative1, dRotative2, dRotative3)
|
||||||
local CollisionCurvePoints = PreCollisionData.Points
|
|
||||||
-- curva di collisione in riferimento locale
|
if not bOkPositions then
|
||||||
local idCollisionCurve = EgtCurveCompoFromPoints( Part.idTempGroup, CollisionCurvePoints)
|
|
||||||
-- curva in riferimento globale
|
error( ' MoveMachineAxesToPosition : error')
|
||||||
local frReference = Frame3d( ptPivot, vtDirectionZ, vtDirectionX)
|
end
|
||||||
EgtTransform( idCollisionCurve, frReference, GDB_RT.GLOB)
|
|
||||||
-- trimesh di collisione
|
local AxesNames = EgtGetAllCurrAxesNames()
|
||||||
local idCollisionSurfTm
|
local dTHome = EgtGetAxisHomePos( AxesNames[1])
|
||||||
if PreCollisionData.bSurfTmByRevolve then
|
|
||||||
idCollisionSurfTm = EgtSurfTmByRevolve( Part.idTempGroup, idCollisionCurve, ptPivot, vtDirectionY, true, 0.05, GDB_RT.GLOB)
|
-- spostamento assi in posizione (la T non si sposta perchè si sposta il pezzo)
|
||||||
else
|
EgtSetAxisPos( AxesNames[2], dLinear2)
|
||||||
local vtPreMove = -vtDirectionZ * ( PreCollisionData.dExtrusionDepth / 2)
|
EgtSetAxisPos( AxesNames[3], dLinear3)
|
||||||
EgtMove( idCollisionCurve, vtPreMove, GDB_RT.GLOB)
|
EgtSetAxisPos( AxesNames[4], dRotative1)
|
||||||
local vtExtrusion = vtDirectionZ * PreCollisionData.dExtrusionDepth
|
EgtSetAxisPos( AxesNames[5], dRotative2)
|
||||||
idCollisionSurfTm = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idCollisionCurve, vtExtrusion, 0.05, GDB_RT.GLOB)
|
if dRotative3 then
|
||||||
|
EgtSetAxisPos( AxesNames[6], dRotative3)
|
||||||
|
end
|
||||||
|
|
||||||
|
return dLinear1 - dTHome
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm)
|
||||||
|
|
||||||
|
-- spostamento assi macchina in posizione
|
||||||
|
local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
|
||||||
|
|
||||||
|
-- si recuperano gli id delle geometrie dell'asse con cui controllare la collisione
|
||||||
|
local idCollisionGroup = EgtGetFirstNameInGroup( EgtGetAxisId( sAxis), 'COLLISION')
|
||||||
|
local idCollisionGroupOther = EgtGetFirstNameInGroup( EgtGetAxisId( sAxis), 'OTHER_COLLISION') or GDB_ID.NULL
|
||||||
|
local CollisionGroupEntitiesId = EgtGetAllInGroup( idCollisionGroup)
|
||||||
|
local CollisionGroupOtherEntitiesId = EgtGetAllInGroup( idCollisionGroupOther)
|
||||||
|
-- si tengono solo gli elementi trimesh
|
||||||
|
local CollisionSurfTmId = {}
|
||||||
|
for i = 1, #CollisionGroupEntitiesId do
|
||||||
|
if EgtGetType( CollisionGroupEntitiesId[i]) == GDB_TY.SRF_MESH then
|
||||||
|
local idCollisionSurfTmCopy = EgtCopyGlob( CollisionGroupEntitiesId[i], Part.idTempGroup)
|
||||||
|
EgtMove( idCollisionSurfTmCopy, Vector3d( dDeltaXHeadOffset, 0, 0), GDB_RT.GLOB)
|
||||||
|
table.insert( CollisionSurfTmId, idCollisionSurfTmCopy)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- se presenti geometrie nel gruppo other si aggiungono anche quelle
|
||||||
|
if CollisionGroupOtherEntitiesId and #CollisionGroupOtherEntitiesId > 0 then
|
||||||
|
for i = 1, #CollisionGroupOtherEntitiesId do
|
||||||
|
if EgtGetType( CollisionGroupOtherEntitiesId[i]) == GDB_TY.SRF_MESH then
|
||||||
|
local idCollisionOtherSurfTmCopy = EgtCopyGlob( CollisionGroupOtherEntitiesId[i], Part.idTempGroup)
|
||||||
|
EgtMove( idCollisionOtherSurfTmCopy, Vector3d( dDeltaXHeadOffset, 0, 0), GDB_RT.GLOB)
|
||||||
|
table.insert( CollisionSurfTmId, idCollisionOtherSurfTmCopy)
|
||||||
|
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
|
||||||
bCollisionFoundPiece = EgtCDeSolidSolid( idCheckCollisionTm, idCollisionSurfTm, BeamData.COLL_SIC)
|
end
|
||||||
|
for i = 1, #CollisionSurfTmId do
|
||||||
|
bCollisionFoundPiece = EgtCDeSolidSolid( idCheckCollisionTm, CollisionSurfTmId[i], BeamData.COLL_SIC)
|
||||||
if not type( bCollisionFoundPiece) == "boolean" then
|
if not type( bCollisionFoundPiece) == "boolean" then
|
||||||
error( 'Presimulation fail')
|
error( 'Presimulation fail')
|
||||||
end
|
end
|
||||||
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
|
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
|
||||||
EgtSetColor( idCollisionSurfTm, RED())
|
EgtSetColor( CollisionSurfTmId[i], RED())
|
||||||
end
|
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
|
||||||
|
|
||||||
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)
|
||||||
if idRestLengthSurfFr then
|
if idRestLengthSurfFr then
|
||||||
bCollisionFoundRestLength = EgtCDeSolidSolid( idRestLengthSurfFr, idCollisionSurfTm, BeamData.COLL_SIC)
|
for i = 1, #CollisionSurfTmId do
|
||||||
if not type( bCollisionFoundRestLength) == "boolean" then
|
bCollisionFoundRestLength = EgtCDeSolidSolid( idRestLengthSurfFr, CollisionSurfTmId[i], BeamData.COLL_SIC)
|
||||||
error( 'Presimulation fail')
|
if not type( bCollisionFoundRestLength) == "boolean" then
|
||||||
end
|
error( 'Presimulation fail')
|
||||||
if EgtGetDebugLevel() >= 3 and bCollisionFoundRestLength then
|
end
|
||||||
EgtSetColor( idCollisionSurfTm, ORANGE())
|
if EgtGetDebugLevel() >= 3 and bCollisionFoundRestLength then
|
||||||
|
EgtSetColor( CollisionSurfTmId[i], ORANGE())
|
||||||
|
end
|
||||||
|
if bCollisionFoundRestLength then
|
||||||
|
break
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -352,46 +401,32 @@ 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
|
||||||
|
|
||||||
-- se normale faccia non parallela a direzione testa c'è qualcosa che non va
|
-- se normale faccia non parallela a direzione testa c'è qualcosa che non va
|
||||||
if not AreSameOrOppositeVectorApprox( vtNFace, vtHead) then
|
if not AreSameOrOppositeVectorApprox( vtNFace, vtHead) then
|
||||||
error( 'CheckCollisionWithAxis : invalid directions')
|
error( 'CheckCollisionWithAxis : invalid directions')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- punti notevoli della lavorazione in cui fare il check
|
-- punti notevoli della lavorazione in cui fare il check
|
||||||
local PointsToCheck = OptionalParameters.PointsToCheck or GetCollisionPointsToCheck( Edge, dDepthToMachine)
|
local PointsToCheck = OptionalParameters.PointsToCheck or GetCollisionPointsToCheck( Edge, dDepthToMachine)
|
||||||
|
|
||||||
-- punti in centro lama su naso mandrino o aggregato. In base a direzione e punto
|
-- punti sul tip dell'utensile, in centro
|
||||||
local bIsDownUp = AreOppositeVectorApprox( vtNFace, vtHead)
|
local PointsOnToolTipCenter = {}
|
||||||
local ToolExitPoints = {}
|
|
||||||
for i = 1, #PointsToCheck do
|
for i = 1, #PointsToCheck do
|
||||||
ToolExitPoints[i] = GetToolExitPoint( PointsToCheck[i], Edge.vtN, vtHead, Tool, bIsDownUp)
|
PointsOnToolTipCenter[i] = PreSimulationLib.GetPointOnToolTipCenter( PointsToCheck[i], vtHead, vtNFace, Edge.vtN, Tool)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- vtC punta sempre verso il corpo dell'asse C o verso l'aggregato
|
|
||||||
local nSCC = Tool.SetupInfo.GetSCC( Edge.vtN, Edge.vtEdge, vtNFace)
|
|
||||||
local vtSCC = BeamLib.GetDirectionFromSCC( nSCC)
|
|
||||||
local vtC = vtHead ^ Tool.SetupInfo.vtRotationAxisC
|
|
||||||
vtC:normalize()
|
|
||||||
if vtC:isSmall() then
|
|
||||||
vtC = vtSCC
|
|
||||||
elseif vtC * vtSCC < GEO.EPS_SMALL then
|
|
||||||
vtC = -vtC
|
|
||||||
end
|
|
||||||
|
|
||||||
-- punti curva collisione e direzioni check da macchina
|
|
||||||
local PreCollisionData = Tool.SetupInfo.GetPreCollisionData( sAxis, vtC, vtHead)
|
|
||||||
|
|
||||||
local bMoveAfterSplit = false
|
local bMoveAfterSplit = false
|
||||||
|
|
||||||
-- se almeno in un punto c'è collisione con il pezzo si ritorna collisione
|
-- se almeno in un punto c'è collisione con il pezzo si ritorna collisione
|
||||||
-- 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, #ToolExitPoints do
|
for i = 1, #PointsOnToolTipCenter do
|
||||||
|
|
||||||
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( ToolExitPoints[i], vtC, vtHead, PreCollisionData, 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
|
||||||
@@ -410,29 +445,33 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
|
|||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
function PreSimulationLib.CheckCollision( sBladeEngagement, Parameters, OptionalParameters)
|
function PreSimulationLib.CheckCollision( Parameters, OptionalParameters)
|
||||||
|
|
||||||
local bCollisionFound
|
local bCollisionFound
|
||||||
local bMoveAfterSplitZ, bMoveAfterSplitC, bMoveAfterSplitAB
|
local bMoveAfterSplitL3, bMoveAfterSplitR3, bMoveAfterSplitR2, bMoveAfterSplitR1
|
||||||
|
|
||||||
|
-- parametri obbligatori
|
||||||
|
local Edge = Parameters.Edge
|
||||||
|
local vtNFace = Parameters.vtNFace
|
||||||
|
local Tool = Parameters.Tool
|
||||||
|
|
||||||
-- parametri opzionali, in parte da far transitare
|
-- parametri opzionali, in parte da far transitare
|
||||||
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.vtAux = OptionalParameters.vtAux
|
||||||
|
OptionalParametersCheckCollisionWithAxis.idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||||
|
|
||||||
local bIsDicing = OptionalParameters.bIsDicing or false
|
local sBlockedAxis = OptionalParameters.sBlockedAxis
|
||||||
local bCheckOnlyRestlengthForAxisABC = false
|
local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or 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
|
||||||
else
|
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
|
||||||
@@ -455,21 +494,43 @@ function PreSimulationLib.CheckCollision( sBladeEngagement, Parameters, Optional
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- asse Z si controlla sempre
|
-- SCC
|
||||||
bCollisionFound, bMoveAfterSplitZ = CheckCollisionWithAxis( 'Z', Parameters, OptionalParametersCheckCollisionWithAxis)
|
local nSCC = Tool.SetupInfo.GetSCC( Edge.vtN, Edge.vtEdge, vtNFace)
|
||||||
|
|
||||||
-- assi AB e C: se richiesto si controlla la collisione solo col grezzo
|
-- si settano utensile, SCC e asse bloccato per il controllo collisione
|
||||||
OptionalParametersCheckCollisionWithAxis.bCheckOnlyRestlength = bCheckOnlyRestlengthForAxisABC
|
local bOkTool = EgtSetCalcTool( Tool.sName, Tool.sHead, Tool.nExit)
|
||||||
|
if not bOkTool then
|
||||||
|
error( 'CheckCollisionWithAxis : cannot set calc tool')
|
||||||
|
end
|
||||||
|
EgtSetCalcSolCh( nSCC)
|
||||||
|
if sBlockedAxis and type( sBlockedAxis) == "string" then
|
||||||
|
local BlockedAxis = EgtSplitString( sBlockedAxis, '=')
|
||||||
|
EgtSetRotAxisBlock( BlockedAxis[1], tonumber( BlockedAxis[2]))
|
||||||
|
end
|
||||||
|
|
||||||
if not bCollisionFound then
|
-- nomi degli assi con cui controllare la collisione
|
||||||
bCollisionFound, bMoveAfterSplitAB = CheckCollisionWithAxis( 'AB', Parameters, OptionalParametersCheckCollisionWithAxis)
|
local AxesNames = EgtGetAllCurrAxesNames()
|
||||||
|
local sL3 = AxesNames[3]
|
||||||
|
local sR3 = AxesNames[6]
|
||||||
|
local sR2 = AxesNames[5]
|
||||||
|
local sR1 = AxesNames[4]
|
||||||
|
|
||||||
|
-- ultimo asse lineare prima dei rotativi (solitamente Z) si controlla sempre
|
||||||
|
bCollisionFound, bMoveAfterSplitL3 = CheckCollisionWithAxis( sL3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
||||||
|
|
||||||
|
if sR3 and not bCollisionFound then
|
||||||
|
bCollisionFound, bMoveAfterSplitR3 = CheckCollisionWithAxis( sR3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
||||||
end
|
end
|
||||||
|
|
||||||
if not bCollisionFound then
|
if not bCollisionFound then
|
||||||
bCollisionFound, bMoveAfterSplitC = CheckCollisionWithAxis( 'C', Parameters, OptionalParametersCheckCollisionWithAxis)
|
bCollisionFound, bMoveAfterSplitR2 = CheckCollisionWithAxis( sR2, Parameters, OptionalParametersCheckCollisionWithAxis)
|
||||||
end
|
end
|
||||||
|
|
||||||
local bMoveAfterSplit = bMoveAfterSplitZ or bMoveAfterSplitC or bMoveAfterSplitAB
|
if not bCollisionFound then
|
||||||
|
bCollisionFound, bMoveAfterSplitR1 = CheckCollisionWithAxis( sR1, Parameters, OptionalParametersCheckCollisionWithAxis)
|
||||||
|
end
|
||||||
|
|
||||||
|
local bMoveAfterSplit = bMoveAfterSplitL3 or bMoveAfterSplitR3 or bMoveAfterSplitR2 or bMoveAfterSplitR1
|
||||||
|
|
||||||
return bCollisionFound, bMoveAfterSplit
|
return bCollisionFound, bMoveAfterSplit
|
||||||
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()
|
||||||
|
|||||||
@@ -688,7 +688,7 @@
|
|||||||
"TopologyList" : [
|
"TopologyList" : [
|
||||||
{ "sName": "Feature",
|
{ "sName": "Feature",
|
||||||
"sImage": "ConfigStrategy\\ScarfJoint.png",
|
"sImage": "ConfigStrategy\\ScarfJoint.png",
|
||||||
"StrategyList" : [ ]
|
"StrategyList" : [ { "sStrategyId": "STR0009" }]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|
||||||
|
|||||||
@@ -269,6 +269,8 @@ local function GetBestPocketingStrategy( Proc, Part)
|
|||||||
Milling.idProc = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.id
|
Milling.idProc = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.id
|
||||||
Milling.dElevation = ( Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation * 2) + BeamData.MILL_OVERLAP
|
Milling.dElevation = ( Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].dElevation * 2) + BeamData.MILL_OVERLAP
|
||||||
Milling.bMachAppliedToTunnelFace = true
|
Milling.bMachAppliedToTunnelFace = true
|
||||||
|
else
|
||||||
|
ToolSearchParameters.vtToolDirection = nil
|
||||||
end
|
end
|
||||||
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing')
|
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing')
|
||||||
Milling.ToolInfo = {}
|
Milling.ToolInfo = {}
|
||||||
@@ -278,6 +280,19 @@ local function GetBestPocketingStrategy( Proc, Part)
|
|||||||
local ParametersMRR = {}
|
local ParametersMRR = {}
|
||||||
ParametersMRR.nToolIndex = Milling.ToolInfo.nToolIndex
|
ParametersMRR.nToolIndex = Milling.ToolInfo.nToolIndex
|
||||||
Milling.dMRR = MachiningLib.GetToolMRR( ParametersMRR)
|
Milling.dMRR = MachiningLib.GetToolMRR( ParametersMRR)
|
||||||
|
-- se la faccia tunnel è troppo piccola non si lavora
|
||||||
|
if Milling.bMachAppliedToTunnelFace then
|
||||||
|
local dLongestEdgeLength = 0
|
||||||
|
for i = 1, #Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].Edges do
|
||||||
|
if Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].Edges[i].dLength > dLongestEdgeLength + 10 * GEO.EPS_SMALL then
|
||||||
|
dLongestEdgeLength = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].Edges[i].dLength
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if dLongestEdgeLength < TOOLS[Milling.ToolInfo.nToolIndex].dDiameter then
|
||||||
|
Milling.bIsApplicable = false
|
||||||
|
ParametersMRR = {}
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.insert( Machining, Milling)
|
table.insert( Machining, Milling)
|
||||||
@@ -309,6 +324,8 @@ local function GetBestPocketingStrategy( Proc, Part)
|
|||||||
Milling.idFaceToMachine = Proc.MainFaces.SideFaces[1].id
|
Milling.idFaceToMachine = Proc.MainFaces.SideFaces[1].id
|
||||||
Milling.idProc = Proc.id
|
Milling.idProc = Proc.id
|
||||||
Milling.dElevation = Proc.MainFaces.SideFaces[1].dElevation
|
Milling.dElevation = Proc.MainFaces.SideFaces[1].dElevation
|
||||||
|
else
|
||||||
|
ToolSearchParameters.vtToolDirection = nil
|
||||||
end
|
end
|
||||||
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing')
|
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing')
|
||||||
Milling.ToolInfo = {}
|
Milling.ToolInfo = {}
|
||||||
@@ -318,6 +335,19 @@ local function GetBestPocketingStrategy( Proc, Part)
|
|||||||
local ParametersMRR = {}
|
local ParametersMRR = {}
|
||||||
ParametersMRR.nToolIndex = Milling.ToolInfo.nToolIndex
|
ParametersMRR.nToolIndex = Milling.ToolInfo.nToolIndex
|
||||||
Milling.dMRR = MachiningLib.GetToolMRR( ParametersMRR)
|
Milling.dMRR = MachiningLib.GetToolMRR( ParametersMRR)
|
||||||
|
-- se la faccia tunnel è troppo piccola non si lavora
|
||||||
|
if Milling.bMachAppliedToTunnelFace then
|
||||||
|
local dLongestEdgeLength = 0
|
||||||
|
for i = 1, #Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].Edges do
|
||||||
|
if Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].Edges[i].dLength > dLongestEdgeLength + 10 * GEO.EPS_SMALL then
|
||||||
|
dLongestEdgeLength = Proc.MainFaces.TunnelAddedFaces.MiddleFaceTm.Faces[1].Edges[i].dLength
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if dLongestEdgeLength < TOOLS[Milling.ToolInfo.nToolIndex].dDiameter then
|
||||||
|
Milling.bIsApplicable = false
|
||||||
|
ParametersMRR = {}
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.insert( Machining, Milling)
|
table.insert( Machining, Milling)
|
||||||
|
|||||||
@@ -195,6 +195,17 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
Blade.Result = {}
|
Blade.Result = {}
|
||||||
Chainsaw.Result = {}
|
Chainsaw.Result = {}
|
||||||
|
|
||||||
|
|
||||||
|
-- se arriva una feature senza MainFaces o MainEdges necessari la strategia non è applicabile
|
||||||
|
-- TODO riuniure a IsTopologyOk?
|
||||||
|
if not Proc.MainFaces
|
||||||
|
or not Proc.MainFaces.LongFaces[1]
|
||||||
|
or not Proc.MainFaces.LongFaces[1].MainEdges then
|
||||||
|
|
||||||
|
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable( 'Topology')
|
||||||
|
return false, Strategy.Result
|
||||||
|
end
|
||||||
|
|
||||||
if not IsTopologyOk( Proc) then
|
if not IsTopologyOk( Proc) then
|
||||||
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. Strategy.sName .. ' not implemented'
|
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. Strategy.sName .. ' not implemented'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
@@ -241,16 +252,6 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
dPocketHeight = Proc.MainFaces.BottomFaces[1].MainEdges.SideEdges[1].dLength
|
dPocketHeight = Proc.MainFaces.BottomFaces[1].MainEdges.SideEdges[1].dLength
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se arriva una feature senza MainFaces o MainEdges necessari la strategia non è applicabile
|
|
||||||
-- TODO riuniure a IsTopologyOk?
|
|
||||||
if not Proc.MainFaces
|
|
||||||
or not Proc.MainFaces.LongFaces[1]
|
|
||||||
or not Proc.MainFaces.LongFaces[1].MainEdges then
|
|
||||||
|
|
||||||
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable( 'Topology')
|
|
||||||
return false, Strategy.Result
|
|
||||||
end
|
|
||||||
|
|
||||||
-- riferimenti locali per leggibilità e performance
|
-- riferimenti locali per leggibilità e performance
|
||||||
local LongFace = Proc.MainFaces.LongFaces[1]
|
local LongFace = Proc.MainFaces.LongFaces[1]
|
||||||
local OppositeEdge1 = LongFace.MainEdges.OppositeEdges[1]
|
local OppositeEdge1 = LongFace.MainEdges.OppositeEdges[1]
|
||||||
|
|||||||
@@ -132,6 +132,16 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
bIsSplitFeature = true
|
bIsSplitFeature = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- se arriva una feature senza MainFaces o MainEdges necessari la strategia non è applicabile
|
||||||
|
-- TODO riuniure a IsTopologyOk?
|
||||||
|
if not Proc.MainFaces
|
||||||
|
or not Proc.MainFaces.LongFaces[1]
|
||||||
|
or not Proc.MainFaces.LongFaces[1].MainEdges then
|
||||||
|
|
||||||
|
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable( 'Topology')
|
||||||
|
return false, Strategy.Result
|
||||||
|
end
|
||||||
|
|
||||||
-- altezza tasca
|
-- altezza tasca
|
||||||
local dPocketHeight = 0
|
local dPocketHeight = 0
|
||||||
if Proc.Topology.sFamily == 'Tunnel' then
|
if Proc.Topology.sFamily == 'Tunnel' then
|
||||||
@@ -145,16 +155,6 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
dPocketHeight = Proc.MainFaces.BottomFaces[1].MainEdges.SideEdges[1].dLength
|
dPocketHeight = Proc.MainFaces.BottomFaces[1].MainEdges.SideEdges[1].dLength
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se arriva una feature senza MainFaces o MainEdges necessari la strategia non è applicabile
|
|
||||||
-- TODO riuniure a IsTopologyOk?
|
|
||||||
if not Proc.MainFaces
|
|
||||||
or not Proc.MainFaces.LongFaces[1]
|
|
||||||
or not Proc.MainFaces.LongFaces[1].MainEdges then
|
|
||||||
|
|
||||||
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable( 'Topology')
|
|
||||||
return false, Strategy.Result
|
|
||||||
end
|
|
||||||
|
|
||||||
-- riferimenti locali per leggibilità e performance
|
-- riferimenti locali per leggibilità e performance
|
||||||
local LongFace = Proc.MainFaces.LongFaces[1]
|
local LongFace = Proc.MainFaces.LongFaces[1]
|
||||||
local OppositeEdge1 = LongFace.MainEdges.OppositeEdges[1]
|
local OppositeEdge1 = LongFace.MainEdges.OppositeEdges[1]
|
||||||
|
|||||||
@@ -441,7 +441,7 @@ function STR0007.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.id, 1, GDB_ID.ROOT)
|
local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.id, 1, GDB_ID.ROOT)
|
||||||
if ptCutC and vtCutN and AreSameVectorApprox( Proc.FeatureInfo.vtMortiseN, vtCutN) then
|
if ptCutC and vtCutN and AreSameVectorApprox( Proc.FeatureInfo.vtMortiseN, vtCutN) then
|
||||||
-- recupero gruppo per geometria addizionale
|
-- recupero gruppo per geometria addizionale
|
||||||
local nAddGrpId = Part.idTempGroup
|
local nAddGrpId = BeamLib.GetAddGroup( Part.id)
|
||||||
Strategy.idMortiseCutPlane = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, Part.b3Part, GDB_RT.GLOB)
|
Strategy.idMortiseCutPlane = EgtSurfTmPlaneInBBox( nAddGrpId, ptCutC, vtCutN, Part.b3Part, GDB_RT.GLOB)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -311,10 +311,7 @@ function STR0008.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
-- si applicano le lavorazioni di svuotatura
|
-- si applicano le lavorazioni di svuotatura
|
||||||
for i = 1, #Strategy.Machining.Pocketing do
|
for i = 1, #Strategy.Machining.Pocketing do
|
||||||
if Strategy.Machining.Pocketing[i].bIsApplicable then
|
if Strategy.Machining.Pocketing[i].bIsApplicable then
|
||||||
Pocketing = {}
|
Pocketing = MachiningLib.InitMachiningParameters( MCH_MY.POCKETING)
|
||||||
Pocketing.Steps = {}
|
|
||||||
Pocketing.LeadIn = {}
|
|
||||||
Pocketing.nType = MCH_MY.POCKETING
|
|
||||||
Pocketing.nSubType = MCH_POCK_SUB.SPIRALOUT
|
Pocketing.nSubType = MCH_POCK_SUB.SPIRALOUT
|
||||||
Pocketing.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
Pocketing.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
||||||
Pocketing.Steps.dStep = TOOLS[Strategy.Machining.Pocketing[i].ToolInfo.nToolIndex].dStep
|
Pocketing.Steps.dStep = TOOLS[Strategy.Machining.Pocketing[i].ToolInfo.nToolIndex].dStep
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"sStrategyId": "STR0009",
|
"sStrategyId": "STR0009",
|
||||||
"sStrategyName": "Mill Heading",
|
"sStrategyName": "ScarfJoint",
|
||||||
"ParameterList" : [
|
"ParameterList" : [
|
||||||
{
|
{
|
||||||
"sName": "dDepthChamfer",
|
"sName": "dDepthChamfer",
|
||||||
@@ -13,35 +13,15 @@
|
|||||||
"sMinUserLevel": "1"
|
"sMinUserLevel": "1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"sName": "dOverMaterial",
|
"sName": "bAntiSplint",
|
||||||
"sNameNge": "OVERMAT",
|
"sNameNge": "ANTISPLINT",
|
||||||
"sValue": "0",
|
|
||||||
"sDescriptionShort": "Overmaterial",
|
|
||||||
"sDescriptionLong": "",
|
|
||||||
"sType": "d",
|
|
||||||
"sMessageId": " ",
|
|
||||||
"sMinUserLevel": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"sName": "bForceStrip",
|
|
||||||
"sNameNge": "FORCE_STRIP",
|
|
||||||
"sValue": "false",
|
"sValue": "false",
|
||||||
"sDescriptionShort": "Force strip",
|
"sDescriptionShort": "Use Anti-Splint strategy",
|
||||||
"sDescriptionLong": "Enable the parameter to force the software to leave a strip to sustain the piece",
|
"sDescriptionLong": "The strategy will apply blade cuts on corner to avoid wood splint",
|
||||||
"sType": "b",
|
"sType": "b",
|
||||||
"sMessageId": " ",
|
"sMessageId": " ",
|
||||||
"sMinUserLevel": "1"
|
"sMinUserLevel": "1"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"sName": "dStripWidth",
|
|
||||||
"sNameNge": "STRIP_WIDTH",
|
|
||||||
"sValue": "0",
|
|
||||||
"sDescriptionShort": "Strip width",
|
|
||||||
"sDescriptionLong": "Width of the strip in case if foreseen from the machining",
|
|
||||||
"sType": "d",
|
|
||||||
"sMessageId": " ",
|
|
||||||
"sMinUserLevel": "1"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"sName": "sMillingList",
|
"sName": "sMillingList",
|
||||||
"sNameNge": "PROFILE_TOOL_LIST",
|
"sNameNge": "PROFILE_TOOL_LIST",
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
-- Strategia: STR0009
|
-- Strategia: STR0009
|
||||||
-- Descrizione
|
-- Descrizione
|
||||||
-- Fresatura di contorno
|
-- Feature tipo ScarfJoint
|
||||||
-- Feature tipo Arco
|
|
||||||
|
|
||||||
|
|
||||||
-- carico librerie
|
-- carico librerie
|
||||||
@@ -10,156 +9,182 @@ local BeamData = require( 'BeamDataNew')
|
|||||||
local MachiningLib = require( 'MachiningLib')
|
local MachiningLib = require( 'MachiningLib')
|
||||||
local FeatureLib = require( 'FeatureLib')
|
local FeatureLib = require( 'FeatureLib')
|
||||||
-- strategie di base
|
-- strategie di base
|
||||||
local BladeToWaste = require('BLADETOWASTE')
|
local BladeToWaste = require( 'BLADETOWASTE')
|
||||||
|
local FaceByMill = require( 'FACEBYMILL')
|
||||||
|
local FaceByBlade = require( 'FACEBYBLADE')
|
||||||
|
local AntiSplintOnFace = require( 'ANTISPLINTONFACE')
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local STR0009 = {}
|
local STR0009 = {}
|
||||||
local Strategy = {}
|
local Strategy = {}
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO gestire il caso in cui non si trova l'utensile
|
local function GetFacesIdOrder( Proc, Part)
|
||||||
local function GetArcStrategy( Proc, Part)
|
local Faces = {}
|
||||||
local Machining = {}
|
if Proc.nFct == 5 then
|
||||||
local ToolSearchParameters = {}
|
-- carico gli id delle facce
|
||||||
|
for i = 1, Proc.nFct do
|
||||||
|
Faces[#Faces + 1] = BeamLib.TableCopyDeep( Proc.Faces[i])
|
||||||
|
end
|
||||||
|
elseif Proc.nFct == 4 then
|
||||||
|
local vtN1 = Proc.Faces[1].vtN
|
||||||
|
local vtN2 = Proc.Faces[2].vtN
|
||||||
|
local nIndex = EgtIf( abs( vtN1:getX()) > abs( vtN2:getX()), 1, 2)
|
||||||
|
for i = nIndex, Proc.nFct do
|
||||||
|
Faces[#Faces + 1] = BeamLib.TableCopyDeep( Proc.Faces[i])
|
||||||
|
end
|
||||||
|
-- TODO manca il caso in cui mancano facce 4 e 5
|
||||||
|
else -- Proc.nFct == 3
|
||||||
|
for i = 2, Proc.nFct do
|
||||||
|
Faces[#Faces + 1] = BeamLib.TableCopyDeep( Proc.Faces[i])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- recupero e verifico l'entità curva
|
return Faces
|
||||||
local idAux = EgtGetInfo( Proc.id, 'AUXID', 'i')
|
end
|
||||||
if idAux then idAux = idAux + Proc.id end
|
|
||||||
if not idAux or ( EgtGetType( idAux) & GDB_FY.GEO_CURVE) == 0 then
|
-------------------------------------------------------------------------------------------------------------
|
||||||
local sErr = 'Error on process ' .. tostring( Proc.id) .. ' missing profile geometry'
|
local function GetEdgeToMachine( ClosingFace, idBottomFace)
|
||||||
|
local EdgeToMachine
|
||||||
|
|
||||||
|
for i = 1, #ClosingFace.Edges do
|
||||||
|
if ClosingFace.Edges[i].idAdjacentFace == idBottomFace then
|
||||||
|
EdgeToMachine = ClosingFace.Edges[i]
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return EdgeToMachine
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
local function GetScarfJointStrategy( Proc, Part)
|
||||||
|
-- ordino le facce in base al loro numero e al parallelismo delle due facce principali
|
||||||
|
-- faccia 0: superficie tappo (*potrebbe non esserci)
|
||||||
|
-- faccia 1: superficie principale di fondo
|
||||||
|
-- faccia 2: superficie opposta alla faccia 1
|
||||||
|
-- faccia 3: superficie principale superiore
|
||||||
|
-- faccia 4: superficie di testa (*potrebbe non esserci)
|
||||||
|
-- creo una tabella unica contenente tutte le lavorazioni
|
||||||
|
local Result = {}
|
||||||
|
local Cutting = { Machinings = {}, Result = {}}
|
||||||
|
local AntiSplints = {}
|
||||||
|
local Pocketing = {}
|
||||||
|
|
||||||
|
Result.dTimeToMachine = 0
|
||||||
|
local Faces = GetFacesIdOrder( Proc)
|
||||||
|
-- taglio su faccia 4
|
||||||
|
if Faces[4] and Faces[4].vtN then
|
||||||
|
-- recupero gruppo per geometria addizionale
|
||||||
|
local nAddGrpId = BeamLib.GetAddGroup( Part.id)
|
||||||
|
-- TODO la nuova faccia creata sulla 4 può tagliare faccia 1. In caso tagliasse faccia 1, bisogna calcolare i cubetti con 2 facce
|
||||||
|
Strategy.idFeatureCutPlane = EgtSurfTmPlaneInBBox( nAddGrpId, Faces[4].ptCenter, Faces[4].vtN, Part.b3Part, GDB_RT.GLOB)
|
||||||
|
Cutting.Machinings, Cutting.Result = BladeToWaste.Make( Strategy.idFeatureCutPlane, Part)
|
||||||
|
if Cutting.Result.sStatus == 'Completed' then
|
||||||
|
Cutting.Machinings.bIsApplicable = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- antischeggia facce 1 e 3
|
||||||
|
local bAreAllAntisplintsApplicable = true
|
||||||
|
if Strategy.Parameters.bAntiSplint then
|
||||||
|
AntiSplints = AntiSplintOnFace.Make( Proc, Part, Faces[2])
|
||||||
|
for k = 1, #AntiSplints do
|
||||||
|
if not AntiSplints[k].bIsApplicable then
|
||||||
|
bAreAllAntisplintsApplicable = false
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- svuotatura faccia 2
|
||||||
|
if Faces[2] then
|
||||||
|
local frPock, dL, dW = EgtSurfTmFacetMinAreaRectangle( Proc.id, Faces[2].id, GDB_ID.ROOT)
|
||||||
|
local ToolSearchParameters = {}
|
||||||
|
ToolSearchParameters.sMillShape = 'STANDARD'
|
||||||
|
ToolSearchParameters.vtToolDirection = Faces[2].vtN
|
||||||
|
ToolSearchParameters.dElevation = abs( ( Faces[2].ptCenter - Faces[4].ptCenter) * Faces[2].vtN)
|
||||||
|
ToolSearchParameters.dMaxToolDiameter = min( dL, dW)
|
||||||
|
ToolSearchParameters.ToolInfo = {}
|
||||||
|
ToolSearchParameters.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||||
|
if ToolSearchParameters.ToolInfo.nToolIndex then
|
||||||
|
local Machining = MachiningLib.InitMachiningParameters( MCH_MY.POCKETING)
|
||||||
|
Machining.Geometry = {{ Proc.id, Faces[2].id}}
|
||||||
|
Machining.dElevation = ToolSearchParameters.dElevation
|
||||||
|
Machining.dMaxElev = Machining.dElevation
|
||||||
|
Machining.vtToolDirection = ToolSearchParameters.vtToolDirection
|
||||||
|
Machining.nSubType = MCH_POCK_SUB.SPIRALIN
|
||||||
|
Machining.LeadIn.nType = MCH_POCK_LI.ZIGZAG
|
||||||
|
Machining.Steps.dStep = TOOLS[ToolSearchParameters.ToolInfo.nToolIndex].dStep
|
||||||
|
Machining.Steps.dSideStep = TOOLS[ToolSearchParameters.ToolInfo.nToolIndex].dSideStep
|
||||||
|
Machining.nToolIndex = ToolSearchParameters.ToolInfo.nToolIndex
|
||||||
|
Machining.LeadIn.dTangentDistance = TOOLS[ToolSearchParameters.ToolInfo.nToolIndex].dDiameter / 2
|
||||||
|
Machining.LeadIn.dElevation = TOOLS[ToolSearchParameters.ToolInfo.nToolIndex].dDiameter / 2
|
||||||
|
Machining.sDepth = 0
|
||||||
|
Machining.dResidualDepth = ToolSearchParameters.ToolInfo.dResidualDepth
|
||||||
|
-- TODO vedere se questo parametro con svuotature nuove si può rimuovere
|
||||||
|
Machining.dOpenMinSafe = Strategy.Parameters.dOpenMinSafe
|
||||||
|
Machining.dTimeToMachine = MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part)
|
||||||
|
Result.dTimeToMachine = Result.dTimeToMachine + Machining.dTimeToMachine
|
||||||
|
table.insert( Pocketing, Machining)
|
||||||
|
Pocketing.bIsApplicable = true
|
||||||
|
-- se non sono stati fatti i passaggi antischeggia si verifica che le facce siano a 90°, altrimenti serve passaggio con fresa
|
||||||
|
if not Strategy.Parameters.bAntiSplint or not bAreAllAntisplintsApplicable then
|
||||||
|
local dAngleBetweenFaces = Proc.AdjacencyMatrix[1][2] or 0
|
||||||
|
-- si fa passaggio con fresa
|
||||||
|
if dAngleBetweenFaces > -90 then
|
||||||
|
local EdgeToMachine = GetEdgeToMachine( Faces[1], Faces[2].id)
|
||||||
|
local CuttingClosingFace = FaceByBlade.Make( Proc, Part, Faces[1], EdgeToMachine)
|
||||||
|
if CuttingClosingFace.bIsApplicable then
|
||||||
|
table.insert( AntiSplints, CuttingClosingFace)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- se manca taglio principale, feature non eseguibile
|
||||||
|
if not Cutting.Machinings.bIsApplicable then
|
||||||
|
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. Strategy.sName .. ' not applicable'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
Result = FeatureLib.GetStrategyResultNotApplicable( sErr)
|
||||||
end
|
|
||||||
Proc.idAddAuxGeom = idAux
|
|
||||||
|
|
||||||
-- recupero i dati della curva e del profilo
|
|
||||||
local dDepth = abs( EgtCurveThickness( idAux))
|
|
||||||
local vtExtr = EgtCurveExtrusion( idAux, GDB_RT.GLOB)
|
|
||||||
local bToolInvert = ( vtExtr:getZ() < -0.1)
|
|
||||||
local bIsHorizontal = abs( vtExtr:getZ()) < 10 * GEO.EPS_SMALL
|
|
||||||
local bIsFeatureDown = Proc.AffectedFaces.bBottom and not Proc.AffectedFaces.bTop
|
|
||||||
local bIsFeatureBack = Proc.AffectedFaces.bBack and not Proc.AffectedFaces.bFront
|
|
||||||
local bForceStrip = Strategy.Parameters.bForceStrip
|
|
||||||
local dDimStrip = EgtIf( Strategy.Parameters.dStripWidth < 100 * GEO.EPS_SMALL, nil, Strategy.Parameters.dStripWidth)
|
|
||||||
|
|
||||||
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 bIsFeatureDown or bIsFeatureBack then
|
|
||||||
dDimStrip = dDimStrip or max( BeamData.DIM_STRIP or 5, 5)
|
|
||||||
else
|
|
||||||
dDimStrip = dDimStrip or max( BeamData.DIM_STRIP_SMALL or 5, 1)
|
|
||||||
end
|
|
||||||
bExecStrip = true
|
|
||||||
end
|
|
||||||
if not bExecStrip then
|
|
||||||
dDimStrip = 0
|
|
||||||
end
|
|
||||||
|
|
||||||
-- se lavorazione orizzontale
|
|
||||||
if bIsHorizontal then
|
|
||||||
local bDouble
|
|
||||||
local Milling = MachiningLib.InitMachiningParameters( MCH_MY.MILLING)
|
|
||||||
Milling.bIsApplicable = false
|
|
||||||
ToolSearchParameters = {}
|
|
||||||
ToolSearchParameters.sMillShape = 'STANDARD'
|
|
||||||
ToolSearchParameters.dElevation = EgtIf( bExecStrip, ( dDepth - dDimStrip) / 2, dDepth + BeamData.MILL_OVERLAP)
|
|
||||||
ToolSearchParameters.vtToolDirection = EgtIf( bToolInvert, -vtExtr, vtExtr)
|
|
||||||
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sMillingList, 'Milling')
|
|
||||||
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.dResidualDepth > 10 * GEO.EPS_SMALL and not bExecStrip then
|
|
||||||
bDouble = true
|
|
||||||
ToolSearchParameters.dElevation = ( dDepth + BeamData.MILL_OVERLAP) / 2
|
|
||||||
ToolSearchParameters.vtToolDirection = EgtIf( bToolInvert, -vtExtr, vtExtr)
|
|
||||||
end
|
|
||||||
Milling.bToolInvert = bToolInvert
|
|
||||||
Milling.vtToolDirection = vtExtr
|
|
||||||
|
|
||||||
if bDouble or bExecStrip then
|
|
||||||
if bDouble then
|
|
||||||
Milling.sDepth = ( dDepth + BeamData.MILL_OVERLAP) / 2
|
|
||||||
else
|
|
||||||
Milling.sDepth = ( dDepth - dDimStrip) / 2
|
|
||||||
end
|
|
||||||
table.insert( Machining, Milling)
|
|
||||||
local Milling2 = BeamLib.TableCopyDeep( Milling)
|
|
||||||
table.insert( Machining, Milling2)
|
|
||||||
else
|
|
||||||
Milling.sDepth = dDepth + BeamData.MILL_OVERLAP
|
|
||||||
table.insert( Machining, Milling)
|
|
||||||
end
|
|
||||||
-- se lavorazione verticale
|
|
||||||
else
|
else
|
||||||
-- si cerca utensile 1
|
local dCompletionPercentage = 100
|
||||||
local Milling = {}
|
-- completa se svuotatura eseguita e antisplit eseguiti (o non richiesti)
|
||||||
Milling.bIsApplicable = false
|
if Pocketing.bIsApplicable and ( bAreAllAntisplintsApplicable or not Strategy.Parameters.bAntiSplint) then
|
||||||
ToolSearchParameters = {}
|
Result.sStatus = 'Completed'
|
||||||
ToolSearchParameters.sMillShape = 'STANDARD'
|
if bAreAllAntisplintsApplicable then
|
||||||
ToolSearchParameters.dElevation = dDepth + BeamData.MILL_OVERLAP
|
Result.dQuality = FeatureLib.GetStrategyQuality( 'FINE')
|
||||||
ToolSearchParameters.vtToolDirection = EgtIf( bToolInvert, -vtExtr, vtExtr)
|
|
||||||
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sMillingList, 'Milling')
|
|
||||||
Milling.ToolInfo = {}
|
|
||||||
Milling.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
|
||||||
-- si cerca utensile 2
|
|
||||||
local Milling2 = {}
|
|
||||||
Milling2.bIsApplicable = false
|
|
||||||
ToolSearchParameters = {}
|
|
||||||
ToolSearchParameters.sMillShape = 'STANDARD'
|
|
||||||
ToolSearchParameters.dElevation = dDepth + BeamData.MILL_OVERLAP
|
|
||||||
ToolSearchParameters.vtToolDirection = EgtIf( bToolInvert, vtExtr, -vtExtr)
|
|
||||||
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sMillingList, 'Milling')
|
|
||||||
Milling2.ToolInfo = {}
|
|
||||||
Milling2.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
|
||||||
|
|
||||||
-- se serve codolo
|
|
||||||
if bExecStrip then
|
|
||||||
-- se a disposizione entrambi gli utensili
|
|
||||||
if Milling.ToolInfo.nToolIndex and Milling2.ToolInfo.nToolIndex then
|
|
||||||
table.insert( Machining, Milling)
|
|
||||||
table.insert( Machining, Milling2)
|
|
||||||
-- se disponibile solo primo utensile
|
|
||||||
elseif Milling.ToolInfo.nToolIndex then
|
|
||||||
table.insert( Machining, Milling)
|
|
||||||
-- se disponibile solo secondo utensile
|
|
||||||
elseif Milling2.ToolInfo.nToolIndex then
|
|
||||||
table.insert( Machining, Milling2)
|
|
||||||
-- nessun utensile disponibile
|
|
||||||
else
|
else
|
||||||
-- non si fa nulla
|
Result.dQuality = FeatureLib.GetStrategyQuality( 'STD')
|
||||||
end
|
end
|
||||||
-- altrimenti senza codolo
|
-- altrimenti non completa
|
||||||
else
|
else
|
||||||
-- se utensile 1 esegue completamente
|
Result.dQuality = FeatureLib.GetStrategyQuality( 'STD')
|
||||||
if Milling.ToolInfo.nToolIndex and Milling.ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL then
|
Result.sStatus = 'Not-Completed'
|
||||||
table.insert( Machining, Milling)
|
-- se fa solo svuotatura
|
||||||
-- se utensile 2 esegue completamente
|
if Pocketing.bIsApplicable then
|
||||||
elseif Milling2.ToolInfo.nToolIndex and Milling2.ToolInfo.dResidualDepth < 10 * GEO.EPS_SMALL then
|
dCompletionPercentage = 90
|
||||||
table.insert( Machining, Milling2)
|
Result.sInfo = 'Anti-Split not executed'
|
||||||
-- se possono lavorare entrambi
|
elseif Strategy.Parameters.bAntiSplint and bAreAllAntisplintsApplicable then
|
||||||
elseif Milling.ToolInfo.nToolIndex and Milling2.ToolInfo.nToolIndex then
|
dCompletionPercentage = 75
|
||||||
table.insert( Machining, Milling)
|
Result.sInfo = 'Pocketing not executed'
|
||||||
table.insert( Machining, Milling2)
|
else
|
||||||
-- se utensile 1 non completo
|
dCompletionPercentage = 50
|
||||||
elseif Milling.ToolInfo.nToolIndex then
|
Result.sInfo = 'Only the cut has been executed'
|
||||||
table.insert( Machining, Milling)
|
|
||||||
-- se utensile 2 non completo
|
|
||||||
elseif Milling2.ToolInfo.nToolIndex then
|
|
||||||
table.insert( Machining, Milling2)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Result.dCompletionIndex = FeatureLib.GetFeatureCompletionIndex( dCompletionPercentage)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODO VOTO DA FARE!!!!
|
-- creo una tabella unica contenente tutte le lavorazioni
|
||||||
Strategy.Result.sStatus = 'Completed'
|
local Machinings = {}
|
||||||
Strategy.Result.dCompletionIndex = 5
|
EgtJoinTables( Machinings, Cutting.Machinings)
|
||||||
Strategy.Result.dMRR = MachiningLib.GetToolMRR( Machining[1].ToolInfo or Machining[2].ToolInfo)
|
EgtJoinTables( Machinings, AntiSplints)
|
||||||
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( 'MILL')
|
EgtJoinTables( Machinings, Pocketing)
|
||||||
Strategy.Result.sInfo = ''
|
|
||||||
|
|
||||||
return Machining
|
return Machinings, Result
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
@@ -173,79 +198,33 @@ function STR0009.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
Strategy.Result = {}
|
Strategy.Result = {}
|
||||||
|
|
||||||
local bAreAllMachiningsAdded = true
|
local bAreAllMachiningsAdded = true
|
||||||
local Milling = {}
|
|
||||||
|
|
||||||
Strategy.Machinings = GetArcStrategy( Proc, Part)
|
-- controlli preliminari
|
||||||
|
if Proc.nFct < 3 or Proc.nFct > 5 then
|
||||||
|
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. StrategyLib.Config.sStrategyId .. ' not applicable'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable( sErr)
|
||||||
|
return false, Strategy.Result
|
||||||
|
end
|
||||||
|
|
||||||
if bAddMachining and Strategy.Result.sStatus ~= 'Not-Applicable' then
|
Strategy.Machinings, Strategy.Result = GetScarfJointStrategy( Proc, Part)
|
||||||
-- eventuali punti di spezzatura
|
|
||||||
local FeatureSplittingPoints = FeatureLib.GetFeatureSplittingPoints( Proc, Part)
|
|
||||||
|
|
||||||
for i = 1, #Strategy.Machinings do
|
-- aggiunta lavorazioni
|
||||||
|
if #Strategy.Machinings > 0 then
|
||||||
Strategy.Machinings[i].Geometry = {{ Proc.idAddAuxGeom, -1}}
|
if bAddMachining and Strategy.Result.sStatus ~= 'Not-Applicable' then
|
||||||
Strategy.Machinings[i].nToolIndex = Strategy.Machinings[i].ToolInfo.nToolIndex
|
|
||||||
Strategy.Machinings[i].nType = MCH_MY.MILLING
|
|
||||||
Strategy.Machinings[i].dStartSafetyLength = 0
|
|
||||||
Strategy.Machinings[i].Steps = {}
|
|
||||||
Strategy.Machinings[i].Steps = MachiningLib.GetMachiningSteps( false, tonumber( Strategy.Machinings[i].sDepth), TOOLS[Strategy.Machinings[i].nToolIndex].dStep)
|
|
||||||
|
|
||||||
-- LeadIn / LeadOut
|
|
||||||
Strategy.Machinings[i].LeadIn = {}
|
|
||||||
Strategy.Machinings[i].LeadOut = {}
|
|
||||||
Strategy.Machinings[i].LeadIn.nType = MCH_MILL_LI.TANGENT
|
|
||||||
Strategy.Machinings[i].LeadOut.nType = MCH_MILL_LI.TANGENT
|
|
||||||
Strategy.Machinings[i].LeadIn.dTangentDistance = TOOLS[Strategy.Machinings[i].ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
|
|
||||||
Strategy.Machinings[i].LeadIn.dPerpDistance = 0
|
|
||||||
Strategy.Machinings[i].LeadIn.dStartAddLength = 0
|
|
||||||
Strategy.Machinings[i].LeadOut.dTangentDistance = TOOLS[Strategy.Machinings[i].ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
|
|
||||||
Strategy.Machinings[i].LeadOut.dPerpDistance = 0
|
|
||||||
Strategy.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.Machinings[i].sStage = 'AfterTail'
|
|
||||||
end
|
|
||||||
|
|
||||||
-- preparo attacco/uscita in caso di spezzatura arco
|
|
||||||
Strategy.Machinings[i].LeadInForSplit = BeamLib.TableCopyDeep( Strategy.Machinings[i].LeadIn)
|
|
||||||
Strategy.Machinings[i].LeadOutForSplit = BeamLib.TableCopyDeep( Strategy.Machinings[i].LeadOut)
|
|
||||||
Strategy.Machinings[i].LeadInForSplit.nType = MCH_MILL_LI.LINEAR
|
|
||||||
Strategy.Machinings[i].LeadOutForSplit.nType = MCH_MILL_LI.LINEAR
|
|
||||||
Strategy.Machinings[i].LeadInForSplit.dTangentDistance = 0
|
|
||||||
Strategy.Machinings[i].LeadInForSplit.dPerpDistance = TOOLS[Strategy.Machinings[i].ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
|
|
||||||
Strategy.Machinings[i].LeadOutForSplit.dTangentDistance = 0
|
|
||||||
Strategy.Machinings[i].LeadOutForSplit.dPerpDistance = TOOLS[Strategy.Machinings[i].ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
|
|
||||||
|
|
||||||
-- sistemo il lato e la direzione di lavoro
|
|
||||||
if i == 1 then
|
|
||||||
Strategy.Machinings[i].bInvert = EgtIf( TOOLS[Strategy.Machinings[i].ToolInfo.nToolIndex].bIsCCW, false, true)
|
|
||||||
Strategy.Machinings[i].nWorkside = EgtIf( TOOLS[Strategy.Machinings[i].ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
|
||||||
else
|
|
||||||
Strategy.Machinings[i].bToolInvert = true
|
|
||||||
Strategy.Machinings[i].bInvert = EgtIf( TOOLS[Strategy.Machinings[i].ToolInfo.nToolIndex].bIsCCW, true, false)
|
|
||||||
Strategy.Machinings[i].nWorkside = EgtIf( TOOLS[Strategy.Machinings[i].ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
|
||||||
end
|
|
||||||
Strategy.Machinings[i].ptEdge1 = EgtSP( Proc.idAddAuxGeom, GDB_ID.ROOT)
|
|
||||||
Strategy.Machinings[i].ptEdge2 = EgtEP( Proc.idAddAuxGeom, GDB_ID.ROOT)
|
|
||||||
Strategy.Machinings[i].dEdgeLength = EgtCurveLength( Proc.idAddAuxGeom)
|
|
||||||
Strategy.Machinings[i].vtEdgeDirection = EgtSV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtMV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtEV( Proc.idAddAuxGeom, GDB_ID.ROOT)
|
|
||||||
Strategy.Machinings[i].dLengthOnX = Proc.b3Box:getDimX()
|
|
||||||
|
|
||||||
local MachiningToSplit = {}
|
|
||||||
table.insert( MachiningToSplit, Strategy.Machinings[i])
|
|
||||||
local MachiningResult = MachiningLib.GetSplitMachinings( MachiningToSplit, FeatureSplittingPoints, Part)
|
|
||||||
-- aggiunge lavorazione
|
-- aggiunge lavorazione
|
||||||
for j = 1, #MachiningResult do
|
for j = 1, #Strategy.Machinings do
|
||||||
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, MachiningResult[j])
|
if Proc.AffectedFaces.bLeft then
|
||||||
|
Strategy.Machinings[j].sStage = 'AfterTail'
|
||||||
|
end
|
||||||
|
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.Machinings[j])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
bAreAllMachiningsAdded = false
|
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return bAreAllMachiningsAdded, Strategy.Result
|
return bAreAllMachiningsAdded, Strategy.Result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -253,6 +253,7 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
ToolSearchParameters.vtToolDirection = BottomFace1.vtN
|
ToolSearchParameters.vtToolDirection = BottomFace1.vtN
|
||||||
ToolSearchParameters.bAllowTopHead = true
|
ToolSearchParameters.bAllowTopHead = true
|
||||||
ToolSearchParameters.bAllowBottomHead = true
|
ToolSearchParameters.bAllowBottomHead = true
|
||||||
|
ToolSearchParameters.sMillShape = 'STANDARD'
|
||||||
local ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
local ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||||
local nToolIndex = ToolInfo.nToolIndex
|
local nToolIndex = ToolInfo.nToolIndex
|
||||||
|
|
||||||
@@ -391,7 +392,12 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
Strategy.Machinings = MachiningLib.GetSplitMachinings( Strategy.Machinings, FeatureSplittingPoints, Part)
|
Strategy.Machinings = MachiningLib.GetSplitMachinings( Strategy.Machinings, FeatureSplittingPoints, Part)
|
||||||
table.sort( Strategy.Machinings, SortMachiningsBySegment)
|
table.sort( Strategy.Machinings, SortMachiningsBySegment)
|
||||||
|
|
||||||
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( Strategy.Machinings)
|
-- se non ci sono lati chiusi, la qualità è migliore
|
||||||
|
if Proc.Topology.sName == 'Bevel-1-Through' or Proc.Topology.sName == 'DoubleBevel-2-Through' or Proc.Topology.sName == 'Cut-1-Through' then
|
||||||
|
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( 'FINE')
|
||||||
|
else
|
||||||
|
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( Strategy.Machinings)
|
||||||
|
end
|
||||||
Strategy.Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Strategy.Machinings)
|
Strategy.Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Strategy.Machinings)
|
||||||
Strategy.Result.dMRR = ( dFeatureVolume / Strategy.Result.dTimeToMachine) / pow( 10, 6)
|
Strategy.Result.dMRR = ( dFeatureVolume / Strategy.Result.dTimeToMachine) / pow( 10, 6)
|
||||||
if Strategy.Result.dCompletionPercentage > 100 - 10 * GEO.EPS_SMALL then
|
if Strategy.Result.dCompletionPercentage > 100 - 10 * GEO.EPS_SMALL then
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ local function GetDrillingWithMillStrategy( Proc, Part)
|
|||||||
HalfMilling2.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
HalfMilling2.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||||
|
|
||||||
-- se entrambi gli utensili lavorano in modo completo fino alla metà del foro, li sostituisco a qeulli trovati in precedenza
|
-- se entrambi gli utensili lavorano in modo completo fino alla metà del foro, li sostituisco a qeulli trovati in precedenza
|
||||||
if HalfMilling.ToolInfo.dResidualDepth < 0 and HalfMilling2.ToolInfo.dResidualDepth < 0 then
|
if HalfMilling.ToolInfo.dResidualDepth and HalfMilling2.ToolInfo.dResidualDepth and HalfMilling.ToolInfo.dResidualDepth < 0 and HalfMilling2.ToolInfo.dResidualDepth < 0 then
|
||||||
if Milling.ToolInfo.nToolIndex ~= HalfMilling.ToolInfo.nToolIndex then
|
if Milling.ToolInfo.nToolIndex ~= HalfMilling.ToolInfo.nToolIndex then
|
||||||
Milling.ToolInfo.nToolIndex, Milling.ToolInfo.dResidualDepth = HalfMilling.ToolInfo.nToolIndex, HalfMilling.ToolInfo.dResidualDepth
|
Milling.ToolInfo.nToolIndex, Milling.ToolInfo.dResidualDepth = HalfMilling.ToolInfo.nToolIndex, HalfMilling.ToolInfo.dResidualDepth
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -104,12 +106,24 @@ function STR0014.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
Strategy.Machining.LeadOut = {}
|
Strategy.Machining.LeadOut = {}
|
||||||
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]
|
||||||
Strategy.AuxiliaryData.Clones[i+1] = {}
|
Strategy.AuxiliaryData.Clones[i+1] = {}
|
||||||
Strategy.AuxiliaryData.Clones[i+1].Geometry = EgtSetMachiningGeometry( {{ AuxId, -1}})
|
Strategy.AuxiliaryData.Clones[i+1].Geometry = {{ AuxId, -1}}
|
||||||
end
|
end
|
||||||
|
|
||||||
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.Machining, Strategy.AuxiliaryData)
|
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.Machining, Strategy.AuxiliaryData)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ STR0005 = 1, 2 o 3 facce. Lama con taglio singolo o cubetti. Se richiesto o nece
|
|||||||
STR0006 = Tenone. Lama + fresa
|
STR0006 = Tenone. Lama + fresa
|
||||||
STR0007 = Mortasa a coda di rondine e mortasa frontale a coda di rondine
|
STR0007 = Mortasa a coda di rondine e mortasa frontale a coda di rondine
|
||||||
STR0008 = Svuotatura mortasa (raggiata)
|
STR0008 = Svuotatura mortasa (raggiata)
|
||||||
STR0009 = !!DEPRECATA!! Sostituita da STR0015. RIUTILIZZABILE!
|
STR0009 = ScarfJoint
|
||||||
STR0010 = Fresatura perpendicolare (tipo cut, longcut)
|
STR0010 = Fresatura perpendicolare (tipo cut, longcut)
|
||||||
STR0011 = Foratura
|
STR0011 = Foratura
|
||||||
STR0012 = RidgeLap
|
STR0012 = RidgeLap
|
||||||
|
|||||||
@@ -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,28 +835,24 @@ 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
|
||||||
local bReduceBladePath = Parameters.bReduceBladePath
|
local bReduceBladePath = Parameters.bReduceBladePath
|
||||||
local sRestLengthSideForPreSimulation = Parameters.sRestLengthSideForPreSimulation
|
local sRestLengthSideForPreSimulation = Parameters.sRestLengthSideForPreSimulation
|
||||||
local bCannotSplitRestLength = Parameters.bCannotSplitRestLength
|
local bCannotSplitRestLength = Parameters.bCannotSplitRestLength
|
||||||
|
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
|
||||||
@@ -851,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
|
||||||
}
|
}
|
||||||
@@ -876,16 +916,25 @@ 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
|
||||||
-- caso standard (tagli perpendicolari o paralleli non accorpabili)
|
-- caso standard (tagli perpendicolari o paralleli non accorpabili)
|
||||||
if ( not bCanMergeParallelCuts) or ( not bIsDicingOk) then
|
if ( not bCanMergeParallelCuts) or ( not bIsDicingOk) then
|
||||||
for j = 1, #vCuts[i] do
|
for j = 1, #vCuts[i] do
|
||||||
-- in generale sta sollevato di pochissimo
|
-- se abilitato, la lama sta sollevata per non rovinare le facce
|
||||||
local dExtraCut = -0.1
|
local dExtraCut
|
||||||
|
if bReduceDiceDepth == false then
|
||||||
|
dExtraCut = 0
|
||||||
|
else
|
||||||
|
dExtraCut = -0.1
|
||||||
|
end
|
||||||
-- se tagli paralleli
|
-- se tagli paralleli
|
||||||
if ( i % 2) == 0 then
|
if ( i % 2) == 0 then
|
||||||
-- se non ci sono tagli ortogonali devo affondare
|
-- se non ci sono tagli ortogonali devo affondare
|
||||||
@@ -913,8 +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 = 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)
|
||||||
@@ -929,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
|
||||||
@@ -964,6 +1019,9 @@ local function CutWithDicing( Proc, Part, OptionalParameters)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- angolo tra le facce, se più di una
|
||||||
|
local dAngleBetweenFaces = Proc.AdjacencyMatrix[1][2] or 0
|
||||||
|
|
||||||
-- scelta lama da sopra o da sotto
|
-- scelta lama da sopra o da sotto
|
||||||
local sChosenBladeType = ''
|
local sChosenBladeType = ''
|
||||||
if not nToolIndex then
|
if not nToolIndex then
|
||||||
@@ -1003,12 +1061,14 @@ 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,
|
||||||
bReduceBladePath = bReduceBladePath,
|
bReduceBladePath = bReduceBladePath,
|
||||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||||
bCannotSplitRestLength = bCannotSplitRestLength
|
bCannotSplitRestLength = bCannotSplitRestLength,
|
||||||
|
bReduceDiceDepth = ( dAngleBetweenFaces < - 10) -- per facce molto aperte non si riduce l'affondamento della lama nei cubetti (rischio che non si stacchino)
|
||||||
}
|
}
|
||||||
|
|
||||||
bIsDicingOk, Machinings, bMoveAfterSplit = CalculateDiceMachinings( vCuts, Parameters)
|
bIsDicingOk, Machinings, bMoveAfterSplit = CalculateDiceMachinings( vCuts, Parameters)
|
||||||
|
|||||||
@@ -209,8 +209,10 @@ 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
|
||||||
|
|
||||||
-- lunghezze, direzioni e punti caratteristici della lavorazione e del lato lavorato
|
-- lunghezze, direzioni e punti caratteristici della lavorazione e del lato lavorato
|
||||||
Cutting.dEdgeLength = EdgeToMachine.dLength
|
Cutting.dEdgeLength = EdgeToMachine.dLength
|
||||||
@@ -231,10 +233,15 @@ 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
|
||||||
}
|
}
|
||||||
local Engagement
|
local Engagement
|
||||||
TIMER:startElapsed( 'GetBladeEngagement')
|
TIMER:startElapsed( 'GetBladeEngagement')
|
||||||
@@ -258,6 +265,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
|||||||
ToolSearchParameters.Part = Part
|
ToolSearchParameters.Part = Part
|
||||||
ToolSearchParameters.sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation
|
ToolSearchParameters.sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation
|
||||||
ToolSearchParameters.bCannotSplitRestLength = bCannotSplitRestLength
|
ToolSearchParameters.bCannotSplitRestLength = bCannotSplitRestLength
|
||||||
|
ToolSearchParameters.bDisableRealElevationCheck = bDisableRealElevationCheck
|
||||||
|
|
||||||
local ToolInfo = MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
local ToolInfo = MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||||
Cutting.nToolIndex = ToolInfo.nToolIndex
|
Cutting.nToolIndex = ToolInfo.nToolIndex
|
||||||
@@ -354,8 +362,10 @@ 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
|
||||||
}
|
}
|
||||||
TIMER:startElapsed( 'GetBladeEngagement')
|
TIMER:startElapsed( 'GetBladeEngagement')
|
||||||
local bIsApplicableOpposite, EngagementOpposite = MachiningLib.GetBladeEngagement( BladeEngagementParameters, BladeEngagementOptionalParameters)
|
local bIsApplicableOpposite, EngagementOpposite = MachiningLib.GetBladeEngagement( BladeEngagementParameters, BladeEngagementOptionalParameters)
|
||||||
@@ -471,8 +481,10 @@ 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
|
||||||
}
|
}
|
||||||
TIMER:startElapsed( 'GetBladeEngagement')
|
TIMER:startElapsed( 'GetBladeEngagement')
|
||||||
local bIsApplicable, CurrentEngagement = MachiningLib.GetBladeEngagement( BladeEngagementParameters, BladeEngagementOptionalParameters )
|
local bIsApplicable, CurrentEngagement = MachiningLib.GetBladeEngagement( BladeEngagementParameters, BladeEngagementOptionalParameters )
|
||||||
|
|||||||
+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