Compare commits

..

1 Commits

Author SHA1 Message Date
andrea.villa adf08876a9 DA CONTROLLARE!!!! Piccole modifiche per far funzionare nesting inclinato 2026-05-29 07:48:14 +02:00
17 changed files with 111 additions and 267 deletions
+2 -19
View File
@@ -388,18 +388,10 @@ 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 -- TODO nella ProcessBeams andava in errore con 10mm!!! CONTROLLARE
dBarLen = PARTS[1].b3PartOriginal:getDimX() + 20
if dBarLen < 2200 then if dBarLen < 2200 then
dBarLen = dBarLen + 1800 dBarLen = dBarLen + 1800
end end
@@ -456,15 +448,6 @@ 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
+24 -61
View File
@@ -341,11 +341,6 @@ function BeamExec.GetAvailableCombinations( PartInfo, bIsFlipRot)
nCycles = 2 nCycles = 2
end end
if bIsFlipRot and PartInfo.GeneralParameters.GEN_bGetAlternativesNesting2D then
BeamData.ROT90 = false
BeamData.ROT180 = false
end
-- verifico tutte le combinazioni che possono essere considerate -- verifico tutte le combinazioni che possono essere considerate
for nInvertIndex = 1, nCycles do for nInvertIndex = 1, nCycles do
for nUnloadPos = 1, 4 do for nUnloadPos = 1, 4 do
@@ -363,31 +358,22 @@ function BeamExec.GetAvailableCombinations( PartInfo, bIsFlipRot)
Combination.bPartInCombiIsInverted = true Combination.bPartInCombiIsInverted = true
end end
-- counter numero totale di rotazioni della combinazione
Combination.nRotationCounter = 0
-- se posizionamento iniziale attivo -- se posizionamento iniziale attivo
if string.sub( sBitIndexCombination, 1, 1) == '1' then if string.sub( sBitIndexCombination, 1, 1) == '1' then
CombinationList.Rotations[1] = 1 CombinationList.Rotations[1] = 1
Combination.nRotationCounter = Combination.nRotationCounter + 1
end end
-- se attiva rotazione 90 -- se attiva rotazione 90
if string.sub( sBitIndexCombination, 2, 2) == '1' then if string.sub( sBitIndexCombination, 2, 2) == '1' then
CombinationList.Rotations[2] = 1 CombinationList.Rotations[2] = 1
Combination.nRotationCounter = Combination.nRotationCounter + 1
end end
-- se attiva rotazione 180 -- se attiva rotazione 180
if string.sub( sBitIndexCombination, 3, 3) == '1' then if string.sub( sBitIndexCombination, 3, 3) == '1' then
CombinationList.Rotations[3] = 1 CombinationList.Rotations[3] = 1
Combination.nRotationCounter = Combination.nRotationCounter + 1
end end
-- se attiva rotazione 270 -- se attiva rotazione 270
if string.sub( sBitIndexCombination, 4, 4) == '1' then if string.sub( sBitIndexCombination, 4, 4) == '1' then
CombinationList.Rotations[4] = 1 CombinationList.Rotations[4] = 1
Combination.nRotationCounter = Combination.nRotationCounter + 1
end end
Combination.nRotationCounter = Combination.nRotationCounter - 1
end end
end end
end end
@@ -450,47 +436,36 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
local dPartWidth = CurrentPart.b3PartOriginal:getDimY( ) local dPartWidth = CurrentPart.b3PartOriginal:getDimY( )
local dPartHeight = CurrentPart.b3PartOriginal:getDimZ( ) local dPartHeight = CurrentPart.b3PartOriginal:getDimZ( )
-- Se il pezzo corrente non ha coordinata, si calcola da OvmMid
if ( not CurrentPart.dPosX) then
if ( i == 1) then
CurrentPart.dPosX = dOvmHead
else
CurrentPart.dPosX = PARTS[i - 1].dPosX + PARTS[i - 1].b3PartOriginal:getDimX( ) + dOvmMid
end
end
-- Se il pezzo SUCCESSIVO non ha coordinata, si calcola da OvmMid
if ( i < #PARTS and not PARTS[i + 1].dPosX) then
PARTS[i + 1].dPosX = CurrentPart.dPosX + dPartLen + dOvmMid
end
local dStartOffset = dNextStartOffset local dStartOffset = dNextStartOffset
local dEndOffset = ( i == #PARTS ) and 0 or dOvmMid local dEndOffset = dOvmMid
-- Gap reale tra i pezzi (può essere negativo in caso di compenetrazione nesting obliqui) -- LOGICA LOOK-AHEAD: Analisi del gap reale per la ripartizione specchiata
if ( i < #PARTS ) then if ( i < #PARTS ) then
local dTotalGap = PARTS[i + 1].dPosX - CurrentPart.dPosX - dPartLen local dTotalGap = PARTS[i + 1].dPosX - CurrentPart.dPosX - dPartLen
if ( dTotalGap > dOvmMid ) then if ( dTotalGap > dOvmMid ) then
dEndOffset = dOvmMid dEndOffset = dOvmMid -- Max 5.4mm sulla coda (lato sinistro del grezzo)
dNextStartOffset = dTotalGap - dOvmMid dNextStartOffset = dTotalGap - dOvmMid -- Il residuo sulla testa del prossimo (lato destro)
else else
-- Gap minore dello spessore lama (compenetrazione per nesting obliqui) -- Gestione automatica sotto-soglia o compenetrazione geometrica (Nesting Obliquo)
dEndOffset = dTotalGap dEndOffset = dTotalGap
dNextStartOffset = 0 dNextStartOffset = 0
end end
end end
local dCurrentRawLen = dPartLen + dStartOffset + dEndOffset -- MATEMATICA CORRETTA PER X CAD INVERTITA:
-- Il grezzo idRaw si estende verso destra. Spostando il pezzo internamente di dEndOffset (dDelta),
-- lasciamo dEndOffset a sinistra (coda) e matematicamente dStartOffset a destra (testa).
local dCrawLen = dPartLen + dStartOffset + dEndOffset
local dDelta = dEndOffset local dDelta = dEndOffset
local dStartPos = CurrentPart.dPosX - dStartOffset local dStartPos = (CurrentPart.dPosX or 0) - dStartOffset
local bIsSectionOk = ( ( abs( dPartWidth - dRawW ) < 100 * GEO.EPS_SMALL and abs( dPartHeight - dRawH ) < 100 * GEO.EPS_SMALL ) or local bIsSectionOk = ( ( abs( dPartWidth - dRawW ) < 100 * GEO.EPS_SMALL and abs( dPartHeight - dRawH ) < 100 * GEO.EPS_SMALL ) or
( abs( dPartHeight - dRawW ) < 100 * GEO.EPS_SMALL and abs( dPartWidth - dRawH ) < 100 * GEO.EPS_SMALL ) ) ( abs( dPartHeight - dRawW ) < 100 * GEO.EPS_SMALL and abs( dPartWidth - dRawH ) < 100 * GEO.EPS_SMALL ) )
if ( bIsSectionOk and ( dStartPos + dCurrentRawLen <= dRawL + GEO.EPS_SMALL ) ) then if ( bIsSectionOk and ( dStartPos + dCrawLen <= dRawL + GEO.EPS_SMALL ) ) then
-- 5. Creazione e Posizionamento del Contenitore RawPart -- 5. Creazione e Posizionamento del Contenitore RawPart
CurrentPart.idRaw = EgtAddRawPart( Point3d( 0, 0, 0 ), dCurrentRawLen, dRawW, dRawH, BeamData.RAWCOL ) CurrentPart.idRaw = EgtAddRawPart( Point3d( 0, 0, 0 ), dCrawLen, dRawW, dRawH, BeamData.RAWCOL )
EgtMoveToCornerRawPart( CurrentPart.idRaw, BeamData.ptOriXR, BeamData.dPosXR ) EgtMoveToCornerRawPart( CurrentPart.idRaw, BeamData.ptOriXR, BeamData.dPosXR )
EgtMoveRawPart( CurrentPart.idRaw, Vector3d( -dStartPos, 0, 0 ) ) EgtMoveRawPart( CurrentPart.idRaw, Vector3d( -dStartPos, 0, 0 ) )
@@ -555,7 +530,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
CurrentPart.CombinationList = BeamExec.GetAvailableCombinations( CurrentPart, bIsFlipRot ) CurrentPart.CombinationList = BeamExec.GetAvailableCombinations( CurrentPart, bIsFlipRot )
-- Avanzamento calcolato sulla coordinata reale di fine RawPart (estremità sinistra sulla barra) -- Avanzamento calcolato sulla coordinata reale di fine RawPart (estremità sinistra sulla barra)
dMaxX = max( dMaxX, dStartPos + dCurrentRawLen ) dMaxX = max( dMaxX, dStartPos + dCrawLen )
CurrentPart.dRestLength = dRawL - dMaxX CurrentPart.dRestLength = dRawL - dMaxX
idPrevRaw = CurrentPart.idRaw idPrevRaw = CurrentPart.idRaw
else else
@@ -822,7 +797,7 @@ local function AreDrillingsMirrored( Proc, ProcMirror, Part)
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot) local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
-- gruppo per geometrie temporanee -- gruppo per geometrie temporanee
local idTempGroup = BeamLib.GetTempGroup() local idTempGroup = BeamLib.GetTempGroup()
@@ -834,10 +809,12 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
-- ciclo tutte le feature -- ciclo tutte le feature
for i = 1, #vProcSingleRot do for i = 1, #vProcSingleRot do
local Proc = vProcSingleRot[i] local Proc = vProcSingleRot[i]
if not HeadProcOriginal and Proc.Topology.sName == 'HeadCut' then if Proc.Topology.sName == 'HeadCut' then
HeadProcOriginal = Proc HeadProcOriginal = Proc
elseif not TailProcOriginal and Proc.Topology.sName == 'TailCut' then HeadProcOriginal.bIsOriginalHeadcut = true
elseif Proc.Topology.sName == 'TailCut' then
TailProcOriginal = Proc TailProcOriginal = Proc
TailProcOriginal.bIsOriginalTailcut = true
end end
-- se feature abilitata alla lavorazione -- se feature abilitata alla lavorazione
if Proc.nFlg ~= 0 then if Proc.nFlg ~= 0 then
@@ -852,7 +829,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
and ( FeatureLib.IsFeatureCuttingEntireSection( Proc.b3Box, Part) and FeatureLib.IsFeatureCuttingEntireSection( ProcB.b3Box, Part)) and ( FeatureLib.IsFeatureCuttingEntireSection( Proc.b3Box, Part) and FeatureLib.IsFeatureCuttingEntireSection( ProcB.b3Box, Part))
-- si trovano i veri tagli di testa e coda e si disattivano gli altri, se necessario -- si trovano i veri tagli di testa e coda e si disattivano gli altri, se necessario
if bIsFlipRot and Part.GeneralParameters.GEN_bGetAlternativesNesting2D and bAreBothTruncatingCuts then if bAreBothTruncatingCuts then
-- testa -- testa
if Proc.Faces[1].vtN:getX() > GEO.EPS_SMALL and ProcB.Faces[1].vtN:getX() > GEO.EPS_SMALL then if Proc.Faces[1].vtN:getX() > GEO.EPS_SMALL and ProcB.Faces[1].vtN:getX() > GEO.EPS_SMALL then
-- il primo taglio è più verso il centro della trave -- il primo taglio è più verso il centro della trave
@@ -872,7 +849,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
ProcB.nFlg = 0 ProcB.nFlg = 0
end end
-- il secondo taglio è più verso il centro della trave -- il secondo taglio è più verso il centro della trave
else elseif Proc.b3Box:getMin():getX() >= ProcB.b3Box:getMin():getX() - 10 * GEO.EPS_SMALL then
HeadProc = ProcB HeadProc = ProcB
local idProcCopy = EgtCopyGlob( Proc.id, idTempGroup) local idProcCopy = EgtCopyGlob( Proc.id, idTempGroup)
local idProcBCopy = EgtCopyGlob( ProcB.id, idTempGroup) local idProcBCopy = EgtCopyGlob( ProcB.id, idTempGroup)
@@ -907,7 +884,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
ProcB.nFlg = 0 ProcB.nFlg = 0
end end
-- il secondo taglio è più verso il centro della trave -- il secondo taglio è più verso il centro della trave
else elseif Proc.b3Box:getMax():getX() >= ProcB.b3Box:getMax():getX() - 10 * GEO.EPS_SMALL then
TailProc = ProcB TailProc = ProcB
local idProcCopy = EgtCopyGlob( Proc.id, idTempGroup) local idProcCopy = EgtCopyGlob( Proc.id, idTempGroup)
local idProcBCopy = EgtCopyGlob( ProcB.id, idTempGroup) local idProcBCopy = EgtCopyGlob( ProcB.id, idTempGroup)
@@ -934,7 +911,6 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
table.insert( Proc.SlaveProcIndexes, j) table.insert( Proc.SlaveProcIndexes, j)
ProcB.nIndexMasterProc = i ProcB.nIndexMasterProc = i
ProcB.nFlg = 0 ProcB.nFlg = 0
HeadProcOriginal = Proc
end end
-- se entrambi tagli di coda, si tiene sempre il primo ( ma non quello aggiunto dall'automatismo) -- se entrambi tagli di coda, si tiene sempre il primo ( ma non quello aggiunto dall'automatismo)
if ( ID.IsTailCut( Proc) and not EgtGetInfo( Proc.id, 'HEAD_ADD_CUT', 'i')) and ID.IsTailCut( ProcB) then if ( ID.IsTailCut( Proc) and not EgtGetInfo( Proc.id, 'HEAD_ADD_CUT', 'i')) and ID.IsTailCut( ProcB) then
@@ -944,7 +920,6 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
table.insert( Proc.SlaveProcIndexes, j) table.insert( Proc.SlaveProcIndexes, j)
ProcB.nIndexMasterProc = i ProcB.nIndexMasterProc = i
ProcB.nFlg = 0 ProcB.nFlg = 0
TailProcOriginal = Proc
end end
-- verifico se feature tipo LapJoint è attraversata da almeno un foro -- verifico se feature tipo LapJoint è attraversata da almeno un foro
if ( Proc.Topology.sFamily == 'Pocket' or Proc.Topology.sFamily == 'Tunnel' or Proc.Topology.sFamily == 'Groove' or ID.IsMortise( Proc)) and if ( Proc.Topology.sFamily == 'Pocket' or Proc.Topology.sFamily == 'Tunnel' or Proc.Topology.sFamily == 'Groove' or ID.IsMortise( Proc)) and
@@ -966,24 +941,12 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
end end
end end
if not Part.GeneralParameters.GEN_bGetAlternativesNesting2D then
return vProcSingleRot
end
-- si tiene via il riferimento alla Proc Head/Tail originale in caso si dovesse rimpiazzare
HeadProcOriginal.bIsOriginalHeadcut = true
TailProcOriginal.bIsOriginalTailcut = true
if not HeadProc then if not HeadProc then
HeadProc = HeadProcOriginal HeadProc = HeadProcOriginal
else
HeadProc.HeadProcOriginal = HeadProcOriginal
end end
if not TailProc then if not TailProc then
TailProc = TailProcOriginal TailProc = TailProcOriginal
else
TailProc.TailProcOriginal = TailProcOriginal
end end
HeadProc.Topology = {} HeadProc.Topology = {}
TailProc.Topology = {} TailProc.Topology = {}
HeadProc.Topology.sFamily = 'HeadCut' HeadProc.Topology.sFamily = 'HeadCut'
@@ -1005,7 +968,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
local PtSortedTail = BeamLib.GetSortedVertices( TailProc) local PtSortedTail = BeamLib.GetSortedVertices( TailProc)
if PtSortedTail then if PtSortedTail then
TailcutInfo.OffsetX = {} TailcutInfo.OffsetX = {}
for i = 1, #PtSortedTail do for i = 1, #PtSortedHead do
table.insert( TailcutInfo.OffsetX, Part.b3Part:getMin():getX() - PtSortedTail[i]:getX()) table.insert( TailcutInfo.OffsetX, Part.b3Part:getMin():getX() - PtSortedTail[i]:getX())
end end
end end
@@ -1453,7 +1416,7 @@ function BeamExec.GetProcessings( PARTS, bIsFlipRot)
-- recupero informazioni ausiliarie feature e dipendenze tra feature stesse -- recupero informazioni ausiliarie feature e dipendenze tra feature stesse
-- TODO le dipendenze cambiano in base alla rotazione del pezzo? probabilmente no -- TODO le dipendenze cambiano in base alla rotazione del pezzo? probabilmente no
vProcRot[nIndex], HeadcutInfo, TailcutInfo = GetFeatureInfoAndDependency( vProcRot[nIndex], PARTS[nPart], bIsFlipRot) vProcRot[nIndex], HeadcutInfo, TailcutInfo = GetFeatureInfoAndDependency( vProcRot[nIndex], PARTS[nPart])
else else
-- inserisco una tabella vuota -- inserisco una tabella vuota
table.insert( vProcRot, {}) table.insert( vProcRot, {})
@@ -1840,7 +1803,7 @@ function BeamExec.ProcessMachinings( PARTS, bIsFlipRot)
-- ricerca strategia di lavorazione per ogni pezzo e applicazione lavorazioni -- ricerca strategia di lavorazione per ogni pezzo e applicazione lavorazioni
for nPart = 1, #PARTS do for nPart = 1, #PARTS do
local nCycles = 1 local nCycles = 1
local nMaxReProcessCycles = EgtClamp( PARTS[nPart].GeneralParameters.GEN_nMaxReProcessCycles, 1, 5) local nMaxReProcessCycles = EgtClamp( PARTS[nPart].GeneralParameters.GEN_nMaxReProcessCycles, 1, 3)
-- la parte di applicazione lavorazioni può essere lanciata più volte in caso della presenza di errori -- la parte di applicazione lavorazioni può essere lanciata più volte in caso della presenza di errori
local bProcess = true local bProcess = true
+7 -7
View File
@@ -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( CheckCollisionParameters, CheckCollisionOptionalParameters) local bCollisionFound, bMoveAfterSplit = PreSimulationLib.CheckCollision( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters)
if bCollisionFound then if bCollisionFound then
return false return false
end end
@@ -373,7 +373,7 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
CheckCollisionOptionalParameters.PointsToCheck = {} CheckCollisionOptionalParameters.PointsToCheck = {}
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadIn.ptPoint) table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadIn.ptPoint)
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadOut.ptPoint) table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadOut.ptPoint)
local bCollisionFoundPerpendicular, bMoveAfterSplitPerpendicular = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters) local bCollisionFoundPerpendicular, bMoveAfterSplitPerpendicular = PreSimulationLib.CheckCollision( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters)
-- attacco perpendicolare possibile -- attacco perpendicolare possibile
if not bCollisionFoundPerpendicular then if not bCollisionFoundPerpendicular then
LeadInOut.Perpendicular = PerpendicularLeadInOut LeadInOut.Perpendicular = PerpendicularLeadInOut
@@ -403,7 +403,7 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
CheckCollisionOptionalParameters.PointsToCheck = {} CheckCollisionOptionalParameters.PointsToCheck = {}
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadIn.ptPoint) table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadIn.ptPoint)
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadOut.ptPoint) table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadOut.ptPoint)
local bCollisionFoundTangent, bMoveAfterSplitTangent = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters) local bCollisionFoundTangent, bMoveAfterSplitTangent = PreSimulationLib.CheckCollision( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters)
-- attacco tangenziale possibile -- attacco tangenziale possibile
if not bCollisionFoundTangent then if not bCollisionFoundTangent then
LeadInOut.Tangent = TangentLeadInOut LeadInOut.Tangent = TangentLeadInOut
@@ -625,7 +625,7 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
local bForceLongcutBlade = ToolSearchParameters.bForceLongcutBlade or false local bForceLongcutBlade = ToolSearchParameters.bForceLongcutBlade or false
local EdgeToMachine = ToolSearchParameters.EdgeToMachine local EdgeToMachine = ToolSearchParameters.EdgeToMachine
local Part = ToolSearchParameters.Part local Part = ToolSearchParameters.Part
local idCheckCollisionTm = ToolSearchParameters.idCheckCollisionTm local bIsDicing = ToolSearchParameters.bIsDicing or false
local sRestLengthSideForPreSimulation = ToolSearchParameters.sRestLengthSideForPreSimulation or 'Tail' local sRestLengthSideForPreSimulation = ToolSearchParameters.sRestLengthSideForPreSimulation or 'Tail'
local bCannotSplitRestLength = ToolSearchParameters.bCannotSplitRestLength or false local bCannotSplitRestLength = ToolSearchParameters.bCannotSplitRestLength or false
local bDisableRealElevationCheck = ToolSearchParameters.bDisableRealElevationCheck or false local bDisableRealElevationCheck = ToolSearchParameters.bDisableRealElevationCheck or false
@@ -660,7 +660,7 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
dDepthToMachine = min( dElevation, TOOLS[i].dMaxDepth) dDepthToMachine = min( dElevation, TOOLS[i].dMaxDepth)
} }
local BladeEngagementOptionalParameters = { local BladeEngagementOptionalParameters = {
idCheckCollisionTm = idCheckCollisionTm, bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength, bCannotSplitRestLength = bCannotSplitRestLength,
bDisableRealElevationCheck = bDisableRealElevationCheck bDisableRealElevationCheck = bDisableRealElevationCheck
@@ -1584,8 +1584,8 @@ function MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part)
Machining.CloneStepsLongitudinal.nCount = 1 Machining.CloneStepsLongitudinal.nCount = 1
end end
-- stima tempi di lavorazione per i diversi tratti -- stima tempi di lavorazione per i diversi tratti
local dTimeToMachineLeadIn = ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 0) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) / dToolStartFeed local dTimeToMachineLeadIn = ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 60) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) / dToolStartFeed
local dTimeToMachineLeadOut = ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 0) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) / dToolEndFeed local dTimeToMachineLeadOut = ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 60) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) / dToolEndFeed
local dTimeToMachineEdge = Machining.dLengthToMachine / dToolFeed local dTimeToMachineEdge = Machining.dLengthToMachine / dToolFeed
-- calcolo lunghezze e tempi -- calcolo lunghezze e tempi
if Machining.Steps.nStepType == MCH_MILL_ST.ZIGZAG then if Machining.Steps.nStepType == MCH_MILL_ST.ZIGZAG then
+34 -20
View File
@@ -209,6 +209,12 @@ local function CheckOutOfStrokePoint( ptOnToolTipCenter, vtHead, nSCC, Tool, vtA
return true return true
end end
-- EgtSetAxisPos( 'T', dT)
-- EgtSetAxisPos( 'Y', dY)
-- EgtSetAxisPos( 'Z', dZ)
-- EgtSetAxisPos( 'C', dC1)
-- EgtSetAxisPos( 'A', dA1)
-- se si arriva qui, il punto non è in finecorsa -- se si arriva qui, il punto non è in finecorsa
return false return false
end end
@@ -299,7 +305,7 @@ local function MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm) local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, bCheckOnlyRestlength)
-- spostamento assi macchina in posizione -- spostamento assi macchina in posizione
local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux) local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
@@ -331,32 +337,32 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
-- check collisione con pezzo -- check collisione con pezzo
local bCollisionFoundPiece = false local bCollisionFoundPiece = false
if not idCheckCollisionTm then if not bCheckOnlyRestlength then
idCheckCollisionTm = Part.idBoxTm local 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
end for i = 1, #CollisionSurfTmId do
for i = 1, #CollisionSurfTmId do bCollisionFoundPiece = EgtCDeSolidSolid( idCheckCollisionTm, CollisionSurfTmId[i], BeamData.COLL_SIC)
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
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
EgtSetColor( CollisionSurfTmId[i], RED())
end
if bCollisionFoundPiece then
break
end
end end
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
EgtSetColor( CollisionSurfTmId[i], RED())
end
if bCollisionFoundPiece then
break
end
end
-- se trovata collisione con pezzo è inutile procedere con il grezzo -- se trovata collisione con pezzo è inutile procedere con il grezzo
if bCollisionFoundPiece then if bCollisionFoundPiece then
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
@@ -395,7 +401,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
-- parametri opzionali -- parametri opzionali
OptionalParameters = OptionalParameters or {} OptionalParameters = OptionalParameters or {}
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm local bCheckOnlyRestlength = OptionalParameters.bCheckOnlyRestlength or false
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail' local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
local vtAux = OptionalParameters.vtAux local vtAux = OptionalParameters.vtAux
@@ -420,7 +426,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
-- se non si trova collisione si ritorna se è necessario separare prima di effettuare la lavorazione (ossia non c'è collisione con il pezzo ma c'è con il grezzo restante) -- se non si trova collisione si ritorna se è necessario separare prima di effettuare la lavorazione (ossia non c'è collisione con il pezzo ma c'è con il grezzo restante)
for i = 1, #PointsOnToolTipCenter do for i = 1, #PointsOnToolTipCenter do
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm) local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, bCheckOnlyRestlength)
-- 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
@@ -439,7 +445,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
function PreSimulationLib.CheckCollision( Parameters, OptionalParameters) function PreSimulationLib.CheckCollision( sBladeEngagement, Parameters, OptionalParameters)
local bCollisionFound local bCollisionFound
local bMoveAfterSplitL3, bMoveAfterSplitR3, bMoveAfterSplitR2, bMoveAfterSplitR1 local bMoveAfterSplitL3, bMoveAfterSplitR3, bMoveAfterSplitR2, bMoveAfterSplitR1
@@ -453,19 +459,24 @@ function PreSimulationLib.CheckCollision( Parameters, OptionalParameters)
OptionalParameters = OptionalParameters or {} OptionalParameters = OptionalParameters or {}
local OptionalParametersCheckCollisionWithAxis = {} local OptionalParametersCheckCollisionWithAxis = {}
OptionalParametersCheckCollisionWithAxis.bCheckOnlyRestlength = false
OptionalParametersCheckCollisionWithAxis.PointsToCheck = OptionalParameters.PointsToCheck or nil OptionalParametersCheckCollisionWithAxis.PointsToCheck = OptionalParameters.PointsToCheck or nil
OptionalParametersCheckCollisionWithAxis.sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail' OptionalParametersCheckCollisionWithAxis.sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
OptionalParametersCheckCollisionWithAxis.bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false OptionalParametersCheckCollisionWithAxis.bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
OptionalParametersCheckCollisionWithAxis.sBlockedAxis = OptionalParameters.sBlockedAxis OptionalParametersCheckCollisionWithAxis.sBlockedAxis = OptionalParameters.sBlockedAxis
OptionalParametersCheckCollisionWithAxis.vtAux = OptionalParameters.vtAux OptionalParametersCheckCollisionWithAxis.vtAux = OptionalParameters.vtAux
OptionalParametersCheckCollisionWithAxis.idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
local sBlockedAxis = OptionalParameters.sBlockedAxis local sBlockedAxis = OptionalParameters.sBlockedAxis
local bIsDicing = OptionalParameters.bIsDicing or false
local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false
local bCheckOnlyRestlengthForAxisABC = false
-- se cubetti in modalità standard (no DownUp) gli assi AB e C si controllano solo con grezzo (ci sarebbe collisione con il materiale già rimosso controllando AB e C con pezzo)
if bIsDicing and ( sBladeEngagement == 'Standard') then
bCheckOnlyRestlengthForAxisABC = true
-- se l'elevazione reale (rispetto al pezzo + eventuale materiale in testa/coda) è maggiore del massimo materiale è sempre collisione -- se l'elevazione reale (rispetto al pezzo + eventuale materiale in testa/coda) è maggiore del massimo materiale è sempre collisione
-- TODO rifare con funzione -- TODO rifare con funzione
if not bDisableRealElevationCheck then elseif 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
@@ -512,6 +523,9 @@ function PreSimulationLib.CheckCollision( Parameters, OptionalParameters)
-- ultimo asse lineare prima dei rotativi (solitamente Z) si controlla sempre -- ultimo asse lineare prima dei rotativi (solitamente Z) si controlla sempre
bCollisionFound, bMoveAfterSplitL3 = CheckCollisionWithAxis( sL3, Parameters, OptionalParametersCheckCollisionWithAxis) bCollisionFound, bMoveAfterSplitL3 = CheckCollisionWithAxis( sL3, Parameters, OptionalParametersCheckCollisionWithAxis)
-- assi rotativi: se richiesto si controlla la collisione solo col grezzo
OptionalParametersCheckCollisionWithAxis.bCheckOnlyRestlength = bCheckOnlyRestlengthForAxisABC
if sR3 and not bCollisionFound then if sR3 and not bCollisionFound then
bCollisionFound, bMoveAfterSplitR3 = CheckCollisionWithAxis( sR3, Parameters, OptionalParametersCheckCollisionWithAxis) bCollisionFound, bMoveAfterSplitR3 = CheckCollisionWithAxis( sR3, Parameters, OptionalParametersCheckCollisionWithAxis)
end end
-8
View File
@@ -131,14 +131,6 @@ 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()
+1 -1
View File
@@ -46,7 +46,7 @@
"sName": "GEN_bGetAlternativesNesting2D", "sName": "GEN_bGetAlternativesNesting2D",
"sNameNge": "GET_ALTERNATIVES_NEST2D", "sNameNge": "GET_ALTERNATIVES_NEST2D",
"sValue": "false", "sValue": "false",
"sDescriptionShort": "Enable material optimization function in nesting (part rotation disabled)", "sDescriptionShort": "Enable material optimization function in nesting",
"sDescriptionLong": "", "sDescriptionLong": "",
"sType": "b", "sType": "b",
"sMessageId": " ", "sMessageId": " ",
-1
View File
@@ -87,7 +87,6 @@ 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)
+2 -9
View File
@@ -415,8 +415,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
end end
-- ancora materiale residuo - se possibile si lavora dal lato -- ancora materiale residuo - se possibile si lavora dal lato
if ( Chainsaw.Result.Bottom[#Chainsaw.Result.Bottom].dResidualDepth > 10 * GEO.EPS_SMALL if Chainsaw.Result.Bottom[#Chainsaw.Result.Bottom].dResidualDepth > 10 * GEO.EPS_SMALL
or not Chainsaw.Result.Bottom[#Chainsaw.Result.Bottom].bIsApplicable)
and #Proc.MainFaces.SideFaces == 1 then and #Proc.MainFaces.SideFaces == 1 then
-- si lavora solamente l'impronta lama sul fondo -- si lavora solamente l'impronta lama sul fondo
@@ -699,13 +698,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
else else
Strategy.Result.sStatus = 'Not-Completed' Strategy.Result.sStatus = 'Not-Completed'
end end
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( Result)
if Proc.Topology.sName == 'Groove-4-Blind' or Proc.Topology.sName == 'Pocket-5-Blind' then
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( 'SEMI')
else
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( Result)
end
Strategy.Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Result) Strategy.Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Result)
Strategy.Result.dMRR = ( dFeatureVolume / Strategy.Result.dTimeToMachine) / pow( 10, 6) Strategy.Result.dMRR = ( dFeatureVolume / Strategy.Result.dTimeToMachine) / pow( 10, 6)
else else
+1
View File
@@ -215,6 +215,7 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters)
end end
-- se la lavorazione ostacola il pinzaggio, non posso farla, serve una lavorazioen che lasci il testimone -- se la lavorazione ostacola il pinzaggio, non posso farla, serve una lavorazioen che lasci il testimone
-- TODO Girando il pezzo trova sempre che limitano il pinzaggio se pezzo piccolo!! Il controllo non va bene. Da rifare
if MachiningLib.IsFeatureHinderingClamping( Proc, Part) then if MachiningLib.IsFeatureHinderingClamping( Proc, Part) then
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. StrategyLib.Config.sStrategyId .. ' not applicable ( Feature hinders clamping)' local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. StrategyLib.Config.sStrategyId .. ' not applicable ( Feature hinders clamping)'
EgtOutLog( sErr) EgtOutLog( sErr)
-23
View File
@@ -16,27 +16,6 @@ local Strategy = {}
-- TODO Da fare completamente gestione foratura doppia con 2 teste -- TODO Da fare completamente gestione foratura doppia con 2 teste
-------------------------------------------------------------------------------------------------------------
local function GetSCC( vtMachiningDirection)
-- TODO implementare SCC come per FacesBySaw
local nSCC = MCH_SCC.NONE
if vtMachiningDirection:getZ() < -0.9 then
nSCC = MCH_SCC.ADIR_ZM
elseif vtMachiningDirection:getZ() > 0.9 then
nSCC = MCH_SCC.ADIR_ZP
elseif vtMachiningDirection:getY() < -0.707 then
nSCC = MCH_SCC.ADIR_YM
elseif vtMachiningDirection:getY() > 0.707 then
nSCC = MCH_SCC.ADIR_YP
elseif vtMachiningDirection:getX() < -0.707 then
nSCC = MCH_SCC.ADIR_XM
elseif vtMachiningDirection:getX() > 0.707 then
nSCC = MCH_SCC.ADIR_XP
end
return nSCC
end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function GetDrillingStrategy( Proc, Part) local function GetDrillingStrategy( Proc, Part)
local ToolSearchParameters = {} local ToolSearchParameters = {}
@@ -60,7 +39,6 @@ local function GetDrillingStrategy( Proc, Part)
Drilling.nToolIndex = Drilling.ToolInfo.nToolIndex Drilling.nToolIndex = Drilling.ToolInfo.nToolIndex
Drilling.vtToolDirection = Proc.FeatureInfo.vtDrillExtrusion Drilling.vtToolDirection = Proc.FeatureInfo.vtDrillExtrusion
Drilling.dStep = TOOLS[Drilling.nToolIndex].dStep Drilling.dStep = TOOLS[Drilling.nToolIndex].dStep
Drilling.nSCC = GetSCC( -Drilling.vtToolDirection)
end end
-- TODO se utensile 2 che si torverà è il gemello da usare nelle lavorazioni in doppio, allora gestire di conseguenza l'applicazione delle lavorazioni in doppio -- TODO se utensile 2 che si torverà è il gemello da usare nelle lavorazioni in doppio, allora gestire di conseguenza l'applicazione delle lavorazioni in doppio
@@ -83,7 +61,6 @@ local function GetDrillingStrategy( Proc, Part)
Drilling2.bInvert = true Drilling2.bInvert = true
Drilling2.vtToolDirection = -Proc.FeatureInfo.vtDrillExtrusion Drilling2.vtToolDirection = -Proc.FeatureInfo.vtDrillExtrusion
Drilling2.dStep = TOOLS[Drilling2.nToolIndex].dStep Drilling2.dStep = TOOLS[Drilling2.nToolIndex].dStep
Drilling2.nSCC = GetSCC( -Drilling2.vtToolDirection)
end end
end end
-24
View File
@@ -14,27 +14,6 @@ local FeatureLib = require( 'FeatureLib')
local STR0013 = {} local STR0013 = {}
local Strategy = {} local Strategy = {}
-------------------------------------------------------------------------------------------------------------
local function GetSCC( vtMachiningDirection)
-- TODO implementare SCC come per FacesBySaw
local nSCC = MCH_SCC.NONE
if vtMachiningDirection:getZ() < -0.9 then
nSCC = MCH_SCC.ADIR_ZM
elseif vtMachiningDirection:getZ() > 0.9 then
nSCC = MCH_SCC.ADIR_ZP
elseif vtMachiningDirection:getY() < -0.707 then
nSCC = MCH_SCC.ADIR_YM
elseif vtMachiningDirection:getY() > 0.707 then
nSCC = MCH_SCC.ADIR_YP
elseif vtMachiningDirection:getX() < -0.707 then
nSCC = MCH_SCC.ADIR_XM
elseif vtMachiningDirection:getX() > 0.707 then
nSCC = MCH_SCC.ADIR_XP
end
return nSCC
end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function GetDrillingWithMillStrategy( Proc, Part) local function GetDrillingWithMillStrategy( Proc, Part)
local ToolSearchParameters = {} local ToolSearchParameters = {}
@@ -193,7 +172,6 @@ function STR0013.Make( bAddMachining, Proc, Part, CustomParameters)
MachiningToAdd = MachiningLib.InitMachiningParameters( MCH_MY.DRILLING) MachiningToAdd = MachiningLib.InitMachiningParameters( MCH_MY.DRILLING)
MachiningToAdd = BeamLib.MergeTables( MachiningToAdd, Strategy.Machinings[j]) MachiningToAdd = BeamLib.MergeTables( MachiningToAdd, Strategy.Machinings[j])
MachiningToAdd.Steps.dStep = TOOLS[nIndexTool].dStep / 3 MachiningToAdd.Steps.dStep = TOOLS[nIndexTool].dStep / 3
MachiningToAdd.nSCC = GetSCC( -MachiningToAdd.vtToolDirection)
-- se diametro foro più grande della fresa, ma non oltre il doppio del diametro, si fa contornatura a spirale -- se diametro foro più grande della fresa, ma non oltre il doppio del diametro, si fa contornatura a spirale
elseif Proc.FeatureInfo.dDrillDiam < ( TOOLS[nIndexTool].dDiameter * 0.75) * 2 or Strategy.Parameters.bOnlyContouring then elseif Proc.FeatureInfo.dDrillDiam < ( TOOLS[nIndexTool].dDiameter * 0.75) * 2 or Strategy.Parameters.bOnlyContouring then
MachiningToAdd = MachiningLib.InitMachiningParameters( MCH_MY.MILLING) MachiningToAdd = MachiningLib.InitMachiningParameters( MCH_MY.MILLING)
@@ -206,7 +184,6 @@ function STR0013.Make( bAddMachining, Proc, Part, CustomParameters)
MachiningToAdd.LeadOut.dTangentDistance = 0.5 MachiningToAdd.LeadOut.dTangentDistance = 0.5
MachiningToAdd.LeadOut.dPerpDistance = 0.5 MachiningToAdd.LeadOut.dPerpDistance = 0.5
MachiningToAdd.LeadOut.dElevation = Proc.FeatureInfo.dDrillLen MachiningToAdd.LeadOut.dElevation = Proc.FeatureInfo.dDrillLen
MachiningToAdd.nSCC = GetSCC( -MachiningToAdd.vtToolDirection)
-- se diametro foro più grande del doppio del diametro fresa, si fa svuotatura -- se diametro foro più grande del doppio del diametro fresa, si fa svuotatura
else else
MachiningToAdd = MachiningLib.InitMachiningParameters( MCH_MY.POCKETING) MachiningToAdd = MachiningLib.InitMachiningParameters( MCH_MY.POCKETING)
@@ -217,7 +194,6 @@ function STR0013.Make( bAddMachining, Proc, Part, CustomParameters)
MachiningToAdd.LeadIn.nType = MCH_POCK_LI.HELIX MachiningToAdd.LeadIn.nType = MCH_POCK_LI.HELIX
MachiningToAdd.LeadIn.dTangentDistance = TOOLS[nIndexTool].dDiameter / 2 MachiningToAdd.LeadIn.dTangentDistance = TOOLS[nIndexTool].dDiameter / 2
MachiningToAdd.LeadIn.dElevation = MachiningToAdd.Steps.dStep / 2 MachiningToAdd.LeadIn.dElevation = MachiningToAdd.Steps.dStep / 2
MachiningToAdd.nSCC = GetSCC( -MachiningToAdd.vtToolDirection)
end end
MachiningToAdd.nToolIndex = nIndexTool MachiningToAdd.nToolIndex = nIndexTool
+4 -4
View File
@@ -222,21 +222,21 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
elseif Proc.nFct == 2 then elseif Proc.nFct == 2 then
-- per angolo tra le facce >= 90deg (feature convessa) non applicabile -- per angolo tra le facce >= 90deg (feature convessa) non applicabile
if Proc.AdjacencyMatrix[1][2] > 10 * GEO.EPS_SMALL or Proc.AdjacencyMatrix[1][2] < -91 then if Proc.AdjacencyMatrix[1][2] > 10 * GEO.EPS_SMALL or Proc.AdjacencyMatrix[1][2] < -91 then
Result = FeatureLib.GetStrategyResultNotApplicable() Result = FeatureLib.GetStrategyResultNotApplicable( 'BladeKeepWaste : angle between faces must be concave and >= 90deg')
return Machinings, Result return Machinings, Result
end end
elseif Proc.nFct == 3 then elseif Proc.nFct == 3 then
-- caso speciale RidgeLap - per angolo tra le facce >= 90deg (feature convessa) non applicabile -- caso speciale RidgeLap - per angolo tra le facce >= 90deg (feature convessa) non applicabile
if Proc.AdjacencyMatrix[1][2] > 10 * GEO.EPS_SMALL or Proc.AdjacencyMatrix[1][2] < -91 then if Proc.AdjacencyMatrix[1][2] > 10 * GEO.EPS_SMALL or Proc.AdjacencyMatrix[1][2] < -91 then
Result = FeatureLib.GetStrategyResultNotApplicable() Result = FeatureLib.GetStrategyResultNotApplicable( 'BladeKeepWaste : angle between faces must be concave and >= 90deg')
return Machinings, Result return Machinings, Result
end end
if Proc.AdjacencyMatrix[1][3] > 10 * GEO.EPS_SMALL or Proc.AdjacencyMatrix[1][3] < -91 then if Proc.AdjacencyMatrix[1][3] > 10 * GEO.EPS_SMALL or Proc.AdjacencyMatrix[1][3] < -91 then
Result = FeatureLib.GetStrategyResultNotApplicable() Result = FeatureLib.GetStrategyResultNotApplicable( 'BladeKeepWaste : angle between faces must be concave and >= 90deg')
return Machinings, Result return Machinings, Result
end end
if Proc.AdjacencyMatrix[2][3] > 10 * GEO.EPS_SMALL or Proc.AdjacencyMatrix[2][3] < -91 then if Proc.AdjacencyMatrix[2][3] > 10 * GEO.EPS_SMALL or Proc.AdjacencyMatrix[2][3] < -91 then
Result = FeatureLib.GetStrategyResultNotApplicable() Result = FeatureLib.GetStrategyResultNotApplicable( 'BladeKeepWaste : angle between faces must be concave and >= 90deg')
return Machinings, Result return Machinings, Result
end end
end end
+29 -78
View File
@@ -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 idCheckCollisionTm = OptionalParameters.idCheckCollisionTm local bIsDicing = OptionalParameters.bIsDicing
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,
idCheckCollisionTm = idCheckCollisionTm, bIsDicing = bIsDicing,
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,
idCheckCollisionTm = idCheckCollisionTm, bIsDicing = bIsDicing,
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 idCheckCollisionTm = OptionalParameters.idCheckCollisionTm local bIsDicing = OptionalParameters.bIsDicing or false
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,
idCheckCollisionTm = idCheckCollisionTm, bIsDicing = bIsDicing,
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,
idCheckCollisionTm = idCheckCollisionTm, bIsDicing = bIsDicing,
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 idCheckCollisionTm = OptionalParameters.idCheckCollisionTm local bIsDicing = OptionalParameters.bIsDicing or false
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,
idCheckCollisionTm = idCheckCollisionTm, bIsDicing = bIsDicing,
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,
idCheckCollisionTm = idCheckCollisionTm, bIsDicing = bIsDicing,
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,
idCheckCollisionTm = idCheckCollisionTm, bIsDicing = bIsDicing,
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,
idCheckCollisionTm = idCheckCollisionTm, bIsDicing = bIsDicing,
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,
idCheckCollisionTm = idCheckCollisionTm, bIsDicing = bIsDicing,
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 = {
idCheckCollisionTm = idCheckCollisionTm, bIsDicing = bIsDicing,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
} }
@@ -782,52 +782,6 @@ 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
@@ -835,7 +789,6 @@ 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
@@ -844,15 +797,21 @@ local function CalculateDiceMachinings( vCuts, Parameters)
local bCannotSplitRestLength = Parameters.bCannotSplitRestLength local bCannotSplitRestLength = Parameters.bCannotSplitRestLength
local bReduceDiceDepth = Parameters.bReduceDiceDepth local bReduceDiceDepth = Parameters.bReduceDiceDepth
-- trimesh con RestLength
local b3CheckCollision = BeamLib.GetPartBoxWithHeadTail( Part, sRestLengthSideForPreSimulation)
local idCheckCollisionTm = EgtSurfTmBBox( Part.idTempGroup, b3CheckCollision, false, GDB_RT.GLOB)
-- eventuale inversione tagli ortogonali e aggiunta informazioni alla geometria -- eventuale inversione tagli ortogonali e aggiunta informazioni alla geometria
local bAreOrthogonalCutsInverted = false local bAreOrthogonalCutsInverted = false
for i = 1, #vCuts do for i = 1, #vCuts do
for j = 1, #vCuts[i] do for j = 1, #vCuts[i] do
SetDiceFaceInfo( Proc, vCuts[i][j]) SetDiceFaceInfo( Proc, vCuts[i][j])
-- TODO vedere se questa parte serve ancora; in teoria no perchè il taglio è girato automaticamente nella FaceByBlade
-- if ( i % 2) == 1 then
-- local vtO = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
-- if MachiningLib.IsFaceZOutOfRange( vtO, Tool) then
-- EgtInvertSurf( vCuts[i][j])
-- local vtCurrentFaceNormal = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
-- EgtMove( vCuts[i][j], -vtCurrentFaceNormal * Tool.dThickness, GDB_RT.GLOB)
-- bAreOrthogonalCutsInverted = true
-- end
-- end
end end
end end
-- calcolo lavorazioni -- calcolo lavorazioni
@@ -893,17 +852,19 @@ 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 idSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false) local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
local ProcTrimesh = FeatureLib.GetProcFromTrimesh( idSurfToCut, Part) local ProcTrimesh = FeatureLib.GetProcFromTrimesh( nSurfToCut, 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
} }
@@ -916,12 +877,8 @@ 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( idSurfToCut) EgtErase( nSurfToCut)
bIsDicingOk = false bIsDicingOk = false
end end
end end
@@ -962,10 +919,9 @@ 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 bDisableRealElevationCheck = ( i % 2) > 0 -- se taglio perpendicolare non si deve mai considerare il materiale precedente
} }
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)
@@ -980,10 +936,6 @@ 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
@@ -1061,7 +1013,6 @@ 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,
-4
View File
@@ -209,7 +209,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
local dRadialStepSpan = OptionalParameters.dRadialStepSpan local dRadialStepSpan = OptionalParameters.dRadialStepSpan
local sUserNotes = OptionalParameters.sUserNotes or '' local sUserNotes = OptionalParameters.sUserNotes or ''
local bIsDicing = OptionalParameters.bIsDicing or false local bIsDicing = OptionalParameters.bIsDicing or false
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail' local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false
@@ -238,7 +237,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
end end
local BladeEngagementOptionalParameters = { local BladeEngagementOptionalParameters = {
bIsDicing = bIsDicing, bIsDicing = bIsDicing,
idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength, bCannotSplitRestLength = bCannotSplitRestLength,
bDisableRealElevationCheck = bDisableRealElevationCheck bDisableRealElevationCheck = bDisableRealElevationCheck
@@ -362,7 +360,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
} }
local BladeEngagementOptionalParameters = { local BladeEngagementOptionalParameters = {
bIsDicing = bIsDicing, bIsDicing = bIsDicing,
idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength, bCannotSplitRestLength = bCannotSplitRestLength,
bDisableRealElevationCheck = bDisableRealElevationCheck bDisableRealElevationCheck = bDisableRealElevationCheck
@@ -481,7 +478,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
} }
local BladeEngagementOptionalParameters = { local BladeEngagementOptionalParameters = {
bIsDicing = bIsDicing, bIsDicing = bIsDicing,
idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength, bCannotSplitRestLength = bCannotSplitRestLength,
bDisableRealElevationCheck = bDisableRealElevationCheck bDisableRealElevationCheck = bDisableRealElevationCheck
+3 -4
View File
@@ -44,9 +44,8 @@ local function CalculateLeadInOut( Machining, EdgeToMachine, sSideToMachine, dLe
end end
-- punti dell'attacco -- punti dell'attacco
local dLengthToAdd = EgtIf( Machining.bToolInvert, -Machining.dStartSafetyLength, EdgeToMachine.dElevation - ( Machining.dMaxElev or 0) + Machining.dStartSafetyLength) LeadIn.ptPoint = EdgeToMachine.ptStart - EdgeToMachine.vtEdge * LeadIn.dStartAddLength + EdgeToMachine.vtN * ( EdgeToMachine.dElevation - Machining.dDepthToMachine)
LeadIn.ptPoint = EdgeToMachine.ptStart - EdgeToMachine.vtEdge * LeadIn.dStartAddLength + EdgeToMachine.vtN * dLengthToAdd LeadOut.ptPoint = EdgeToMachine.ptEnd + EdgeToMachine.vtEdge * LeadOut.dEndAddLength + EdgeToMachine.vtN * ( EdgeToMachine.dElevation - Machining.dDepthToMachine)
LeadOut.ptPoint = EdgeToMachine.ptEnd + EdgeToMachine.vtEdge * LeadOut.dEndAddLength + EdgeToMachine.vtN * dLengthToAdd
return LeadIn, LeadOut return LeadIn, LeadOut
end end
@@ -174,7 +173,7 @@ function FACEBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional
-- offset radiale -- offset radiale
Mortising.dRadialOffset = 0 Mortising.dRadialOffset = 0
-- distanza di sicurezza -- distanza di sicurezza
Mortising.dStartSafetyLength = ( TOOLS[Mortising.nToolIndex].SetupInfo.dZSafeDelta or 0) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ) Mortising.dStartSafetyLength = max( EdgeToMachine.dElevation, ( TOOLS[Mortising.nToolIndex].SetupInfo.dZSafeDelta or 60) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ))
-- overlap -- overlap
Mortising.dOverlap = 0 Mortising.dOverlap = 0
-- step -- step
+2 -2
View File
@@ -1,4 +1,4 @@
==== Beam Update Log ==== ==== Beam Update Log ====
Versione 3.1e1 (29/05/2026) Versione 2.6-- (--/--/2024)
- Primo commit nuovo automatismo a strategie - Primo commit creazione nuovo automatismo BEAM con strategie
+2 -2
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di Beam -- Gestione della versione di Beam
NAME = 'Beam' NAME = 'Beam'
VERSION = '3.1e1' VERSION = '2.8a1'
MIN_EXE = '3.1e1' MIN_EXE = '2.7j2'