Compare commits

..

5 Commits

Author SHA1 Message Date
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
9 changed files with 112 additions and 174 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].sBTLInfo = EgtGetInfo( PARTS[i].id, 'PROJ', 's') or nil
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
( 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
-- si carica configurazione lavorazioni
TIMER:startElapsed('Json')
BeamExec.GetStrategiesFromJSONinBD( PARTS[i].sAISetupConfig)
+86 -83
View File
@@ -398,42 +398,42 @@ end
-------------------------------------------------------------------------------------------------------------
-- *** 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
local idTempGroup = BeamLib.GetTempGroup( )
local idTempGroup = BeamLib.GetTempGroup()
local dMinLengthToCreateRaw = 10
BeamData.OVM_BLADE_HBEAM = ( BeamData.OVM_BLADE_HBEAM or 11 )
BeamData.OVM_CHAIN_HBEAM = ( BeamData.OVM_CHAIN_HBEAM or 8 )
BeamData.OVM_BLADE_HBEAM = ( BeamData.OVM_BLADE_HBEAM or 11)
BeamData.OVM_CHAIN_HBEAM = ( BeamData.OVM_CHAIN_HBEAM or 8)
dOvmMid = ( dOvmMid or 5.4 )
dOvmHead = ( dOvmHead or 0 )
BeamExec.CalcMinUnloadableRaw( dRawW, dRawH )
dOvmMid = ( dOvmMid or 5.4)
dOvmHead = ( dOvmHead or 0)
BeamExec.CalcMinUnloadableRaw( dRawW, dRawH)
-- 2. Gestione Gruppo di Lavoro
if ( bCreateMachGroup == nil ) then bCreateMachGroup = true end
if ( bCreateMachGroup ) then
local sMgName = EgtGetMachGroupNewName( 'Mach_1' )
local idNewMg = EgtAddMachGroup( sMgName )
if ( not idNewMg ) then
if ( bCreateMachGroup == nil) then bCreateMachGroup = true end
if ( bCreateMachGroup) then
local sMgName = EgtGetMachGroupNewName( 'Mach_1')
local idNewMg = EgtAddMachGroup( sMgName)
if ( not idNewMg) then
return false, 'Errore creazione gruppo di lavoro'
end
end
-- 3. Configurazione Tavola Macchina
EgtSetTable( 'Tab' )
local nMGrpId = EgtGetCurrMachGroup( )
if ( not EgtGetInfo( nMGrpId, 'BARLEN', 'd' ) ) then
EgtSetInfo( nMGrpId, 'BARLEN', dRawL )
EgtSetTable( 'Tab')
local nMGrpId = EgtGetCurrMachGroup()
if ( not EgtGetInfo( nMGrpId, 'BARLEN', 'd')) then
EgtSetInfo( nMGrpId, 'BARLEN', dRawL)
end
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 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()))
BeamData.ptOriXR = Point3d( b3Tab:getDimX( ), dPosY, 0 )
BeamData.dPosXR = EgtIf( BeamData.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR )
BeamData.ptOriXR = Point3d( b3Tab:getDimX(), dPosY, 0)
BeamData.dPosXR = EgtIf( BeamData.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR)
EgtImportSetup( )
EgtImportSetup()
-- 4. Ciclo di Inserimento Pezzi
local nCnt = 0
@@ -443,20 +443,20 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
for i = 1, #PARTS do
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 dPartWidth = CurrentPart.b3PartOriginal:getDimY( )
local dPartHeight = CurrentPart.b3PartOriginal:getDimZ( )
local dPartLen = CurrentPart.b3PartOriginal:getDimX()
local dPartWidth = CurrentPart.b3PartOriginal:getDimY()
local dPartHeight = CurrentPart.b3PartOriginal:getDimZ()
-- Se il pezzo corrente non ha coordinata, si calcola da OvmMid
if ( not CurrentPart.dPosX) then
if ( i == 1) then
CurrentPart.dPosX = dOvmHead
else
CurrentPart.dPosX = PARTS[i - 1].dPosX + PARTS[i - 1].b3PartOriginal:getDimX( ) + dOvmMid
CurrentPart.dPosX = PARTS[i - 1].dPosX + PARTS[i - 1].b3PartOriginal:getDimX() + dOvmMid
end
end
@@ -469,8 +469,8 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
local dEndOffset = 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 ( 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
@@ -479,9 +479,9 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
end
-- 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
if ( dTotalGap > dOvmMid ) then
if ( dTotalGap > dOvmMid) then
dEndOffset = dOvmMid
dNextStartOffset = dTotalGap - dOvmMid
else
@@ -495,102 +495,105 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
local dDelta = dEndOffset
local dStartPos = CurrentPart.dPosX - dStartOffset
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 ) )
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))
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
CurrentPart.idRaw = EgtAddRawPart( Point3d( 0, 0, 0 ), dCurrentRawLen, dRawW, dRawH, BeamData.RAWCOL )
EgtMoveToCornerRawPart( CurrentPart.idRaw, BeamData.ptOriXR, BeamData.dPosXR )
EgtMoveRawPart( CurrentPart.idRaw, Vector3d( -dStartPos, 0, 0 ) )
CurrentPart.idRaw = EgtAddRawPart( Point3d( 0, 0, 0), dCurrentRawLen, dRawW, dRawH, BeamData.RAWCOL)
EgtMoveToCornerRawPart( CurrentPart.idRaw, BeamData.ptOriXR, BeamData.dPosXR)
EgtMoveRawPart( CurrentPart.idRaw, Vector3d( -dStartPos, 0, 0))
-- 6. Configurazione Geometrie Pezzo
nCnt = nCnt + 1
EgtSetInfo( CurrentPart.idRaw, 'ORD', nCnt )
EgtSetInfo( CurrentPart.idRaw, 'ORD', nCnt)
if ( not BeamLib.CreateOrEmptyAddGroup( CurrentPart.id ) ) then
return false, 'Error creating Additional Group in Part ' .. tostring( CurrentPart.id )
if ( not BeamLib.CreateOrEmptyAddGroup( CurrentPart.id)) then
return false, 'Error creating Additional Group in Part ' .. tostring( CurrentPart.id)
end
BeamLib.AddPartStartFace( CurrentPart.id, CurrentPart.b3PartOriginal )
BeamLib.AddPartEndFace( CurrentPart.id, CurrentPart.b3PartOriginal )
BeamLib.AddPartStartFace( 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)
EgtDeselectPartObjs( CurrentPart.id )
local ptPos = b3BoxExact:getMin( ) - CurrentPart.b3PartOriginal:getMin( ) + Vector3d( dDelta, ( dRawW - dPartWidth ) / 2, ( dRawH - dPartHeight ) / 2 )
EgtAddPartToRawPart( CurrentPart.id, ptPos, CurrentPart.idRaw )
EgtDeselectPartObjs( CurrentPart.id)
local ptPos = b3BoxExact:getMin() - CurrentPart.b3PartOriginal:getMin() + Vector3d( dDelta, ( dRawW - dPartWidth) / 2, ( dRawH - dPartHeight) / 2)
EgtAddPartToRawPart( CurrentPart.id, ptPos, CurrentPart.idRaw)
-- Rotazione sezione se necessaria
if ( abs( dPartWidth - dRawW ) > 100 * GEO.EPS_SMALL ) then
EgtRotatePartInRawPart( CurrentPart.id, X_AX( ), 90 )
local vtEccOri = CurrentPart.b3PartOriginal:getCenter( ) - b3BoxExact:getCenter( )
local vtEccRot = Vector3d( vtEccOri )
vtEccRot:rotate( X_AX( ), 90 )
EgtMovePartInRawPart( CurrentPart.id, ( vtEccOri - vtEccRot ) )
if ( abs( dPartWidth - dRawW) > 100 * GEO.EPS_SMALL) then
EgtRotatePartInRawPart( CurrentPart.id, X_AX(), 90)
local vtEccOri = CurrentPart.b3PartOriginal:getCenter() - b3BoxExact:getCenter()
local vtEccRot = Vector3d( vtEccOri)
vtEccRot:rotate( X_AX(), 90)
EgtMovePartInRawPart( CurrentPart.id, ( vtEccOri - vtEccRot))
end
-- 7. Popolamento Metadati della Tabella CurrentPart
CurrentPart.bIsLastPart = ( i == #PARTS )
CurrentPart.bIsLastPart = ( i == #PARTS)
CurrentPart.dDistanceToNextPiece = dEndOffset
CurrentPart.b3Raw = EgtGetRawPartBBox( CurrentPart.idRaw )
CurrentPart.dLength = CurrentPart.b3Raw:getDimX( )
CurrentPart.dWidth = CurrentPart.b3Raw:getDimY( )
CurrentPart.dHeight = CurrentPart.b3Raw:getDimZ( )
CurrentPart.bSquareSection = abs( CurrentPart.dWidth - CurrentPart.dHeight ) < 100 * GEO.EPS_SMALL
CurrentPart.b3Raw = EgtGetRawPartBBox( CurrentPart.idRaw)
CurrentPart.dLength = CurrentPart.b3Raw:getDimX()
CurrentPart.dWidth = CurrentPart.b3Raw:getDimY()
CurrentPart.dHeight = CurrentPart.b3Raw:getDimZ()
CurrentPart.bSquareSection = abs( CurrentPart.dWidth - CurrentPart.dHeight) < 100 * GEO.EPS_SMALL
CurrentPart.idBoxTm = EgtGetFirstInGroup( EgtGetFirstNameInGroup( CurrentPart.id, 'Box' ) or GDB_ID.NULL )
CurrentPart.b3Part = EgtGetBBoxGlob( CurrentPart.idBoxTm, GDB_BB.STANDARD )
CurrentPart.idBoxTm = EgtGetFirstInGroup( EgtGetFirstNameInGroup( CurrentPart.id, 'Box') or GDB_ID.NULL)
CurrentPart.b3Part = EgtGetBBoxGlob( CurrentPart.idBoxTm, GDB_BB.STANDARD)
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.dHeadOverMaterial = dStartOffset
CurrentPart.sBTLInfo = EgtGetInfo( CurrentPart.id, 'PROJ', 's' ) or nil
CurrentPart.sBTLInfo = EgtGetInfo( CurrentPart.id, 'PROJ', 's') or nil
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
if ( dStartOffset > 0.09 ) then EgtSetInfo( CurrentPart.idRaw, 'HOVM', dStartOffset ) end
if ( dEndOffset > 0.09 ) then EgtSetInfo( CurrentPart.idRaw, 'TOVM', dEndOffset ) end
if ( idPrevRaw ) then EgtSetInfo( idPrevRaw, 'BDST', 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 ( idPrevRaw) then EgtSetInfo( idPrevRaw, 'BDST', dStartOffset) end
-- Caricamento Strategie JSON
CurrentPart.sAISetupConfig = EgtGetInfo( CurrentPart.id, 'AISETUP', 's' ) or
( GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo] and GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo].sAISetupConfig ) or
CurrentPart.sAISetupConfig = EgtGetInfo( CurrentPart.id, 'AISETUP', 's') or
( GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo] and GENERAL_PARAMETERS.BTL[CurrentPart.sBTLInfo].sAISetupConfig) or
GENERAL_PARAMETERS.PROJECT.sAISetupConfig or nil
TIMER:startElapsed( 'Json' )
BeamExec.GetStrategiesFromJSONinBD( CurrentPart.sAISetupConfig )
CurrentPart.GeneralParameters = BeamLib.GetPieceGeneralParameters( CurrentPart, GENERAL_PARAMETERS_JSON )
TIMER:stopElapsed( 'Json' )
TIMER:startElapsed( 'Json')
BeamExec.GetStrategiesFromJSONinBD( CurrentPart.sAISetupConfig)
CurrentPart.GeneralParameters = BeamLib.GetPieceGeneralParameters( CurrentPart, GENERAL_PARAMETERS_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)
dMaxX = max( dMaxX, dStartPos + dCurrentRawLen )
dMaxX = max( dMaxX, dStartPos + dCurrentRawLen)
CurrentPart.dRestLength = dRawL - dMaxX
idPrevRaw = CurrentPart.idRaw
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
end
end
-- 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
if ( dRemaining > dMinLengthToCreateRaw - GEO.EPS_SMALL) then
local idRawRest = EgtAddRawPart( Point3d( 0, 0, 0 ), dRemaining, dRawW, dRawH, BeamData.RAWCOL )
EgtMoveToCornerRawPart( idRawRest, BeamData.ptOriXR, BeamData.dPosXR )
EgtMoveRawPart( idRawRest, Vector3d( -dMaxX, 0, 0 ) )
local idRawRest = EgtAddRawPart( Point3d( 0, 0, 0), dRemaining, dRawW, dRawH, BeamData.RAWCOL)
EgtMoveToCornerRawPart( idRawRest, BeamData.ptOriXR, BeamData.dPosXR)
EgtMoveRawPart( idRawRest, Vector3d( -dMaxX, 0, 0))
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
end
else
if ( #PARTS > 0 ) then PARTS[#PARTS].dDistanceToNextPiece = 10000 end
if ( #PARTS > 0) then PARTS[#PARTS].dDistanceToNextPiece = 10000 end
end
return true
@@ -776,11 +779,11 @@ local function AreDrillingsMirrored( Proc, ProcMirror, Part)
-- geometria ausiliaria foro principale
AuxId = EgtGetInfo( Proc.id, 'AUXID', 'i')
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
local AuxIdMirror = EgtGetInfo( ProcMirror.id, 'AUXID', 'i')
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
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptBC = EgtGP( AuxId, GDB_RT.GLOB)
@@ -2658,7 +2661,7 @@ function BeamExec.ProcessAlternatives( PARTS)
if PARTS[nPart].HeadcutInfo then
local sOffsetX = table.concat( PARTS[nPart].HeadcutInfo[AlternativesNest2D[i]].OffsetX, ',')
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
if PARTS[nPart].TailcutInfo then
local sOffsetX = table.concat( PARTS[nPart].TailcutInfo[AlternativesNest2D[i]].OffsetX, ',')
+14 -11
View File
@@ -9,7 +9,6 @@ require( 'EgtBase')
local BeamData = require( 'BeamDataNew')
local FaceData = require( 'FaceData')
local BeamLib = require( 'BeamLib')
local PreSimulationLib = require( 'PreSimulationLib')
EgtOutLog( ' LeadInOutLib started', 1)
@@ -72,20 +71,24 @@ end
local function CalculateLeadInOutLength( ptToolCenter, vtNFace, b3Box, vtLeadInOut, Tool)
-- al momento gestita solo lama
if not Tool.sFamily == 'SAWBLADE' then
if not Tool.sFamily == 'SawBlade' then
error(' Tool family not implemented')
end
local ptStart = Point3d( ptToolCenter)
local DistanceData = {}
DistanceData.vtNFace = vtNFace
DistanceData.vtMove = vtLeadInOut
DistanceData.dToolThickness = Tool.dThickness
DistanceData.dToolDiameter = Tool.dDiameter
DistanceData.sToolFamily = Tool.sFamily
DistanceData.ptReferencePoint = ptStart + DistanceData.dToolThickness * DistanceData.vtNFace
-- Box del pezzo espansi ortogonalmente alle tre direzioni canoniche X, Y e Z
local b3BoxX = BBox3d( b3Box) ; b3BoxX:expand( 0, 1000, 1000)
local b3BoxY = BBox3d( b3Box) ; b3BoxY:expand( 1000, 0, 1000)
local b3BoxZ = BBox3d( b3Box) ; b3BoxZ:expand( 1000, 1000, 0)
return PreSimulationLib.GetDistanceToRetractToolFromRaw( DistanceData, b3Box)
-- si setta utensile lama per il controllo collisione
EgtCAvSetSawTool( Tool.dThickness, Tool.dDiameter, Tool.dThickness, 0, 0)
-- calcolo distanza di cui retrarre con funzioni Tool Collision Avoidance
local dLength = min( EgtCAvToolPosBox( ptToolCenter + Tool.dThickness * vtNFace, vtNFace, b3BoxX, vtLeadInOut),
EgtCAvToolPosBox( ptToolCenter + Tool.dThickness * vtNFace, vtNFace, b3BoxY, vtLeadInOut),
EgtCAvToolPosBox( ptToolCenter + Tool.dThickness * vtNFace, vtNFace, b3BoxZ, vtLeadInOut))
return dLength
end
-26
View File
@@ -791,25 +791,6 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
return ToolInfo
end
-- Calcolo profondità massima del foro rispetto al Portautensile (solo per utensile punta)
-------------------------------------------------------------------------------------------------------------
function MachiningLib.GetDrillMaxDepthFromToolHolderSideEncumbrance( FeatureInfo, nToolIndex, b3Raw)
local b3Box = BBox3d( b3Raw)
b3Box:expand( BeamData.COLL_SIC)
local ptStart = Point3d( FeatureInfo.ptDrillCenter)
local dToolLength = TOOLS[nToolIndex].dLength
local dMaxDepth = TOOLS[nToolIndex].dMaxDepth
local DistanceData = {}
DistanceData.vtNFace = Vector3d( FeatureInfo.vtDrillExtrusion)
DistanceData.vtMove = Vector3d( FeatureInfo.vtDrillExtrusion)
DistanceData.dToolLength = TOOLS[nToolIndex].ToolHolder.dLength
DistanceData.dToolDiameter = TOOLS[nToolIndex].ToolHolder.dDiameter
DistanceData.sToolFamily = 'TOOLHOLDER'
DistanceData.ptReferencePoint = ptStart + ( ( dToolLength - dMaxDepth - DistanceData.dToolLength) * DistanceData.vtNFace)
return PreSimulationLib.GetDistanceToRetractToolFromRaw( DistanceData, b3Box)
end
-------------------------------------------------------------------------------------------------------------
-- funzione per cercare utensile tipo PUNTA A FORARE con certe caratteristiche
function MachiningLib.FindDrill( Proc, ToolSearchParameters)
@@ -926,13 +907,6 @@ function MachiningLib.FindDrill( Proc, ToolSearchParameters)
ToolInfo.nToolIndex = nBestToolIndex
ToolInfo.dResidualDepth = dBestToolResidualDepth
if nBestToolIndex then
local dTHReduction = MachiningLib.GetDrillMaxDepthFromToolHolderSideEncumbrance( Proc.FeatureInfo, nBestToolIndex, ToolSearchParameters.Part.b3Raw)
local dTHResidualDepth = ToolSearchParameters.dElevation + dTHReduction - TOOLS[nBestToolIndex].dMaxDepth
if dTHResidualDepth < dBestToolResidualDepth then
ToolInfo.dResidualDepth = dTHResidualDepth
end
end
-- si salva se la punta ha lo stesso diametro del foro
if nBestToolIndex and TOOLS[nBestToolIndex].dDiameter - ToolSearchParameters.dToolDiameter > 100 * GEO.EPS_SMALL then
ToolInfo.bDrillIsExactDiameter = true
-29
View File
@@ -103,35 +103,6 @@ function PreSimulationLib.GetPointOnToolTipCenter( ptPointAtDepth, vtHead, vtNFa
return ptPointAtDepth + vtToolOffset * Tool.dDiameter / 2 + vtNFace * EgtIf( AreSameVectorApprox( vtHead, vtNFace), 0, Tool.dThickness)
end
-------------------------------------------------------------------------------------------------------------
function PreSimulationLib.GetDistanceToRetractToolFromRaw( DistanceData, b3Box)
-- Box del pezzo espansi ortogonalmente alle tre direzioni canoniche X, Y e Z
local b3BoxX = BBox3d( b3Box) ; b3BoxX:expand( 0, 1000, 1000)
local b3BoxY = BBox3d( b3Box) ; b3BoxY:expand( 1000, 0, 1000)
local b3BoxZ = BBox3d( b3Box) ; b3BoxZ:expand( 1000, 1000, 0)
-- Imposta l'utensile correttamente
if DistanceData.sToolFamily == 'DRILLBIT' then
-- si setta utensile Punta per il controllo collisione
EgtCAvSetAdvTool( DistanceData.dToolLength, DistanceData.dToolDiameter, ( DistanceData.dToolTotalLength - DistanceData.dToolLength), 0, 0)
elseif DistanceData.sToolFamily == 'SAWBLADE' then
-- si setta utensile Lama per il controllo collisione
EgtCAvSetSawTool( DistanceData.dToolThickness, DistanceData.dToolDiameter, DistanceData.dToolThickness, 0, 0)
elseif DistanceData.sToolFamily == 'TOOLHOLDER' then
-- si setta utensile Cilindrico per simulare il portautensile in caso di fori inclinati nei quali è possibile che il portautensile collida
EgtCAvSetStdTool( DistanceData.dToolLength, DistanceData.dToolDiameter, 0)
-- altre tipologie non gestite
else
return nil
end
-- calcolo distanza di cui retrarre con funzioni Tool Collision Avoidance *da top dell'utensile*
local dLength = min( EgtCAvToolPosBox( DistanceData.ptReferencePoint, DistanceData.vtNFace, b3BoxX, DistanceData.vtMove),
EgtCAvToolPosBox( DistanceData.ptReferencePoint, DistanceData.vtNFace, b3BoxY, DistanceData.vtMove),
EgtCAvToolPosBox( DistanceData.ptReferencePoint, DistanceData.vtNFace, b3BoxZ, DistanceData.vtMove))
return dLength
end
-------------------------------------------------------------------------------------------------------------
-- calcolo punto sull'uscita testa a partire dal punto di lavorazione o di attacco sul diametro utensile
local function GetToolExitPoint( ptMachining, vtNEdge, vtHead, Tool, bIsDownUp)
-22
View File
@@ -8,7 +8,6 @@ local BeamLib = require( 'BeamLib')
local BeamData = require( 'BeamDataNew')
local MachiningLib = require( 'MachiningLib')
local FeatureLib = require( 'FeatureLib')
local PreSimulationLib = require( 'PreSimulationLib')
-- strategie di base
-- Tabella per definizione modulo
@@ -38,24 +37,6 @@ local function GetSCC( vtMachiningDirection)
return nSCC
end
-- Calcolo distanza dalla quale andare a velocità di lavoro ( Start Safety Length)
-------------------------------------------------------------------------------------------------------------
local function GetDrillApprochSafeDistance( FeatureInfo, nToolIndex, b3Raw)
local b3Box = BBox3d( b3Raw)
b3Box:expand( BeamData.COLL_SIC)
local ptStart = Point3d( FeatureInfo.ptDrillCenter)
local DistanceData = {}
DistanceData.vtNFace = Vector3d( FeatureInfo.vtDrillExtrusion)
DistanceData.vtMove = Vector3d( FeatureInfo.vtDrillExtrusion)
DistanceData.dToolLength = TOOLS[nToolIndex].dLength
DistanceData.dToolTotalLength = TOOLS[nToolIndex].dTotalLength
DistanceData.dToolDiameter = TOOLS[nToolIndex].dDiameter
DistanceData.sToolFamily = TOOLS[nToolIndex].sFamily
DistanceData.ptReferencePoint = ptStart + DistanceData.dToolLength * DistanceData.vtNFace
return PreSimulationLib.GetDistanceToRetractToolFromRaw( DistanceData, b3Box)
end
-------------------------------------------------------------------------------------------------------------
local function GetDrillingStrategy( Proc, Part)
local ToolSearchParameters = {}
@@ -70,7 +51,6 @@ local function GetDrillingStrategy( Proc, Part)
ToolSearchParameters.dDiameterTolerance = Strategy.Parameters.dDiameterTolerance
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sDrillBitList, 'Drilling')
ToolSearchParameters.ptCheckOutStroke = { Proc.FeatureInfo.ptDrillCenter + ( EgtMdbGetGeneralParam( MCH_GP.SAFEZ) * ToolSearchParameters.vtToolDirection)}
ToolSearchParameters.Part = Part
Drilling.ToolInfo = {}
Drilling.ToolInfo = MachiningLib.FindDrill( Proc, ToolSearchParameters)
@@ -81,7 +61,6 @@ local function GetDrillingStrategy( Proc, Part)
Drilling.vtToolDirection = Proc.FeatureInfo.vtDrillExtrusion
Drilling.dStep = TOOLS[Drilling.nToolIndex].dStep
Drilling.nSCC = GetSCC( -Drilling.vtToolDirection)
Drilling.dStartSafetyLength = max( BeamData.COLL_SIC, GetDrillApprochSafeDistance( Proc.FeatureInfo, Drilling.ToolInfo.nToolIndex, Part.b3Raw))
end
-- TODO se utensile 2 che si torverà è il gemello da usare nelle lavorazioni in doppio, allora gestire di conseguenza l'applicazione delle lavorazioni in doppio
@@ -105,7 +84,6 @@ local function GetDrillingStrategy( Proc, Part)
Drilling2.vtToolDirection = -Proc.FeatureInfo.vtDrillExtrusion
Drilling2.dStep = TOOLS[Drilling2.nToolIndex].dStep
Drilling2.nSCC = GetSCC( -Drilling2.vtToolDirection)
Drilling2.dStartSafetyLength = max( BeamData.COLL_SIC, GetDrillApprochSafeDistance( Proc.FeatureInfo, Drilling.ToolInfo.nToolIndex, Part.b3Raw))
end
end
+5
View File
@@ -577,6 +577,11 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
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)
EdgeToMachine = GetEdgeToMachine( FaceToMachine.Edges, 'Vertical')
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 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
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
( Proc.b3Box:getDimZ() > Part.b3Raw:getDimZ() - 100 * GEO.EPS_SMALL) and
Proc.AffectedFaces.bLeft
+1 -1
View File
@@ -2,5 +2,5 @@
-- Gestione della versione di BeamNT
NAME = 'BeamNT'
VERSION = '3.1g4'
VERSION = '3.1g5'
MIN_EXE = '3.1g3'