Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a2868c4a8 |
+1
-3
@@ -647,13 +647,11 @@ 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)
|
||||||
|
|||||||
@@ -5,14 +5,8 @@ set LUAC=C:\EgtProg\Dll32\luac54.exe
|
|||||||
set ROOT=%cd%\
|
set ROOT=%cd%\
|
||||||
set OUTBASE=bin
|
set OUTBASE=bin
|
||||||
|
|
||||||
rmdir /s /q "%ROOT%\%OUTBASE%"
|
|
||||||
|
|
||||||
if not exist %OUTBASE% mkdir %OUTBASE%
|
if not exist %OUTBASE% mkdir %OUTBASE%
|
||||||
|
|
||||||
xcopy "%ROOT%\Images" "%ROOT%\%OUTBASE%\Images" /E /H /C /I /Y
|
|
||||||
|
|
||||||
xcopy "%ROOT%\Messages" "%ROOT%\%OUTBASE%\Messages" /E /H /C /I /Y
|
|
||||||
|
|
||||||
REM Compile all .lua files excluding bin\ and any dot folders/files
|
REM Compile all .lua files excluding bin\ and any dot folders/files
|
||||||
for /f "delims=" %%F in ('dir /b /s /a-d *.lua ^| findstr /v /i /c:"\%OUTBASE%\"') do (
|
for /f "delims=" %%F in ('dir /b /s /a-d *.lua ^| findstr /v /i /c:"\%OUTBASE%\"') do (
|
||||||
set FULL=%%F
|
set FULL=%%F
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
+122
-174
@@ -398,42 +398,41 @@ 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
|
|
||||||
|
|
||||||
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 +442,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
|
||||||
|
|
||||||
@@ -466,22 +465,12 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
|
|||||||
end
|
end
|
||||||
|
|
||||||
local dStartOffset = dNextStartOffset
|
local dStartOffset = dNextStartOffset
|
||||||
local dEndOffset = dOvmMid
|
local dEndOffset = ( i == #PARTS ) and 0 or dOvmMid
|
||||||
|
|
||||||
-- se ultimo pezzo bisogna allungare il grezzo del restante solo se non viene creato un grezzo indipendente
|
|
||||||
if ( i == #PARTS) then
|
|
||||||
local dPotentialRemaining = max( 0, dRawL - ( CurrentPart.dPosX + dPartLen))
|
|
||||||
if ( dPotentialRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then
|
|
||||||
dEndOffset = 0 -- Coda a zero, il resto diventerà un idRawRest indipendente
|
|
||||||
else
|
|
||||||
dEndOffset = dPotentialRemaining -- Il pezzo si allunga per prendere tutta la barra residua
|
|
||||||
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,105 +484,102 @@ 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 > 10 ) 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
|
||||||
@@ -745,8 +731,6 @@ local function CollectFeatures( Part, dRotIndex)
|
|||||||
end
|
end
|
||||||
-- calcolo riduzione lunghezza pinzabile testa/coda
|
-- calcolo riduzione lunghezza pinzabile testa/coda
|
||||||
Proc.NotClampableLength = FeatureLib.CalculateFeatureNotClampableLengths( Proc, Part)
|
Proc.NotClampableLength = FeatureLib.CalculateFeatureNotClampableLengths( Proc, Part)
|
||||||
-- si verifica se la feature, lavorata in questa fase, compromette il pinzaggio
|
|
||||||
Proc.bFeatureHindersClamping = FeatureLib.IsMachiningLong( max( Proc.NotClampableLength.dNotClampableLengthHead, Proc.NotClampableLength.dNotClampableLengthTail), Part)
|
|
||||||
-- si verifica se la feature, lavorata in questa fase, compromette lettura misura laser
|
-- si verifica se la feature, lavorata in questa fase, compromette lettura misura laser
|
||||||
Proc.bHindersLaserMeasure = FeatureLib.CalculateFeatureHindersLaserMeasure( Proc, Part)
|
Proc.bHindersLaserMeasure = FeatureLib.CalculateFeatureHindersLaserMeasure( Proc, Part)
|
||||||
-- altrimenti errore (serviva riconoscimento topologico, ma non è stato possibile farlo)
|
-- altrimenti errore (serviva riconoscimento topologico, ma non è stato possibile farlo)
|
||||||
@@ -779,11 +763,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)
|
||||||
@@ -1190,9 +1174,6 @@ local function CalculateStrategies( vProcSingleRot, Part)
|
|||||||
-- eseguo la strategia solo come calcolo fattibilità e voto. Non si applicano le lavorazioni. Si passa la Proc e i parametri personalizzati
|
-- eseguo la strategia solo come calcolo fattibilità e voto. Non si applicano le lavorazioni. Si passa la Proc e i parametri personalizzati
|
||||||
_, Proc.AvailableStrategies[nIndexCurrentStrategy].Result = CurrentStrategy.Script.Make( false, Proc, Part, Proc.AvailableStrategies[nIndexCurrentStrategy])
|
_, Proc.AvailableStrategies[nIndexCurrentStrategy].Result = CurrentStrategy.Script.Make( false, Proc, Part, Proc.AvailableStrategies[nIndexCurrentStrategy])
|
||||||
|
|
||||||
-- pulizia eventuali geometrie aggiutive create dalla strategia
|
|
||||||
EgtEmptyGroup( Part.idTempGroup)
|
|
||||||
|
|
||||||
-- se taglio di testa o coda sostitutivo non applicabile si ripristina l'originale
|
-- se taglio di testa o coda sostitutivo non applicabile si ripristina l'originale
|
||||||
if Proc.AvailableStrategies[nIndexCurrentStrategy].Result.sStatus ~= 'Completed' then
|
if Proc.AvailableStrategies[nIndexCurrentStrategy].Result.sStatus ~= 'Completed' then
|
||||||
if ID.IsHeadCut( Proc) and not Proc.bIsOriginalHeadcut then
|
if ID.IsHeadCut( Proc) and not Proc.bIsOriginalHeadcut then
|
||||||
@@ -1450,8 +1431,6 @@ local function CalculateMachinings( vProc, Part, nInitialRotation)
|
|||||||
local StrategyScript = require( StrategyScriptName)
|
local StrategyScript = require( StrategyScriptName)
|
||||||
-- eseguo la strategia e si applicano le lavorazioni. Si passa la Proc e i parametri personalizzati
|
-- eseguo la strategia e si applicano le lavorazioni. Si passa la Proc e i parametri personalizzati
|
||||||
local _, Result = StrategyScript.Make( true, Proc, Part, Proc.ChosenStrategy)
|
local _, Result = StrategyScript.Make( true, Proc, Part, Proc.ChosenStrategy)
|
||||||
-- pulizia eventuali geometrie aggiutive create dalla strategia
|
|
||||||
EgtEmptyGroup( Part.idTempGroup)
|
|
||||||
-- per i tagli di testa e coda, che non hanno girato nel CalculateStrategies, si devono settare i risultati
|
-- per i tagli di testa e coda, che non hanno girato nel CalculateStrategies, si devono settare i risultati
|
||||||
if ( ID.IsHeadCut( Proc) or ID.IsTailCut( Proc)) and not Proc.ChosenStrategy.Result then
|
if ( ID.IsHeadCut( Proc) or ID.IsTailCut( Proc)) and not Proc.ChosenStrategy.Result then
|
||||||
Proc.ChosenStrategy.Result = Result
|
Proc.ChosenStrategy.Result = Result
|
||||||
@@ -1514,6 +1493,7 @@ function BeamExec.GetProcessings( PARTS, bIsFlipRot)
|
|||||||
local nOffsetIndex = EgtIf( nInvertIndex == 2, 4, 0)
|
local nOffsetIndex = EgtIf( nInvertIndex == 2, 4, 0)
|
||||||
-- le rotazioni sono 1,2,3,4 (0, 90, 180, 270) e 5,6,7,8 (le stesse invertite)
|
-- le rotazioni sono 1,2,3,4 (0, 90, 180, 270) e 5,6,7,8 (le stesse invertite)
|
||||||
local nIndex = nRotIndex + nOffsetIndex
|
local nIndex = nRotIndex + nOffsetIndex
|
||||||
|
local HeadcutInfo, TailcutInfo
|
||||||
-- si calcolano le feature solo se la rotazione può essere presa in considerazione
|
-- si calcolano le feature solo se la rotazione può essere presa in considerazione
|
||||||
if PARTS[nPart].CombinationList.Rotations[nRotIndex] == 1 then
|
if PARTS[nPart].CombinationList.Rotations[nRotIndex] == 1 then
|
||||||
-- recupero le feature di lavorazione della trave
|
-- recupero le feature di lavorazione della trave
|
||||||
@@ -1712,19 +1692,17 @@ end
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
-- funzione che calcola le combinazioni di rotazione per lavorare la trave e sceglie la migliore
|
-- funzione che calcola le combinazioni di rotazione per lavorare la trave e sceglie la migliore
|
||||||
local function GetCombinationListFromMatrix( ProcessingsOnPart, Part, bReProcessEmptyChosenStrategy, BitCombinationListToReprocess)
|
local function GetCombinationListFromMatrix( ProcessingsOnPart, PartInfo, bReProcessEmptyChosenStrategy, BitCombinationListToReprocess)
|
||||||
local CombinationsList = { dAllCombinationsTotalTime = 0}
|
local CombinationsList = { dAllCombinationsTotalTime = 0}
|
||||||
|
|
||||||
-- calcolo per tutte le combinazioni disponibili precedentemente verificate
|
-- calcolo per tutte le combinazioni disponibili precedentemente verificate
|
||||||
for i = 1, #Part.CombinationList do
|
for i = 1, #PartInfo.CombinationList do
|
||||||
local bToProcess = false
|
local bToProcess = false
|
||||||
-- controllo se debbano essere ricalcolate solo alcune soluzioni
|
-- controllo se debbano essere ricalcolate solo alcune soluzioni
|
||||||
local nSingleCombinationToReprocessIndex
|
|
||||||
if BitCombinationListToReprocess and #BitCombinationListToReprocess > 0 then
|
if BitCombinationListToReprocess and #BitCombinationListToReprocess > 0 then
|
||||||
for c = 1, #BitCombinationListToReprocess do
|
for c = 1, #BitCombinationListToReprocess do
|
||||||
if Part.CombinationList[i].sBitIndexCombination == BitCombinationListToReprocess[c].sBitIndexCombination and
|
if PartInfo.CombinationList[i].sBitIndexCombination == BitCombinationListToReprocess[c].sBitIndexCombination and
|
||||||
Part.CombinationList[i].bPartInCombiIsInverted == BitCombinationListToReprocess[c].bPartInCombiIsInverted then
|
PartInfo.CombinationList[i].bPartInCombiIsInverted == BitCombinationListToReprocess[c].bPartInCombiIsInverted then
|
||||||
nSingleCombinationToReprocessIndex = c
|
|
||||||
bToProcess = true
|
bToProcess = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1735,20 +1713,18 @@ local function GetCombinationListFromMatrix( ProcessingsOnPart, Part, bReProcess
|
|||||||
if bToProcess then
|
if bToProcess then
|
||||||
local bRot90, bRot180
|
local bRot90, bRot180
|
||||||
local SingleCombination = {}
|
local SingleCombination = {}
|
||||||
local nUnloadPos = Part.CombinationList[i].nUnloadPos
|
local nUnloadPos = PartInfo.CombinationList[i].nUnloadPos
|
||||||
SingleCombination.nRotations = 0
|
SingleCombination.nRotations = 0
|
||||||
SingleCombination.dTotalTimeToMachine = 0
|
SingleCombination.dTotalTimeToMachine = 0
|
||||||
SingleCombination.dTotalQuality = 0
|
SingleCombination.dTotalQuality = 0
|
||||||
|
SingleCombination.dFeatureRotationIndex = 0
|
||||||
SingleCombination.dTotalCompletionIndex = 0
|
SingleCombination.dTotalCompletionIndex = 0
|
||||||
SingleCombination.nComplete = 0
|
SingleCombination.nComplete = 0
|
||||||
SingleCombination.nNotComplete = 0
|
SingleCombination.nNotComplete = 0
|
||||||
SingleCombination.nNotExecute = 0
|
SingleCombination.nNotExecute = 0
|
||||||
SingleCombination.sBitIndexCombination = Part.CombinationList[i].sBitIndexCombination
|
SingleCombination.sBitIndexCombination = PartInfo.CombinationList[i].sBitIndexCombination
|
||||||
if nSingleCombinationToReprocessIndex then
|
|
||||||
SingleCombination.sBitIndexCombinationToNest = BitCombinationListToReprocess[nSingleCombinationToReprocessIndex].sBitIndexCombinationToNest
|
|
||||||
end
|
|
||||||
-- TODO se pezzo invertito bisogna considerare le rotazioni nell'array dalla 5 alla 8
|
-- TODO se pezzo invertito bisogna considerare le rotazioni nell'array dalla 5 alla 8
|
||||||
SingleCombination.bPartInCombiIsInverted = Part.CombinationList[i].bPartInCombiIsInverted
|
SingleCombination.bPartInCombiIsInverted = PartInfo.CombinationList[i].bPartInCombiIsInverted
|
||||||
SingleCombination.nUnloadPos = nUnloadPos
|
SingleCombination.nUnloadPos = nUnloadPos
|
||||||
-- creo liste dei proc suddivisi per rotazione
|
-- creo liste dei proc suddivisi per rotazione
|
||||||
SingleCombination.Rot0 = {}
|
SingleCombination.Rot0 = {}
|
||||||
@@ -1769,38 +1745,19 @@ local function GetCombinationListFromMatrix( ProcessingsOnPart, Part, bReProcess
|
|||||||
else
|
else
|
||||||
if not ( ( ID.IsHeadCut( ProcessingsOnPart.Rotation[1+nOffsetIndex][nProc]) and ProcessingsOnPart.Rotation[1+nOffsetIndex][nProc].bIsOriginalHeadcut)
|
if not ( ( ID.IsHeadCut( ProcessingsOnPart.Rotation[1+nOffsetIndex][nProc]) and ProcessingsOnPart.Rotation[1+nOffsetIndex][nProc].bIsOriginalHeadcut)
|
||||||
or ( ID.IsTailCut( ProcessingsOnPart.Rotation[1+nOffsetIndex][nProc]) and ProcessingsOnPart.Rotation[1+nOffsetIndex][nProc].bIsOriginalTailcut)) then
|
or ( ID.IsTailCut( ProcessingsOnPart.Rotation[1+nOffsetIndex][nProc]) and ProcessingsOnPart.Rotation[1+nOffsetIndex][nProc].bIsOriginalTailcut)) then
|
||||||
-- primo ciclo sulle rotazioni per vedere se la feature interferisce con il pinzaggio, in una qualunque rotazione
|
|
||||||
local dMaxNotClampableLengthHead = 0
|
|
||||||
local dMaxNotClampableLengthTail = 0
|
|
||||||
local dMaxNotClampableLength = 0
|
|
||||||
for nRotation = 1, 4 do
|
|
||||||
-- si considera solo rotazione attiva
|
|
||||||
if string.sub( Part.CombinationList[i].sBitIndexCombination, nRotation, nRotation) == '1' and ( ProcessingsOnPart.Rotation[nRotation+nOffsetIndex][nProc].nFlg > 0) then
|
|
||||||
dMaxNotClampableLengthHead = max( ProcessingsOnPart.Rotation[nRotation+nOffsetIndex][nProc].NotClampableLength.dNotClampableLengthHead, dMaxNotClampableLengthHead)
|
|
||||||
dMaxNotClampableLengthTail = max( ProcessingsOnPart.Rotation[nRotation+nOffsetIndex][nProc].NotClampableLength.dNotClampableLengthTail, dMaxNotClampableLengthTail)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
dMaxNotClampableLength = max( dMaxNotClampableLengthHead, dMaxNotClampableLengthTail)
|
|
||||||
-- ciclo sulle rotazioni
|
-- ciclo sulle rotazioni
|
||||||
local nNextRot = nUnloadPos
|
local nNextRot = nUnloadPos
|
||||||
local ResultsList = {}
|
local ResultsList = {}
|
||||||
local bExecInLastRotation = false
|
|
||||||
for nRotation = 1, 3 do
|
for nRotation = 1, 3 do
|
||||||
-- se rotazione abilitata da combinazione
|
-- se rotazione abilitata da combinazione
|
||||||
if string.sub( Part.CombinationList[i].sBitIndexCombination, nNextRot, nNextRot) == '1' then
|
if string.sub( PartInfo.CombinationList[i].sBitIndexCombination, nNextRot, nNextRot) == '1' then
|
||||||
local CurrProc = ProcessingsOnPart.Rotation[nNextRot+nOffsetIndex][nProc]
|
local CurrProc = ProcessingsOnPart.Rotation[nNextRot+nOffsetIndex][nProc]
|
||||||
-- se non è settata la ChosenStrategy, provo a cercare comunque tra quelle disponibili
|
-- se è ultima rotazione oppure se feature non impatta su misura laser, allora è valida e può essere effettivamente considerata
|
||||||
if not CurrProc.ChosenStrategy and bReProcessEmptyChosenStrategy then
|
if nNextRot == nUnloadPos or not( CurrProc.bHindersLaserMeasure) then
|
||||||
CurrProc = GetFeatureBestStrategy( CurrProc, Part)
|
-- se non è settata la ChosenStrtegy, provo a cercare comunque tra quelle disponibili
|
||||||
end
|
if not CurrProc.ChosenStrategy and bReProcessEmptyChosenStrategy then
|
||||||
-- si verifica se la feature compromette il pinzaggio
|
CurrProc = GetFeatureBestStrategy( CurrProc, PartInfo)
|
||||||
local bIgnoreNotClampableLength = false
|
end
|
||||||
if CurrProc.ChosenStrategy then
|
|
||||||
bIgnoreNotClampableLength = CurrProc.ChosenStrategy.Result.bIgnoreNotClampableLength
|
|
||||||
end
|
|
||||||
bExecInLastRotation = ( not bIgnoreNotClampableLength) and FeatureLib.IsMachiningLong( dMaxNotClampableLength, Part)
|
|
||||||
-- se la feature impatta sulla lettura laser o compromette il pinzaggio è valida solo se fatta in ultima rotazione; negli altri casi è sempre valida
|
|
||||||
if nNextRot == nUnloadPos or not( CurrProc.bHindersLaserMeasure or bExecInLastRotation) then
|
|
||||||
-- controllo se è stata scelta una strategia
|
-- controllo se è stata scelta una strategia
|
||||||
if CurrProc.ChosenStrategy then
|
if CurrProc.ChosenStrategy then
|
||||||
local Proc = {}
|
local Proc = {}
|
||||||
@@ -1820,7 +1777,7 @@ local function GetCombinationListFromMatrix( ProcessingsOnPart, Part, bReProcess
|
|||||||
SingleCombination.nIndexTailCutInVProc = nProc
|
SingleCombination.nIndexTailCutInVProc = nProc
|
||||||
else
|
else
|
||||||
if #ResultsList > 0 then
|
if #ResultsList > 0 then
|
||||||
local Proc, Data = GetProcBestMachRotationFromList( ResultsList, Part)
|
local Proc, Data = GetProcBestMachRotationFromList( ResultsList, PartInfo)
|
||||||
Proc.nIndexRotation = Data.nIndexRotation
|
Proc.nIndexRotation = Data.nIndexRotation
|
||||||
-- inserisco la Proc nell'apposita lista
|
-- inserisco la Proc nell'apposita lista
|
||||||
if Data.nIndexRotation == nUnloadPos then
|
if Data.nIndexRotation == nUnloadPos then
|
||||||
@@ -1836,6 +1793,7 @@ local function GetCombinationListFromMatrix( ProcessingsOnPart, Part, bReProcess
|
|||||||
SingleCombination.dTotalTimeToMachine = SingleCombination.dTotalTimeToMachine + Data.dTimeToMachine
|
SingleCombination.dTotalTimeToMachine = SingleCombination.dTotalTimeToMachine + Data.dTimeToMachine
|
||||||
SingleCombination.dTotalQuality = SingleCombination.dTotalQuality + Data.dQuality
|
SingleCombination.dTotalQuality = SingleCombination.dTotalQuality + Data.dQuality
|
||||||
SingleCombination.dTotalCompletionIndex = SingleCombination.dTotalCompletionIndex + Data.dCompletionIndex
|
SingleCombination.dTotalCompletionIndex = SingleCombination.dTotalCompletionIndex + Data.dCompletionIndex
|
||||||
|
SingleCombination.dFeatureRotationIndex = SingleCombination.dFeatureRotationIndex + ( Data.dFeatureRotationIndex or 3)
|
||||||
SingleCombination.nComplete = SingleCombination.nComplete + EgtIf( Data.bComplete, 1, 0)
|
SingleCombination.nComplete = SingleCombination.nComplete + EgtIf( Data.bComplete, 1, 0)
|
||||||
SingleCombination.nNotComplete = SingleCombination.nNotComplete + EgtIf( Data.bNotComplete, 1, 0)
|
SingleCombination.nNotComplete = SingleCombination.nNotComplete + EgtIf( Data.bNotComplete, 1, 0)
|
||||||
SingleCombination.nNotExecute = SingleCombination.nNotExecute + EgtIf( Data.bNotApplicable, 1, 0)
|
SingleCombination.nNotExecute = SingleCombination.nNotExecute + EgtIf( Data.bNotApplicable, 1, 0)
|
||||||
@@ -1871,7 +1829,7 @@ local function GetCombinationListFromMatrix( ProcessingsOnPart, Part, bReProcess
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- si calsola il total rating
|
-- si calsola il total rating
|
||||||
CombinationsList = FeatureLib.CalculateCombinationsCompositeRating( CombinationsList, Part.GeneralParameters.GEN_sMachiningStrategy)
|
CombinationsList = FeatureLib.CalculateCombinationsCompositeRating( CombinationsList, PartInfo.GeneralParameters.GEN_sMachiningStrategy)
|
||||||
|
|
||||||
return CombinationsList
|
return CombinationsList
|
||||||
end
|
end
|
||||||
@@ -2317,47 +2275,36 @@ function BeamExec.ProcessAlternatives( PARTS)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- se serve calcolare posizione per ottimizzazione tagli in nesting (le soluzioni non possono avere ribaltamenti)
|
-- se serve calcolare posizione per ottimizzazione tagli in nesting (le soluzioni non possono avere ribaltamenti)
|
||||||
-- il pezzo è il posizione 0 in questo momento, ma l'automatismo ha già fatto la prerotazione, se abilitata
|
|
||||||
-- le combinazioni vanno testate considerando come 0 la posizione preruotata
|
|
||||||
-- allo stesso modo, le alternative devono considerare come 0 quello preruotato
|
|
||||||
if PARTS[nPart].GeneralParameters.GEN_bGetAlternativesNesting2D then
|
if PARTS[nPart].GeneralParameters.GEN_bGetAlternativesNesting2D then
|
||||||
-- POSIZIONE 0 (e invertito)
|
-- POSIZIONE 0 (e invertito)
|
||||||
local sBitIndexCombinationToCheck = BeamLib.StringReplaceChar( '0000', PARTS[nPart].nInitialPosition, "1")
|
local sCombinationToCheck = BeamLib.StringReplaceChar( '0000', PARTS[nPart].nInitialPosition, "1")
|
||||||
local sBitIndexCombinationToNest = '1000'
|
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sCombinationToCheck}, bIsNesting2D = true})
|
||||||
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sBitIndexCombinationToCheck, sBitIndexCombinationToNest = sBitIndexCombinationToNest, bPartInCombiIsInverted = PARTS[nPart].bPartInCombiIsInverted}, bIsNesting2D = true})
|
|
||||||
if PARTS[nPart].GeneralParameters.GEN_bAllowPieceInversion then
|
if PARTS[nPart].GeneralParameters.GEN_bAllowPieceInversion then
|
||||||
sBitIndexCombinationToNest = '1000_INV'
|
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sCombinationToCheck, bPartInCombiIsInverted = true}, bIsNesting2D = true})
|
||||||
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sBitIndexCombinationToCheck, sBitIndexCombinationToNest = sBitIndexCombinationToNest, bPartInCombiIsInverted = not PARTS[nPart].bPartInCombiIsInverted}, bIsNesting2D = true})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- POSIZIONE 180 (e invertito)
|
-- POSIZIONE 180 (e invertito)
|
||||||
if PARTS[nPart].GeneralParameters.GEN_sPiecesLoadingPosition == 'STD_PRE_ROTATION' then
|
if PARTS[nPart].GeneralParameters.GEN_sPiecesLoadingPosition == 'STD_PRE_ROTATION' then
|
||||||
local nOtherPosition = EgtIf( PARTS[nPart].nInitialPosition + 2 > 4, PARTS[nPart].nInitialPosition + 2 - 4, PARTS[nPart].nInitialPosition + 2)
|
local nOtherPosition = EgtIf( PARTS[nPart].nInitialPosition + 2 > 4, PARTS[nPart].nInitialPosition + 2 - 4, PARTS[nPart].nInitialPosition + 2)
|
||||||
sBitIndexCombinationToCheck = BeamLib.StringReplaceChar( '0000', nOtherPosition, "1")
|
sCombinationToCheck = BeamLib.StringReplaceChar( '0000', nOtherPosition, "1")
|
||||||
sBitIndexCombinationToNest = '0010'
|
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sCombinationToCheck}, bIsNesting2D = true})
|
||||||
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sBitIndexCombinationToCheck, sBitIndexCombinationToNest = sBitIndexCombinationToNest, bPartInCombiIsInverted = PARTS[nPart].bPartInCombiIsInverted}, bIsNesting2D = true})
|
|
||||||
if PARTS[nPart].GeneralParameters.GEN_bAllowPieceInversion then
|
if PARTS[nPart].GeneralParameters.GEN_bAllowPieceInversion then
|
||||||
sBitIndexCombinationToNest = '0010_INV'
|
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sCombinationToCheck, bPartInCombiIsInverted = true}, bIsNesting2D = true})
|
||||||
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sBitIndexCombinationToCheck, sBitIndexCombinationToNest = sBitIndexCombinationToNest, bPartInCombiIsInverted = not PARTS[nPart].bPartInCombiIsInverted}, bIsNesting2D = true})
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- POSIZIONE 90/270 (e invertito)
|
-- POSIZIONE 90/270 (e invertito)
|
||||||
if PARTS[nPart].GeneralParameters.GEN_sPiecesLoadingPosition == 'FULL_PRE_ROTATION' then
|
if PARTS[nPart].GeneralParameters.GEN_sPiecesLoadingPosition == 'FULL_PRE_ROTATION' then
|
||||||
local nOtherPosition = EgtIf( PARTS[nPart].nInitialPosition + 1 > 4, PARTS[nPart].nInitialPosition + 1 - 4, PARTS[nPart].nInitialPosition + 1)
|
local nOtherPosition = EgtIf( PARTS[nPart].nInitialPosition + 1 > 4, PARTS[nPart].nInitialPosition + 1 - 4, PARTS[nPart].nInitialPosition + 1)
|
||||||
sBitIndexCombinationToCheck = BeamLib.StringReplaceChar( '0000', nOtherPosition, "1")
|
sCombinationToCheck = BeamLib.StringReplaceChar( '0000', nOtherPosition, "1")
|
||||||
sBitIndexCombinationToNest = '0100'
|
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sCombinationToCheck}, bIsNesting2D = true})
|
||||||
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sBitIndexCombinationToCheck, sBitIndexCombinationToNest = sBitIndexCombinationToNest, bPartInCombiIsInverted = PARTS[nPart].bPartInCombiIsInverted}, bIsNesting2D = true})
|
|
||||||
if PARTS[nPart].GeneralParameters.GEN_bAllowPieceInversion then
|
if PARTS[nPart].GeneralParameters.GEN_bAllowPieceInversion then
|
||||||
sBitIndexCombinationToNest = '0100_INV'
|
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sCombinationToCheck, bPartInCombiIsInverted = true}, bIsNesting2D = true})
|
||||||
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sBitIndexCombinationToCheck, sBitIndexCombinationToNest = sBitIndexCombinationToNest, bPartInCombiIsInverted = not PARTS[nPart].bPartInCombiIsInverted}, bIsNesting2D = true})
|
|
||||||
end
|
end
|
||||||
nOtherPosition = EgtIf( PARTS[nPart].nInitialPosition + 3 > 4, PARTS[nPart].nInitialPosition + 3 - 4, PARTS[nPart].nInitialPosition + 3)
|
nOtherPosition = EgtIf( PARTS[nPart].nInitialPosition + 3 > 4, PARTS[nPart].nInitialPosition + 3 - 4, PARTS[nPart].nInitialPosition + 3)
|
||||||
sBitIndexCombinationToCheck = BeamLib.StringReplaceChar( '0000', nOtherPosition, "1")
|
sCombinationToCheck = BeamLib.StringReplaceChar( '0000', nOtherPosition, "1")
|
||||||
sBitIndexCombinationToNest = '0001'
|
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sCombinationToCheck}, bIsNesting2D = true})
|
||||||
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sBitIndexCombinationToCheck, sBitIndexCombinationToNest = sBitIndexCombinationToNest, bPartInCombiIsInverted = PARTS[nPart].bPartInCombiIsInverted}, bIsNesting2D = true})
|
|
||||||
if PARTS[nPart].GeneralParameters.GEN_bAllowPieceInversion then
|
if PARTS[nPart].GeneralParameters.GEN_bAllowPieceInversion then
|
||||||
sBitIndexCombinationToNest = '0001_INV'
|
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sCombinationToCheck, bPartInCombiIsInverted = true}, bIsNesting2D = true})
|
||||||
table.insert( TotalCombiToTest, {{ sBitIndexCombination = sBitIndexCombinationToCheck, sBitIndexCombinationToNest = sBitIndexCombinationToNest, bPartInCombiIsInverted = not PARTS[nPart].bPartInCombiIsInverted}, bIsNesting2D = true})
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -2443,8 +2390,6 @@ function BeamExec.ProcessAlternatives( PARTS)
|
|||||||
|
|
||||||
local HeadCut = PROCESSINGS[nPart].Rotation[nRotHeadCut+nOffsetIndex][MatrixResult.nIndexHeadCutInVProc]
|
local HeadCut = PROCESSINGS[nPart].Rotation[nRotHeadCut+nOffsetIndex][MatrixResult.nIndexHeadCutInVProc]
|
||||||
local TailCut = PROCESSINGS[nPart].Rotation[nRotSplitCut+nOffsetIndex][MatrixResult.nIndexTailCutInVProc]
|
local TailCut = PROCESSINGS[nPart].Rotation[nRotSplitCut+nOffsetIndex][MatrixResult.nIndexTailCutInVProc]
|
||||||
local HeadCutOnFirstRotation = PROCESSINGS[nPart].Rotation[1+nOffsetIndex][MatrixResult.nIndexHeadCutInVProc]
|
|
||||||
local TailCutOnFirstRotation = PROCESSINGS[nPart].Rotation[1+nOffsetIndex][MatrixResult.nIndexTailCutInVProc]
|
|
||||||
|
|
||||||
-- setto nella Proc l'indice rotazione nella quale deve essere lavorata
|
-- setto nella Proc l'indice rotazione nella quale deve essere lavorata
|
||||||
HeadCut.nIndexRotation = nRotHeadCut
|
HeadCut.nIndexRotation = nRotHeadCut
|
||||||
@@ -2485,12 +2430,13 @@ function BeamExec.ProcessAlternatives( PARTS)
|
|||||||
|
|
||||||
-- aggiornamento info testa/coda per Nesting
|
-- aggiornamento info testa/coda per Nesting
|
||||||
local nRotation = BeamLib.ConvertBitIndexToRotationIndex( BestCombination.sBitIndexCombination)
|
local nRotation = BeamLib.ConvertBitIndexToRotationIndex( BestCombination.sBitIndexCombination)
|
||||||
local HeadcutInfo, TailcutInfo = GetHeadTailInfoForNesting( HeadCutOnFirstRotation, TailCutOnFirstRotation, PARTS[nPart])
|
local sBitIndexCombinationWithInvert = BestCombination.sBitIndexCombination .. EgtIf( BestCombination.bPartInCombiIsInverted, '_INV', '')
|
||||||
|
local HeadcutInfo, TailcutInfo = GetHeadTailInfoForNesting( HeadCut, TailCut, PARTS[nPart])
|
||||||
if HeadcutInfo then
|
if HeadcutInfo then
|
||||||
-- offset e vettori vanno adeguati alla rotazione attuale (inversione è già corretta)
|
-- offset e vettori vanno adeguati alla rotazione attuale (inversione è già corretta)
|
||||||
BeamLib.RotateTableFromIndexInPlace( HeadcutInfo.OffsetX, nRotation)
|
BeamLib.RotateTableFromIndexInPlace( HeadcutInfo.OffsetX, nRotation)
|
||||||
HeadcutInfo.vtN:rotate( X_AX(), ( nRotation - 1) * 90)
|
HeadcutInfo.vtN:rotate( X_AX(), ( nRotation - 1) * 90)
|
||||||
PARTS[nPart].HeadcutInfo[BestCombination.sBitIndexCombinationToNest] = {
|
PARTS[nPart].HeadcutInfo[sBitIndexCombinationWithInvert] = {
|
||||||
OffsetX = HeadcutInfo.OffsetX,
|
OffsetX = HeadcutInfo.OffsetX,
|
||||||
vtN = HeadcutInfo.vtN
|
vtN = HeadcutInfo.vtN
|
||||||
}
|
}
|
||||||
@@ -2499,7 +2445,7 @@ function BeamExec.ProcessAlternatives( PARTS)
|
|||||||
-- offset e vettori vanno adeguati alla rotazione attuale (inversione è già corretta)
|
-- offset e vettori vanno adeguati alla rotazione attuale (inversione è già corretta)
|
||||||
BeamLib.RotateTableFromIndexInPlace( TailcutInfo.OffsetX, nRotation)
|
BeamLib.RotateTableFromIndexInPlace( TailcutInfo.OffsetX, nRotation)
|
||||||
TailcutInfo.vtN:rotate( X_AX(), ( nRotation - 1) * 90)
|
TailcutInfo.vtN:rotate( X_AX(), ( nRotation - 1) * 90)
|
||||||
PARTS[nPart].TailcutInfo[BestCombination.sBitIndexCombinationToNest] = {
|
PARTS[nPart].TailcutInfo[sBitIndexCombinationWithInvert] = {
|
||||||
OffsetX = TailcutInfo.OffsetX,
|
OffsetX = TailcutInfo.OffsetX,
|
||||||
vtN = TailcutInfo.vtN
|
vtN = TailcutInfo.vtN
|
||||||
}
|
}
|
||||||
@@ -2635,10 +2581,11 @@ function BeamExec.ProcessAlternatives( PARTS)
|
|||||||
local bApplOk, _, _ = EgtApplyAllMachinings()
|
local bApplOk, _, _ = EgtApplyAllMachinings()
|
||||||
-- se non ci sono errori, soluzione alternativa valida: scrittura variabili globali per interfaccia
|
-- se non ci sono errori, soluzione alternativa valida: scrittura variabili globali per interfaccia
|
||||||
if bApplOk then
|
if bApplOk then
|
||||||
|
local sBitIndexCombinationWithInvert = BestCombination.sBitIndexCombination .. EgtIf( BestCombination.bPartInCombiIsInverted, '_INV', '')
|
||||||
if TotalCombiToTest[z].bIsNesting2D then
|
if TotalCombiToTest[z].bIsNesting2D then
|
||||||
table.insert( AlternativesNest2D, BestCombination.sBitIndexCombinationToNest)
|
table.insert( AlternativesNest2D, sBitIndexCombinationWithInvert)
|
||||||
else
|
else
|
||||||
table.insert( Alternatives, BestCombination.sBitIndexCombinationToNest)
|
table.insert( Alternatives, sBitIndexCombinationWithInvert)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se ultima combinazione, si esce e non si riporta in posizione iniziale. Verrà infatti cancellata
|
-- se ultima combinazione, si esce e non si riporta in posizione iniziale. Verrà infatti cancellata
|
||||||
@@ -2657,11 +2604,12 @@ function BeamExec.ProcessAlternatives( PARTS)
|
|||||||
|
|
||||||
-- passaggio info a interfaccia da scrivere sul pezzo
|
-- passaggio info a interfaccia da scrivere sul pezzo
|
||||||
BEAM.INFONGEPART = {}
|
BEAM.INFONGEPART = {}
|
||||||
|
table.insert( BEAM.INFONGEPART, 'INITIALPOSITION=' .. PARTS[nPart].nInitialPosition)
|
||||||
for i = 1, #AlternativesNest2D do
|
for i = 1, #AlternativesNest2D do
|
||||||
if PARTS[nPart].HeadcutInfo then
|
if PARTS[nPart].HeadcutInfo then
|
||||||
local sOffsetX = table.concat( PARTS[nPart].HeadcutInfo[AlternativesNest2D[i]].OffsetX, ',')
|
local sOffsetX = table.concat( PARTS[nPart].HeadcutInfo[AlternativesNest2D[i]].OffsetX, ',')
|
||||||
local sVtN = ( tostring( PARTS[nPart].HeadcutInfo[AlternativesNest2D[i]].vtN)):gsub("^%(", ""):gsub("%)$", "")
|
local sVtN = ( tostring( PARTS[nPart].HeadcutInfo[AlternativesNest2D[i]].vtN)):gsub("^%(", ""):gsub("%)$", "")
|
||||||
table.insert( BEAM.INFONGEPART, 'ALT' .. AlternativesNest2D[i].. '_H' .. '=' .. sOffsetX .. ';' .. sVtN)
|
table.insert( BEAM.INFONGEPART, 'ALT' .. AlternativesNest2D[i].. '_H' .. '=' .. sOffsetX .. ';' .. sVtN )
|
||||||
end
|
end
|
||||||
if PARTS[nPart].TailcutInfo then
|
if PARTS[nPart].TailcutInfo then
|
||||||
local sOffsetX = table.concat( PARTS[nPart].TailcutInfo[AlternativesNest2D[i]].OffsetX, ',')
|
local sOffsetX = table.concat( PARTS[nPart].TailcutInfo[AlternativesNest2D[i]].OffsetX, ',')
|
||||||
|
|||||||
+13
-5
@@ -764,7 +764,7 @@ function BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, D
|
|||||||
if DefaultStrategyParamList.ParameterList[i].sType == 'b' then
|
if DefaultStrategyParamList.ParameterList[i].sType == 'b' then
|
||||||
UpdatedParameters[DefaultStrategyParamList.ParameterList[i].sName] = xParameterValue == 'true' or xParameterValue == '1' or xParameterValue == true
|
UpdatedParameters[DefaultStrategyParamList.ParameterList[i].sName] = xParameterValue == 'true' or xParameterValue == '1' or xParameterValue == true
|
||||||
elseif DefaultStrategyParamList.ParameterList[i].sType == 'd' then
|
elseif DefaultStrategyParamList.ParameterList[i].sType == 'd' then
|
||||||
if #DefaultStrategyParamList.ParameterList[i].sValue > 0 or #xParameterValue > 0 then
|
if #DefaultStrategyParamList.ParameterList[i].sValue > 0 then
|
||||||
UpdatedParameters[DefaultStrategyParamList.ParameterList[i].sName] = tonumber( xParameterValue)
|
UpdatedParameters[DefaultStrategyParamList.ParameterList[i].sName] = tonumber( xParameterValue)
|
||||||
-- stringa vuota equivale a non passare alcun valore (deciderà la strategia)
|
-- stringa vuota equivale a non passare alcun valore (deciderà la strategia)
|
||||||
else
|
else
|
||||||
@@ -940,14 +940,22 @@ end
|
|||||||
function BeamLib.ConvertBitIndexToRotationIndex( sBitIndexCombination)
|
function BeamLib.ConvertBitIndexToRotationIndex( sBitIndexCombination)
|
||||||
local nRotationIndex
|
local nRotationIndex
|
||||||
|
|
||||||
if EgtStartsWith( sBitIndexCombination, '1000') then
|
if sBitIndexCombination == '1000' then
|
||||||
return 1
|
return 1
|
||||||
elseif EgtStartsWith( sBitIndexCombination, '0100') then
|
elseif sBitIndexCombination == '0100' then
|
||||||
return 2
|
return 2
|
||||||
elseif EgtStartsWith( sBitIndexCombination, '0010') then
|
elseif sBitIndexCombination == '0010' then
|
||||||
return 3
|
return 3
|
||||||
elseif EgtStartsWith( sBitIndexCombination, '0001') then
|
elseif sBitIndexCombination == '0001' then
|
||||||
return 4
|
return 4
|
||||||
|
elseif sBitIndexCombination == '1000_INV' then
|
||||||
|
return 5
|
||||||
|
elseif sBitIndexCombination == '0100_INV' then
|
||||||
|
return 6
|
||||||
|
elseif sBitIndexCombination == '0010_INV' then
|
||||||
|
return 7
|
||||||
|
elseif sBitIndexCombination == '0001_INV' then
|
||||||
|
return 8
|
||||||
end
|
end
|
||||||
|
|
||||||
return nRotationIndex
|
return nRotationIndex
|
||||||
|
|||||||
@@ -788,15 +788,17 @@ function FeatureLib.CalculateCombinationsCompositeRating( CombinationsList, sMac
|
|||||||
local dIndexWeightTimeToMachine = 5 - ( 4 * ( EgtClamp( CombinationsList[n].dTotalTimeToMachine / CombinationsList.dAllCombinationsTotalTime, 0, 1)))
|
local dIndexWeightTimeToMachine = 5 - ( 4 * ( EgtClamp( CombinationsList[n].dTotalTimeToMachine / CombinationsList.dAllCombinationsTotalTime, 0, 1)))
|
||||||
|
|
||||||
-- si calcolano gli indici pesati in base alla configurazione utente. Possibili parametri di configurazione:
|
-- si calcolano gli indici pesati in base alla configurazione utente. Possibili parametri di configurazione:
|
||||||
local dQuality, dCompletion, dTime, dCoeffQuality, dCoeffCompletion, dCoeffTime
|
local dQuality, dCompletion, dTime, dFeatureRotationIndex, dCoeffQuality, dCoeffCompletion, dCoeffTime
|
||||||
dCoeffQuality, dCoeffCompletion, dCoeffTime = GetMachiningStrategyCoefficients( sMachiningStrategy)
|
dCoeffQuality, dCoeffCompletion, dCoeffTime = GetMachiningStrategyCoefficients( sMachiningStrategy)
|
||||||
|
|
||||||
|
|
||||||
dQuality = CombinationsList[n].dTotalQuality * dCoeffQuality
|
dQuality = CombinationsList[n].dTotalQuality * dCoeffQuality
|
||||||
dCompletion = CombinationsList[n].dTotalCompletionIndex * dCoeffCompletion
|
dCompletion = CombinationsList[n].dTotalCompletionIndex * dCoeffCompletion
|
||||||
dTime = dIndexWeightTimeToMachine * dCoeffTime
|
dTime = dIndexWeightTimeToMachine * dCoeffTime
|
||||||
|
dFeatureRotationIndex = CombinationsList[n].dFeatureRotationIndex
|
||||||
|
|
||||||
CombinationsList[n].dTotalRating = dQuality + dCompletion + dTime -- TODO da verificare se meglio sommare o moltiplicare gli indici
|
-- TODO da verificare se meglio sommare o moltiplicare gli indici
|
||||||
|
CombinationsList[n].dTotalRating = dQuality + dCompletion + dTime + dFeatureRotationIndex
|
||||||
else
|
else
|
||||||
CombinationsList[n].dTotalRating = 0
|
CombinationsList[n].dTotalRating = 0
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ end
|
|||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
function LeadInOutLib.GetToolAddLength( dToolDiameter, dDepthToMachine)
|
local function GetToolAddLength( dToolDiameter, dDepthToMachine)
|
||||||
local dCheckDepth = min( dToolDiameter / 2, dDepthToMachine)
|
local dCheckDepth = min( dToolDiameter / 2, dDepthToMachine)
|
||||||
local dToolAddLength = sqrt( dCheckDepth * dToolDiameter - dCheckDepth * dCheckDepth)
|
local dToolAddLength = sqrt( dCheckDepth * dToolDiameter - dCheckDepth * dCheckDepth)
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ function LeadInOutLib.CalculateLeadInOut( sLeadInOutType, Parameters, OptionalPa
|
|||||||
local bIsEndClosed = not Edge.bIsEndOpen
|
local bIsEndClosed = not Edge.bIsEndOpen
|
||||||
|
|
||||||
-- accorciamento per lati chiusi
|
-- accorciamento per lati chiusi
|
||||||
LeadInOut.dToolAddLength = LeadInOutLib.GetToolAddLength( Tool.dDiameter, dDepthToMachine)
|
LeadInOut.dToolAddLength = GetToolAddLength( Tool.dDiameter, dDepthToMachine)
|
||||||
LeadInOut.dExtraAddLengthStart, LeadInOut.dExtraAddLengthEnd = GetExtraAddLengthInclinedSides( Face, Edge)
|
LeadInOut.dExtraAddLengthStart, LeadInOut.dExtraAddLengthEnd = GetExtraAddLengthInclinedSides( Face, Edge)
|
||||||
-- allungamento per faccia singola (aperta in tutte le direzioni)
|
-- allungamento per faccia singola (aperta in tutte le direzioni)
|
||||||
LeadInOut.dAddedLengthOpenFace = BeamData.CUT_EXTRA
|
LeadInOut.dAddedLengthOpenFace = BeamData.CUT_EXTRA
|
||||||
@@ -215,50 +215,6 @@ function LeadInOutLib.CalculateLeadInOut( sLeadInOutType, Parameters, OptionalPa
|
|||||||
-- punti dell'attacco
|
-- punti dell'attacco
|
||||||
LeadIn.ptPoint = Point3d( ptStartAtDepth - Edge.vtEdge * dLeadInLength)
|
LeadIn.ptPoint = Point3d( ptStartAtDepth - Edge.vtEdge * dLeadInLength)
|
||||||
LeadOut.ptPoint = Point3d( ptEndAtDepth + Edge.vtEdge * dLeadOutLength)
|
LeadOut.ptPoint = Point3d( ptEndAtDepth + Edge.vtEdge * dLeadOutLength)
|
||||||
|
|
||||||
elseif sLeadInOutType == 'SpecialTangent' then
|
|
||||||
|
|
||||||
-- uscita con componente aggiuntiva perpendicolare
|
|
||||||
LeadOut.nType = MCH_MILL_LO.PERP_TG
|
|
||||||
local dStartEndOffset = 10
|
|
||||||
local ptEndAtDepthWithOffset = ptEndAtDepth + Edge.vtN * dStartEndOffset
|
|
||||||
local ptEndBladeCenterWithOffset = ptEndBladeCenter + Edge.vtN * dStartEndOffset
|
|
||||||
|
|
||||||
-- calcolo distanza per uscire dal box con questa lama nella direzione tangenziale
|
|
||||||
local dLeadInLength = CalculateLeadInOutLength( ptStartBladeCenter, Face.vtN, b3BoxPartExpanded, -Edge.vtEdge, Tool)
|
|
||||||
local dLeadOutLength = -CalculateLeadInOutLength( ptEndBladeCenterWithOffset, Face.vtN, b3BoxPartExpanded, -Edge.vtEdge, Tool)
|
|
||||||
|
|
||||||
-- componenti dell'attacco
|
|
||||||
LeadIn.dPerpDistance = 0
|
|
||||||
LeadIn.dTangentDistance = dLeadInLength
|
|
||||||
LeadOut.dPerpDistance = dStartEndOffset
|
|
||||||
LeadOut.dTangentDistance = dLeadOutLength
|
|
||||||
|
|
||||||
-- punti dell'attacco
|
|
||||||
LeadIn.ptPoint = Point3d( ptStartAtDepth - Edge.vtEdge * dLeadInLength)
|
|
||||||
LeadOut.ptPoint = Point3d( ptEndAtDepthWithOffset + Edge.vtEdge * dLeadOutLength)
|
|
||||||
|
|
||||||
elseif sLeadInOutType == 'SpecialTangentInverted' then
|
|
||||||
|
|
||||||
-- ingresso con componente aggiuntiva perpendicolare
|
|
||||||
LeadIn.nType = MCH_MILL_LI.TG_PERP
|
|
||||||
local dStartEndOffset = 10
|
|
||||||
local ptStartAtDepthWithOffset = ptStartAtDepth + Edge.vtN * dStartEndOffset
|
|
||||||
local ptStartBladeCenterWithOffset = ptStartBladeCenter + Edge.vtN * dStartEndOffset
|
|
||||||
|
|
||||||
-- calcolo distanza per uscire dal box con questa lama nella direzione tangenziale
|
|
||||||
local dLeadInLength = -CalculateLeadInOutLength( ptStartBladeCenterWithOffset, Face.vtN, b3BoxPartExpanded, Edge.vtEdge, Tool)
|
|
||||||
local dLeadOutLength = CalculateLeadInOutLength( ptEndBladeCenter, Face.vtN, b3BoxPartExpanded, Edge.vtEdge, Tool)
|
|
||||||
|
|
||||||
-- componenti dell'attacco
|
|
||||||
LeadIn.dPerpDistance = dStartEndOffset
|
|
||||||
LeadIn.dTangentDistance = dLeadInLength
|
|
||||||
LeadOut.dPerpDistance = 0
|
|
||||||
LeadOut.dTangentDistance = dLeadOutLength
|
|
||||||
|
|
||||||
-- punti dell'attacco
|
|
||||||
LeadIn.ptPoint = Point3d( ptStartAtDepthWithOffset - Edge.vtEdge * dLeadInLength)
|
|
||||||
LeadOut.ptPoint = Point3d( ptEndAtDepth + Edge.vtEdge * dLeadOutLength)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- lunghezza totale attacco
|
-- lunghezza totale attacco
|
||||||
@@ -277,8 +233,6 @@ function LeadInOutLib.InvertLeadInOut( LeadIn, LeadOut)
|
|||||||
|
|
||||||
local dOriginalStartAddLength = LeadIn.dStartAddLength
|
local dOriginalStartAddLength = LeadIn.dStartAddLength
|
||||||
local dOriginalEndAddLength = LeadOut.dEndAddLength
|
local dOriginalEndAddLength = LeadOut.dEndAddLength
|
||||||
local nOriginalLeadInType = LeadIn.nType
|
|
||||||
local nOriginalLeadOutType = LeadOut.nType
|
|
||||||
|
|
||||||
LeadIn, LeadOut = LeadOut, LeadIn
|
LeadIn, LeadOut = LeadOut, LeadIn
|
||||||
|
|
||||||
@@ -286,12 +240,6 @@ function LeadInOutLib.InvertLeadInOut( LeadIn, LeadOut)
|
|||||||
LeadOut.dEndAddLength = dOriginalStartAddLength
|
LeadOut.dEndAddLength = dOriginalStartAddLength
|
||||||
LeadIn.dEndAddLength = nil
|
LeadIn.dEndAddLength = nil
|
||||||
LeadOut.dStartAddLength = nil
|
LeadOut.dStartAddLength = nil
|
||||||
if nOriginalLeadInType == MCH_MILL_LI.TG_PERP then
|
|
||||||
LeadOut.nType = MCH_MILL_LO.PERP_TG
|
|
||||||
end
|
|
||||||
if nOriginalLeadOutType == MCH_MILL_LO.PERP_TG then
|
|
||||||
LeadIn.nType = MCH_MILL_LI.TG_PERP
|
|
||||||
end
|
|
||||||
|
|
||||||
return LeadIn, LeadOut
|
return LeadIn, LeadOut
|
||||||
end
|
end
|
||||||
|
|||||||
+17
-73
@@ -96,6 +96,16 @@ function MachiningLib.CanExtendAfterTail( sCanDamageNextPiece, Part)
|
|||||||
return bCanExtendAfterTail
|
return bCanExtendAfterTail
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
function MachiningLib.IsFeatureHinderingClamping( Proc, Part)
|
||||||
|
local bFeatureHindersClamping
|
||||||
|
|
||||||
|
local dFeatureMaxNotClampableLengthHead, dFeatureMaxNotClampableLengthTail = FeatureLib.GetFeatureMaxNotClampableLengths( Proc, Part)
|
||||||
|
bFeatureHindersClamping = FeatureLib.IsMachiningLong( max( dFeatureMaxNotClampableLengthHead, dFeatureMaxNotClampableLengthTail), Part, { dMaxSegmentLength = BeamData.LONGCUT_ENDLEN})
|
||||||
|
|
||||||
|
return bFeatureHindersClamping
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
function MachiningLib.GetMachiningSteps( bIsSlot, dMachiningDepth, dStep)
|
function MachiningLib.GetMachiningSteps( bIsSlot, dMachiningDepth, dStep)
|
||||||
local MachiningSteps = {}
|
local MachiningSteps = {}
|
||||||
@@ -191,35 +201,16 @@ function MachiningLib.GetSplitMachinings( Machinings, SplittingPoints, Part)
|
|||||||
Machinings[nCurrentMachiningIndex].LeadIn.dStartAddLength = dStartAddLength
|
Machinings[nCurrentMachiningIndex].LeadIn.dStartAddLength = dStartAddLength
|
||||||
Machinings[nCurrentMachiningIndex].LeadOut.dEndAddLength = dEndAddLength
|
Machinings[nCurrentMachiningIndex].LeadOut.dEndAddLength = dEndAddLength
|
||||||
end
|
end
|
||||||
-- TODO qui funzione per SCC, da macchina!!! Non qua dentro
|
|
||||||
if not bIsLastSegment then
|
if not bIsLastSegment then
|
||||||
Machinings[nCurrentMachiningIndex].sStage = ''
|
Machinings[nCurrentMachiningIndex].sStage = ''
|
||||||
if abs( Machinings[nCurrentMachiningIndex].vtHead:getX()) > GEO.EPS_SMALL then
|
|
||||||
if Machinings[nCurrentMachiningIndex].vtToolDirection:getY() > GEO.EPS_SMALL then
|
|
||||||
Machinings[nCurrentMachiningIndex].nSCC = MCH_SCC.ADIR_YP
|
|
||||||
else
|
|
||||||
Machinings[nCurrentMachiningIndex].nSCC = MCH_SCC.ADIR_YM
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Machinings[nCurrentMachiningIndex].nSCC = MCH_SCC.ADIR_XP
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
Machinings[nCurrentMachiningIndex].sStage = sOriginalStage
|
Machinings[nCurrentMachiningIndex].sStage = sOriginalStage
|
||||||
if abs( Machinings[nCurrentMachiningIndex].vtHead:getX()) > GEO.EPS_SMALL then
|
|
||||||
if Machinings[nCurrentMachiningIndex].vtToolDirection:getY() > GEO.EPS_SMALL then
|
|
||||||
Machinings[nCurrentMachiningIndex].nSCC = MCH_SCC.ADIR_YP
|
|
||||||
else
|
|
||||||
Machinings[nCurrentMachiningIndex].nSCC = MCH_SCC.ADIR_YM
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Machinings[nCurrentMachiningIndex].nSCC = MCH_SCC.ADIR_XM
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
Machinings[nCurrentMachiningIndex].nFeatureSegment = j
|
Machinings[nCurrentMachiningIndex].nFeatureSegment = j
|
||||||
Machinings[nCurrentMachiningIndex].dLengthToMachine = Machinings[nCurrentMachiningIndex].dEdgeLength + Machinings[nCurrentMachiningIndex].LeadIn.dStartAddLength + Machinings[nCurrentMachiningIndex].LeadOut.dEndAddLength
|
Machinings[nCurrentMachiningIndex].dLengthToMachine = Machinings[nCurrentMachiningIndex].dEdgeLength + Machinings[nCurrentMachiningIndex].LeadIn.dStartAddLength + Machinings[nCurrentMachiningIndex].LeadOut.dEndAddLength
|
||||||
Machinings[nCurrentMachiningIndex].dTimeToMachine = MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machinings[nCurrentMachiningIndex], Part)
|
Machinings[nCurrentMachiningIndex].dTimeToMachine = MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machinings[nCurrentMachiningIndex], Part)
|
||||||
Machinings[nCurrentMachiningIndex].bIsFirstSegment = ( j == 1)
|
Machinings[nCurrentMachiningIndex].bIsFirstSegment = ( j == 1)
|
||||||
Machinings[nCurrentMachiningIndex].bIsLastSegment = bIsLastSegment
|
Machinings[nCurrentMachiningIndex].bIsLastSegment = ( j == nParts)
|
||||||
Machinings[nCurrentMachiningIndex].bIsMachiningSplitted = true
|
Machinings[nCurrentMachiningIndex].bIsMachiningSplitted = true
|
||||||
end
|
end
|
||||||
-- anche le lavorazioni non splittate necessitano del segmento assegnato
|
-- anche le lavorazioni non splittate necessitano del segmento assegnato
|
||||||
@@ -423,53 +414,6 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se attacco tangenziale standard non possibile si prova l'attacco tangenziale speciale tutto da un lato
|
|
||||||
if not LeadInOut.Tangent then
|
|
||||||
-- prima si prova l'invertito (il più frequente)
|
|
||||||
TangentLeadInOut = LeadInOutLib.CalculateLeadInOut( 'SpecialTangentInverted', Parameters, LeadInOutOptionalParameters)
|
|
||||||
-- check extracorsa nei punti di attacco
|
|
||||||
PointsOnToolTipCenter = {
|
|
||||||
PreSimulationLib.GetPointOnToolTipCenter( TangentLeadInOut.LeadIn.ptPoint, vtHead, Face.vtN, Edge.vtN, Tool),
|
|
||||||
PreSimulationLib.GetPointOnToolTipCenter( TangentLeadInOut.LeadOut.ptPoint, vtHead, Face.vtN, Edge.vtN, Tool)
|
|
||||||
}
|
|
||||||
bOutOfStrokeTangent = PreSimulationLib.CheckOutOfStrokeFromPoints( PointsOnToolTipCenter, vtHead, nSCC, Tool)
|
|
||||||
-- attacco tangenziale non in extracorsa: si verifica se è in collisione
|
|
||||||
if not bOutOfStrokeTangent then
|
|
||||||
CheckCollisionOptionalParameters.PointsToCheck = {}
|
|
||||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadIn.ptPoint)
|
|
||||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadOut.ptPoint)
|
|
||||||
local bCollisionFoundTangent, bMoveAfterSplitTangent = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
|
|
||||||
-- attacco tangenziale possibile
|
|
||||||
if not bCollisionFoundTangent then
|
|
||||||
LeadInOut.Tangent = TangentLeadInOut
|
|
||||||
LeadInOut.Tangent.bMoveAfterSplit = bMoveAfterSplitTangent
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if not LeadInOut.Tangent then
|
|
||||||
-- se speciale invertito non applicabile si prova lo speciale non invertito
|
|
||||||
TangentLeadInOut = LeadInOutLib.CalculateLeadInOut( 'SpecialTangent', Parameters, LeadInOutOptionalParameters)
|
|
||||||
-- check extracorsa nei punti di attacco
|
|
||||||
PointsOnToolTipCenter = {
|
|
||||||
PreSimulationLib.GetPointOnToolTipCenter( TangentLeadInOut.LeadIn.ptPoint, vtHead, Face.vtN, Edge.vtN, Tool),
|
|
||||||
PreSimulationLib.GetPointOnToolTipCenter( TangentLeadInOut.LeadOut.ptPoint, vtHead, Face.vtN, Edge.vtN, Tool)
|
|
||||||
}
|
|
||||||
bOutOfStrokeTangent = PreSimulationLib.CheckOutOfStrokeFromPoints( PointsOnToolTipCenter, vtHead, nSCC, Tool)
|
|
||||||
-- attacco tangenziale non in extracorsa: si verifica se è in collisione
|
|
||||||
if not bOutOfStrokeTangent then
|
|
||||||
CheckCollisionOptionalParameters.PointsToCheck = {}
|
|
||||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadIn.ptPoint)
|
|
||||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadOut.ptPoint)
|
|
||||||
local bCollisionFoundTangent, bMoveAfterSplitTangent = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
|
|
||||||
-- attacco tangenziale possibile
|
|
||||||
if not bCollisionFoundTangent then
|
|
||||||
LeadInOut.Tangent = TangentLeadInOut
|
|
||||||
LeadInOut.Tangent.bMoveAfterSplit = bMoveAfterSplitTangent
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- se disponibili più attacchi si sceglie il più corto, altrimenti quello possibile
|
-- se disponibili più attacchi si sceglie il più corto, altrimenti quello possibile
|
||||||
if LeadInOut.Perpendicular and LeadInOut.Tangent then
|
if LeadInOut.Perpendicular and LeadInOut.Tangent then
|
||||||
if LeadInOut.Perpendicular.dTotalLength > LeadInOut.Tangent.dTotalLength + 10 then
|
if LeadInOut.Perpendicular.dTotalLength > LeadInOut.Tangent.dTotalLength + 10 then
|
||||||
@@ -1662,16 +1606,12 @@ 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
|
||||||
sOpenEdges = sOpenEdges .. EgtNumToString( ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].id) .. ','
|
EgtCurveCompoSetTempProp( idFaceContour, ProcTm.Faces[Machining.Geometry[1][2] + 1].Edges[i].id, 1)
|
||||||
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)
|
||||||
@@ -1682,7 +1622,11 @@ 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)
|
||||||
EgtRemoveInfo( idFaceContour, 'OPEN')
|
-- si settano tutti i lati chiusi per la curva offsettata
|
||||||
|
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)
|
||||||
|
|||||||
@@ -301,8 +301,6 @@ 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)
|
||||||
|
|
||||||
@@ -352,23 +350,17 @@ 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
|
||||||
@@ -411,7 +403,6 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
|
|||||||
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
|
||||||
local bCheckFlange = OptionalParameters.bCheckFlange
|
|
||||||
|
|
||||||
-- se normale faccia non parallela a direzione testa c'è qualcosa che non va
|
-- se normale faccia non parallela a direzione testa c'è qualcosa che non va
|
||||||
if not AreSameOrOppositeVectorApprox( vtNFace, vtHead) then
|
if not AreSameOrOppositeVectorApprox( vtNFace, vtHead) then
|
||||||
@@ -435,11 +426,11 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
|
|||||||
|
|
||||||
-- se lama con flangia si aggiunge quest'ultima ai solidi di collisione, ipotizzandola grande fino al dMaxDepth + sicurezza
|
-- se lama con flangia si aggiunge quest'ultima ai solidi di collisione, ipotizzandola grande fino al dMaxDepth + sicurezza
|
||||||
local idAddedCollisionSurfTm
|
local idAddedCollisionSurfTm
|
||||||
if bCheckFlange and Tool.sType == 'SAW_FLAT' then
|
if 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 dFlangeRadius = Tool.ToolHolder.dDiameter / 2
|
local dExtraSafety = 2 -- valore empirico che serve nei casi molto inclinati, ci potrebbero essere casi in cui va aumentato
|
||||||
local idFlangeCurve = EgtCircle( Part.idTempGroup, ORIG(), dFlangeRadius, GDB_RT.GLOB)
|
local idFlangeCurve = EgtCircle( Part.idTempGroup, ORIG(), dExtraSafety + Tool.dDiameter / 2 - Tool.dMaxDepth, 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
|
||||||
@@ -451,7 +442,6 @@ 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
|
||||||
@@ -542,10 +532,7 @@ function PreSimulationLib.CheckCollision( Parameters, OptionalParameters)
|
|||||||
local sR1 = AxesNames[4]
|
local sR1 = AxesNames[4]
|
||||||
|
|
||||||
-- ultimo asse lineare prima dei rotativi (solitamente Z) si controlla sempre
|
-- ultimo asse lineare prima dei rotativi (solitamente Z) si controlla sempre
|
||||||
-- qui si controlla anche la collisione con flangia lama, se necessario
|
|
||||||
OptionalParametersCheckCollisionWithAxis.bCheckFlange = true
|
|
||||||
bCollisionFound, bMoveAfterSplitL3 = CheckCollisionWithAxis( sL3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
bCollisionFound, bMoveAfterSplitL3 = CheckCollisionWithAxis( sL3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
||||||
OptionalParametersCheckCollisionWithAxis.bCheckFlange = false
|
|
||||||
|
|
||||||
if sR3 and not bCollisionFound then
|
if sR3 and not bCollisionFound then
|
||||||
bCollisionFound, bMoveAfterSplitR3 = CheckCollisionWithAxis( sR3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
bCollisionFound, bMoveAfterSplitR3 = CheckCollisionWithAxis( sR3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
||||||
|
|||||||
@@ -321,6 +321,4 @@
|
|||||||
1000318=Use a mill to finish the surface if split with chain saw
|
1000318=Use a mill to finish the surface if split with chain saw
|
||||||
1000319=Allow multiple short strips
|
1000319=Allow multiple short strips
|
||||||
1000320=Allow multiple short strips
|
1000320=Allow multiple short strips
|
||||||
1000321=Length limit to drop the waste
|
|
||||||
1000322=If Cutting Strategy is set on AUTO, up to this length the software drop the waste, otherwise it'll keep attached
|
|
||||||
// ----- End -----
|
// ----- End -----
|
||||||
|
|||||||
@@ -321,6 +321,4 @@
|
|||||||
1000318=Utilizza una fresa per rifinire la superficie se tagliata con la sega a catena
|
1000318=Utilizza una fresa per rifinire la superficie se tagliata con la sega a catena
|
||||||
1000319=Permettere codoli multipli
|
1000319=Permettere codoli multipli
|
||||||
1000320=Permettere codoli multipli
|
1000320=Permettere codoli multipli
|
||||||
1000321=Lunghezza limite fino alla quale lo scarto viene staccato
|
|
||||||
1000322=Se la strategia di taglio è impostata su AUTO, fino a questa lunghezza il software stacca gli scarti, altrimenti li mantiene attaccati
|
|
||||||
// ----- End -----
|
// ----- End -----
|
||||||
|
|||||||
@@ -321,6 +321,4 @@
|
|||||||
1000318=Gebruik een frees om het oppervlak na te bewerken als dit met de kettingzaag is gespleten
|
1000318=Gebruik een frees om het oppervlak na te bewerken als dit met de kettingzaag is gespleten
|
||||||
1000319=Sta meerdere korte verbindingsstrips toe
|
1000319=Sta meerdere korte verbindingsstrips toe
|
||||||
1000320=Sta meerdere korte verbindingsstrips toe
|
1000320=Sta meerdere korte verbindingsstrips toe
|
||||||
1000321=Maximale lengte voor het uitwerpen van het reststuk
|
|
||||||
1000322=Als de snijstrategie op AUTO staat, wordt het reststuk tot deze maximale lengte automatisch uitgeworpen; bij grotere lengtes blijft het reststuk aan het werkstuk bevestigd.
|
|
||||||
// ----- End -----
|
// ----- End -----
|
||||||
+5
-107
@@ -538,102 +538,6 @@ local function CommitBestMove( BestMove)
|
|||||||
Job.bNested = true
|
Job.bNested = true
|
||||||
end
|
end
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------------------
|
|
||||||
-- Dump diagnostico Input/Output
|
|
||||||
function RawInventory:DumpNestingData()
|
|
||||||
EgtOutLog("\n##########################################################################################")
|
|
||||||
EgtOutLog("### EGALWARE NESTING - DIAGNOSTIC DUMP ###")
|
|
||||||
EgtOutLog("##########################################################################################\n")
|
|
||||||
|
|
||||||
-- 1. AMBIENTE & CONFIGURAZIONE
|
|
||||||
EgtOutLog("--- [1. NESTING ENVIRONMENT & PARAMETERS] ---")
|
|
||||||
EgtOutLog(string.format("NEST.STARTOFFSET = %s", tostring(NEST.STARTOFFSET)))
|
|
||||||
EgtOutLog(string.format("NEST.MATERIAL = %s", tostring(NEST.MATERIAL)))
|
|
||||||
EgtOutLog(string.format("NEST.MACHINE = %s", tostring(NEST.MACHINE)))
|
|
||||||
for k, v in pairs(CONFIG) do
|
|
||||||
EgtOutLog(string.format("CONFIG.%s = %s", tostring(k), tostring(v)))
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 2. MATERIALE DISPONIBILE (STOCK)
|
|
||||||
EgtOutLog("\n--- [2. RAW STOCK INVENTORY INPUTS] ---")
|
|
||||||
for i = 1, #self.Stock do
|
|
||||||
EgtOutLog(string.format("Stock Index %d: Length = %.4f mm | Qty Available = %d", i, self.Stock[i].dLength, self.Stock[i].nCount))
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 3. COMMESSA PEZZI RICHIESTI (DEMANDED PARTS)
|
|
||||||
EgtOutLog("\n--- [3. DEMANDED PARTS (PART TABLE)] ---")
|
|
||||||
for id, count in pairs(PART) do
|
|
||||||
local sInitialPos = tostring(EgtGetInfo(id, 'INITIALPOSITION', 'i') or 0)
|
|
||||||
local sManualRot = tostring(EgtGetInfo(id, 'MANUALROT', 'i') or 0)
|
|
||||||
local sManualFlip = tostring(EgtGetInfo(id, 'MANUALFLIP', 'i') or 0)
|
|
||||||
EgtOutLog(string.format("Part ID: %5s | Demand Count: %d | CAD Base Length: %.4f mm | InitialPos: %s | ManualRot: %s | ManualFlip: %s",
|
|
||||||
tostring(id), count, EgtGetInfo(id, 'L', 'd') or 0, sInitialPos, sManualRot, sManualFlip))
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 4. DATABASE GEOMETRICO COMPLETO (PART TEMPLATES)
|
|
||||||
EgtOutLog("\n--- [4. DETAILED GEOMETRIC TEMPLATES (ALL READABLE STATES)] ---")
|
|
||||||
for id, Template in pairs(PartTemplates) do
|
|
||||||
if type(Template) == "table" and Template.dLength then
|
|
||||||
EgtOutLog(string.format("\nPART ID: %s | Math Length: %.4f | MaxGlobalTailRecess: %.4f", tostring(id), Template.dLength, Template.dMaxGlobalTailRecess))
|
|
||||||
for sState, State in pairs(Template.States) do
|
|
||||||
EgtOutLog(string.format(" -> State [%s]:", sState))
|
|
||||||
-- Stringhe Grezze lette dal CAD
|
|
||||||
EgtOutLog(string.format(" Raw ALT_H String: %s", tostring(EgtGetInfo(id, 'ALT'..sState..'_H'))))
|
|
||||||
EgtOutLog(string.format(" Raw ALT_T String: %s", tostring(EgtGetInfo(id, 'ALT'..sState..'_T'))))
|
|
||||||
-- Valori matematici interpretati dal Nesting
|
|
||||||
local hOX = table.concat(State.Head.OffsetX, ", ")
|
|
||||||
local tOX = table.concat(State.Tail.OffsetX, ", ")
|
|
||||||
EgtOutLog(string.format(" HEAD Math -> OffsetX: [%s] | vtN: [X:%.6f, Y:%.6f, Z:%.6f] | vtNXabs: %.6f | dMaxHeadRecess: %.4f",
|
|
||||||
hOX, State.Head.vtN:getX(), State.Head.vtN:getY(), State.Head.vtN:getZ(), State.Head.vtNXabs, State.dMaxHeadRecess))
|
|
||||||
EgtOutLog(string.format(" TAIL Math -> OffsetX: [%s] | vtN: [X:%.6f, Y:%.6f, Z:%.6f] | vtNXabs: %.6f | dMaxTailRecess: %.4f",
|
|
||||||
tOX, State.Tail.vtN:getX(), State.Tail.vtN:getY(), State.Tail.vtN:getZ(), State.Tail.vtNXabs, State.dMaxTailRecess))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- 5. ANALISI DETTAGLIATA DELL'OUTPUT FINALE SULLE BARRE (ACTIVE BEAMS)
|
|
||||||
EgtOutLog("\n--- [5. FINAL NESTING SOLUTIONS AND SPATIAL COORDS] ---")
|
|
||||||
for i = 1, #self.ActiveBeams do
|
|
||||||
local Beam = self.ActiveBeams[i]
|
|
||||||
local dStartOffset = NEST.STARTOFFSET or 0
|
|
||||||
EgtOutLog(string.format("\n=========================================================================================="))
|
|
||||||
EgtOutLog(string.format("ACTIVE BEAM [%d] -> Total Length: %.4f mm | Nesting Residual Space: %.4f mm",
|
|
||||||
i, Beam.dTotalLength, Beam.dResidualLength))
|
|
||||||
EgtOutLog(string.format("=========================================================================================="))
|
|
||||||
|
|
||||||
-- Ordine di Nesting (dall'ultimo appoggio a destra fino a sinistra)
|
|
||||||
EgtOutLog(" A. Array Storage Order (Nesting Logic - from Right to Left):")
|
|
||||||
for j = 1, #Beam.NestedParts do
|
|
||||||
local Part = Beam.NestedParts[j]
|
|
||||||
EgtOutLog(string.format(" [%d] ID: %5s | State: %12s | Length: %9.4f | Math PosX: %9.4f | Overlap: %9.4f | SharedCut: %s",
|
|
||||||
j, tostring(Part.id), tostring(Part.sState), Part.dLength, Part.dPosX, Part.dSafeOverlap, tostring(Part.bSharedCut)))
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Ordine di posizionamento sul Gruppo Macchina (da Sinistra X=0 a Destra)
|
|
||||||
EgtOutLog(" B. CAD Positioning Order (Output Macro - from Left X=0 to Right):")
|
|
||||||
local nIndex = 1
|
|
||||||
for j = #Beam.NestedParts, 1, -1 do
|
|
||||||
local Part = Beam.NestedParts[j]
|
|
||||||
local dPosX = Part.dPosX - Beam.dResidualLength + dStartOffset
|
|
||||||
|
|
||||||
-- Distanza dal pezzo precedente a sinistra (se esiste)
|
|
||||||
local sPrevDist = "N/A (First Part on Left)"
|
|
||||||
if j < #Beam.NestedParts then
|
|
||||||
local PrevPart = Beam.NestedParts[j+1]
|
|
||||||
local dPrevPosX = PrevPart.dPosX - Beam.dResidualLength + dStartOffset
|
|
||||||
sPrevDist = string.format("%.4f mm", dPosX - dPrevPosX)
|
|
||||||
end
|
|
||||||
|
|
||||||
EgtOutLog(string.format(" PART%d -> ID: %5s | Chosen State: %12s | CAD Target PosX: %9.4f mm | Gap from left: %s",
|
|
||||||
nIndex, tostring(Part.id), tostring(Part.sState), dPosX, sPrevDist))
|
|
||||||
nIndex = nIndex + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
EgtOutLog("\n##########################################################################################")
|
|
||||||
EgtOutLog("### END OF DUMP ###")
|
|
||||||
EgtOutLog("##########################################################################################\n")
|
|
||||||
end
|
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------------
|
||||||
-- script principale
|
-- script principale
|
||||||
|
|
||||||
@@ -729,6 +633,7 @@ for i = 1, #RawInventory.ActiveBeams do
|
|||||||
|
|
||||||
for j = #Beam.NestedParts, 1, -1 do
|
for j = #Beam.NestedParts, 1, -1 do
|
||||||
local Part = Beam.NestedParts[j]
|
local Part = Beam.NestedParts[j]
|
||||||
|
local nInitialPosition = EgtGetInfo( Part.id, 'INITIALPOSITION', 'i')
|
||||||
|
|
||||||
-- spostamento verso la testa della barra
|
-- spostamento verso la testa della barra
|
||||||
local dPosX = Part.dPosX - Beam.dResidualLength + dStartOffset
|
local dPosX = Part.dPosX - Beam.dResidualLength + dStartOffset
|
||||||
@@ -742,8 +647,8 @@ for i = 1, #RawInventory.ActiveBeams do
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- eventuale rotazione
|
-- eventuale rotazione
|
||||||
local bIsRotationNeeded = EgtStartsWith( Part.sState, '0010')
|
if ( EgtStartsWith( Part.sState, '0010') and nInitialPosition == 1)
|
||||||
if bIsRotationNeeded then
|
or ( EgtStartsWith( Part.sState, '1000') and nInitialPosition == 3) then
|
||||||
local idSurfTmBoxDuplo = EgtGetFirstNameInGroup( idDuplo, "Box")
|
local idSurfTmBoxDuplo = EgtGetFirstNameInGroup( idDuplo, "Box")
|
||||||
local b3Duplo = EgtGetBBoxGlob( idSurfTmBoxDuplo, GDB_BB.STANDARD)
|
local b3Duplo = EgtGetBBoxGlob( idSurfTmBoxDuplo, GDB_BB.STANDARD)
|
||||||
EgtRotate( idDuplo, b3Duplo:getCenter(), X_AX(), 180, GDB_RT.GLOB)
|
EgtRotate( idDuplo, b3Duplo:getCenter(), X_AX(), 180, GDB_RT.GLOB)
|
||||||
@@ -751,9 +656,7 @@ for i = 1, #RawInventory.ActiveBeams do
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- eventuale inversione
|
-- eventuale inversione
|
||||||
-- TODO conta anche l'ordine rotazione-inversione?
|
if EgtEndsWith( Part.sState, 'INV') then
|
||||||
local bIsInversionNeeded = EgtEndsWith( Part.sState, 'INV')
|
|
||||||
if bIsInversionNeeded then
|
|
||||||
local idSurfTmBoxDuplo = EgtGetFirstNameInGroup( idDuplo, "Box")
|
local idSurfTmBoxDuplo = EgtGetFirstNameInGroup( idDuplo, "Box")
|
||||||
local b3Duplo = EgtGetBBoxGlob( idSurfTmBoxDuplo, GDB_BB.STANDARD)
|
local b3Duplo = EgtGetBBoxGlob( idSurfTmBoxDuplo, GDB_BB.STANDARD)
|
||||||
EgtRotate( idDuplo, b3Duplo:getCenter(), Z_AX(), 180, GDB_RT.GLOB)
|
EgtRotate( idDuplo, b3Duplo:getCenter(), Z_AX(), 180, GDB_RT.GLOB)
|
||||||
@@ -803,9 +706,4 @@ EgtResetCurrMachGroup()
|
|||||||
NEST.ERR = 0
|
NEST.ERR = 0
|
||||||
|
|
||||||
-- calcolo bontà soluzione
|
-- calcolo bontà soluzione
|
||||||
RawInventory:PrintDiagnosticReport()
|
RawInventory:PrintDiagnosticReport()
|
||||||
|
|
||||||
-- Dump diagnostico - solo per debug
|
|
||||||
if EgtGetDebugLevel() >= 3 then
|
|
||||||
RawInventory:DumpNestingData()
|
|
||||||
end
|
|
||||||
@@ -108,10 +108,6 @@
|
|||||||
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
||||||
},
|
},
|
||||||
{ "sName": "VGroove-2-Through",
|
|
||||||
"sImage": "ConfigStrategy\\VGroove-2-Through.png",
|
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
|
||||||
},
|
|
||||||
{ "sName": "Cut-1-Through",
|
{ "sName": "Cut-1-Through",
|
||||||
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
||||||
@@ -155,10 +151,6 @@
|
|||||||
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
||||||
},
|
},
|
||||||
{ "sName": "VGroove-2-Through",
|
|
||||||
"sImage": "ConfigStrategy\\VGroove-2-Through.png",
|
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
|
||||||
},
|
|
||||||
{ "sName": "Cut-1-Through",
|
{ "sName": "Cut-1-Through",
|
||||||
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
||||||
@@ -204,10 +196,6 @@
|
|||||||
{ "sName": "Rabbet-2-Through",
|
{ "sName": "Rabbet-2-Through",
|
||||||
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
||||||
},
|
|
||||||
{ "sName": "VGroove-2-Through",
|
|
||||||
"sImage": "ConfigStrategy\\VGroove-2-Through.png",
|
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -236,10 +224,6 @@
|
|||||||
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
||||||
},
|
},
|
||||||
{ "sName": "VGroove-2-Through",
|
|
||||||
"sImage": "ConfigStrategy\\VGroove-2-Through.png",
|
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
|
||||||
},
|
|
||||||
{ "sName": "Cut-1-Through",
|
{ "sName": "Cut-1-Through",
|
||||||
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
||||||
@@ -287,10 +271,6 @@
|
|||||||
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
||||||
},
|
},
|
||||||
{ "sName": "VGroove-2-Through",
|
|
||||||
"sImage": "ConfigStrategy\\VGroove-2-Through.png",
|
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
|
||||||
},
|
|
||||||
{ "sName": "Cut-1-Through",
|
{ "sName": "Cut-1-Through",
|
||||||
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
||||||
@@ -334,10 +314,6 @@
|
|||||||
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
||||||
},
|
},
|
||||||
{ "sName": "VGroove-2-Through",
|
|
||||||
"sImage": "ConfigStrategy\\VGroove-2-Through.png",
|
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
|
||||||
},
|
|
||||||
{ "sName": "Cut-1-Through",
|
{ "sName": "Cut-1-Through",
|
||||||
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
||||||
@@ -392,10 +368,6 @@
|
|||||||
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
||||||
},
|
},
|
||||||
{ "sName": "VGroove-2-Through",
|
|
||||||
"sImage": "ConfigStrategy\\VGroove-2-Through.png",
|
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
|
||||||
},
|
|
||||||
{ "sName": "Cut-1-Through",
|
{ "sName": "Cut-1-Through",
|
||||||
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
||||||
@@ -483,10 +455,6 @@
|
|||||||
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
||||||
},
|
},
|
||||||
{ "sName": "VGroove-2-Through",
|
|
||||||
"sImage": "ConfigStrategy\\VGroove-2-Through.png",
|
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
|
||||||
},
|
|
||||||
{ "sName": "Cut-1-Through",
|
{ "sName": "Cut-1-Through",
|
||||||
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
||||||
@@ -552,10 +520,6 @@
|
|||||||
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
||||||
},
|
},
|
||||||
{ "sName": "VGroove-2-Through",
|
|
||||||
"sImage": "ConfigStrategy\\VGroove-2-Through.png",
|
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
|
||||||
},
|
|
||||||
{ "sName": "Cut-1-Through",
|
{ "sName": "Cut-1-Through",
|
||||||
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
||||||
@@ -611,10 +575,6 @@
|
|||||||
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
"sImage": "ConfigStrategy\\Rabbet-2-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
||||||
},
|
},
|
||||||
{ "sName": "VGroove-2-Through",
|
|
||||||
"sImage": "ConfigStrategy\\VGroove-2-Through.png",
|
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" }, { "sStrategyId": "STR0010"} ]
|
|
||||||
},
|
|
||||||
{ "sName": "Cut-1-Through",
|
{ "sName": "Cut-1-Through",
|
||||||
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
"sImage": "ConfigStrategy\\Cut-1-Through.png",
|
||||||
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
"StrategyList" : [ { "sStrategyId": "STR0002" }, { "sStrategyId": "STR0005" } ]
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ function HEADCUT.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( 'SAWBLADE')
|
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( 'SAWBLADE')
|
||||||
|
|
||||||
-- se settato da saltare o coincide con inizio grezzo, non va fatto
|
-- se settato da saltare o coincide con inizio grezzo, non va fatto
|
||||||
local bSkipHeadCut = ( EgtGetInfo( Part.id, "SKIP_HEADCUT", 'i') or 0) == 1
|
--local bSkipHeadCut = ( EgtGetInfo( Part.id, "SKIP_HEADCUT", 'i') or 0) == 1
|
||||||
if bSkipHeadCut or ( abs( Proc.b3Box:getCenter():getX() - Part.b3Raw:getMax():getX()) < 10 * GEO.EPS_SMALL) then
|
if bSkipHeadCut or ( abs( Proc.b3Box:getCenter():getX() - Part.b3Raw:getMax():getX()) < 10 * GEO.EPS_SMALL) then
|
||||||
return true, Strategy.Result
|
return true, Strategy.Result
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ local function GetTenonMachiningResult( Proc, Result)
|
|||||||
else
|
else
|
||||||
TotalResult.dQuality = FeatureLib.GetStrategyQuality( 'FINE')
|
TotalResult.dQuality = FeatureLib.GetStrategyQuality( 'FINE')
|
||||||
end
|
end
|
||||||
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
|
TotalResult.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
|
||||||
TotalResult.dTimeToMachine = Result.Milling.dTimeToMachine + Result.Cutting.dTimeToMachine
|
TotalResult.dTimeToMachine = Result.Milling.dTimeToMachine + Result.Cutting.dTimeToMachine
|
||||||
TotalResult.sInfo = ''
|
TotalResult.sInfo = ''
|
||||||
-- lavorazione incompleta
|
-- lavorazione incompleta
|
||||||
@@ -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.dOverMatOnLength, -5, 5)
|
Strategy.Parameters.dOverMatOnLength = EgtClamp( Strategy.Parameters.dOverMatOnRadius, -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()
|
||||||
|
|||||||
@@ -596,7 +596,7 @@ function STR0002.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
return false, Strategy.Result
|
return false, Strategy.Result
|
||||||
end
|
end
|
||||||
-- se la lavorazione ostacola il pinzaggio, non posso farla, serve una lavorazioen che lasci il testimone
|
-- se la lavorazione ostacola il pinzaggio, non posso farla, serve una lavorazioen che lasci il testimone
|
||||||
if Proc.bFeatureHindersClamping then
|
if MachiningLib.IsFeatureHinderingClamping( Proc, Part) then
|
||||||
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. StrategyLib.Config.sStrategyId .. ' not applicable ( Feature hinders clamping)'
|
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. StrategyLib.Config.sStrategyId .. ' not applicable ( Feature hinders clamping)'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable( sErr)
|
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable( sErr)
|
||||||
|
|||||||
@@ -360,15 +360,10 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
-- non ha senso che STR0003 lama+catena sia applicabile se la lama non può lavorare, in quel caso deve essere scelta la STR0004 solo catena
|
-- non ha senso che STR0003 lama+catena sia applicabile se la lama non può lavorare, in quel caso deve essere scelta la STR0004 solo catena
|
||||||
else
|
else
|
||||||
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable()
|
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable()
|
||||||
|
Strategy.Parameters.bFinishWithChainSaw = false
|
||||||
end
|
end
|
||||||
|
|
||||||
return bAreAllMachiningsAdded, Strategy.Result
|
return bAreAllMachiningsAdded, Strategy.Result
|
||||||
else
|
|
||||||
-- non ha senso che STR0003 lama+catena sia applicabile se la lama non può lavorare, in quel caso deve essere scelta la STR0004 solo catena
|
|
||||||
if #Blade.Result.Sorted == 0 then
|
|
||||||
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable()
|
|
||||||
return false, Strategy.Result
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODO funzione separata
|
-- TODO funzione separata
|
||||||
@@ -411,8 +406,12 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
|
|
||||||
-- si lavora tutto il fondo
|
-- si lavora tutto il fondo
|
||||||
else
|
else
|
||||||
|
OptionalParameters.dMaxElev = Blade.Result.Bottom[1].dResidualDepth + BeamData.CUT_EXTRA
|
||||||
|
|
||||||
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, BottomEdge, OptionalParameters)
|
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, BottomEdge, OptionalParameters)
|
||||||
Chainsaw.AddResult( Mortising)
|
Chainsaw.AddResult( Mortising)
|
||||||
|
|
||||||
|
OptionalParameters.dMaxElev = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- ancora materiale residuo - se possibile si lavora dal lato
|
-- ancora materiale residuo - se possibile si lavora dal lato
|
||||||
@@ -453,12 +452,14 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if BottomEdge.bIsStartOpen then
|
if BottomEdge.bIsStartOpen then
|
||||||
|
OptionalParameters.dMaxElev = dBladeResidualDepth + BeamData.CUT_EXTRA
|
||||||
OptionalParameters.OppositeToolDirectionMode = 'Enabled'
|
OptionalParameters.OppositeToolDirectionMode = 'Enabled'
|
||||||
|
|
||||||
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters)
|
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters)
|
||||||
Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine)
|
Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine)
|
||||||
|
|
||||||
elseif BottomEdge.bIsEndOpen then
|
elseif BottomEdge.bIsEndOpen then
|
||||||
|
OptionalParameters.dMaxElev = dBladeResidualDepth + BeamData.CUT_EXTRA
|
||||||
OptionalParameters.OppositeToolDirectionMode = 'Enabled'
|
OptionalParameters.OppositeToolDirectionMode = 'Enabled'
|
||||||
|
|
||||||
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge2, OptionalParameters)
|
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge2, OptionalParameters)
|
||||||
@@ -474,8 +475,12 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
if Blade.Result.Bottom[1].dResidualDepth > 10 * GEO.EPS_SMALL then
|
if Blade.Result.Bottom[1].dResidualDepth > 10 * GEO.EPS_SMALL then
|
||||||
|
|
||||||
-- si lavora tutto il fondo
|
-- si lavora tutto il fondo
|
||||||
|
OptionalParameters.dMaxElev = Blade.Result.Bottom[1].dResidualDepth + BeamData.CUT_EXTRA
|
||||||
|
|
||||||
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, BottomEdge, OptionalParameters)
|
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, BottomEdge, OptionalParameters)
|
||||||
Chainsaw.AddResult( Mortising)
|
Chainsaw.AddResult( Mortising)
|
||||||
|
|
||||||
|
OptionalParameters.dMaxElev = nil
|
||||||
|
|
||||||
-- ancora materiale residuo - si lavorano i lati
|
-- ancora materiale residuo - si lavorano i lati
|
||||||
if Chainsaw.Result.Bottom[1].dResidualDepth > 10 * GEO.EPS_SMALL then
|
if Chainsaw.Result.Bottom[1].dResidualDepth > 10 * GEO.EPS_SMALL then
|
||||||
@@ -526,6 +531,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
else
|
else
|
||||||
|
|
||||||
OptionalParameters.dDepthToMachine = SideEdge1.dElevation + BeamData.CUT_EXTRA
|
OptionalParameters.dDepthToMachine = SideEdge1.dElevation + BeamData.CUT_EXTRA
|
||||||
|
OptionalParameters.dMaxElev = Blade.Result.Side[1].dResidualDepth + BeamData.CUT_EXTRA
|
||||||
OptionalParameters.OppositeToolDirectionMode = 'Enabled'
|
OptionalParameters.OppositeToolDirectionMode = 'Enabled'
|
||||||
|
|
||||||
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters)
|
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters)
|
||||||
@@ -538,12 +544,14 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
Chainsaw.Result.Side[1].bIsApplicable = false
|
Chainsaw.Result.Side[1].bIsApplicable = false
|
||||||
|
|
||||||
OptionalParameters.dDepthToMachine = SideEdge1.dElevation / 2 + BeamData.CUT_EXTRA_MIN
|
OptionalParameters.dDepthToMachine = SideEdge1.dElevation / 2 + BeamData.CUT_EXTRA_MIN
|
||||||
|
OptionalParameters.dMaxElev = Blade.Result.Side[1].dResidualDepth + BeamData.CUT_EXTRA
|
||||||
|
|
||||||
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters)
|
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge1, OptionalParameters)
|
||||||
Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine)
|
Mortising.dAreaToMachine = Mortising.dDepthToMachine * ( Mortising.dEdgeLength - Chainsaw.Result.Bottom[1].dDepthToMachine)
|
||||||
Chainsaw.AddResult( Mortising)
|
Chainsaw.AddResult( Mortising)
|
||||||
|
|
||||||
OptionalParameters.dDepthToMachine = SideEdge2.dElevation / 2 + BeamData.CUT_EXTRA_MIN
|
OptionalParameters.dDepthToMachine = SideEdge2.dElevation / 2 + BeamData.CUT_EXTRA_MIN
|
||||||
|
OptionalParameters.dMaxElev = Blade.Result.Side[2].dResidualDepth + BeamData.CUT_EXTRA
|
||||||
|
|
||||||
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge2, OptionalParameters)
|
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, SideEdge2, OptionalParameters)
|
||||||
Mortising.dAreaToMachine = 0
|
Mortising.dAreaToMachine = 0
|
||||||
@@ -625,6 +633,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
-- si lavora tutto il lato
|
-- si lavora tutto il lato
|
||||||
else
|
else
|
||||||
OptionalParameters.dDepthToMachine = OppositeEdge1.dElevation + BeamData.CUT_EXTRA
|
OptionalParameters.dDepthToMachine = OppositeEdge1.dElevation + BeamData.CUT_EXTRA
|
||||||
|
OptionalParameters.dMaxElev = Blade.Result.Opposite[1].dResidualDepth + BeamData.CUT_EXTRA
|
||||||
|
|
||||||
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge1, OptionalParameters)
|
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge1, OptionalParameters)
|
||||||
Chainsaw.AddResult( Mortising)
|
Chainsaw.AddResult( Mortising)
|
||||||
@@ -634,11 +643,13 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
Chainsaw.Result.Opposite[1].bIsApplicable = false
|
Chainsaw.Result.Opposite[1].bIsApplicable = false
|
||||||
|
|
||||||
OptionalParameters.dDepthToMachine = OppositeEdge1.dElevation / 2 + BeamData.CUT_EXTRA_MIN
|
OptionalParameters.dDepthToMachine = OppositeEdge1.dElevation / 2 + BeamData.CUT_EXTRA_MIN
|
||||||
|
OptionalParameters.dMaxElev = Blade.Result.Opposite[1].dResidualDepth + BeamData.CUT_EXTRA
|
||||||
|
|
||||||
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge1, OptionalParameters)
|
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge1, OptionalParameters)
|
||||||
Chainsaw.AddResult( Mortising)
|
Chainsaw.AddResult( Mortising)
|
||||||
|
|
||||||
OptionalParameters.dDepthToMachine = OppositeEdge2.dElevation / 2 + BeamData.CUT_EXTRA_MIN
|
OptionalParameters.dDepthToMachine = OppositeEdge2.dElevation / 2 + BeamData.CUT_EXTRA_MIN
|
||||||
|
OptionalParameters.dMaxElev = Blade.Result.Opposite[2].dResidualDepth + BeamData.CUT_EXTRA
|
||||||
|
|
||||||
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge2, OptionalParameters)
|
Mortising = FaceByChainsaw.Make( Proc, Part, LongFace, OppositeEdge2, OptionalParameters)
|
||||||
Chainsaw.AddResult( Mortising)
|
Chainsaw.AddResult( Mortising)
|
||||||
|
|||||||
@@ -100,18 +100,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"sName": "dLengthLimitToDropWaste",
|
|
||||||
"sNameNge": "LEN_DROP_WASTE",
|
|
||||||
"sValue": "",
|
|
||||||
"sDescriptionShort": "Length limit to drop the waste",
|
|
||||||
"sDescriptionLong": "If Cutting Strategy is set on AUTO, up to this length the software drop the waste, otherwise it'll keep attached",
|
|
||||||
"idDescriptionShortMsg": 1000321,
|
|
||||||
"idDescriptionLongMsg": 1000322,
|
|
||||||
"sType": "d",
|
|
||||||
"sMessageId": " ",
|
|
||||||
"sMinUserLevel": "1"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"sName": "bDisableDicing",
|
"sName": "bDisableDicing",
|
||||||
"sNameNge": "DISABLE_DICING",
|
"sNameNge": "DISABLE_DICING",
|
||||||
|
|||||||
@@ -46,6 +46,20 @@ local function IsTwoFacesCommonEdgeTooLong( Proc, Part)
|
|||||||
return bIsTwoFacesCommonEdgeTooLong
|
return bIsTwoFacesCommonEdgeTooLong
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
-- si cerca di tenere la feature rivolta verso il fronte o sopra, cioè dal lato opposto la battuta
|
||||||
|
local function GetFeatureRotationIndex( Proc)
|
||||||
|
local nVoteIndex
|
||||||
|
|
||||||
|
if Proc.MainFaces.BottomFaces[1].vtN:getY() < 0 or Proc.MainFaces.BottomFaces[1].vtN:getZ() < 0 then
|
||||||
|
nVoteIndex = 2
|
||||||
|
else
|
||||||
|
nVoteIndex = 3
|
||||||
|
end
|
||||||
|
|
||||||
|
return nVoteIndex
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||||
-- carico parametri da default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti)
|
-- carico parametri da default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti)
|
||||||
@@ -100,15 +114,15 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
-- considerazioni necessarie a determinare se lavorare con codolo oppure no
|
-- considerazioni necessarie a determinare se lavorare con codolo oppure no
|
||||||
local bKeepWasteAttached = ( Strategy.Parameters.sCuttingStrategy == 'KEEP_WASTE_ATTACHED')
|
local bKeepWasteAttached = ( Strategy.Parameters.sCuttingStrategy == 'KEEP_WASTE_ATTACHED')
|
||||||
local bDropWaste = ( Strategy.Parameters.sCuttingStrategy == 'DROP_WASTE')
|
local bDropWaste = ( Strategy.Parameters.sCuttingStrategy == 'DROP_WASTE')
|
||||||
local dLengthLimitToDropWaste = Strategy.Parameters.dLengthLimitToDropWaste
|
|
||||||
|
local bFeatureHindersClamping = MachiningLib.IsFeatureHinderingClamping( Proc, Part)
|
||||||
|
|
||||||
local bIsFeatureLong = FeatureLib.IsMachiningLong( Proc.b3Box:getDimX(), Part, { dMaxSegmentLength = BeamData.LONGCUT_ENDLEN})
|
local bIsFeatureLong = FeatureLib.IsMachiningLong( Proc.b3Box:getDimX(), Part, { dMaxSegmentLength = BeamData.LONGCUT_ENDLEN})
|
||||||
local bIsTwoFacesCommonEdgeTooLong = ( ( Proc.Topology and ( Proc.Topology.sName == 'Rabbet-2-Through' or Proc.Topology.sName == 'Bevel-2-Blind')) and IsTwoFacesCommonEdgeTooLong( Proc, Part))
|
local bIsTwoFacesCommonEdgeTooLong = ( ( Proc.Topology and ( Proc.Topology.sName == 'Rabbet-2-Through' or Proc.Topology.sName == 'Bevel-2-Blind')) and IsTwoFacesCommonEdgeTooLong( Proc, Part))
|
||||||
|
|
||||||
-- lavorazione con codolo
|
-- lavorazione con codolo
|
||||||
if ( Proc.nFct > 2 and bIsFeatureLong)
|
if ( Proc.nFct > 2 and bIsFeatureLong)
|
||||||
or ( Proc.bFeatureHindersClamping and not bDropWaste)
|
or ( bFeatureHindersClamping and not bDropWaste)
|
||||||
or ( dLengthLimitToDropWaste and Proc.b3Box:getDimX() > dLengthLimitToDropWaste)
|
|
||||||
or bKeepWasteAttached then
|
or bKeepWasteAttached then
|
||||||
|
|
||||||
local BladeKeepWasteResult
|
local BladeKeepWasteResult
|
||||||
@@ -125,6 +139,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
dCompletionPercentage = BladeKeepWasteResult.dCompletionPercentage
|
dCompletionPercentage = BladeKeepWasteResult.dCompletionPercentage
|
||||||
dQuality = BladeKeepWasteResult.dQuality
|
dQuality = BladeKeepWasteResult.dQuality
|
||||||
Strategy.Result.sInfo = BladeKeepWasteResult.sInfo or ''
|
Strategy.Result.sInfo = BladeKeepWasteResult.sInfo or ''
|
||||||
|
Strategy.Result.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- lavorazione a cubetti / taglio singolo
|
-- lavorazione a cubetti / taglio singolo
|
||||||
@@ -162,6 +177,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
dMRRBlade = BladeKeepWasteResult.dMRR
|
dMRRBlade = BladeKeepWasteResult.dMRR
|
||||||
dCompletionPercentage = BladeKeepWasteResult.dCompletionPercentage
|
dCompletionPercentage = BladeKeepWasteResult.dCompletionPercentage
|
||||||
dQuality = BladeKeepWasteResult.dQuality
|
dQuality = BladeKeepWasteResult.dQuality
|
||||||
|
Strategy.Result.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- lavorazione eventuale terza faccia tipo RidgeLap
|
-- lavorazione eventuale terza faccia tipo RidgeLap
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ local function GetTenonMachiningResult( Proc, Result)
|
|||||||
TotalResult.dCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
|
TotalResult.dCompletionIndex = FeatureLib.GetFeatureCompletionIndex( 100)
|
||||||
TotalResult.dMRR = ( Result.Milling.dMRR + Result.Cutting.dMRR) / 2
|
TotalResult.dMRR = ( Result.Milling.dMRR + Result.Cutting.dMRR) / 2
|
||||||
TotalResult.dQuality = FeatureLib.GetStrategyQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'STD', 'FINE'))
|
TotalResult.dQuality = FeatureLib.GetStrategyQuality( EgtIf( Strategy.Machining.bCuttingWithMill, 'STD', 'FINE'))
|
||||||
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
|
TotalResult.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
|
||||||
TotalResult.dTimeToMachine = Result.Milling.dTimeToMachine + Result.Cutting.dTimeToMachine
|
TotalResult.dTimeToMachine = Result.Milling.dTimeToMachine + Result.Cutting.dTimeToMachine
|
||||||
TotalResult.sInfo = ''
|
TotalResult.sInfo = ''
|
||||||
-- lavorazione incompleta
|
-- lavorazione incompleta
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ function GetMortiseMachiningResult( Proc, Result)
|
|||||||
sQuality = 'STD'
|
sQuality = 'STD'
|
||||||
end
|
end
|
||||||
TotalResult.dQuality = FeatureLib.GetStrategyQuality( sQuality)
|
TotalResult.dQuality = FeatureLib.GetStrategyQuality( sQuality)
|
||||||
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
|
TotalResult.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
|
||||||
TotalResult.sInfo = ''
|
TotalResult.sInfo = ''
|
||||||
-- lavorazione mortasa completa
|
-- lavorazione mortasa completa
|
||||||
elseif Strategy.Machining.Milling.bIsApplicable and not( Proc.FeatureInfo.bIsFrontMortise) then
|
elseif Strategy.Machining.Milling.bIsApplicable and not( Proc.FeatureInfo.bIsFrontMortise) then
|
||||||
@@ -258,7 +258,7 @@ function GetMortiseMachiningResult( Proc, Result)
|
|||||||
TotalResult.dMRR = Result.Milling.dMRR
|
TotalResult.dMRR = Result.Milling.dMRR
|
||||||
local sQuality = EgtIf( Strategy.Machining.AntiSplint.bIsApplicable, 'BEST', 'STD')
|
local sQuality = EgtIf( Strategy.Machining.AntiSplint.bIsApplicable, 'BEST', 'STD')
|
||||||
TotalResult.dQuality = FeatureLib.GetStrategyQuality( sQuality)
|
TotalResult.dQuality = FeatureLib.GetStrategyQuality( sQuality)
|
||||||
TotalResult.nFeatureRotationIndex = GetFeatureRotationIndex( Proc)
|
TotalResult.dFeatureRotationIndex = GetFeatureRotationIndex( Proc)
|
||||||
TotalResult.sInfo = ''
|
TotalResult.sInfo = ''
|
||||||
-- lavorazione incompleta
|
-- lavorazione incompleta
|
||||||
elseif Strategy.Machining.Cutting.bIsApplicable then
|
elseif Strategy.Machining.Cutting.bIsApplicable then
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ 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
|
||||||
@@ -213,8 +214,8 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se la lavorazione ostacola il pinzaggio non posso farla, serve una lavorazioen che lasci il testimone
|
-- se la lavorazione ostacola il pinzaggio, non posso farla, serve una lavorazioen che lasci il testimone
|
||||||
if Proc.bFeatureHindersClamping then
|
if MachiningLib.IsFeatureHinderingClamping( Proc, Part) then
|
||||||
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. StrategyLib.Config.sStrategyId .. ' not applicable ( Feature hinders clamping)'
|
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. StrategyLib.Config.sStrategyId .. ' not applicable ( Feature hinders clamping)'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable( sErr)
|
Strategy.Result = FeatureLib.GetStrategyResultNotApplicable( sErr)
|
||||||
|
|||||||
@@ -216,9 +216,6 @@ 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])
|
||||||
|
|||||||
@@ -51,18 +51,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"sName": "dLengthLimitToDropWaste",
|
|
||||||
"sNameNge": "LEN_DROP_WASTE",
|
|
||||||
"sValue": "",
|
|
||||||
"sDescriptionShort": "Length limit to drop the waste",
|
|
||||||
"sDescriptionLong": "If Cutting Strategy is set on AUTO, up to this length the software drop the waste, otherwise it'll keep attached",
|
|
||||||
"idDescriptionShortMsg": 1000321,
|
|
||||||
"idDescriptionLongMsg": 1000322,
|
|
||||||
"sType": "d",
|
|
||||||
"sMessageId": " ",
|
|
||||||
"sMinUserLevel": "1"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"sName": "sCanDamageNextPiece",
|
"sName": "sCanDamageNextPiece",
|
||||||
"sNameNge": "DAMAGE_NEXT_PIECE",
|
"sNameNge": "DAMAGE_NEXT_PIECE",
|
||||||
|
|||||||
@@ -18,6 +18,20 @@ local Strategy = {}
|
|||||||
local RidgeLap = {}
|
local RidgeLap = {}
|
||||||
RidgeLap.Result = {}
|
RidgeLap.Result = {}
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
-- si cerca di tenere la feature rivolta verso il fronte o sopra, cioè dal lato opposto la battuta
|
||||||
|
local function GetFeatureRotationIndex( Proc)
|
||||||
|
local nVoteIndex
|
||||||
|
|
||||||
|
if Proc.MainFaces.BottomFaces[1].vtN:getY() < 0 or Proc.MainFaces.BottomFaces[1].vtN:getZ() < 0 then
|
||||||
|
nVoteIndex = 2
|
||||||
|
else
|
||||||
|
nVoteIndex = 3
|
||||||
|
end
|
||||||
|
|
||||||
|
return nVoteIndex
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
-- TODO risolvere problemi calcolo volume nullo se facce rimosse
|
-- TODO risolvere problemi calcolo volume nullo se facce rimosse
|
||||||
-- TODO gestire lavorazione con svuotatura
|
-- TODO gestire lavorazione con svuotatura
|
||||||
@@ -94,11 +108,10 @@ function STR0012.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
-- considerazioni necessarie a determinare se lavorare con codolo oppure no
|
-- considerazioni necessarie a determinare se lavorare con codolo oppure no
|
||||||
local bKeepWasteAttached = ( Strategy.Parameters.sCuttingStrategy == 'KEEP_WASTE_ATTACHED')
|
local bKeepWasteAttached = ( Strategy.Parameters.sCuttingStrategy == 'KEEP_WASTE_ATTACHED')
|
||||||
local bDropWaste = ( Strategy.Parameters.sCuttingStrategy == 'DROP_WASTE')
|
local bDropWaste = ( Strategy.Parameters.sCuttingStrategy == 'DROP_WASTE')
|
||||||
local dLengthLimitToDropWaste = Strategy.Parameters.dLengthLimitToDropWaste
|
local bFeatureHindersClamping = MachiningLib.IsFeatureHinderingClamping( NewProc, Part)
|
||||||
|
|
||||||
-- lavorazione con codolo
|
-- lavorazione con codolo
|
||||||
if ( Proc.bFeatureHindersClamping and not bDropWaste)
|
if ( bFeatureHindersClamping and not bDropWaste)
|
||||||
or ( dLengthLimitToDropWaste and Proc.b3Box:getDimX() > dLengthLimitToDropWaste)
|
|
||||||
or bKeepWasteAttached then
|
or bKeepWasteAttached then
|
||||||
|
|
||||||
local BladeKeepWasteResult
|
local BladeKeepWasteResult
|
||||||
@@ -111,6 +124,7 @@ function STR0012.Make( bAddMachining, Proc, Part, CustomParameters)
|
|||||||
dMRRBlade = BladeKeepWasteResult.dMRR
|
dMRRBlade = BladeKeepWasteResult.dMRR
|
||||||
dCompletionPercentage = BladeKeepWasteResult.dCompletionPercentage
|
dCompletionPercentage = BladeKeepWasteResult.dCompletionPercentage
|
||||||
dQuality = BladeKeepWasteResult.dQuality
|
dQuality = BladeKeepWasteResult.dQuality
|
||||||
|
Strategy.Result.dFeatureRotationIndex = GetFeatureRotationIndex( NewProc)
|
||||||
|
|
||||||
-- lavorazione a cubetti facce concave
|
-- lavorazione a cubetti facce concave
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -858,38 +858,24 @@ 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
|
||||||
if not ID.IsFreeContour( Proc) then
|
CurrentMachining.LeadOutForSplit.dPerpDistance = TOOLS[CurrentMachining.ToolInfo.nToolIndex].dDiameter / 2 + BeamData.COLL_SIC
|
||||||
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; se FreeContour il lato è determinato dalla Feature, altrimenti dalla concordanza
|
-- sistemo il lato e la direzione di lavoro
|
||||||
if ID.IsFreeContour( Proc) then
|
if CurrentMachining.bOtherDirection then
|
||||||
CurrentMachining.bInvert = false
|
CurrentMachining.bToolInvert = true
|
||||||
if Proc.nGrp == 0 then
|
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, true, false)
|
||||||
CurrentMachining.nWorkside = MCH_MILL_WS.CENTER
|
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
||||||
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
|
||||||
if CurrentMachining.bOtherDirection then
|
CurrentMachining.bInvert = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, false, true)
|
||||||
CurrentMachining.bToolInvert = true
|
CurrentMachining.nWorkside = EgtIf( TOOLS[CurrentMachining.ToolInfo.nToolIndex].bIsCCW, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
|
||||||
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)
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ require( 'EgtBase')
|
|||||||
local FeatureLib = require( 'FeatureLib')
|
local FeatureLib = require( 'FeatureLib')
|
||||||
local FaceData = require( 'FaceData')
|
local FaceData = require( 'FaceData')
|
||||||
local MachiningLib = require( 'MachiningLib')
|
local MachiningLib = require( 'MachiningLib')
|
||||||
local BeamLib = require( 'BeamLib')
|
local BeamLib = require('BeamLib')
|
||||||
local BeamData = require( 'BeamDataNew')
|
|
||||||
-- strategie di base
|
-- strategie di base
|
||||||
local FaceByBlade = require('FACEBYBLADE')
|
local FaceByBlade = require('FACEBYBLADE')
|
||||||
local FaceByMill = require( 'FACEBYMILL')
|
local FaceByMill = require( 'FACEBYMILL')
|
||||||
@@ -186,6 +185,7 @@ local function MakeBottomFace( Proc, Part, BottomFace, EdgeToMachine, Parameters
|
|||||||
end
|
end
|
||||||
|
|
||||||
OptionalParametersFaceByBlade2.dDepthToMachine = dDepthToMachine
|
OptionalParametersFaceByBlade2.dDepthToMachine = dDepthToMachine
|
||||||
|
OptionalParametersFaceByBlade2.bAllowPerpendicularStrip = bAllowPerpendicularStrip
|
||||||
|
|
||||||
Cutting2 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade2)
|
Cutting2 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade2)
|
||||||
Cutting2.nInternalSortingPriority = 2
|
Cutting2.nInternalSortingPriority = 2
|
||||||
@@ -206,6 +206,7 @@ local function MakeBottomFace( Proc, Part, BottomFace, EdgeToMachine, Parameters
|
|||||||
end
|
end
|
||||||
|
|
||||||
OptionalParametersFaceByBlade1.dDepthToMachine = dDepthToMachine
|
OptionalParametersFaceByBlade1.dDepthToMachine = dDepthToMachine
|
||||||
|
OptionalParametersFaceByBlade1.bAllowPerpendicularStrip = bAllowPerpendicularStrip
|
||||||
|
|
||||||
Cutting1 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade1)
|
Cutting1 = FaceByBlade.Make( Proc, Part, BottomFace, EdgeToMachine, OptionalParametersFaceByBlade1)
|
||||||
Cutting1.nInternalSortingPriority = 2
|
Cutting1.nInternalSortingPriority = 2
|
||||||
@@ -234,6 +235,12 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
|||||||
if Proc.nFct > 3 and Proc.Topology.sFamily ~= 'DoubleBevel' then
|
if Proc.nFct > 3 and Proc.Topology.sFamily ~= 'DoubleBevel' then
|
||||||
Result = FeatureLib.GetStrategyResultNotApplicable( 'BladeKeepWaste : max 3 faces supported')
|
Result = FeatureLib.GetStrategyResultNotApplicable( 'BladeKeepWaste : max 3 faces supported')
|
||||||
return Machinings, Result
|
return Machinings, Result
|
||||||
|
elseif Proc.nFct == 2 then
|
||||||
|
-- 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
|
||||||
|
Result = FeatureLib.GetStrategyResultNotApplicable()
|
||||||
|
return Machinings, Result
|
||||||
|
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
|
||||||
@@ -259,7 +266,7 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
|||||||
local bFinishWithMill = ( OptionalParameters.bFinishWithMill ~= false)
|
local bFinishWithMill = ( OptionalParameters.bFinishWithMill ~= false)
|
||||||
local dMillingOffsetFromSide = OptionalParameters.dMillingOffsetFromSide or 1
|
local dMillingOffsetFromSide = OptionalParameters.dMillingOffsetFromSide or 1
|
||||||
local dStripWidth = OptionalParameters.dStripWidth or 5
|
local dStripWidth = OptionalParameters.dStripWidth or 5
|
||||||
local bAllowPerpendicularStrip = ( OptionalParameters.bAllowPerpendicularStrip and ( Part.b3Raw:getMin():getZ() + BeamData.VICE_MINH > Proc.b3Box:getMin():getZ() - 10 * GEO.EPS_SMALL)) or false
|
local bAllowPerpendicularStrip = OptionalParameters.bAllowPerpendicularStrip or false
|
||||||
local bForced = OptionalParameters.bForced or false
|
local bForced = OptionalParameters.bForced or false
|
||||||
|
|
||||||
-- volume della feature
|
-- volume della feature
|
||||||
@@ -377,6 +384,7 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local OptionalParametersMilling = {
|
local OptionalParametersMilling = {
|
||||||
|
bIsSplitFeature = bIsSplitFeature,
|
||||||
dExtendAfterTail = dExtendAfterTail,
|
dExtendAfterTail = dExtendAfterTail,
|
||||||
dRadialStepSpan = dToolMarkLength,
|
dRadialStepSpan = dToolMarkLength,
|
||||||
dDepthToMachine = dDepthToMachine
|
dDepthToMachine = dDepthToMachine
|
||||||
@@ -406,6 +414,7 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local OptionalParametersMilling = {
|
local OptionalParametersMilling = {
|
||||||
|
bIsSplitFeature = bIsSplitFeature,
|
||||||
dExtendAfterTail = dExtendAfterTail,
|
dExtendAfterTail = dExtendAfterTail,
|
||||||
dRadialStepSpan = dToolMarkLength,
|
dRadialStepSpan = dToolMarkLength,
|
||||||
dDepthToMachine = dDepthToMachine
|
dDepthToMachine = dDepthToMachine
|
||||||
@@ -439,24 +448,29 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
|||||||
-- se codoli perpendicolari, si accorciano LeadIn/LeadOut
|
-- se codoli perpendicolari, si accorciano LeadIn/LeadOut
|
||||||
if bAllowPerpendicularStrip then
|
if bAllowPerpendicularStrip then
|
||||||
for j = 1, #Machinings do
|
for j = 1, #Machinings do
|
||||||
local Machining = Machinings[j]
|
if Machinings[j].bIsMachiningSplitted then
|
||||||
if Machining.bIsMachiningSplitted then
|
-- se primo spezzone
|
||||||
local dOriginalStartAddLength = Machining.LeadIn.dStartAddLength
|
if Machinings[j].bIsFirstSegment then
|
||||||
local dOriginalEndAddLength = Machining.LeadOut.dEndAddLength
|
if MachiningLib.StartsLeftSide( Machinings[j]) then
|
||||||
local bStartsLeftSide = MachiningLib.StartsLeftSide( Machining)
|
Machinings[j].LeadIn.dStartAddLength = Machinings[j].LeadIn.dStartAddLength - Machinings[j].dToolMarkLength - dStripWidth
|
||||||
Machining.LeadIn.dStartAddLength = dOriginalStartAddLength - Machining.dToolMarkLength - dStripWidth
|
Machinings[j].LeadOut.dEndAddLength = Machinings[j].LeadOut.dEndAddLength - dStripWidth
|
||||||
Machining.LeadOut.dEndAddLength = dOriginalEndAddLength - Machining.dToolMarkLength - dStripWidth
|
else
|
||||||
if Machining.bIsStartClosed and
|
Machinings[j].LeadOut.dEndAddLength = Machinings[j].LeadOut.dEndAddLength - Machinings[j].dToolMarkLength - dStripWidth
|
||||||
( ( Machining.bIsLastSegment and bStartsLeftSide) or
|
Machinings[j].LeadIn.dStartAddLength = Machinings[j].LeadIn.dStartAddLength - dStripWidth
|
||||||
( Machining.bIsFirstSegment and not bStartsLeftSide)) then
|
end
|
||||||
|
-- se ultimo spezzone
|
||||||
Machining.LeadIn.dStartAddLength = dOriginalStartAddLength - dStripWidth
|
elseif Machinings[j].bIsLastSegment then
|
||||||
end
|
if MachiningLib.StartsLeftSide( Machinings[j]) then
|
||||||
if Machining.bIsEndClosed and
|
Machinings[j].LeadOut.dEndAddLength = Machinings[j].LeadOut.dEndAddLength - Machinings[j].dToolMarkLength - dStripWidth
|
||||||
( ( Machining.bIsFirstSegment and bStartsLeftSide) or
|
Machinings[j].LeadIn.dStartAddLength = Machinings[j].LeadIn.dStartAddLength - dStripWidth
|
||||||
( Machining.bIsLastSegment and not bStartsLeftSide)) then
|
else
|
||||||
|
Machinings[j].LeadIn.dStartAddLength = Machinings[j].LeadIn.dStartAddLength - Machinings[j].dToolMarkLength - dStripWidth
|
||||||
Machining.LeadOut.dEndAddLength = dOriginalEndAddLength - dStripWidth
|
Machinings[j].LeadOut.dEndAddLength = Machinings[j].LeadOut.dEndAddLength - dStripWidth
|
||||||
|
end
|
||||||
|
-- se spezzoni centrali
|
||||||
|
else
|
||||||
|
Machinings[j].LeadIn.dStartAddLength = Machinings[j].LeadIn.dStartAddLength - Machinings[j].dToolMarkLength - dStripWidth
|
||||||
|
Machinings[j].LeadOut.dEndAddLength = Machinings[j].LeadOut.dEndAddLength - Machinings[j].dToolMarkLength - dStripWidth
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -472,8 +486,6 @@ function BLADEKEEPWASTE.Make( Proc, Part, OptionalParameters)
|
|||||||
Result.dQuality = FeatureLib.GetStrategyQuality( Machinings)
|
Result.dQuality = FeatureLib.GetStrategyQuality( Machinings)
|
||||||
Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Machinings)
|
Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Machinings)
|
||||||
Result.dMRR = ( dFeatureVolume / Result.dTimeToMachine) / pow( 10, 6)
|
Result.dMRR = ( dFeatureVolume / Result.dTimeToMachine) / pow( 10, 6)
|
||||||
-- il codolo non compromette mai il pinzaggio
|
|
||||||
Result.bIgnoreNotClampableLength = true
|
|
||||||
if Result.dCompletionPercentage > 100 - 10 * GEO.EPS_SMALL then
|
if Result.dCompletionPercentage > 100 - 10 * GEO.EPS_SMALL then
|
||||||
Result.sStatus = 'Completed'
|
Result.sStatus = 'Completed'
|
||||||
if bForced then
|
if bForced then
|
||||||
|
|||||||
@@ -358,8 +358,8 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function SetDiceFaceInfo( Proc, idDiceFace, sType)
|
local function SetDiceFaceInfo( Proc, idDiceFace)
|
||||||
EgtSetName( idDiceFace, 'Face' .. tostring( Proc.idFeature or 'Add') .. '_Dice_' .. sType)
|
EgtSetName( idDiceFace, 'Face' .. tostring( Proc.idFeature or 'Add') .. '_Dice')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -577,11 +577,6 @@ 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
|
||||||
@@ -775,7 +770,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( 'FINE')
|
Result.dQuality = FeatureLib.GetStrategyQuality( 'STD')
|
||||||
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)
|
||||||
@@ -787,30 +782,45 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part)
|
local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part, MainFace, OtherFace)
|
||||||
|
|
||||||
-- contorno della faccia parallela
|
-- frame solidale alla feature
|
||||||
local vtNParallelFaceTm = EgtSurfTmFacetNormVersor( idParallelTm, 0, GDB_ID.ROOT)
|
local vtZ = MainFace.vtN
|
||||||
local idParallelFaceCurveCompo = EgtExtractSurfTmLoops( idParallelTm, Part.idTempGroup)
|
local vtX = OtherFace and OtherFace.vtN or nil
|
||||||
EgtModifyCurveExtrusion( idParallelFaceCurveCompo, vtNParallelFaceTm, GDB_RT.GLOB)
|
local frMainFace = Frame3d( MainFace.ptCenter, vtZ, vtX)
|
||||||
EgtOffsetCurve( idParallelFaceCurveCompo, 100, GDB_OT.EXTEND)
|
|
||||||
|
|
||||||
-- trimesh da sottrarre, tagliata con il piano perpendicolare
|
-- box del cubetto in riferimento feature
|
||||||
local vtExtrusion = 1000 * vtNParallelFaceTm
|
local b3Surf = EgtGetBBoxRef( idParallelTm, GDB_BB.STANDARD, frMainFace)
|
||||||
local idSurfTmToSubtract = EgtSurfTmByRegionExtrusion( Part.idTempGroup, idParallelFaceCurveCompo, vtExtrusion, 0.05, GDB_RT.GLOB)
|
|
||||||
if idPerpendicularTm then
|
if idPerpendicularTm then
|
||||||
local ptCenterPerpendicularTm, vtNPerpendicularTm = EgtSurfTmFacetCenter( idPerpendicularTm, 0, GDB_ID.ROOT)
|
local b3SurfPerpendicular = EgtGetBBoxRef( idPerpendicularTm, GDB_BB.STANDARD, frMainFace)
|
||||||
EgtCutSurfTmPlane( idSurfTmToSubtract, ptCenterPerpendicularTm, -vtNPerpendicularTm, false, GDB_RT.GLOB)
|
b3Surf:Add( b3SurfPerpendicular)
|
||||||
-- dove la trimesh è stata tagliata mancherà la faccia: si riaggiunge
|
else
|
||||||
local idRemovedFaceCurveCompo = EgtExtractSurfTmLoops( idSurfTmToSubtract, Part.idTempGroup)
|
-- se non arriva la superficie perpendicolare è un solo taglio parallelo: si estende il box in Z in modo da uscire dal pezzo
|
||||||
local idRemovedFaceTm = EgtSurfTmByFlatContour( Part.idTempGroup, idRemovedFaceCurveCompo)
|
local ptDeltaZ = b3Surf:getMax() + vtZ * ( MainFace.dElevation + 5)
|
||||||
local vtNRemovedFace = EgtSurfTmFacetNormVersor( idRemovedFaceTm, 0, GDB_ID.ROOT)
|
b3Surf:Add( ptDeltaZ)
|
||||||
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)
|
||||||
|
|
||||||
@@ -846,8 +856,7 @@ 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
|
||||||
local sType = ( i % 2 == 0) and 'Paral' or 'Perp'
|
SetDiceFaceInfo( Proc, vCuts[i][j])
|
||||||
SetDiceFaceInfo( Proc, vCuts[i][j], sType)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- calcolo lavorazioni
|
-- calcolo lavorazioni
|
||||||
@@ -913,7 +922,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, nil, Part)
|
UpdateDiceRaw( idCheckCollisionTm, idSurfToCut, vCuts[i-1][#vCuts[i-1]], Part, MainFace, OtherFace)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
EgtErase( idSurfToCut)
|
EgtErase( idSurfToCut)
|
||||||
@@ -977,7 +986,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)
|
UpdateDiceRaw( idCheckCollisionTm, vCuts[i][j], vCuts[i-1][j], Part, MainFace, OtherFace)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -330,13 +330,10 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
|||||||
Cutting.bInvert = false
|
Cutting.bInvert = false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- ToolInvert e direzione testa
|
-- ToolInvert
|
||||||
if Cutting.sBladeEngagement == 'DownUp' then
|
if Cutting.sBladeEngagement == 'DownUp' then
|
||||||
Cutting.bToolInvert = true
|
Cutting.bToolInvert = true
|
||||||
Cutting.bInvert = not Cutting.bInvert
|
Cutting.bInvert = not Cutting.bInvert
|
||||||
Cutting.vtHead = Vector3d( -FaceToMachine.vtN)
|
|
||||||
else
|
|
||||||
Cutting.vtHead = Vector3d( FaceToMachine.vtN)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se dicing, lato di lavoro e inversione per avere taglio sempre verso l'alto
|
-- se dicing, lato di lavoro e inversione per avere taglio sempre verso l'alto
|
||||||
@@ -586,8 +583,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
|||||||
Cutting.dToolMarkLength = abs( Cutting.LeadIn.dStartAddLength)
|
Cutting.dToolMarkLength = abs( Cutting.LeadIn.dStartAddLength)
|
||||||
elseif Cutting.bIsEndClosed then
|
elseif Cutting.bIsEndClosed then
|
||||||
Cutting.dToolMarkLength = abs( Cutting.LeadOut.dEndAddLength)
|
Cutting.dToolMarkLength = abs( Cutting.LeadOut.dEndAddLength)
|
||||||
else
|
|
||||||
Cutting.dToolMarkLength = LeadInOutLib.GetToolAddLength( TOOLS[Cutting.nToolIndex].dDiameter, dDepthToMachine)
|
|
||||||
end
|
end
|
||||||
-- area lavorata
|
-- area lavorata
|
||||||
Cutting.dAreaToMachine = min( EdgeToMachine.dElevation, Cutting.dDepthToMachine) * ( min( Cutting.dEdgeLength, Cutting.dLengthToMachine + 2 * Cutting.dToolMarkLength))
|
Cutting.dAreaToMachine = min( EdgeToMachine.dElevation, Cutting.dDepthToMachine) * ( min( Cutting.dEdgeLength, Cutting.dLengthToMachine + 2 * Cutting.dToolMarkLength))
|
||||||
@@ -599,22 +594,12 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
|||||||
Cutting.sOperationName = 'Cut_' .. ( EgtGetName( Cutting.idProc) or tostring( Cutting.idProc)) .. '_' .. tostring( FaceToMachine.id + 1)
|
Cutting.sOperationName = 'Cut_' .. ( EgtGetName( Cutting.idProc) or tostring( Cutting.idProc)) .. '_' .. tostring( FaceToMachine.id + 1)
|
||||||
|
|
||||||
-- se lavorazione aperta sulla coda, eventuali aggiustamenti
|
-- se lavorazione aperta sulla coda, eventuali aggiustamenti
|
||||||
-- TODO fare funzione a parte: bisogna guardare il lato (e forse la faccia) lavorato comprensivo di attacchi, non la Proc
|
-- TODO valutare se fare funzione a parte
|
||||||
-- 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.AffectedFaces.bLeft and
|
local bIsTruncatingCutOnTail = Proc.Topology and ( Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'TailCut') and Proc.AffectedFaces.bLeft
|
||||||
( ( Proc.Topology and ( Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'TailCut')) or
|
if Cutting.bMoveAfterSplit or bIsTruncatingCutOnTail then
|
||||||
( 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 ( Cutting.vtToolDirection:getX() < 0.707)) then
|
||||||
( EdgeToMachine.sType == 'Bottom' or
|
|
||||||
( Cutting.vtToolDirection:getX() < 0.707 and not ( Cutting.vtToolDirection:getX() > - 10 * GEO.EPS_SMALL and ( 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
|
||||||
if bIsSplitFeature then
|
if bIsSplitFeature then
|
||||||
@@ -648,7 +633,7 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
|||||||
end
|
end
|
||||||
|
|
||||||
return Cutting
|
return Cutting
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -159,8 +159,6 @@ function FACEBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional
|
|||||||
Mortising.nWorkside = MCH_MILL_WS.RIGHT
|
Mortising.nWorkside = MCH_MILL_WS.RIGHT
|
||||||
Mortising.bToolInvert = false
|
Mortising.bToolInvert = false
|
||||||
end
|
end
|
||||||
-- direzione testa
|
|
||||||
Mortising.vtHead = Vector3d( FaceToMachine.vtN)
|
|
||||||
-- profondità e offset longitudinale
|
-- profondità e offset longitudinale
|
||||||
if bExtendWithCornerRadius then
|
if bExtendWithCornerRadius then
|
||||||
dDepthToMachine = dDepthToMachine + TOOLS[Mortising.nToolIndex].dCornerRadius
|
dDepthToMachine = dDepthToMachine + TOOLS[Mortising.nToolIndex].dCornerRadius
|
||||||
|
|||||||
@@ -304,8 +304,6 @@ function FACEBYMILL.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPara
|
|||||||
if Milling.bToolInvert then
|
if Milling.bToolInvert then
|
||||||
Milling.bInvert = not Milling.bInvert
|
Milling.bInvert = not Milling.bInvert
|
||||||
end
|
end
|
||||||
-- direzione testa
|
|
||||||
Milling.vtHead = Vector3d( FaceToMachine.vtN)
|
|
||||||
-- profondità da lavorare e offset radiale
|
-- profondità da lavorare e offset radiale
|
||||||
if OptionalParameters.dPocketHeight then
|
if OptionalParameters.dPocketHeight then
|
||||||
if TOOLS[Milling.nToolIndex].dSideDepth > dDepthToMachine - 10 * GEO.EPS_SMALL then
|
if TOOLS[Milling.nToolIndex].dSideDepth > dDepthToMachine - 10 * GEO.EPS_SMALL then
|
||||||
|
|||||||
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
-- Version.lua by EgalWare s.r.l. 2026/07/16
|
-- Version.lua by EgalWare s.r.l. 2024/04/02
|
||||||
-- Gestione della versione di BeamNT
|
-- Gestione della versione di Beam
|
||||||
|
|
||||||
NAME = 'BeamNT'
|
NAME = 'Beam'
|
||||||
VERSION = '3.1g5'
|
VERSION = '3.1e1'
|
||||||
MIN_EXE = '3.1g3'
|
MIN_EXE = '3.1e1'
|
||||||
|
|||||||
Reference in New Issue
Block a user