Compare commits

..

27 Commits

Author SHA1 Message Date
luca.mazzoleni 05fc22b1d4 Merge branch 'main' into develop 2026-07-30 17:28:02 +02:00
luca.mazzoleni a7b55ce018 Merge branch 'develop' 2026-07-30 16:10:20 +02:00
luca.mazzoleni 2f88f6843b update version 2026-07-30 16:09:33 +02:00
luca.mazzoleni 4eaa3e9e80 - in FACEBYBLADE tutti i tagli che guardano a sx e non sono slot vanno dopo separazione 2026-07-30 15:28:28 +02:00
luca.mazzoleni 73c81f6e05 - in BLADETOWASTE il taglio doppio verticale si prova solo se la feature è piccola 2026-07-29 15:03:21 +02:00
luca.mazzoleni 10ecdbd686 - se non trovata GetRestrictedLength da BeamData si usa LEN_VERY_SHORT_PART o valore fisso 2026-07-28 17:27:27 +02:00
luca.mazzoleni da37e7e45a - in STR0010 rimosso require inutile 2026-07-27 10:32:06 +02:00
andrea.villa 8969b8bc9f Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/databeamnew into develop 2026-07-24 14:51:36 +02:00
andrea.villa 237fa742fc - In calcolo tempo delle svuotature non si utilizza più la funzione EgtCurveCompoSetTempProp ma si setta direttaemnte la nota sul percorso
- In BLADETOWASTE la alvorazione di un lato "brutto" con lama ha comunque una finitura migliore che standard
2026-07-24 14:51:31 +02:00
luca.mazzoleni b6ccdd59ea Merge branch 'DiceRawFix' into develop 2026-07-24 14:37:15 +02:00
luca.mazzoleni b10844beed - in BLADETOWASTE corretta UpdateDiceRaw
- in FACEBYBLADE tutte le feature aperte sul retro e che occupano tutta la sezione diventano AfterTail
2026-07-24 14:37:03 +02:00
luca.mazzoleni 793aff4ffb - in BLADETOWASTE.UpdateDiceRaw corretto (rifatto) il calcolo del grezzo dinamico per cubetti
- in PreSimulationLib se trovata collisione i solidi interessati si copiano nel livello Mach (temporaneamente, sarà da mettere in gruppo apposito)
2026-07-23 18:02:48 +02:00
luca.mazzoleni 3d2d17e11f Merge branch 'develop' into DiceRawFix 2026-07-23 10:48:37 +02:00
luca.mazzoleni 16c9ac9771 Merge branch 'main' into develop 2026-07-23 10:48:13 +02:00
luca.mazzoleni 098c4e1fe3 Merge branch 'develop' 2026-07-23 09:19:54 +02:00
luca.mazzoleni 33ede89b64 update version 2026-07-23 09:19:42 +02:00
luca.mazzoleni b171ba5d0d - in STR0001 correzione in lettura parametro dOverMatOnLength 2026-07-23 09:13:37 +02:00
luca.mazzoleni ed658fffa6 - in BLADETOWASTE corretta UpdateDiceRaw per funzionare anche con tagli obliqui 2026-07-23 09:11:45 +02:00
andrea.villa 18789c30f2 In STR0011 (foratura), si setta AfterTail in caso sia aperto sulla faccia di coda 2026-07-22 17:52:05 +02:00
luca.mazzoleni 4e2afcd4bf Merge branch 'main' into develop 2026-07-22 10:39:14 +02:00
luca.mazzoleni 4e4e183382 Merge branch 'develop' 2026-07-22 10:38:41 +02:00
luca.mazzoleni d769b603bd update version 2026-07-22 10:38:31 +02:00
luca.mazzoleni 06ed12b1fe - in STR0015 gestito correttamente lato di lavoro per FreeContour; aggiunta vtHead 2026-07-22 10:37:56 +02:00
luca.mazzoleni 2e289e1921 - commenti 2026-07-21 17:50:03 +02:00
luca.mazzoleni c55395f829 Merge branch 'main' into develop 2026-07-20 18:04:04 +02:00
luca.mazzoleni 4ae8525573 Merge branch 'develop' 2026-07-20 18:03:31 +02:00
luca.mazzoleni 7b092ecb93 - update version 2026-07-20 18:03:25 +02:00
11 changed files with 188 additions and 190 deletions
+3 -1
View File
@@ -647,11 +647,13 @@ if bToProcess then
PARTS[i].NotClampableLength = { STD = { dHead = 0, dTail = 0}, SIDE = { dHead = 0, dTail = 0}, DOWN = { dHead = 0, dTail = 0}} PARTS[i].NotClampableLength = { STD = { dHead = 0, dTail = 0}, SIDE = { dHead = 0, dTail = 0}, DOWN = { dHead = 0, dTail = 0}}
PARTS[i].sBTLInfo = EgtGetInfo( PARTS[i].id, 'PROJ', 's') or nil PARTS[i].sBTLInfo = EgtGetInfo( PARTS[i].id, 'PROJ', 's') or nil
PARTS[i].idTempGroup = idTempGroup PARTS[i].idTempGroup = idTempGroup
PARTS[i].RestrictedLength = ( BeamData.GetRestrictedLength and BeamData.GetRestrictedLength( PARTS[i].dRawWidth, PARTS[i].dRawHeight, PARTS[i].dRawLength))
or BeamData.LEN_VERY_SHORT_PART
or 400
PARTS[i].sAISetupConfig = EgtGetInfo( PARTS[i].id, 'AISETUP', 's') or PARTS[i].sAISetupConfig = EgtGetInfo( PARTS[i].id, 'AISETUP', 's') or
( GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo] and GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo].sAISetupConfig) or -- i parametri BTL potrebbero non esistere ( GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo] and GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo].sAISetupConfig) or -- i parametri BTL potrebbero non esistere
GENERAL_PARAMETERS.PROJECT.sAISetupConfig or nil GENERAL_PARAMETERS.PROJECT.sAISetupConfig or nil
-- si carica configurazione lavorazioni -- si carica configurazione lavorazioni
TIMER:startElapsed('Json') TIMER:startElapsed('Json')
BeamExec.GetStrategiesFromJSONinBD( PARTS[i].sAISetupConfig) BeamExec.GetStrategiesFromJSONinBD( PARTS[i].sAISetupConfig)
+95 -118
View File
@@ -398,42 +398,42 @@ end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
-- *** Funzioni posizionamento pezzi all'interno della barra*** -- *** Funzioni posizionamento pezzi all'interno della barra***
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, bCreateMachGroup, bIsFlipRot ) function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, bCreateMachGroup, bIsFlipRot)
-- 1. Inizializzazione e Default -- 1. Inizializzazione e Default
local idTempGroup = BeamLib.GetTempGroup( ) local idTempGroup = BeamLib.GetTempGroup()
local dMinLengthToCreateRaw = 10 local dMinLengthToCreateRaw = 10
BeamData.OVM_BLADE_HBEAM = ( BeamData.OVM_BLADE_HBEAM or 11 ) BeamData.OVM_BLADE_HBEAM = ( BeamData.OVM_BLADE_HBEAM or 11)
BeamData.OVM_CHAIN_HBEAM = ( BeamData.OVM_CHAIN_HBEAM or 8 ) BeamData.OVM_CHAIN_HBEAM = ( BeamData.OVM_CHAIN_HBEAM or 8)
dOvmMid = ( dOvmMid or 5.4 ) dOvmMid = ( dOvmMid or 5.4)
dOvmHead = ( dOvmHead or 0 ) dOvmHead = ( dOvmHead or 0)
BeamExec.CalcMinUnloadableRaw( dRawW, dRawH ) BeamExec.CalcMinUnloadableRaw( dRawW, dRawH)
-- 2. Gestione Gruppo di Lavoro -- 2. Gestione Gruppo di Lavoro
if ( bCreateMachGroup == nil ) then bCreateMachGroup = true end if ( bCreateMachGroup == nil) then bCreateMachGroup = true end
if ( bCreateMachGroup ) then if ( bCreateMachGroup) then
local sMgName = EgtGetMachGroupNewName( 'Mach_1' ) local sMgName = EgtGetMachGroupNewName( 'Mach_1')
local idNewMg = EgtAddMachGroup( sMgName ) local idNewMg = EgtAddMachGroup( sMgName)
if ( not idNewMg ) then if ( not idNewMg) then
return false, 'Errore creazione gruppo di lavoro' return false, 'Errore creazione gruppo di lavoro'
end end
end end
-- 3. Configurazione Tavola Macchina -- 3. Configurazione Tavola Macchina
EgtSetTable( 'Tab' ) EgtSetTable( 'Tab')
local nMGrpId = EgtGetCurrMachGroup( ) local nMGrpId = EgtGetCurrMachGroup()
if ( not EgtGetInfo( nMGrpId, 'BARLEN', 'd' ) ) then if ( not EgtGetInfo( nMGrpId, 'BARLEN', 'd')) then
EgtSetInfo( nMGrpId, 'BARLEN', dRawL ) EgtSetInfo( nMGrpId, 'BARLEN', dRawL)
end end
local b3Tab = EgtGetTableArea( ) local b3Tab = EgtGetTableArea()
local dPosY = EgtIf( BeamData.CENTER_BEAM, ( b3Tab:getDimY( ) + dRawW * EgtIf( BeamData.RIGHT_LOAD, -1, 1 ) ) / 2, EgtIf( BeamData.RIGHT_LOAD, 0, b3Tab:getDimY( ) ) ) local dPosY = EgtIf( BeamData.CENTER_BEAM, ( b3Tab:getDimY() + dRawW * EgtIf( BeamData.RIGHT_LOAD, -1, 1)) / 2, EgtIf( BeamData.RIGHT_LOAD, 0, b3Tab:getDimY()))
BeamData.ptOriXR = Point3d( b3Tab:getDimX( ), dPosY, 0 ) BeamData.ptOriXR = Point3d( b3Tab:getDimX(), dPosY, 0)
BeamData.dPosXR = EgtIf( BeamData.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR ) BeamData.dPosXR = EgtIf( BeamData.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
EgtImportSetup( ) EgtImportSetup()
-- 4. Ciclo di Inserimento Pezzi -- 4. Ciclo di Inserimento Pezzi
local nCnt = 0 local nCnt = 0
@@ -443,20 +443,20 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
for i = 1, #PARTS do for i = 1, #PARTS do
local CurrentPart = PARTS[i] local CurrentPart = PARTS[i]
local b3BoxExact = EgtGetBBoxGlob( CurrentPart.id or GDB_ID.NULL, GDB_BB.EXACT ) local b3BoxExact = EgtGetBBoxGlob( CurrentPart.id or GDB_ID.NULL, GDB_BB.EXACT)
if ( b3BoxExact:isEmpty( ) or CurrentPart.b3PartOriginal:isEmpty( ) ) then break end if ( b3BoxExact:isEmpty() or CurrentPart.b3PartOriginal:isEmpty()) then break end
local dPartLen = CurrentPart.b3PartOriginal:getDimX( ) local dPartLen = CurrentPart.b3PartOriginal:getDimX()
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 -- Se il pezzo corrente non ha coordinata, si calcola da OvmMid
if ( not CurrentPart.dPosX) then if ( not CurrentPart.dPosX) then
if ( i == 1) then if ( i == 1) then
CurrentPart.dPosX = dOvmHead CurrentPart.dPosX = dOvmHead
else else
CurrentPart.dPosX = PARTS[i - 1].dPosX + PARTS[i - 1].b3PartOriginal:getDimX( ) + dOvmMid CurrentPart.dPosX = PARTS[i - 1].dPosX + PARTS[i - 1].b3PartOriginal:getDimX() + dOvmMid
end end
end end
@@ -469,8 +469,8 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
local dEndOffset = dOvmMid local dEndOffset = dOvmMid
-- se ultimo pezzo bisogna allungare il grezzo del restante solo se non viene creato un grezzo indipendente -- se ultimo pezzo bisogna allungare il grezzo del restante solo se non viene creato un grezzo indipendente
if ( i == #PARTS ) then if ( i == #PARTS) then
local dPotentialRemaining = max( 0, dRawL - ( CurrentPart.dPosX + dPartLen )) local dPotentialRemaining = max( 0, dRawL - ( CurrentPart.dPosX + dPartLen))
if ( dPotentialRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then if ( dPotentialRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then
dEndOffset = 0 -- Coda a zero, il resto diventerà un idRawRest indipendente dEndOffset = 0 -- Coda a zero, il resto diventerà un idRawRest indipendente
else else
@@ -479,9 +479,9 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
end end
-- Gap reale tra i pezzi (può essere negativo in caso di compenetrazione nesting obliqui) -- 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 dEndOffset = dOvmMid
dNextStartOffset = dTotalGap - dOvmMid dNextStartOffset = dTotalGap - dOvmMid
else else
@@ -495,102 +495,105 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
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 + dCurrentRawLen <= 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 ), dCurrentRawLen, 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))
-- 6. Configurazione Geometrie Pezzo -- 6. Configurazione Geometrie Pezzo
nCnt = nCnt + 1 nCnt = nCnt + 1
EgtSetInfo( CurrentPart.idRaw, 'ORD', nCnt ) EgtSetInfo( CurrentPart.idRaw, 'ORD', nCnt)
if ( not BeamLib.CreateOrEmptyAddGroup( CurrentPart.id ) ) then if ( not BeamLib.CreateOrEmptyAddGroup( CurrentPart.id)) then
return false, 'Error creating Additional Group in Part ' .. tostring( CurrentPart.id ) return false, 'Error creating Additional Group in Part ' .. tostring( CurrentPart.id)
end end
BeamLib.AddPartStartFace( CurrentPart.id, CurrentPart.b3PartOriginal ) BeamLib.AddPartStartFace( CurrentPart.id, CurrentPart.b3PartOriginal)
BeamLib.AddPartEndFace( CurrentPart.id, CurrentPart.b3PartOriginal ) BeamLib.AddPartEndFace( CurrentPart.id, CurrentPart.b3PartOriginal)
-- Inserimento con dDelta (lascia lo spazio vuoto a sinistra e spinge il pezzo a destra) -- Inserimento con dDelta (lascia lo spazio vuoto a sinistra e spinge il pezzo a destra)
EgtDeselectPartObjs( CurrentPart.id ) EgtDeselectPartObjs( CurrentPart.id)
local ptPos = b3BoxExact:getMin( ) - CurrentPart.b3PartOriginal:getMin( ) + Vector3d( dDelta, ( dRawW - dPartWidth ) / 2, ( dRawH - dPartHeight ) / 2 ) local ptPos = b3BoxExact:getMin() - CurrentPart.b3PartOriginal:getMin() + Vector3d( dDelta, ( dRawW - dPartWidth) / 2, ( dRawH - dPartHeight) / 2)
EgtAddPartToRawPart( CurrentPart.id, ptPos, CurrentPart.idRaw ) EgtAddPartToRawPart( CurrentPart.id, ptPos, CurrentPart.idRaw)
-- Rotazione sezione se necessaria -- Rotazione sezione se necessaria
if ( abs( dPartWidth - dRawW ) > 100 * GEO.EPS_SMALL ) then if ( abs( dPartWidth - dRawW) > 100 * GEO.EPS_SMALL) then
EgtRotatePartInRawPart( CurrentPart.id, X_AX( ), 90 ) EgtRotatePartInRawPart( CurrentPart.id, X_AX(), 90)
local vtEccOri = CurrentPart.b3PartOriginal:getCenter( ) - b3BoxExact:getCenter( ) local vtEccOri = CurrentPart.b3PartOriginal:getCenter() - b3BoxExact:getCenter()
local vtEccRot = Vector3d( vtEccOri ) local vtEccRot = Vector3d( vtEccOri)
vtEccRot:rotate( X_AX( ), 90 ) vtEccRot:rotate( X_AX(), 90)
EgtMovePartInRawPart( CurrentPart.id, ( vtEccOri - vtEccRot ) ) EgtMovePartInRawPart( CurrentPart.id, ( vtEccOri - vtEccRot))
end end
-- 7. Popolamento Metadati della Tabella CurrentPart -- 7. Popolamento Metadati della Tabella CurrentPart
CurrentPart.bIsLastPart = ( i == #PARTS ) CurrentPart.bIsLastPart = ( i == #PARTS)
CurrentPart.dDistanceToNextPiece = dEndOffset CurrentPart.dDistanceToNextPiece = dEndOffset
CurrentPart.b3Raw = EgtGetRawPartBBox( CurrentPart.idRaw ) CurrentPart.b3Raw = EgtGetRawPartBBox( CurrentPart.idRaw)
CurrentPart.dLength = CurrentPart.b3Raw:getDimX( ) CurrentPart.dLength = CurrentPart.b3Raw:getDimX()
CurrentPart.dWidth = CurrentPart.b3Raw:getDimY( ) CurrentPart.dWidth = CurrentPart.b3Raw:getDimY()
CurrentPart.dHeight = CurrentPart.b3Raw:getDimZ( ) CurrentPart.dHeight = CurrentPart.b3Raw:getDimZ()
CurrentPart.bSquareSection = abs( CurrentPart.dWidth - CurrentPart.dHeight ) < 100 * GEO.EPS_SMALL CurrentPart.bSquareSection = abs( CurrentPart.dWidth - CurrentPart.dHeight) < 100 * GEO.EPS_SMALL
CurrentPart.idBoxTm = EgtGetFirstInGroup( EgtGetFirstNameInGroup( CurrentPart.id, 'Box' ) or GDB_ID.NULL ) CurrentPart.idBoxTm = EgtGetFirstInGroup( EgtGetFirstNameInGroup( CurrentPart.id, 'Box') or GDB_ID.NULL)
CurrentPart.b3Part = EgtGetBBoxGlob( CurrentPart.idBoxTm, GDB_BB.STANDARD ) CurrentPart.b3Part = EgtGetBBoxGlob( CurrentPart.idBoxTm, GDB_BB.STANDARD)
CurrentPart.nIndexInParts = i CurrentPart.nIndexInParts = i
CurrentPart.SplittingPoints = BeamLib.GetPartSplittingPoints( CurrentPart ) CurrentPart.SplittingPoints = BeamLib.GetPartSplittingPoints( CurrentPart)
CurrentPart.NotClampableLength = { STD = { dHead = 0, dTail = 0 }, SIDE = { dHead = 0, dTail = 0 }, DOWN = { dHead = 0, dTail = 0 } } CurrentPart.NotClampableLength = { STD = { dHead = 0, dTail = 0 }, SIDE = { dHead = 0, dTail = 0 }, DOWN = { dHead = 0, dTail = 0 } }
CurrentPart.dHeadOverMaterial = dStartOffset CurrentPart.dHeadOverMaterial = dStartOffset
CurrentPart.sBTLInfo = EgtGetInfo( CurrentPart.id, 'PROJ', 's' ) or nil CurrentPart.sBTLInfo = EgtGetInfo( CurrentPart.id, 'PROJ', 's') or nil
CurrentPart.idTempGroup = idTempGroup CurrentPart.idTempGroup = idTempGroup
CurrentPart.RestrictedLength = ( BeamData.GetRestrictedLength and BeamData.GetRestrictedLength( dPartWidth, dPartHeight, dPartLen))
or BeamData.LEN_VERY_SHORT_PART
or 400
-- Notifiche al Post-Processor basate sulla nuova scomposizione -- Notifiche al Post-Processor basate sulla nuova scomposizione
if ( dStartOffset > 0.09 ) then EgtSetInfo( CurrentPart.idRaw, 'HOVM', dStartOffset ) end if ( dStartOffset > 0.09) then EgtSetInfo( CurrentPart.idRaw, 'HOVM', dStartOffset) end
if ( dEndOffset > 0.09 ) then EgtSetInfo( CurrentPart.idRaw, 'TOVM', dEndOffset ) end if ( dEndOffset > 0.09) then EgtSetInfo( CurrentPart.idRaw, 'TOVM', dEndOffset) end
if ( idPrevRaw ) then EgtSetInfo( idPrevRaw, 'BDST', dStartOffset ) end if ( idPrevRaw) then EgtSetInfo( idPrevRaw, 'BDST', dStartOffset) end
-- Caricamento Strategie JSON -- Caricamento Strategie JSON
CurrentPart.sAISetupConfig = EgtGetInfo( CurrentPart.id, 'AISETUP', 's' ) or CurrentPart.sAISetupConfig = EgtGetInfo( CurrentPart.id, 'AISETUP', 's') or
( GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo] and GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo].sAISetupConfig ) or ( GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo] and GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo].sAISetupConfig) or
GENERAL_PARAMETERS.PROJECT.sAISetupConfig or nil GENERAL_PARAMETERS.PROJECT.sAISetupConfig or nil
TIMER:startElapsed( 'Json' ) TIMER:startElapsed( 'Json')
BeamExec.GetStrategiesFromJSONinBD( CurrentPart.sAISetupConfig ) BeamExec.GetStrategiesFromJSONinBD( CurrentPart.sAISetupConfig)
CurrentPart.GeneralParameters = BeamLib.GetPieceGeneralParameters( CurrentPart, GENERAL_PARAMETERS_JSON ) CurrentPart.GeneralParameters = BeamLib.GetPieceGeneralParameters( CurrentPart, GENERAL_PARAMETERS_JSON)
TIMER:stopElapsed( 'Json' ) TIMER:stopElapsed( 'Json')
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 + dCurrentRawLen)
CurrentPart.dRestLength = dRawL - dMaxX CurrentPart.dRestLength = dRawL - dMaxX
idPrevRaw = CurrentPart.idRaw idPrevRaw = CurrentPart.idRaw
else else
local sOut = 'Error: part L(' .. EgtNumToString( dPartLen, 1 ) .. ') too big for remaining bar space' local sOut = 'Error: part L(' .. EgtNumToString( dPartLen, 1) .. ') too big for remaining bar space'
return false, sOut return false, sOut
end end
end end
-- 8. Chiusura Barra e Gestione Avanzo (Rest Material) -- 8. Chiusura Barra e Gestione Avanzo (Rest Material)
if ( idPrevRaw ) then EgtSetInfo( idPrevRaw, 'BDST', 10000 ) end if ( idPrevRaw) then EgtSetInfo( idPrevRaw, 'BDST', 10000) end
local dRemaining = dRawL - dMaxX local dRemaining = dRawL - dMaxX
if ( dRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then if ( dRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then
local idRawRest = EgtAddRawPart( Point3d( 0, 0, 0 ), dRemaining, dRawW, dRawH, BeamData.RAWCOL ) local idRawRest = EgtAddRawPart( Point3d( 0, 0, 0), dRemaining, dRawW, dRawH, BeamData.RAWCOL)
EgtMoveToCornerRawPart( idRawRest, BeamData.ptOriXR, BeamData.dPosXR ) EgtMoveToCornerRawPart( idRawRest, BeamData.ptOriXR, BeamData.dPosXR)
EgtMoveRawPart( idRawRest, Vector3d( -dMaxX, 0, 0 ) ) EgtMoveRawPart( idRawRest, Vector3d( -dMaxX, 0, 0))
nCnt = nCnt + 1 nCnt = nCnt + 1
EgtSetInfo( idRawRest, 'ORD', nCnt ) EgtSetInfo( idRawRest, 'ORD', nCnt)
if ( EgtGetRawPartBBox( idRawRest ):getDimX( ) < BeamData.dMinRaw ) then if ( EgtGetRawPartBBox( idRawRest):getDimX() < BeamData.dMinRaw) then
PARTS[#PARTS].dDistanceToNextPiece = 10000 PARTS[#PARTS].dDistanceToNextPiece = 10000
end end
else else
if ( #PARTS > 0 ) then PARTS[#PARTS].dDistanceToNextPiece = 10000 end if ( #PARTS > 0) then PARTS[#PARTS].dDistanceToNextPiece = 10000 end
end end
return true return true
@@ -776,11 +779,11 @@ local function AreDrillingsMirrored( Proc, ProcMirror, Part)
-- geometria ausiliaria foro principale -- geometria ausiliaria foro principale
AuxId = EgtGetInfo( Proc.id, 'AUXID', 'i') AuxId = EgtGetInfo( Proc.id, 'AUXID', 'i')
if AuxId then AuxId = AuxId + Proc.id end if AuxId then AuxId = AuxId + Proc.id end
if not AuxId or EgtGetType( AuxId ) ~= GDB_TY.CRV_ARC then return false end if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then return false end
-- geometria ausiliaria foro specchiato -- geometria ausiliaria foro specchiato
local AuxIdMirror = EgtGetInfo( ProcMirror.id, 'AUXID', 'i') local AuxIdMirror = EgtGetInfo( ProcMirror.id, 'AUXID', 'i')
if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.id end if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.id end
if not AuxIdMirror or EgtGetType( AuxIdMirror ) ~= GDB_TY.CRV_ARC then return false end if not AuxIdMirror or EgtGetType( AuxIdMirror) ~= GDB_TY.CRV_ARC then return false end
-- dati del foro principale -- dati del foro principale
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptBC = EgtGP( AuxId, GDB_RT.GLOB) local ptBC = EgtGP( AuxId, GDB_RT.GLOB)
@@ -2653,43 +2656,17 @@ function BeamExec.ProcessAlternatives( PARTS)
end end
-- passaggio info a interfaccia da scrivere sul pezzo -- passaggio info a interfaccia da scrivere sul pezzo
local function IsStateInAlternativesNest2D( sState)
for _, v in ipairs( AlternativesNest2D) do
if v == sState then
return true
end
end
return false
end
BEAM.INFONGEPART = {} BEAM.INFONGEPART = {}
local States = { for i = 1, #AlternativesNest2D do
"1000", if PARTS[nPart].HeadcutInfo then
"0100", local sOffsetX = table.concat( PARTS[nPart].HeadcutInfo[AlternativesNest2D[i]].OffsetX, ',')
"0010", local sVtN = ( tostring( PARTS[nPart].HeadcutInfo[AlternativesNest2D[i]].vtN)):gsub("^%(", ""):gsub("%)$", "")
"0001", table.insert( BEAM.INFONGEPART, 'ALT' .. AlternativesNest2D[i].. '_H' .. '=' .. sOffsetX .. ';' .. sVtN)
"1000_INV", end
"0100_INV", if PARTS[nPart].TailcutInfo then
"0010_INV", local sOffsetX = table.concat( PARTS[nPart].TailcutInfo[AlternativesNest2D[i]].OffsetX, ',')
"0001_INV", local sVtN = ( tostring( PARTS[nPart].TailcutInfo[AlternativesNest2D[i]].vtN)):gsub("^%(", ""):gsub("%)$", "")
} table.insert( BEAM.INFONGEPART, 'ALT' .. AlternativesNest2D[i] .. '_T' .. '=' .. sOffsetX .. ';' .. sVtN)
for i = 1, #States do
local sState = States[i]
if IsStateInAlternativesNest2D( sState) then
if PARTS[nPart].HeadcutInfo then
local HeadcutInfo = PARTS[nPart].HeadcutInfo[sState]
local sOffsetX = table.concat( HeadcutInfo.OffsetX, ',')
local sVtN = ( tostring( HeadcutInfo.vtN)):gsub("^%(", ""):gsub("%)$", "")
table.insert( BEAM.INFONGEPART, 'ALT' .. sState.. '_H' .. '=' .. sOffsetX .. ';' .. sVtN )
end
if PARTS[nPart].TailcutInfo then
local TailCutInfo = PARTS[nPart].TailcutInfo[sState]
local sOffsetX = table.concat( TailCutInfo.OffsetX, ',')
local sVtN = ( tostring( TailCutInfo.vtN)):gsub("^%(", ""):gsub("%)$", "")
table.insert( BEAM.INFONGEPART, 'ALT' .. sState .. '_T' .. '=' .. sOffsetX .. ';' .. sVtN)
end
else
table.insert( BEAM.INFONGEPART, 'ALT' .. sState.. '_H' .. '= ')
table.insert( BEAM.INFONGEPART, 'ALT' .. sState.. '_T' .. '= ')
end end
end end
+6 -6
View File
@@ -1662,12 +1662,16 @@ function MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part)
local idTempGroup = Part.idTempGroup local idTempGroup = Part.idTempGroup
-- TODO in futuro creare flatregion (se ci fossero isole il calcolo del percorso non sarebbe corretto) -- TODO in futuro creare flatregion (se ci fossero isole il calcolo del percorso non sarebbe corretto)
local idFaceContour = EgtExtractSurfTmFacetLoops( ProcTm.id, Machining.Geometry[1][2], idTempGroup) local idFaceContour = EgtExtractSurfTmFacetLoops( ProcTm.id, Machining.Geometry[1][2], idTempGroup)
-- si settano i lati aperti della curva derivata dalla superficie -- si settano i lati aperti della curva derivata dalla superficie
local sOpenEdges = ''
for i = 1, #ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges do for i = 1, #ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges do
if ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].bIsOpen then if ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].bIsOpen then
EgtCurveCompoSetTempProp( idFaceContour, ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].id, 1) sOpenEdges = sOpenEdges .. EgtNumToString( ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].id) .. ','
end end
end end
EgtSetInfo( idFaceContour, 'OPEN', sOpenEdges)
-- dal momento che la funzione EgtPocketing non considera il grezzo, nei casi ottimizzati si deve correggere l'offset -- dal momento che la funzione EgtPocketing non considera il grezzo, nei casi ottimizzati si deve correggere l'offset
local idTestCurve = EgtCopyGlob( idFaceContour, idTempGroup ) local idTestCurve = EgtCopyGlob( idFaceContour, idTempGroup )
local bIsOptimizedPocketing = ( TOOLS[Machining.nToolIndex].dDiameter > TOOLS[Machining.nToolIndex].dSideStep - 10 * GEO.EPS_SMALL) local bIsOptimizedPocketing = ( TOOLS[Machining.nToolIndex].dDiameter > TOOLS[Machining.nToolIndex].dSideStep - 10 * GEO.EPS_SMALL)
@@ -1678,11 +1682,7 @@ function MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part)
dOffset = TOOLS[Machining.nToolIndex].dDiameter - TOOLS[Machining.nToolIndex].dSideStep dOffset = TOOLS[Machining.nToolIndex].dDiameter - TOOLS[Machining.nToolIndex].dSideStep
end end
EgtOffsetCurve( idFaceContour, dOffset) EgtOffsetCurve( idFaceContour, dOffset)
-- si settano tutti i lati chiusi per la curva offsettata EgtRemoveInfo( idFaceContour, 'OPEN')
local _, nFaceCountourCurveCount = EgtCurveDomain( idFaceContour)
for i = 1, nFaceCountourCurveCount do
EgtCurveCompoSetTempProp( idFaceContour, i - 1, 0)
end
end end
-- calcolo percorso di svuotatura replicando il calcolo che fa la svuotatura -- calcolo percorso di svuotatura replicando il calcolo che fa la svuotatura
local idPocketingPath = EgtPocketing( idFaceContour, TOOLS[Machining.nToolIndex].dDiameter / 2, TOOLS[Machining.nToolIndex].dSideStep, 0, Machining.nSubType, true, idTempGroup) local idPocketingPath = EgtPocketing( idFaceContour, TOOLS[Machining.nToolIndex].dDiameter / 2, TOOLS[Machining.nToolIndex].dSideStep, 0, Machining.nSubType, true, idTempGroup)
+15 -6
View File
@@ -301,6 +301,8 @@ end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm) local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm)
local idAddGroup = BeamLib.GetAddGroup( Part.id)
-- spostamento assi macchina in posizione -- spostamento assi macchina in posizione
local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux) local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
@@ -350,17 +352,23 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
end end
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
EgtSetColor( CollisionSurfTmId[i], RED()) EgtSetColor( CollisionSurfTmId[i], RED())
local idBeamCopy = EgtCopyGlob( idCheckCollisionTm, idAddGroup)
EgtSetName( idBeamCopy, 'COLL_BEAM')
local idHeadCopy = EgtCopyGlob( CollisionSurfTmId[i], idAddGroup)
EgtSetName( idHeadCopy, 'COLL_' .. sAxis)
EgtVector( idAddGroup, vtHead, ptOnToolTipCenter, GDB_RT.GLOB)
EgtSetStatus( { idBeamCopy, idHeadCopy}, GDB_ST.OFF)
end end
if bCollisionFoundPiece then if bCollisionFoundPiece then
break break
end end
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
-- 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
@@ -430,8 +438,8 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
if bCheckFlange and Tool.sType == 'SAW_FLAT' then if bCheckFlange and Tool.sType == 'SAW_FLAT' then
local ptCenterFlange = PointsOnToolTipCenter[i] + vtHead * Tool.dThickness local ptCenterFlange = PointsOnToolTipCenter[i] + vtHead * Tool.dThickness
local frHead = Frame3d( ptCenterFlange, vtHead) local frHead = Frame3d( ptCenterFlange, vtHead)
local dExtraSafety = 2 -- valore empirico che serve nei casi molto inclinati, ci potrebbero essere casi in cui va aumentato local dFlangeRadius = Tool.ToolHolder.dDiameter / 2
local idFlangeCurve = EgtCircle( Part.idTempGroup, ORIG(), dExtraSafety + Tool.dDiameter / 2 - Tool.dMaxDepth, GDB_RT.GLOB) local idFlangeCurve = EgtCircle( Part.idTempGroup, ORIG(), dFlangeRadius, GDB_RT.GLOB)
EgtTransform( idFlangeCurve, frHead, GDB_RT.GLOB) EgtTransform( idFlangeCurve, frHead, GDB_RT.GLOB)
-- TODO verificare se questo controllo serve -- TODO verificare se questo controllo serve
@@ -443,6 +451,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
idAddedCollisionSurfTm = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idFlangeCurve, vtExtrusion, 0.05, GDB_RT.GLOB) idAddedCollisionSurfTm = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idFlangeCurve, vtExtrusion, 0.05, GDB_RT.GLOB)
end end
-- TODO raggruppare parametri opzionali!
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm) local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm, idAddedCollisionSurfTm)
-- se trovata collisione con pezzo è inutile controllare gli altri punti -- se trovata collisione con pezzo è inutile controllare gli altri punti
+1 -1
View File
@@ -326,7 +326,7 @@ function STR0001.Make( bAddMachining, Proc, Part, CustomParameters)
-- controllo conformità offset tenone -- controllo conformità offset tenone
Strategy.Parameters.dOverMatOnRadius = EgtClamp( Strategy.Parameters.dOverMatOnRadius, -5, 5) Strategy.Parameters.dOverMatOnRadius = EgtClamp( Strategy.Parameters.dOverMatOnRadius, -5, 5)
Strategy.Parameters.dOverMatOnLength = EgtClamp( Strategy.Parameters.dOverMatOnRadius, -5, 5) Strategy.Parameters.dOverMatOnLength = EgtClamp( Strategy.Parameters.dOverMatOnLength, -5, 5)
-- calcolo se la lavorazione del tenone può essere spostata dopo taglio di coda -- calcolo se la lavorazione del tenone può essere spostata dopo taglio di coda
local dLengthOnX = Proc.b3Box:getDimX() local dLengthOnX = Proc.b3Box:getDimX()
-1
View File
@@ -10,7 +10,6 @@ local MachiningLib = require( 'MachiningLib')
local FeatureLib = require( 'FeatureLib') local FeatureLib = require( 'FeatureLib')
-- strategie di base -- strategie di base
local FaceByMill = require( 'FACEBYMILL') local FaceByMill = require( 'FACEBYMILL')
local FaceByBlade = require( 'FACEBYBLADE')
local AntiSplintOnFace = require( 'ANTISPLINTONFACE') local AntiSplintOnFace = require( 'ANTISPLINTONFACE')
-- Tabella per definizione modulo -- Tabella per definizione modulo
+3
View File
@@ -216,6 +216,9 @@ function STR0011.Make( bAddMachining, Proc, Part, CustomParameters)
if bAddMachining and Strategy.Result.sStatus ~= 'Not-Applicable' then if bAddMachining and Strategy.Result.sStatus ~= 'Not-Applicable' then
-- aggiunge lavorazione -- aggiunge lavorazione
for j = 1, #Strategy.Machinings do for j = 1, #Strategy.Machinings do
if Proc.AffectedFaces.bLeft and not Proc.FeatureInfo.bIsDrillOpen then
Strategy.Machinings[j].sStage = 'AfterTail'
end
Strategy.Machinings[j].nType = MCH_MY.DRILLING Strategy.Machinings[j].nType = MCH_MY.DRILLING
Strategy.Machinings[j].Steps.dStep = TOOLS[Strategy.Machinings[j].ToolInfo.nToolIndex].dStep Strategy.Machinings[j].Steps.dStep = TOOLS[Strategy.Machinings[j].ToolInfo.nToolIndex].dStep
bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.Machinings[j]) bAreAllMachiningsAdded = MachiningLib.AddMachinings( Proc, Strategy.Machinings[j])
+23 -9
View File
@@ -858,24 +858,38 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters)
CurrentMachining.LeadInForSplit.nType = MCH_MILL_LI.LINEAR CurrentMachining.LeadInForSplit.nType = MCH_MILL_LI.LINEAR
CurrentMachining.LeadOutForSplit.nType = MCH_MILL_LI.LINEAR CurrentMachining.LeadOutForSplit.nType = MCH_MILL_LI.LINEAR
CurrentMachining.LeadInForSplit.dTangentDistance = 0 CurrentMachining.LeadInForSplit.dTangentDistance = 0
CurrentMachining.LeadInForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
CurrentMachining.LeadOutForSplit.dTangentDistance = 0 CurrentMachining.LeadOutForSplit.dTangentDistance = 0
CurrentMachining.LeadOutForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC if not ID.IsFreeContour( Proc) then
CurrentMachining.LeadInForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
CurrentMachining.LeadOutForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
end
-- sistemo il lato e la direzione di lavoro -- sistemo il lato e la direzione di lavoro; se FreeContour il lato è determinato dalla Feature, altrimenti dalla concordanza
if CurrentMachining.bOtherDirection then if ID.IsFreeContour( Proc) then
CurrentMachining.bToolInvert = true CurrentMachining.bInvert = false
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, true, false) if Proc.nGrp == 0 then
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT) CurrentMachining.nWorkside = MCH_MILL_WS.CENTER
elseif Proc.nGrp == 3 then
CurrentMachining.nWorkside = MCH_MILL_WS.LEFT
elseif Proc.nGrp == 4 then
CurrentMachining.nWorkside = MCH_MILL_WS.RIGHT
end
else else
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, false, true) if CurrentMachining.bOtherDirection then
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT) CurrentMachining.bToolInvert = true
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, true, false)
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
else
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, false, true)
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
end
end end
CurrentMachining.ptEdge1 = EgtSP( Proc.idAddAuxGeom, GDB_ID.ROOT) CurrentMachining.ptEdge1 = EgtSP( Proc.idAddAuxGeom, GDB_ID.ROOT)
CurrentMachining.ptEdge2 = EgtEP( Proc.idAddAuxGeom, GDB_ID.ROOT) CurrentMachining.ptEdge2 = EgtEP( Proc.idAddAuxGeom, GDB_ID.ROOT)
CurrentMachining.dEdgeLength = EgtCurveLength( Proc.idAddAuxGeom) CurrentMachining.dEdgeLength = EgtCurveLength( Proc.idAddAuxGeom)
CurrentMachining.vtEdgeDirection = EgtSV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtMV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtEV( Proc.idAddAuxGeom, GDB_ID.ROOT) CurrentMachining.vtEdgeDirection = EgtSV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtMV( Proc.idAddAuxGeom, GDB_ID.ROOT) + EgtEV( Proc.idAddAuxGeom, GDB_ID.ROOT)
CurrentMachining.dLengthOnX = Proc.b3Box:getDimX() CurrentMachining.dLengthOnX = Proc.b3Box:getDimX()
CurrentMachining.vtHead = CurrentMachining.vtToolDirection
local MachiningToSplit = {} local MachiningToSplit = {}
table.insert( MachiningToSplit, CurrentMachining) table.insert( MachiningToSplit, CurrentMachining)
+31 -40
View File
@@ -358,8 +358,8 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
end end
local function SetDiceFaceInfo( Proc, idDiceFace) local function SetDiceFaceInfo( Proc, idDiceFace, sType)
EgtSetName( idDiceFace, 'Face' .. tostring( Proc.idFeature or 'Add') .. '_Dice') EgtSetName( idDiceFace, 'Face' .. tostring( Proc.idFeature or 'Add') .. '_Dice_' .. sType)
end end
@@ -577,6 +577,11 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
end end
end end
-- se la feature non è piccola il taglio doppio verticale non si può fare
if not FeatureInfo.bIsFeatureSmall then
return CuttingParametersList, EdgeToMachine
end
-- arrivati qui si prova il taglio doppio verticale (taglio doppio orizzontale non si può fare oppure non ci arriva) -- arrivati qui si prova il taglio doppio verticale (taglio doppio orizzontale non si può fare oppure non ci arriva)
EdgeToMachine = GetEdgeToMachine( FaceToMachine.Edges, 'Vertical') EdgeToMachine = GetEdgeToMachine( FaceToMachine.Edges, 'Vertical')
local dDepthToMachine = EdgeToMachine.dElevation / 2 + BeamData.CUT_EXTRA_MIN local dDepthToMachine = EdgeToMachine.dElevation / 2 + BeamData.CUT_EXTRA_MIN
@@ -770,7 +775,7 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
Result.dQuality = FeatureLib.GetStrategyQuality( Machinings) Result.dQuality = FeatureLib.GetStrategyQuality( Machinings)
-- per tagli con lati brutti o ghigliottina si abbassa la qualità -- per tagli con lati brutti o ghigliottina si abbassa la qualità
if ( sChosenBladeType ~= 'Top') and ( sChosenBladeType ~= 'Bottom') then if ( sChosenBladeType ~= 'Top') and ( sChosenBladeType ~= 'Bottom') then
Result.dQuality = FeatureLib.GetStrategyQuality( 'STD') Result.dQuality = FeatureLib.GetStrategyQuality( 'FINE')
end end
Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Machinings) Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Machinings)
Result.dMRR = ( FeatureInfo.dFeatureVolume / Result.dTimeToMachine) / pow( 10, 6) Result.dMRR = ( FeatureInfo.dFeatureVolume / Result.dTimeToMachine) / pow( 10, 6)
@@ -782,45 +787,30 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
end end
local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part, MainFace, OtherFace) local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part)
-- frame solidale alla feature -- contorno della faccia parallela
local vtZ = MainFace.vtN local vtNParallelFaceTm = EgtSurfTmFacetNormVersor( idParallelTm, 0, GDB_ID.ROOT)
local vtX = OtherFace and OtherFace.vtN or nil local idParallelFaceCurveCompo = EgtExtractSurfTmLoops( idParallelTm, Part.idTempGroup)
local frMainFace = Frame3d( MainFace.ptCenter, vtZ, vtX) EgtModifyCurveExtrusion( idParallelFaceCurveCompo, vtNParallelFaceTm, GDB_RT.GLOB)
EgtOffsetCurve( idParallelFaceCurveCompo, 100, GDB_OT.EXTEND)
-- box del cubetto in riferimento feature -- trimesh da sottrarre, tagliata con il piano perpendicolare
local b3Surf = EgtGetBBoxRef( idParallelTm, GDB_BB.STANDARD, frMainFace) local vtExtrusion = 1000 * vtNParallelFaceTm
local idSurfTmToSubtract = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idParallelFaceCurveCompo, vtExtrusion, 0.05, GDB_RT.GLOB)
if idPerpendicularTm then if idPerpendicularTm then
local b3SurfPerpendicular = EgtGetBBoxRef( idPerpendicularTm, GDB_BB.STANDARD, frMainFace) local ptCenterPerpendicularTm, vtNPerpendicularTm = EgtSurfTmFacetCenter( idPerpendicularTm, 0, GDB_ID.ROOT)
b3Surf:Add( b3SurfPerpendicular) EgtCutSurfTmPlane( idSurfTmToSubtract, ptCenterPerpendicularTm, -vtNPerpendicularTm, false, GDB_RT.GLOB)
else -- dove la trimesh è stata tagliata mancherà la faccia: si riaggiunge
-- se non arriva la superficie perpendicolare è un solo taglio parallelo: si estende il box in Z in modo da uscire dal pezzo local idRemovedFaceCurveCompo = EgtExtractSurfTmLoops( idSurfTmToSubtract, Part.idTempGroup)
local ptDeltaZ = b3Surf:getMax() + vtZ * ( MainFace.dElevation + 5) local idRemovedFaceTm = EgtSurfTmByFlatContour( Part.idTempGroup, idRemovedFaceCurveCompo)
b3Surf:Add( ptDeltaZ) local vtNRemovedFace = EgtSurfTmFacetNormVersor( idRemovedFaceTm, 0, GDB_ID.ROOT)
if AreSameVectorApprox( vtNPerpendicularTm, vtNRemovedFace) then
EgtInvertSurf( idRemovedFaceTm)
end
idSurfTmToSubtract = EgtSurfTmBySewing( Part.idTempGroup, { idSurfTmToSubtract, idRemovedFaceTm})
end 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 -- sottrazione del cubetto dal grezzo
EgtSurfTmSubtract( idRaw, idSurfTmToSubtract) EgtSurfTmSubtract( idRaw, idSurfTmToSubtract)
@@ -856,7 +846,8 @@ local function CalculateDiceMachinings( vCuts, Parameters)
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]) local sType = ( i % 2 == 0) and 'Paral' or 'Perp'
SetDiceFaceInfo( Proc, vCuts[i][j], sType)
end end
end end
-- calcolo lavorazioni -- calcolo lavorazioni
@@ -922,7 +913,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
end end
-- aggiornamento grezzo dinamico -- aggiornamento grezzo dinamico
if i % 2 == 0 then if i % 2 == 0 then
UpdateDiceRaw( idCheckCollisionTm, idSurfToCut, vCuts[i-1][#vCuts[i-1]], Part, MainFace, OtherFace) UpdateDiceRaw( idCheckCollisionTm, idSurfToCut, nil, Part)
end end
else else
EgtErase( idSurfToCut) EgtErase( idSurfToCut)
@@ -986,7 +977,7 @@ local function CalculateDiceMachinings( vCuts, Parameters)
end end
-- aggiornamento grezzo dinamico -- aggiornamento grezzo dinamico
if i % 2 == 0 then if i % 2 == 0 then
UpdateDiceRaw( idCheckCollisionTm, vCuts[i][j], vCuts[i-1][j], Part, MainFace, OtherFace) UpdateDiceRaw( idCheckCollisionTm, vCuts[i][j], vCuts[i-1][j], Part)
end end
end end
end end
+9 -6
View File
@@ -602,15 +602,18 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
-- TODO fare funzione a parte: bisogna guardare il lato (e forse la faccia) lavorato comprensivo di attacchi, non la Proc -- TODO fare funzione a parte: bisogna guardare il lato (e forse la faccia) lavorato comprensivo di attacchi, non la Proc
-- TODO già guardare se il box della faccia è aperto sulla coda, invece di tutta la trimesh, escluderebbe tanti casi -- TODO già guardare se il box della faccia è aperto sulla coda, invece di tutta la trimesh, escluderebbe tanti casi
Cutting.bMoveAfterSplit = Cutting.bMoveAfterSplit or Cutting.LeadIn.bMoveAfterSplit or Cutting.LeadOut.bMoveAfterSplit Cutting.bMoveAfterSplit = Cutting.bMoveAfterSplit or Cutting.LeadIn.bMoveAfterSplit or Cutting.LeadOut.bMoveAfterSplit
local bIsTruncatingCutOnTail = Proc.Topology and ( Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'TailCut') and Proc.AffectedFaces.bLeft local bIsTruncatingCutOnTail = Proc.AffectedFaces.bLeft and
if Cutting.bMoveAfterSplit or bIsTruncatingCutOnTail then ( ( Proc.Topology and ( Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'TailCut')) or
( FaceToMachine.vtN:getX() < GEO.EPS_SMALL and not OptionalParameters.dPocketHeight))
local bIsFeatureBigAsRawOnTail = ( Proc.b3Box:getDimY() > Part.b3Raw:getDimY() - 100 * GEO.EPS_SMALL) and
( Proc.b3Box:getDimZ() > Part.b3Raw:getDimZ() - 100 * GEO.EPS_SMALL) and
Proc.AffectedFaces.bLeft
if Cutting.bMoveAfterSplit or bIsTruncatingCutOnTail or bIsFeatureBigAsRawOnTail then
Cutting.sStage = 'AfterTail' Cutting.sStage = 'AfterTail'
elseif Proc.AffectedFaces.bLeft and elseif Proc.AffectedFaces.bLeft and
( EdgeToMachine.sType == 'Bottom' or ( EdgeToMachine.sType == 'Bottom' or
( Cutting.vtToolDirection:getX() < 0.707 and ( Cutting.vtToolDirection:getX() < 0.707 and not ( Cutting.vtToolDirection:getX() > - 10 * GEO.EPS_SMALL and ( AreSameOrOppositeVectorApprox( EdgeToMachine.vtEdge, Z_AX()) or
not ( Cutting.vtToolDirection:getX() > - 10 * GEO.EPS_SMALL and AreSameOrOppositeVectorApprox( EdgeToMachine.vtEdge, Y_AX()))))) then
( AreSameOrOppositeVectorApprox( EdgeToMachine.vtEdge, Z_AX()) or
AreSameOrOppositeVectorApprox( EdgeToMachine.vtEdge, Y_AX()))))) then
local dLengthOnX = Cutting.dLengthOnX local dLengthOnX = Cutting.dLengthOnX
-- se feature splittata non si considera la lunghezza della feature per il check spostamento dopo separazione -- se feature splittata non si considera la lunghezza della feature per il check spostamento dopo separazione
+2 -2
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di BeamNT -- Gestione della versione di BeamNT
NAME = 'BeamNT' NAME = 'BeamNT'
VERSION = '3.1g1' VERSION = '3.1g5'
MIN_EXE = '3.1g1' MIN_EXE = '3.1g3'