Compare commits

...

26 Commits

Author SHA1 Message Date
luca.mazzoleni ab6380c1c5 - in STR0011 e 13 aggiunto SCC
- in BeamExec il clamp del MaxReprocess è portato a 5
2026-06-15 12:23:10 +02:00
luca.mazzoleni 38f834c421 Merge branch 'develop' into ObliqueNesting 2026-06-15 10:21:19 +02:00
luca.mazzoleni b0827ad72d - in BALDEKEEPWASTE piccola correzione 2026-06-15 10:21:11 +02:00
luca.mazzoleni d2669b0af9 Merge branch 'develop' into ObliqueNesting 2026-06-12 18:18:53 +02:00
luca.mazzoleni cc9a2314eb - in FACEBYCHAINSAW corretti punti di attacco per verifica finecorsa; corretto calcolo safeZ
- in MachiningLib piccola correzione alla stima lunghezza percorso sega a catena
- in STR0003 si gestisce il cambio di orientamento sega a catena in caso di lavorazione fallita (es: finecorsa); se raggio lama non finito si abbassa la qualità (SEMI)
2026-06-12 18:18:44 +02:00
luca.mazzoleni 08856faba2 - in BeamExec.GetAvailableCombinations se FlipRot e Nesting2D si disattivano le combinazioni con rotazioni; i tagli di testa ottimizzati (inclinati) si usano solo se FlipRot e Nesing2D 2026-06-12 14:23:35 +02:00
luca.mazzoleni cc949b5dd1 Merge branch 'develop' into ObliqueNesting 2026-06-11 17:41:28 +02:00
luca.mazzoleni 2cee0831d0 Merge branch 'DicingPresimDynamicRaw' into develop 2026-06-11 17:40:53 +02:00
luca.mazzoleni 4ff1405c8e - ora i tagli di testa obliqui e le informazioni per nesting obliquo sono scritte solo se il parametro GEN_bGetAlternativesNesting2D è attivo 2026-06-11 17:22:16 +02:00
luca.mazzoleni b90ef91edb Merge branch 'DicingPreSimDynamicRaw' into ObliqueNesting 2026-06-11 14:48:13 +02:00
luca.mazzoleni b8d3cd461b Merge branch 'develop' into DicingPreSimDynamicRaw 2026-06-11 14:39:52 +02:00
luca.mazzoleni c506486585 - in BLADETOWASTE.UpdateDiceRaw correzione 2026-06-11 13:08:02 +02:00
luca.mazzoleni a73c0c85ac - in PreSimulationLib si usa il grezzo dinamico per i cubetti. Modificate funzioni correlate
- in BLADETOWASTE.UpdateDiceRaw alcune correzioni
2026-06-11 13:05:06 +02:00
luca.mazzoleni fb3a5ec0be - in Process e BatchProcessNew piccola correzione 2026-06-10 18:21:08 +02:00
luca.mazzoleni e3e7537f8f Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/databeamnew into develop 2026-06-10 18:15:24 +02:00
luca.mazzoleni eec6b50985 - in BLADETOWASTE.CalculateDiceMachinings si calcola il grezzo dinamico per la presimulazione. Da completare e gestire in presimulazione 2026-06-10 18:15:17 +02:00
andrea.villa b5cb706ad5 Aggiunto controllo su massima lunghezza pezzo processabile 2026-06-10 15:02:29 +02:00
andrea.villa 053755e583 Merge remote-tracking branch 'origin/main' into develop 2026-06-10 14:54:41 +02:00
luca.mazzoleni beedbc71f1 - in BLADETOWASTE.CalculateDiceMachinings grezzo dinamico per evitare collisioni in presimulazione, da completare 2026-06-10 09:20:37 +02:00
luca.mazzoleni 8da693817d - in BeamExec.GetFeatureInfoAndDependency correzione importante 2026-06-08 13:27:40 +02:00
luca.mazzoleni 19f35ccd61 - in BeamExec.ProcessBeams modifiche minori 2026-06-08 11:58:15 +02:00
luca.mazzoleni 0806e1bab8 Merge branch 'main' into ObliqueNesting 2026-06-08 11:17:04 +02:00
luca.mazzoleni 387eda8b4a - in BeamExec corretta ProcessBeams per i casi in cui dPosX non è definito 2026-06-08 11:16:50 +02:00
andrea.villa c7045499f4 Merge remote-tracking branch 'origin/develop' 2026-05-29 11:15:28 +02:00
andrea.villa 44478b91f0 Aggiornato log e versione 2026-05-29 11:15:09 +02:00
andrea.villa 1f4aa15af4 Aggiunto tipo fresa da cercare 2026-05-29 11:10:41 +02:00
16 changed files with 266 additions and 108 deletions
+18
View File
@@ -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
+61 -24
View File
@@ -341,6 +341,11 @@ 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
@@ -358,22 +363,31 @@ 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
@@ -436,36 +450,47 @@ 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( )
local dStartOffset = dNextStartOffset -- Se il pezzo corrente non ha coordinata, si calcola da OvmMid
local dEndOffset = dOvmMid 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
-- LOGICA LOOK-AHEAD: Analisi del gap reale per la ripartizione specchiata -- 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 dEndOffset = ( i == #PARTS ) and 0 or dOvmMid
-- Gap reale tra i pezzi (può essere negativo in caso di compenetrazione nesting obliqui)
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 -- Max 5.4mm sulla coda (lato sinistro del grezzo) dEndOffset = dOvmMid
dNextStartOffset = dTotalGap - dOvmMid -- Il residuo sulla testa del prossimo (lato destro) dNextStartOffset = dTotalGap - dOvmMid
else else
-- Gestione automatica sotto-soglia o compenetrazione geometrica (Nesting Obliquo) -- Gap minore dello spessore lama (compenetrazione per nesting obliqui)
dEndOffset = dTotalGap dEndOffset = dTotalGap
dNextStartOffset = 0 dNextStartOffset = 0
end end
end end
-- MATEMATICA CORRETTA PER X CAD INVERTITA: local dCurrentRawLen = dPartLen + dStartOffset + dEndOffset
-- 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 - 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 + dCrawLen <= dRawL + GEO.EPS_SMALL ) ) then if ( bIsSectionOk and ( dStartPos + dCurrentRawLen <= 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 ), dCrawLen, dRawW, dRawH, BeamData.RAWCOL ) CurrentPart.idRaw = EgtAddRawPart( Point3d( 0, 0, 0 ), dCurrentRawLen, 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 ) )
@@ -530,7 +555,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 + dCrawLen ) dMaxX = max( dMaxX, dStartPos + dCurrentRawLen )
CurrentPart.dRestLength = dRawL - dMaxX CurrentPart.dRestLength = dRawL - dMaxX
idPrevRaw = CurrentPart.idRaw idPrevRaw = CurrentPart.idRaw
else else
@@ -797,7 +822,7 @@ local function AreDrillingsMirrored( Proc, ProcMirror, Part)
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function GetFeatureInfoAndDependency( vProcSingleRot, Part) local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
-- gruppo per geometrie temporanee -- gruppo per geometrie temporanee
local idTempGroup = BeamLib.GetTempGroup() local idTempGroup = BeamLib.GetTempGroup()
@@ -809,12 +834,10 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
-- 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 Proc.Topology.sName == 'HeadCut' then if not HeadProcOriginal and Proc.Topology.sName == 'HeadCut' then
HeadProcOriginal = Proc HeadProcOriginal = Proc
HeadProcOriginal.bIsOriginalHeadcut = true elseif not TailProcOriginal and Proc.Topology.sName == 'TailCut' then
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
@@ -829,7 +852,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
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 bAreBothTruncatingCuts then if bIsFlipRot and Part.GeneralParameters.GEN_bGetAlternativesNesting2D and 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
@@ -849,7 +872,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
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
elseif Proc.b3Box:getMin():getX() >= ProcB.b3Box:getMin():getX() - 10 * GEO.EPS_SMALL then else
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)
@@ -884,7 +907,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
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
elseif Proc.b3Box:getMax():getX() >= ProcB.b3Box:getMax():getX() - 10 * GEO.EPS_SMALL then else
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)
@@ -911,6 +934,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
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
@@ -920,6 +944,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
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
@@ -941,12 +966,24 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
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'
@@ -968,7 +1005,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
local PtSortedTail = BeamLib.GetSortedVertices( TailProc) local PtSortedTail = BeamLib.GetSortedVertices( TailProc)
if PtSortedTail then if PtSortedTail then
TailcutInfo.OffsetX = {} TailcutInfo.OffsetX = {}
for i = 1, #PtSortedHead do for i = 1, #PtSortedTail 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
@@ -1416,7 +1453,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]) vProcRot[nIndex], HeadcutInfo, TailcutInfo = GetFeatureInfoAndDependency( vProcRot[nIndex], PARTS[nPart], bIsFlipRot)
else else
-- inserisco una tabella vuota -- inserisco una tabella vuota
table.insert( vProcRot, {}) table.insert( vProcRot, {})
@@ -1803,7 +1840,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, 3) local nMaxReProcessCycles = EgtClamp( PARTS[nPart].GeneralParameters.GEN_nMaxReProcessCycles, 1, 5)
-- 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( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters) local bCollisionFound, bMoveAfterSplit = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
if bCollisionFound then if bCollisionFound then
return false return false
end end
@@ -373,7 +373,7 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
CheckCollisionOptionalParameters.PointsToCheck = {} CheckCollisionOptionalParameters.PointsToCheck = {}
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadIn.ptPoint) table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadIn.ptPoint)
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadOut.ptPoint) table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadOut.ptPoint)
local bCollisionFoundPerpendicular, bMoveAfterSplitPerpendicular = PreSimulationLib.CheckCollision( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters) local bCollisionFoundPerpendicular, bMoveAfterSplitPerpendicular = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
-- attacco perpendicolare possibile -- attacco perpendicolare possibile
if not bCollisionFoundPerpendicular then if not bCollisionFoundPerpendicular then
LeadInOut.Perpendicular = PerpendicularLeadInOut LeadInOut.Perpendicular = PerpendicularLeadInOut
@@ -403,7 +403,7 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
CheckCollisionOptionalParameters.PointsToCheck = {} CheckCollisionOptionalParameters.PointsToCheck = {}
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadIn.ptPoint) table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadIn.ptPoint)
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadOut.ptPoint) table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadOut.ptPoint)
local bCollisionFoundTangent, bMoveAfterSplitTangent = PreSimulationLib.CheckCollision( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters) local bCollisionFoundTangent, bMoveAfterSplitTangent = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
-- attacco tangenziale possibile -- attacco tangenziale possibile
if not bCollisionFoundTangent then if not bCollisionFoundTangent then
LeadInOut.Tangent = TangentLeadInOut LeadInOut.Tangent = TangentLeadInOut
@@ -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 bIsDicing = ToolSearchParameters.bIsDicing or false local idCheckCollisionTm = ToolSearchParameters.idCheckCollisionTm
local sRestLengthSideForPreSimulation = ToolSearchParameters.sRestLengthSideForPreSimulation or 'Tail' local sRestLengthSideForPreSimulation = ToolSearchParameters.sRestLengthSideForPreSimulation or 'Tail'
local bCannotSplitRestLength = ToolSearchParameters.bCannotSplitRestLength or false local bCannotSplitRestLength = ToolSearchParameters.bCannotSplitRestLength or false
local bDisableRealElevationCheck = ToolSearchParameters.bDisableRealElevationCheck or false local bDisableRealElevationCheck = ToolSearchParameters.bDisableRealElevationCheck or false
@@ -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 = {
bIsDicing = bIsDicing, idCheckCollisionTm = idCheckCollisionTm,
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 60) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) / dToolStartFeed local dTimeToMachineLeadIn = ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 0) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) / dToolStartFeed
local dTimeToMachineLeadOut = ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 60) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) / dToolEndFeed local dTimeToMachineLeadOut = ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 0) + 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
+20 -34
View File
@@ -209,12 +209,6 @@ 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
@@ -305,7 +299,7 @@ local function MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, bCheckOnlyRestlength) local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm)
-- spostamento assi macchina in posizione -- spostamento assi macchina in posizione
local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux) local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
@@ -337,32 +331,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 bCheckOnlyRestlength then if not idCheckCollisionTm then
local idCheckCollisionTm = Part.idBoxTm idCheckCollisionTm = Part.idBoxTm
-- se testa o coda attaccate, si considerano nella superficie di collisione -- se testa o coda attaccate, si considerano nella superficie di collisione
if bCannotSplitRestLength then if bCannotSplitRestLength then
local b3CheckCollision = BeamLib.GetPartBoxWithHeadTail( Part, sRestLengthSideForPreSimulation) local b3CheckCollision = BeamLib.GetPartBoxWithHeadTail( Part, sRestLengthSideForPreSimulation)
idCheckCollisionTm = EgtSurfTmBBox( Part.idTempGroup, b3CheckCollision, false, GDB_RT.GLOB) idCheckCollisionTm = EgtSurfTmBBox( Part.idTempGroup, b3CheckCollision, false, GDB_RT.GLOB)
end end
for i = 1, #CollisionSurfTmId do end
bCollisionFoundPiece = EgtCDeSolidSolid( idCheckCollisionTm, CollisionSurfTmId[i], BeamData.COLL_SIC) for i = 1, #CollisionSurfTmId do
if not type( bCollisionFoundPiece) == "boolean" then bCollisionFoundPiece = EgtCDeSolidSolid( idCheckCollisionTm, CollisionSurfTmId[i], BeamData.COLL_SIC)
error( 'Presimulation fail') if not type( bCollisionFoundPiece) == "boolean" then
end error( 'Presimulation fail')
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
EgtSetColor( CollisionSurfTmId[i], RED())
end
if bCollisionFoundPiece then
break
end
end end
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
EgtSetColor( CollisionSurfTmId[i], RED())
end
if bCollisionFoundPiece then
break
end
end
-- se trovata collisione con pezzo è inutile procedere con il grezzo -- se trovata collisione con pezzo è inutile procedere con il grezzo
if bCollisionFoundPiece then if bCollisionFoundPiece then
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
@@ -401,7 +395,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
-- parametri opzionali -- parametri opzionali
OptionalParameters = OptionalParameters or {} OptionalParameters = OptionalParameters or {}
local bCheckOnlyRestlength = OptionalParameters.bCheckOnlyRestlength or false local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail' local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
local vtAux = OptionalParameters.vtAux local vtAux = OptionalParameters.vtAux
@@ -426,7 +420,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
-- se non si trova collisione si ritorna se è necessario separare prima di effettuare la lavorazione (ossia non c'è collisione con il pezzo ma c'è con il grezzo restante) -- se non si trova collisione si ritorna se è necessario separare prima di effettuare la lavorazione (ossia non c'è collisione con il pezzo ma c'è con il grezzo restante)
for i = 1, #PointsOnToolTipCenter do for i = 1, #PointsOnToolTipCenter do
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, bCheckOnlyRestlength) local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm)
-- se trovata collisione con pezzo è inutile controllare gli altri punti -- se trovata collisione con pezzo è inutile controllare gli altri punti
if bCollisionFoundPiece then if bCollisionFoundPiece then
@@ -445,7 +439,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
end end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
function PreSimulationLib.CheckCollision( sBladeEngagement, Parameters, OptionalParameters) function PreSimulationLib.CheckCollision( Parameters, OptionalParameters)
local bCollisionFound local bCollisionFound
local bMoveAfterSplitL3, bMoveAfterSplitR3, bMoveAfterSplitR2, bMoveAfterSplitR1 local bMoveAfterSplitL3, bMoveAfterSplitR3, bMoveAfterSplitR2, bMoveAfterSplitR1
@@ -459,24 +453,19 @@ function PreSimulationLib.CheckCollision( sBladeEngagement, Parameters, Optional
OptionalParameters = OptionalParameters or {} OptionalParameters = OptionalParameters or {}
local OptionalParametersCheckCollisionWithAxis = {} local OptionalParametersCheckCollisionWithAxis = {}
OptionalParametersCheckCollisionWithAxis.bCheckOnlyRestlength = false
OptionalParametersCheckCollisionWithAxis.PointsToCheck = OptionalParameters.PointsToCheck or nil OptionalParametersCheckCollisionWithAxis.PointsToCheck = OptionalParameters.PointsToCheck or nil
OptionalParametersCheckCollisionWithAxis.sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail' OptionalParametersCheckCollisionWithAxis.sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
OptionalParametersCheckCollisionWithAxis.bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false OptionalParametersCheckCollisionWithAxis.bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
OptionalParametersCheckCollisionWithAxis.sBlockedAxis = OptionalParameters.sBlockedAxis OptionalParametersCheckCollisionWithAxis.sBlockedAxis = OptionalParameters.sBlockedAxis
OptionalParametersCheckCollisionWithAxis.vtAux = OptionalParameters.vtAux OptionalParametersCheckCollisionWithAxis.vtAux = OptionalParameters.vtAux
OptionalParametersCheckCollisionWithAxis.idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
local sBlockedAxis = OptionalParameters.sBlockedAxis local sBlockedAxis = OptionalParameters.sBlockedAxis
local bIsDicing = OptionalParameters.bIsDicing or false
local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false
local bCheckOnlyRestlengthForAxisABC = false
-- se cubetti in modalità standard (no DownUp) gli assi AB e C si controllano solo con grezzo (ci sarebbe collisione con il materiale già rimosso controllando AB e C con pezzo)
if bIsDicing and ( sBladeEngagement == 'Standard') then
bCheckOnlyRestlengthForAxisABC = true
-- se l'elevazione reale (rispetto al pezzo + eventuale materiale in testa/coda) è maggiore del massimo materiale è sempre collisione -- se l'elevazione reale (rispetto al pezzo + eventuale materiale in testa/coda) è maggiore del massimo materiale è sempre collisione
-- TODO rifare con funzione -- TODO rifare con funzione
elseif not bDisableRealElevationCheck then if not bDisableRealElevationCheck then
local Edge = Parameters.Edge local Edge = Parameters.Edge
local vtNFace = Parameters.vtNFace local vtNFace = Parameters.vtNFace
local dDepthToMachine = Parameters.dDepthToMachine local dDepthToMachine = Parameters.dDepthToMachine
@@ -523,9 +512,6 @@ function PreSimulationLib.CheckCollision( sBladeEngagement, Parameters, Optional
-- ultimo asse lineare prima dei rotativi (solitamente Z) si controlla sempre -- ultimo asse lineare prima dei rotativi (solitamente Z) si controlla sempre
bCollisionFound, bMoveAfterSplitL3 = CheckCollisionWithAxis( sL3, Parameters, OptionalParametersCheckCollisionWithAxis) bCollisionFound, bMoveAfterSplitL3 = CheckCollisionWithAxis( sL3, Parameters, OptionalParametersCheckCollisionWithAxis)
-- assi rotativi: se richiesto si controlla la collisione solo col grezzo
OptionalParametersCheckCollisionWithAxis.bCheckOnlyRestlength = bCheckOnlyRestlengthForAxisABC
if sR3 and not bCollisionFound then if sR3 and not bCollisionFound then
bCollisionFound, bMoveAfterSplitR3 = CheckCollisionWithAxis( sR3, Parameters, OptionalParametersCheckCollisionWithAxis) bCollisionFound, bMoveAfterSplitR3 = CheckCollisionWithAxis( sR3, Parameters, OptionalParametersCheckCollisionWithAxis)
end end
+8
View File
@@ -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()
+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", "sDescriptionShort": "Enable material optimization function in nesting (part rotation disabled)",
"sDescriptionLong": "", "sDescriptionLong": "",
"sType": "b", "sType": "b",
"sMessageId": " ", "sMessageId": " ",
+1
View File
@@ -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)
+9 -2
View File
@@ -415,7 +415,8 @@ 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
@@ -698,7 +699,13 @@ 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
+23
View File
@@ -16,6 +16,27 @@ 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 = {}
@@ -39,6 +60,7 @@ 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
@@ -61,6 +83,7 @@ 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,6 +14,27 @@ 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 = {}
@@ -172,6 +193,7 @@ 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)
@@ -184,6 +206,7 @@ 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)
@@ -194,6 +217,7 @@ 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( 'BladeKeepWaste : angle between faces must be concave and >= 90deg') Result = FeatureLib.GetStrategyResultNotApplicable()
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( 'BladeKeepWaste : angle between faces must be concave and >= 90deg') Result = FeatureLib.GetStrategyResultNotApplicable()
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( 'BladeKeepWaste : angle between faces must be concave and >= 90deg') Result = FeatureLib.GetStrategyResultNotApplicable()
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( 'BladeKeepWaste : angle between faces must be concave and >= 90deg') Result = FeatureLib.GetStrategyResultNotApplicable()
return Machinings, Result return Machinings, Result
end end
end end
+78 -29
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 bIsDicing = OptionalParameters.bIsDicing local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength
-- TODO qui sarebbe meglio avere dExtra come OptionalParameter??? -- TODO qui sarebbe meglio avere dExtra come OptionalParameter???
@@ -289,7 +289,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
FaceToMachine = Face, FaceToMachine = Face,
EdgeToMachine = EdgeToMachineTop, EdgeToMachine = EdgeToMachineTop,
Part = Part, Part = Part,
bIsDicing = bIsDicing, idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
}) })
@@ -304,7 +304,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
FaceToMachine = Face, FaceToMachine = Face,
EdgeToMachine = EdgeToMachineBottom, EdgeToMachine = EdgeToMachineBottom,
Part = Part, Part = Part,
bIsDicing = bIsDicing, idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
}) })
@@ -371,7 +371,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
local bReduceBladePath = OptionalParameters.bReduceBladePath or false local bReduceBladePath = OptionalParameters.bReduceBladePath or false
local bAllowFastCuts = OptionalParameters.bAllowFastCuts or false local bAllowFastCuts = OptionalParameters.bAllowFastCuts or false
local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1] local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1]
local bIsDicing = OptionalParameters.bIsDicing or false local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail' local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
-- lati da lavorare in base al tipo di lama -- lati da lavorare in base al tipo di lama
@@ -390,7 +390,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
EdgeToMachineTop = EdgeToMachineList.Top, EdgeToMachineTop = EdgeToMachineList.Top,
EdgeToMachineBottom = EdgeToMachineList.Bottom, EdgeToMachineBottom = EdgeToMachineList.Bottom,
nToolIndex = nToolIndex, nToolIndex = nToolIndex,
bIsDicing = bIsDicing, idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
} }
@@ -442,7 +442,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine, FaceToMachine = FaceToMachine,
EdgeToMachine = EdgeToMachineList.TopGuillotine, EdgeToMachine = EdgeToMachineList.TopGuillotine,
Part = Part, Part = Part,
bIsDicing = bIsDicing, idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
}) })
@@ -475,7 +475,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
OptionalParameters = OptionalParameters or {} OptionalParameters = OptionalParameters or {}
local nToolIndex = OptionalParameters.nToolIndex local nToolIndex = OptionalParameters.nToolIndex
local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1] local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1]
local bIsDicing = OptionalParameters.bIsDicing or false local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail' local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
@@ -499,7 +499,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine, FaceToMachine = FaceToMachine,
EdgeToMachine = EdgeToMachine, EdgeToMachine = EdgeToMachine,
Part = Part, Part = Part,
bIsDicing = bIsDicing, idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
}) })
@@ -512,7 +512,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine, FaceToMachine = FaceToMachine,
EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN), EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN),
Part = Part, Part = Part,
bIsDicing = bIsDicing, idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
}) })
@@ -534,7 +534,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine, FaceToMachine = FaceToMachine,
EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN), EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN),
Part = Part, Part = Part,
bIsDicing = bIsDicing, idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
}) })
@@ -553,7 +553,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine, FaceToMachine = FaceToMachine,
EdgeToMachine = EdgeToMachine, EdgeToMachine = EdgeToMachine,
Part = Part, Part = Part,
bIsDicing = bIsDicing, idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
}) })
@@ -589,7 +589,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
FaceToMachine = FaceToMachine, FaceToMachine = FaceToMachine,
EdgeToMachine = EdgeToMachine, EdgeToMachine = EdgeToMachine,
Part = Part, Part = Part,
bIsDicing = bIsDicing, idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
}) })
@@ -607,7 +607,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
dDepthToMachine = dDepthToMachine dDepthToMachine = dDepthToMachine
} }
local BladeEngagementOptionalParameters = { local BladeEngagementOptionalParameters = {
bIsDicing = bIsDicing, idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
} }
@@ -782,6 +782,52 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
end end
local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part, MainFace, OtherFace)
-- frame solidale alla feature
local vtZ = MainFace.vtN
local vtX = OtherFace and OtherFace.vtN or nil
local frMainFace = Frame3d( MainFace.ptCenter, vtZ, vtX)
-- box del cubetto in riferimento feature
local b3Surf = EgtGetBBoxRef( idParallelTm, GDB_BB.STANDARD, frMainFace)
if idPerpendicularTm then
local b3SurfPerpendicular = EgtGetBBoxRef( idPerpendicularTm, GDB_BB.STANDARD, frMainFace)
b3Surf:Add( b3SurfPerpendicular)
else
-- se non arriva la superficie perpendicolare è un solo taglio parallelo: si estende il box in Z in modo da uscire dal pezzo
local ptDeltaZ = b3Surf:getMax() + vtZ * ( MainFace.dElevation + 5)
b3Surf:Add( ptDeltaZ)
end
-- estensione box per non avere problemi nella sottrazione booleana
if OtherFace and idPerpendicularTm then
local vtY = vtZ ^ vtX
local ptDeltaX = b3Surf:getMax() + vtX * 1
local ptDeltaZ = b3Surf:getMax() + vtZ * 1
local ptDeltaYplus = b3Surf:getMax() + vtY * 1
local ptDeltaYminus = b3Surf:getMin() - vtY * 1
b3Surf:Add( ptDeltaX)
b3Surf:Add( ptDeltaZ)
b3Surf:Add( ptDeltaYplus)
b3Surf:Add( ptDeltaYminus)
else
b3Surf:expand( 1)
end
-- si porta il box in riferimento globale
b3Surf:toGlob( frMainFace)
-- conversione box cubetto in superficie
local idSurfTmToSubtract = EgtSurfTmBBox( Part.idTempGroup, b3Surf, false, GDB_RT.GLOB)
-- sottrazione del cubetto dal grezzo
EgtSurfTmSubtract( idRaw, idSurfTmToSubtract)
return idRaw
end
local function CalculateDiceMachinings( vCuts, Parameters) local function CalculateDiceMachinings( vCuts, Parameters)
local Machinings = {} local Machinings = {}
local bMoveAfterSplit = false local bMoveAfterSplit = false
@@ -789,6 +835,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
local Proc = Parameters.Proc local Proc = Parameters.Proc
local Part = Parameters.Part local Part = Parameters.Part
local MainFace = Parameters.MainFace local MainFace = Parameters.MainFace
local OtherFace = next( Parameters.OtherFace) and Parameters.OtherFace or nil
local Tool = Parameters.Tool local Tool = Parameters.Tool
local sChosenBladeType = Parameters.sChosenBladeType local sChosenBladeType = Parameters.sChosenBladeType
local dExtendAfterTail = Parameters.dExtendAfterTail local dExtendAfterTail = Parameters.dExtendAfterTail
@@ -797,21 +844,15 @@ local function CalculateDiceMachinings( vCuts, Parameters)
local bCannotSplitRestLength = Parameters.bCannotSplitRestLength local bCannotSplitRestLength = Parameters.bCannotSplitRestLength
local bReduceDiceDepth = Parameters.bReduceDiceDepth local bReduceDiceDepth = Parameters.bReduceDiceDepth
-- trimesh con RestLength
local b3CheckCollision = BeamLib.GetPartBoxWithHeadTail( Part, sRestLengthSideForPreSimulation)
local idCheckCollisionTm = EgtSurfTmBBox( Part.idTempGroup, b3CheckCollision, false, GDB_RT.GLOB)
-- eventuale inversione tagli ortogonali e aggiunta informazioni alla geometria -- eventuale inversione tagli ortogonali e aggiunta informazioni alla geometria
local bAreOrthogonalCutsInverted = false local bAreOrthogonalCutsInverted = false
for i = 1, #vCuts do for i = 1, #vCuts do
for j = 1, #vCuts[i] do for j = 1, #vCuts[i] do
SetDiceFaceInfo( Proc, vCuts[i][j]) SetDiceFaceInfo( Proc, vCuts[i][j])
-- TODO vedere se questa parte serve ancora; in teoria no perchè il taglio è girato automaticamente nella FaceByBlade
-- if ( i % 2) == 1 then
-- local vtO = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
-- if MachiningLib.IsFaceZOutOfRange( vtO, Tool) then
-- EgtInvertSurf( vCuts[i][j])
-- local vtCurrentFaceNormal = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
-- EgtMove( vCuts[i][j], -vtCurrentFaceNormal * Tool.dThickness, GDB_RT.GLOB)
-- bAreOrthogonalCutsInverted = true
-- end
-- end
end end
end end
-- calcolo lavorazioni -- calcolo lavorazioni
@@ -852,19 +893,17 @@ local function CalculateDiceMachinings( vCuts, Parameters)
end end
-- calcolo lavorazione della singola faccia -- calcolo lavorazione della singola faccia
-- per tagli paralleli e faccia aperta si prova a tagliare come se fosse una faccia singola, accorpando i tagli -- per tagli paralleli e faccia aperta si prova a tagliare come se fosse una faccia singola, accorpando i tagli
-- TODO bIsDicing è da mettere a true?
local bCanMergeParallelCuts = ( ( i % 2) == 0) and ( Proc.nFct == 1) local bCanMergeParallelCuts = ( ( i % 2) == 0) and ( Proc.nFct == 1)
local bIsDicingOk = true local bIsDicingOk = true
if bCanMergeParallelCuts then if bCanMergeParallelCuts then
local nAddGrpId = BeamLib.GetAddGroup( Part.id) local nAddGrpId = BeamLib.GetAddGroup( Part.id)
local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false) local idSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
local ProcTrimesh = FeatureLib.GetProcFromTrimesh( nSurfToCut, Part) local ProcTrimesh = FeatureLib.GetProcFromTrimesh( idSurfToCut, Part)
local OptionalParametersCutWholeWaste = { local OptionalParametersCutWholeWaste = {
nToolIndex = Tool.nIndex, nToolIndex = Tool.nIndex,
dExtendAfterTail = dExtendAfterTail, dExtendAfterTail = dExtendAfterTail,
bReduceBladePath = bReduceBladePath, bReduceBladePath = bReduceBladePath,
bIsDicing = false,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength bCannotSplitRestLength = bCannotSplitRestLength
} }
@@ -877,8 +916,12 @@ local function CalculateDiceMachinings( vCuts, Parameters)
bMoveAfterSplit = true bMoveAfterSplit = true
end end
end end
-- aggiornamento grezzo dinamico
if i % 2 == 0 then
UpdateDiceRaw( idCheckCollisionTm, idSurfToCut, vCuts[i-1][#vCuts[i-1]], Part, MainFace, OtherFace)
end
else else
EgtErase( nSurfToCut) EgtErase( idSurfToCut)
bIsDicingOk = false bIsDicingOk = false
end end
end end
@@ -919,9 +962,10 @@ local function CalculateDiceMachinings( vCuts, Parameters)
dRadialStepSpan = 0, dRadialStepSpan = 0,
dExtendAfterTail = dExtendAfterTail, dExtendAfterTail = dExtendAfterTail,
bIsDicing = true, bIsDicing = true,
idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength, bCannotSplitRestLength = bCannotSplitRestLength,
bDisableRealElevationCheck = ( i % 2) > 0 -- se taglio perpendicolare non si deve mai considerare il materiale precedente bDisableRealElevationCheck = true
} }
Cutting = FaceByBlade.Make( ProcTrimesh, Part, FaceToMachine, EdgeToMachine, OptionalParametersFaceByBlade) Cutting = FaceByBlade.Make( ProcTrimesh, Part, FaceToMachine, EdgeToMachine, OptionalParametersFaceByBlade)
Cutting.ptCenter = Point3d( ProcTrimesh.Faces[1].ptCenter:getX(), 0, 0) Cutting.ptCenter = Point3d( ProcTrimesh.Faces[1].ptCenter:getX(), 0, 0)
@@ -936,6 +980,10 @@ local function CalculateDiceMachinings( vCuts, Parameters)
if Cutting.sStage == 'AfterTail' then if Cutting.sStage == 'AfterTail' then
bMoveAfterSplit = true bMoveAfterSplit = true
end end
-- aggiornamento grezzo dinamico
if i % 2 == 0 then
UpdateDiceRaw( idCheckCollisionTm, vCuts[i][j], vCuts[i-1][j], Part, MainFace, OtherFace)
end
end end
end end
end end
@@ -1013,6 +1061,7 @@ local function CutWithDicing( Proc, Part, OptionalParameters)
Proc = Proc, Proc = Proc,
Part = Part, Part = Part,
MainFace = Face1, MainFace = Face1,
OtherFace = Face2,
Tool = TOOLS[nToolIndex], Tool = TOOLS[nToolIndex],
sChosenBladeType = sChosenBladeType, sChosenBladeType = sChosenBladeType,
dExtendAfterTail = dExtendAfterTail, dExtendAfterTail = dExtendAfterTail,
+4
View File
@@ -209,6 +209,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
local dRadialStepSpan = OptionalParameters.dRadialStepSpan local dRadialStepSpan = OptionalParameters.dRadialStepSpan
local sUserNotes = OptionalParameters.sUserNotes or '' local sUserNotes = OptionalParameters.sUserNotes or ''
local bIsDicing = OptionalParameters.bIsDicing or false local bIsDicing = OptionalParameters.bIsDicing or false
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail' local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false
@@ -237,6 +238,7 @@ 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
@@ -360,6 +362,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
} }
local BladeEngagementOptionalParameters = { local BladeEngagementOptionalParameters = {
bIsDicing = bIsDicing, bIsDicing = bIsDicing,
idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength, bCannotSplitRestLength = bCannotSplitRestLength,
bDisableRealElevationCheck = bDisableRealElevationCheck bDisableRealElevationCheck = bDisableRealElevationCheck
@@ -478,6 +481,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
} }
local BladeEngagementOptionalParameters = { local BladeEngagementOptionalParameters = {
bIsDicing = bIsDicing, bIsDicing = bIsDicing,
idCheckCollisionTm = idCheckCollisionTm,
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation, sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
bCannotSplitRestLength = bCannotSplitRestLength, bCannotSplitRestLength = bCannotSplitRestLength,
bDisableRealElevationCheck = bDisableRealElevationCheck bDisableRealElevationCheck = bDisableRealElevationCheck
+4 -3
View File
@@ -44,8 +44,9 @@ local function CalculateLeadInOut( Machining, EdgeToMachine, sSideToMachine, dLe
end end
-- punti dell'attacco -- punti dell'attacco
LeadIn.ptPoint = EdgeToMachine.ptStart - EdgeToMachine.vtEdge * LeadIn.dStartAddLength + EdgeToMachine.vtN * ( EdgeToMachine.dElevation - Machining.dDepthToMachine) local dLengthToAdd = EgtIf( Machining.bToolInvert, -Machining.dStartSafetyLength, EdgeToMachine.dElevation - ( Machining.dMaxElev or 0) + Machining.dStartSafetyLength)
LeadOut.ptPoint = EdgeToMachine.ptEnd + EdgeToMachine.vtEdge * LeadOut.dEndAddLength + 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 * dLengthToAdd
return LeadIn, LeadOut return LeadIn, LeadOut
end end
@@ -173,7 +174,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 = max( EdgeToMachine.dElevation, ( TOOLS[Mortising.nToolIndex].SetupInfo.dZSafeDelta or 60) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) Mortising.dStartSafetyLength = ( TOOLS[Mortising.nToolIndex].SetupInfo.dZSafeDelta or 0) + 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 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
View File
@@ -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'