Compare commits

...

7 Commits

Author SHA1 Message Date
andrea.villa c1eee0201c In FeatureLib, quando si costruisce la Proc su una Trimesh, si ricava anche la Topologia 2026-08-21 14:38:01 +02:00
luca.mazzoleni 05fc22b1d4 Merge branch 'main' into develop 2026-07-30 17:28:02 +02:00
luca.mazzoleni a7b55ce018 Merge branch 'develop' 2026-07-30 16:10:20 +02:00
luca.mazzoleni 2f88f6843b update version 2026-07-30 16:09:33 +02:00
luca.mazzoleni 4eaa3e9e80 - in FACEBYBLADE tutti i tagli che guardano a sx e non sono slot vanno dopo separazione 2026-07-30 15:28:28 +02:00
luca.mazzoleni 73c81f6e05 - in BLADETOWASTE il taglio doppio verticale si prova solo se la feature è piccola 2026-07-29 15:03:21 +02:00
luca.mazzoleni 10ecdbd686 - se non trovata GetRestrictedLength da BeamData si usa LEN_VERY_SHORT_PART o valore fisso 2026-07-28 17:27:27 +02:00
6 changed files with 101 additions and 86 deletions
+3 -1
View File
@@ -647,11 +647,13 @@ if bToProcess then
PARTS[i].NotClampableLength = { STD = { dHead = 0, dTail = 0}, SIDE = { dHead = 0, dTail = 0}, DOWN = { dHead = 0, dTail = 0}} PARTS[i].NotClampableLength = { STD = { dHead = 0, dTail = 0}, SIDE = { dHead = 0, dTail = 0}, DOWN = { dHead = 0, dTail = 0}}
PARTS[i].sBTLInfo = EgtGetInfo( PARTS[i].id, 'PROJ', 's') or nil PARTS[i].sBTLInfo = EgtGetInfo( PARTS[i].id, 'PROJ', 's') or nil
PARTS[i].idTempGroup = idTempGroup PARTS[i].idTempGroup = idTempGroup
PARTS[i].RestrictedLength = ( BeamData.GetRestrictedLength and BeamData.GetRestrictedLength( PARTS[i].dRawWidth, PARTS[i].dRawHeight, PARTS[i].dRawLength))
or BeamData.LEN_VERY_SHORT_PART
or 400
PARTS[i].sAISetupConfig = EgtGetInfo( PARTS[i].id, 'AISETUP', 's') or PARTS[i].sAISetupConfig = EgtGetInfo( PARTS[i].id, 'AISETUP', 's') or
( GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo] and GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo].sAISetupConfig) or -- i parametri BTL potrebbero non esistere ( GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo] and GENERAL_PARAMETERS.BTL[PARTS[i].sBTLInfo].sAISetupConfig) or -- i parametri BTL potrebbero non esistere
GENERAL_PARAMETERS.PROJECT.sAISetupConfig or nil GENERAL_PARAMETERS.PROJECT.sAISetupConfig or nil
-- si carica configurazione lavorazioni -- si carica configurazione lavorazioni
TIMER:startElapsed('Json') TIMER:startElapsed('Json')
BeamExec.GetStrategiesFromJSONinBD( PARTS[i].sAISetupConfig) BeamExec.GetStrategiesFromJSONinBD( PARTS[i].sAISetupConfig)
+86 -83
View File
@@ -398,42 +398,42 @@ end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
-- *** Funzioni posizionamento pezzi all'interno della barra*** -- *** Funzioni posizionamento pezzi all'interno della barra***
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, bCreateMachGroup, bIsFlipRot ) function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, bCreateMachGroup, bIsFlipRot)
-- 1. Inizializzazione e Default -- 1. Inizializzazione e Default
local idTempGroup = BeamLib.GetTempGroup( ) local idTempGroup = BeamLib.GetTempGroup()
local dMinLengthToCreateRaw = 10 local dMinLengthToCreateRaw = 10
BeamData.OVM_BLADE_HBEAM = ( BeamData.OVM_BLADE_HBEAM or 11 ) BeamData.OVM_BLADE_HBEAM = ( BeamData.OVM_BLADE_HBEAM or 11)
BeamData.OVM_CHAIN_HBEAM = ( BeamData.OVM_CHAIN_HBEAM or 8 ) BeamData.OVM_CHAIN_HBEAM = ( BeamData.OVM_CHAIN_HBEAM or 8)
dOvmMid = ( dOvmMid or 5.4 ) dOvmMid = ( dOvmMid or 5.4)
dOvmHead = ( dOvmHead or 0 ) dOvmHead = ( dOvmHead or 0)
BeamExec.CalcMinUnloadableRaw( dRawW, dRawH ) BeamExec.CalcMinUnloadableRaw( dRawW, dRawH)
-- 2. Gestione Gruppo di Lavoro -- 2. Gestione Gruppo di Lavoro
if ( bCreateMachGroup == nil ) then bCreateMachGroup = true end if ( bCreateMachGroup == nil) then bCreateMachGroup = true end
if ( bCreateMachGroup ) then if ( bCreateMachGroup) then
local sMgName = EgtGetMachGroupNewName( 'Mach_1' ) local sMgName = EgtGetMachGroupNewName( 'Mach_1')
local idNewMg = EgtAddMachGroup( sMgName ) local idNewMg = EgtAddMachGroup( sMgName)
if ( not idNewMg ) then if ( not idNewMg) then
return false, 'Errore creazione gruppo di lavoro' return false, 'Errore creazione gruppo di lavoro'
end end
end end
-- 3. Configurazione Tavola Macchina -- 3. Configurazione Tavola Macchina
EgtSetTable( 'Tab' ) EgtSetTable( 'Tab')
local nMGrpId = EgtGetCurrMachGroup( ) local nMGrpId = EgtGetCurrMachGroup()
if ( not EgtGetInfo( nMGrpId, 'BARLEN', 'd' ) ) then if ( not EgtGetInfo( nMGrpId, 'BARLEN', 'd')) then
EgtSetInfo( nMGrpId, 'BARLEN', dRawL ) EgtSetInfo( nMGrpId, 'BARLEN', dRawL)
end end
local b3Tab = EgtGetTableArea( ) local b3Tab = EgtGetTableArea()
local dPosY = EgtIf( BeamData.CENTER_BEAM, ( b3Tab:getDimY( ) + dRawW * EgtIf( BeamData.RIGHT_LOAD, -1, 1 ) ) / 2, EgtIf( BeamData.RIGHT_LOAD, 0, b3Tab:getDimY( ) ) ) local dPosY = EgtIf( BeamData.CENTER_BEAM, ( b3Tab:getDimY() + dRawW * EgtIf( BeamData.RIGHT_LOAD, -1, 1)) / 2, EgtIf( BeamData.RIGHT_LOAD, 0, b3Tab:getDimY()))
BeamData.ptOriXR = Point3d( b3Tab:getDimX( ), dPosY, 0 ) BeamData.ptOriXR = Point3d( b3Tab:getDimX(), dPosY, 0)
BeamData.dPosXR = EgtIf( BeamData.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR ) BeamData.dPosXR = EgtIf( BeamData.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
EgtImportSetup( ) EgtImportSetup()
-- 4. Ciclo di Inserimento Pezzi -- 4. Ciclo di Inserimento Pezzi
local nCnt = 0 local nCnt = 0
@@ -443,20 +443,20 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
for i = 1, #PARTS do for i = 1, #PARTS do
local CurrentPart = PARTS[i] local CurrentPart = PARTS[i]
local b3BoxExact = EgtGetBBoxGlob( CurrentPart.id or GDB_ID.NULL, GDB_BB.EXACT ) local b3BoxExact = EgtGetBBoxGlob( CurrentPart.id or GDB_ID.NULL, GDB_BB.EXACT)
if ( b3BoxExact:isEmpty( ) or CurrentPart.b3PartOriginal:isEmpty( ) ) then break end if ( b3BoxExact:isEmpty() or CurrentPart.b3PartOriginal:isEmpty()) then break end
local dPartLen = CurrentPart.b3PartOriginal:getDimX( ) local dPartLen = CurrentPart.b3PartOriginal:getDimX()
local dPartWidth = CurrentPart.b3PartOriginal:getDimY( ) local dPartWidth = CurrentPart.b3PartOriginal:getDimY()
local dPartHeight = CurrentPart.b3PartOriginal:getDimZ( ) local dPartHeight = CurrentPart.b3PartOriginal:getDimZ()
-- Se il pezzo corrente non ha coordinata, si calcola da OvmMid -- Se il pezzo corrente non ha coordinata, si calcola da OvmMid
if ( not CurrentPart.dPosX) then if ( not CurrentPart.dPosX) then
if ( i == 1) then if ( i == 1) then
CurrentPart.dPosX = dOvmHead CurrentPart.dPosX = dOvmHead
else else
CurrentPart.dPosX = PARTS[i - 1].dPosX + PARTS[i - 1].b3PartOriginal:getDimX( ) + dOvmMid CurrentPart.dPosX = PARTS[i - 1].dPosX + PARTS[i - 1].b3PartOriginal:getDimX() + dOvmMid
end end
end end
@@ -469,8 +469,8 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
local dEndOffset = dOvmMid local dEndOffset = dOvmMid
-- se ultimo pezzo bisogna allungare il grezzo del restante solo se non viene creato un grezzo indipendente -- se ultimo pezzo bisogna allungare il grezzo del restante solo se non viene creato un grezzo indipendente
if ( i == #PARTS ) then if ( i == #PARTS) then
local dPotentialRemaining = max( 0, dRawL - ( CurrentPart.dPosX + dPartLen )) local dPotentialRemaining = max( 0, dRawL - ( CurrentPart.dPosX + dPartLen))
if ( dPotentialRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then if ( dPotentialRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then
dEndOffset = 0 -- Coda a zero, il resto diventerà un idRawRest indipendente dEndOffset = 0 -- Coda a zero, il resto diventerà un idRawRest indipendente
else else
@@ -479,9 +479,9 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
end end
-- Gap reale tra i pezzi (può essere negativo in caso di compenetrazione nesting obliqui) -- Gap reale tra i pezzi (può essere negativo in caso di compenetrazione nesting obliqui)
if ( i < #PARTS ) then if ( i < #PARTS) then
local dTotalGap = PARTS[i + 1].dPosX - CurrentPart.dPosX - dPartLen local dTotalGap = PARTS[i + 1].dPosX - CurrentPart.dPosX - dPartLen
if ( dTotalGap > dOvmMid ) then if ( dTotalGap > dOvmMid) then
dEndOffset = dOvmMid dEndOffset = dOvmMid
dNextStartOffset = dTotalGap - dOvmMid dNextStartOffset = dTotalGap - dOvmMid
else else
@@ -495,102 +495,105 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
local dDelta = dEndOffset local dDelta = dEndOffset
local dStartPos = CurrentPart.dPosX - dStartOffset local dStartPos = CurrentPart.dPosX - dStartOffset
local bIsSectionOk = ( ( abs( dPartWidth - dRawW ) < 100 * GEO.EPS_SMALL and abs( dPartHeight - dRawH ) < 100 * GEO.EPS_SMALL ) or local bIsSectionOk = ( ( abs( dPartWidth - dRawW) < 100 * GEO.EPS_SMALL and abs( dPartHeight - dRawH) < 100 * GEO.EPS_SMALL) or
( abs( dPartHeight - dRawW ) < 100 * GEO.EPS_SMALL and abs( dPartWidth - dRawH ) < 100 * GEO.EPS_SMALL ) ) ( abs( dPartHeight - dRawW) < 100 * GEO.EPS_SMALL and abs( dPartWidth - dRawH) < 100 * GEO.EPS_SMALL))
if ( bIsSectionOk and ( dStartPos + dCurrentRawLen <= dRawL + GEO.EPS_SMALL ) ) then if ( bIsSectionOk and ( dStartPos + dCurrentRawLen <= dRawL + GEO.EPS_SMALL)) then
-- 5. Creazione e Posizionamento del Contenitore RawPart -- 5. Creazione e Posizionamento del Contenitore RawPart
CurrentPart.idRaw = EgtAddRawPart( Point3d( 0, 0, 0 ), dCurrentRawLen, dRawW, dRawH, BeamData.RAWCOL ) CurrentPart.idRaw = EgtAddRawPart( Point3d( 0, 0, 0), dCurrentRawLen, dRawW, dRawH, BeamData.RAWCOL)
EgtMoveToCornerRawPart( CurrentPart.idRaw, BeamData.ptOriXR, BeamData.dPosXR ) EgtMoveToCornerRawPart( CurrentPart.idRaw, BeamData.ptOriXR, BeamData.dPosXR)
EgtMoveRawPart( CurrentPart.idRaw, Vector3d( -dStartPos, 0, 0 ) ) EgtMoveRawPart( CurrentPart.idRaw, Vector3d( -dStartPos, 0, 0))
-- 6. Configurazione Geometrie Pezzo -- 6. Configurazione Geometrie Pezzo
nCnt = nCnt + 1 nCnt = nCnt + 1
EgtSetInfo( CurrentPart.idRaw, 'ORD', nCnt ) EgtSetInfo( CurrentPart.idRaw, 'ORD', nCnt)
if ( not BeamLib.CreateOrEmptyAddGroup( CurrentPart.id ) ) then if ( not BeamLib.CreateOrEmptyAddGroup( CurrentPart.id)) then
return false, 'Error creating Additional Group in Part ' .. tostring( CurrentPart.id ) return false, 'Error creating Additional Group in Part ' .. tostring( CurrentPart.id)
end end
BeamLib.AddPartStartFace( CurrentPart.id, CurrentPart.b3PartOriginal ) BeamLib.AddPartStartFace( CurrentPart.id, CurrentPart.b3PartOriginal)
BeamLib.AddPartEndFace( CurrentPart.id, CurrentPart.b3PartOriginal ) BeamLib.AddPartEndFace( CurrentPart.id, CurrentPart.b3PartOriginal)
-- Inserimento con dDelta (lascia lo spazio vuoto a sinistra e spinge il pezzo a destra) -- Inserimento con dDelta (lascia lo spazio vuoto a sinistra e spinge il pezzo a destra)
EgtDeselectPartObjs( CurrentPart.id ) EgtDeselectPartObjs( CurrentPart.id)
local ptPos = b3BoxExact:getMin( ) - CurrentPart.b3PartOriginal:getMin( ) + Vector3d( dDelta, ( dRawW - dPartWidth ) / 2, ( dRawH - dPartHeight ) / 2 ) local ptPos = b3BoxExact:getMin() - CurrentPart.b3PartOriginal:getMin() + Vector3d( dDelta, ( dRawW - dPartWidth) / 2, ( dRawH - dPartHeight) / 2)
EgtAddPartToRawPart( CurrentPart.id, ptPos, CurrentPart.idRaw ) EgtAddPartToRawPart( CurrentPart.id, ptPos, CurrentPart.idRaw)
-- Rotazione sezione se necessaria -- Rotazione sezione se necessaria
if ( abs( dPartWidth - dRawW ) > 100 * GEO.EPS_SMALL ) then if ( abs( dPartWidth - dRawW) > 100 * GEO.EPS_SMALL) then
EgtRotatePartInRawPart( CurrentPart.id, X_AX( ), 90 ) EgtRotatePartInRawPart( CurrentPart.id, X_AX(), 90)
local vtEccOri = CurrentPart.b3PartOriginal:getCenter( ) - b3BoxExact:getCenter( ) local vtEccOri = CurrentPart.b3PartOriginal:getCenter() - b3BoxExact:getCenter()
local vtEccRot = Vector3d( vtEccOri ) local vtEccRot = Vector3d( vtEccOri)
vtEccRot:rotate( X_AX( ), 90 ) vtEccRot:rotate( X_AX(), 90)
EgtMovePartInRawPart( CurrentPart.id, ( vtEccOri - vtEccRot ) ) EgtMovePartInRawPart( CurrentPart.id, ( vtEccOri - vtEccRot))
end end
-- 7. Popolamento Metadati della Tabella CurrentPart -- 7. Popolamento Metadati della Tabella CurrentPart
CurrentPart.bIsLastPart = ( i == #PARTS ) CurrentPart.bIsLastPart = ( i == #PARTS)
CurrentPart.dDistanceToNextPiece = dEndOffset CurrentPart.dDistanceToNextPiece = dEndOffset
CurrentPart.b3Raw = EgtGetRawPartBBox( CurrentPart.idRaw ) CurrentPart.b3Raw = EgtGetRawPartBBox( CurrentPart.idRaw)
CurrentPart.dLength = CurrentPart.b3Raw:getDimX( ) CurrentPart.dLength = CurrentPart.b3Raw:getDimX()
CurrentPart.dWidth = CurrentPart.b3Raw:getDimY( ) CurrentPart.dWidth = CurrentPart.b3Raw:getDimY()
CurrentPart.dHeight = CurrentPart.b3Raw:getDimZ( ) CurrentPart.dHeight = CurrentPart.b3Raw:getDimZ()
CurrentPart.bSquareSection = abs( CurrentPart.dWidth - CurrentPart.dHeight ) < 100 * GEO.EPS_SMALL CurrentPart.bSquareSection = abs( CurrentPart.dWidth - CurrentPart.dHeight) < 100 * GEO.EPS_SMALL
CurrentPart.idBoxTm = EgtGetFirstInGroup( EgtGetFirstNameInGroup( CurrentPart.id, 'Box' ) or GDB_ID.NULL ) CurrentPart.idBoxTm = EgtGetFirstInGroup( EgtGetFirstNameInGroup( CurrentPart.id, 'Box') or GDB_ID.NULL)
CurrentPart.b3Part = EgtGetBBoxGlob( CurrentPart.idBoxTm, GDB_BB.STANDARD ) CurrentPart.b3Part = EgtGetBBoxGlob( CurrentPart.idBoxTm, GDB_BB.STANDARD)
CurrentPart.nIndexInParts = i CurrentPart.nIndexInParts = i
CurrentPart.SplittingPoints = BeamLib.GetPartSplittingPoints( CurrentPart ) CurrentPart.SplittingPoints = BeamLib.GetPartSplittingPoints( CurrentPart)
CurrentPart.NotClampableLength = { STD = { dHead = 0, dTail = 0 }, SIDE = { dHead = 0, dTail = 0 }, DOWN = { dHead = 0, dTail = 0 } } CurrentPart.NotClampableLength = { STD = { dHead = 0, dTail = 0 }, SIDE = { dHead = 0, dTail = 0 }, DOWN = { dHead = 0, dTail = 0 } }
CurrentPart.dHeadOverMaterial = dStartOffset CurrentPart.dHeadOverMaterial = dStartOffset
CurrentPart.sBTLInfo = EgtGetInfo( CurrentPart.id, 'PROJ', 's' ) or nil CurrentPart.sBTLInfo = EgtGetInfo( CurrentPart.id, 'PROJ', 's') or nil
CurrentPart.idTempGroup = idTempGroup CurrentPart.idTempGroup = idTempGroup
CurrentPart.RestrictedLength = ( BeamData.GetRestrictedLength and BeamData.GetRestrictedLength( dPartWidth, dPartHeight, dPartLen))
or BeamData.LEN_VERY_SHORT_PART
or 400
-- Notifiche al Post-Processor basate sulla nuova scomposizione -- Notifiche al Post-Processor basate sulla nuova scomposizione
if ( dStartOffset > 0.09 ) then EgtSetInfo( CurrentPart.idRaw, 'HOVM', dStartOffset ) end if ( dStartOffset > 0.09) then EgtSetInfo( CurrentPart.idRaw, 'HOVM', dStartOffset) end
if ( dEndOffset > 0.09 ) then EgtSetInfo( CurrentPart.idRaw, 'TOVM', dEndOffset ) end if ( dEndOffset > 0.09) then EgtSetInfo( CurrentPart.idRaw, 'TOVM', dEndOffset) end
if ( idPrevRaw ) then EgtSetInfo( idPrevRaw, 'BDST', dStartOffset ) end if ( idPrevRaw) then EgtSetInfo( idPrevRaw, 'BDST', dStartOffset) end
-- Caricamento Strategie JSON -- Caricamento Strategie JSON
CurrentPart.sAISetupConfig = EgtGetInfo( CurrentPart.id, 'AISETUP', 's' ) or CurrentPart.sAISetupConfig = EgtGetInfo( CurrentPart.id, 'AISETUP', 's') or
( GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo] and GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo].sAISetupConfig ) or ( GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo] and GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo].sAISetupConfig) or
GENERAL_PARAMETERS.PROJECT.sAISetupConfig or nil GENERAL_PARAMETERS.PROJECT.sAISetupConfig or nil
TIMER:startElapsed( 'Json' ) TIMER:startElapsed( 'Json')
BeamExec.GetStrategiesFromJSONinBD( CurrentPart.sAISetupConfig ) BeamExec.GetStrategiesFromJSONinBD( CurrentPart.sAISetupConfig)
CurrentPart.GeneralParameters = BeamLib.GetPieceGeneralParameters( CurrentPart, GENERAL_PARAMETERS_JSON ) CurrentPart.GeneralParameters = BeamLib.GetPieceGeneralParameters( CurrentPart, GENERAL_PARAMETERS_JSON)
TIMER:stopElapsed( 'Json' ) TIMER:stopElapsed( 'Json')
CurrentPart.CombinationList = BeamExec.GetAvailableCombinations( CurrentPart, bIsFlipRot ) CurrentPart.CombinationList = BeamExec.GetAvailableCombinations( CurrentPart, bIsFlipRot)
-- Avanzamento calcolato sulla coordinata reale di fine RawPart (estremità sinistra sulla barra) -- Avanzamento calcolato sulla coordinata reale di fine RawPart (estremità sinistra sulla barra)
dMaxX = max( dMaxX, dStartPos + dCurrentRawLen ) dMaxX = max( dMaxX, dStartPos + dCurrentRawLen)
CurrentPart.dRestLength = dRawL - dMaxX CurrentPart.dRestLength = dRawL - dMaxX
idPrevRaw = CurrentPart.idRaw idPrevRaw = CurrentPart.idRaw
else else
local sOut = 'Error: part L(' .. EgtNumToString( dPartLen, 1 ) .. ') too big for remaining bar space' local sOut = 'Error: part L(' .. EgtNumToString( dPartLen, 1) .. ') too big for remaining bar space'
return false, sOut return false, sOut
end end
end end
-- 8. Chiusura Barra e Gestione Avanzo (Rest Material) -- 8. Chiusura Barra e Gestione Avanzo (Rest Material)
if ( idPrevRaw ) then EgtSetInfo( idPrevRaw, 'BDST', 10000 ) end if ( idPrevRaw) then EgtSetInfo( idPrevRaw, 'BDST', 10000) end
local dRemaining = dRawL - dMaxX local dRemaining = dRawL - dMaxX
if ( dRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then if ( dRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then
local idRawRest = EgtAddRawPart( Point3d( 0, 0, 0 ), dRemaining, dRawW, dRawH, BeamData.RAWCOL ) local idRawRest = EgtAddRawPart( Point3d( 0, 0, 0), dRemaining, dRawW, dRawH, BeamData.RAWCOL)
EgtMoveToCornerRawPart( idRawRest, BeamData.ptOriXR, BeamData.dPosXR ) EgtMoveToCornerRawPart( idRawRest, BeamData.ptOriXR, BeamData.dPosXR)
EgtMoveRawPart( idRawRest, Vector3d( -dMaxX, 0, 0 ) ) EgtMoveRawPart( idRawRest, Vector3d( -dMaxX, 0, 0))
nCnt = nCnt + 1 nCnt = nCnt + 1
EgtSetInfo( idRawRest, 'ORD', nCnt ) EgtSetInfo( idRawRest, 'ORD', nCnt)
if ( EgtGetRawPartBBox( idRawRest ):getDimX( ) < BeamData.dMinRaw ) then if ( EgtGetRawPartBBox( idRawRest):getDimX() < BeamData.dMinRaw) then
PARTS[#PARTS].dDistanceToNextPiece = 10000 PARTS[#PARTS].dDistanceToNextPiece = 10000
end end
else else
if ( #PARTS > 0 ) then PARTS[#PARTS].dDistanceToNextPiece = 10000 end if ( #PARTS > 0) then PARTS[#PARTS].dDistanceToNextPiece = 10000 end
end end
return true return true
@@ -776,11 +779,11 @@ local function AreDrillingsMirrored( Proc, ProcMirror, Part)
-- geometria ausiliaria foro principale -- geometria ausiliaria foro principale
AuxId = EgtGetInfo( Proc.id, 'AUXID', 'i') AuxId = EgtGetInfo( Proc.id, 'AUXID', 'i')
if AuxId then AuxId = AuxId + Proc.id end if AuxId then AuxId = AuxId + Proc.id end
if not AuxId or EgtGetType( AuxId ) ~= GDB_TY.CRV_ARC then return false end if not AuxId or EgtGetType( AuxId) ~= GDB_TY.CRV_ARC then return false end
-- geometria ausiliaria foro specchiato -- geometria ausiliaria foro specchiato
local AuxIdMirror = EgtGetInfo( ProcMirror.id, 'AUXID', 'i') local AuxIdMirror = EgtGetInfo( ProcMirror.id, 'AUXID', 'i')
if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.id end if AuxIdMirror then AuxIdMirror = AuxIdMirror + ProcMirror.id end
if not AuxIdMirror or EgtGetType( AuxIdMirror ) ~= GDB_TY.CRV_ARC then return false end if not AuxIdMirror or EgtGetType( AuxIdMirror) ~= GDB_TY.CRV_ARC then return false end
-- dati del foro principale -- dati del foro principale
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptBC = EgtGP( AuxId, GDB_RT.GLOB) local ptBC = EgtGP( AuxId, GDB_RT.GLOB)
@@ -2658,7 +2661,7 @@ function BeamExec.ProcessAlternatives( PARTS)
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, ',')
+3
View File
@@ -36,6 +36,9 @@ function FeatureLib.GetProcFromTrimesh( idTrimesh, Part, ProcToCopyFrom)
if ProcToCopyFrom and Proc.dVolume < 10 * GEO.EPS_SMALL then if ProcToCopyFrom and Proc.dVolume < 10 * GEO.EPS_SMALL then
Proc.dVolume = ProcToCopyFrom.dVolume Proc.dVolume = ProcToCopyFrom.dVolume
end end
Proc.nParts = EgtSurfTmPartCount( Proc.id) or 1
Proc.Topology = FeatureLib.ClassifyTopology( Proc, Part)
-- TODO servono anche altri dati raccolti nel collect?? -- TODO servono anche altri dati raccolti nel collect??
return Proc return Proc
+5
View File
@@ -577,6 +577,11 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
end end
end end
-- se la feature non è piccola il taglio doppio verticale non si può fare
if not FeatureInfo.bIsFeatureSmall then
return CuttingParametersList, EdgeToMachine
end
-- arrivati qui si prova il taglio doppio verticale (taglio doppio orizzontale non si può fare oppure non ci arriva) -- arrivati qui si prova il taglio doppio verticale (taglio doppio orizzontale non si può fare oppure non ci arriva)
EdgeToMachine = GetEdgeToMachine( FaceToMachine.Edges, 'Vertical') EdgeToMachine = GetEdgeToMachine( FaceToMachine.Edges, 'Vertical')
local dDepthToMachine = EdgeToMachine.dElevation / 2 + BeamData.CUT_EXTRA_MIN local dDepthToMachine = EdgeToMachine.dElevation / 2 + BeamData.CUT_EXTRA_MIN
+3 -1
View File
@@ -602,7 +602,9 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
-- TODO fare funzione a parte: bisogna guardare il lato (e forse la faccia) lavorato comprensivo di attacchi, non la Proc -- TODO fare funzione a parte: bisogna guardare il lato (e forse la faccia) lavorato comprensivo di attacchi, non la Proc
-- TODO già guardare se il box della faccia è aperto sulla coda, invece di tutta la trimesh, escluderebbe tanti casi -- TODO già guardare se il box della faccia è aperto sulla coda, invece di tutta la trimesh, escluderebbe tanti casi
Cutting.bMoveAfterSplit = Cutting.bMoveAfterSplit or Cutting.LeadIn.bMoveAfterSplit or Cutting.LeadOut.bMoveAfterSplit Cutting.bMoveAfterSplit = Cutting.bMoveAfterSplit or Cutting.LeadIn.bMoveAfterSplit or Cutting.LeadOut.bMoveAfterSplit
local bIsTruncatingCutOnTail = Proc.Topology and ( Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'TailCut') and Proc.AffectedFaces.bLeft local bIsTruncatingCutOnTail = Proc.AffectedFaces.bLeft and
( ( Proc.Topology and ( Proc.Topology.sName == 'Cut-1-Through' or Proc.Topology.sName == 'TailCut')) or
( FaceToMachine.vtN:getX() < GEO.EPS_SMALL and not OptionalParameters.dPocketHeight))
local bIsFeatureBigAsRawOnTail = ( Proc.b3Box:getDimY() > Part.b3Raw:getDimY() - 100 * GEO.EPS_SMALL) and 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.b3Box:getDimZ() > Part.b3Raw:getDimZ() - 100 * GEO.EPS_SMALL) and
Proc.AffectedFaces.bLeft Proc.AffectedFaces.bLeft
+1 -1
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di BeamNT -- Gestione della versione di BeamNT
NAME = 'BeamNT' NAME = 'BeamNT'
VERSION = '3.1g4' VERSION = '3.1g5'
MIN_EXE = '3.1g3' MIN_EXE = '3.1g3'