Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| adf08876a9 |
+2
-19
@@ -388,18 +388,10 @@ if bToProcess then
|
||||
else
|
||||
PARTS[i].b3PartOriginal = b3Solid
|
||||
end
|
||||
if BeamData.MAX_LENGTH and BeamData.MAX_LENGTH > 10 and b3Solid:getDimX() > BeamData.MAX_LENGTH then
|
||||
local sOut = 'Piece-Length (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
|
||||
'out of machine limits (' .. EgtNumToString( BeamData.MAX_LENGTH, 2) .. ') '
|
||||
BEAM.ERR = 17
|
||||
BEAM.MSG = sOut
|
||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
|
||||
PostErrView( BEAM.ERR, BEAM.MSG)
|
||||
return
|
||||
end
|
||||
end
|
||||
-- Assegno lunghezza della barra
|
||||
dBarLen = PARTS[1].b3PartOriginal:getDimX() + 10
|
||||
-- TODO nella ProcessBeams andava in errore con 10mm!!! CONTROLLARE
|
||||
dBarLen = PARTS[1].b3PartOriginal:getDimX() + 20
|
||||
if dBarLen < 2200 then
|
||||
dBarLen = dBarLen + 1800
|
||||
end
|
||||
@@ -456,15 +448,6 @@ if bToProcess then
|
||||
else
|
||||
PARTS[i].b3PartOriginal = b3Solid
|
||||
end
|
||||
if BeamData.MAX_LENGTH and BeamData.MAX_LENGTH > 10 and b3Solid:getDimX() > BeamData.MAX_LENGTH then
|
||||
local sOut = 'Piece-Length (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
|
||||
'out of machine limits (' .. EgtNumToString( BeamData.MAX_LENGTH, 2) .. ') '
|
||||
BEAM.ERR = 17
|
||||
BEAM.MSG = sOut
|
||||
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
|
||||
PostErrView( BEAM.ERR, BEAM.MSG)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+23
-60
@@ -341,11 +341,6 @@ function BeamExec.GetAvailableCombinations( PartInfo, bIsFlipRot)
|
||||
nCycles = 2
|
||||
end
|
||||
|
||||
if bIsFlipRot and PartInfo.GeneralParameters.GEN_bGetAlternativesNesting2D then
|
||||
BeamData.ROT90 = false
|
||||
BeamData.ROT180 = false
|
||||
end
|
||||
|
||||
-- verifico tutte le combinazioni che possono essere considerate
|
||||
for nInvertIndex = 1, nCycles do
|
||||
for nUnloadPos = 1, 4 do
|
||||
@@ -363,31 +358,22 @@ function BeamExec.GetAvailableCombinations( PartInfo, bIsFlipRot)
|
||||
Combination.bPartInCombiIsInverted = true
|
||||
end
|
||||
|
||||
-- counter numero totale di rotazioni della combinazione
|
||||
Combination.nRotationCounter = 0
|
||||
|
||||
-- se posizionamento iniziale attivo
|
||||
if string.sub( sBitIndexCombination, 1, 1) == '1' then
|
||||
CombinationList.Rotations[1] = 1
|
||||
Combination.nRotationCounter = Combination.nRotationCounter + 1
|
||||
end
|
||||
-- se attiva rotazione 90
|
||||
if string.sub( sBitIndexCombination, 2, 2) == '1' then
|
||||
CombinationList.Rotations[2] = 1
|
||||
Combination.nRotationCounter = Combination.nRotationCounter + 1
|
||||
end
|
||||
-- se attiva rotazione 180
|
||||
if string.sub( sBitIndexCombination, 3, 3) == '1' then
|
||||
CombinationList.Rotations[3] = 1
|
||||
Combination.nRotationCounter = Combination.nRotationCounter + 1
|
||||
end
|
||||
-- se attiva rotazione 270
|
||||
if string.sub( sBitIndexCombination, 4, 4) == '1' then
|
||||
CombinationList.Rotations[4] = 1
|
||||
Combination.nRotationCounter = Combination.nRotationCounter + 1
|
||||
end
|
||||
|
||||
Combination.nRotationCounter = Combination.nRotationCounter - 1
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -450,47 +436,36 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
|
||||
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
|
||||
end
|
||||
end
|
||||
|
||||
-- Se il pezzo SUCCESSIVO non ha coordinata, si calcola da OvmMid
|
||||
if ( i < #PARTS and not PARTS[i + 1].dPosX) then
|
||||
PARTS[i + 1].dPosX = CurrentPart.dPosX + dPartLen + dOvmMid
|
||||
end
|
||||
|
||||
local dStartOffset = dNextStartOffset
|
||||
local dEndOffset = ( i == #PARTS ) and 0 or dOvmMid
|
||||
local dEndOffset = dOvmMid
|
||||
|
||||
-- Gap reale tra i pezzi (può essere negativo in caso di compenetrazione nesting obliqui)
|
||||
-- LOGICA LOOK-AHEAD: Analisi del gap reale per la ripartizione specchiata
|
||||
if ( i < #PARTS ) then
|
||||
local dTotalGap = PARTS[i + 1].dPosX - CurrentPart.dPosX - dPartLen
|
||||
if ( dTotalGap > dOvmMid ) then
|
||||
dEndOffset = dOvmMid
|
||||
dNextStartOffset = dTotalGap - dOvmMid
|
||||
dEndOffset = dOvmMid -- Max 5.4mm sulla coda (lato sinistro del grezzo)
|
||||
dNextStartOffset = dTotalGap - dOvmMid -- Il residuo sulla testa del prossimo (lato destro)
|
||||
else
|
||||
-- Gap minore dello spessore lama (compenetrazione per nesting obliqui)
|
||||
-- Gestione automatica sotto-soglia o compenetrazione geometrica (Nesting Obliquo)
|
||||
dEndOffset = dTotalGap
|
||||
dNextStartOffset = 0
|
||||
end
|
||||
end
|
||||
|
||||
local dCurrentRawLen = dPartLen + dStartOffset + dEndOffset
|
||||
-- MATEMATICA CORRETTA PER X CAD INVERTITA:
|
||||
-- Il grezzo idRaw si estende verso destra. Spostando il pezzo internamente di dEndOffset (dDelta),
|
||||
-- lasciamo dEndOffset a sinistra (coda) e matematicamente dStartOffset a destra (testa).
|
||||
local dCrawLen = dPartLen + dStartOffset + dEndOffset
|
||||
local dDelta = dEndOffset
|
||||
local dStartPos = CurrentPart.dPosX - dStartOffset
|
||||
local dStartPos = (CurrentPart.dPosX or 0) - 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 ) )
|
||||
|
||||
if ( bIsSectionOk and ( dStartPos + dCurrentRawLen <= dRawL + GEO.EPS_SMALL ) ) then
|
||||
if ( bIsSectionOk and ( dStartPos + dCrawLen <= dRawL + GEO.EPS_SMALL ) ) then
|
||||
|
||||
-- 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 ), dCrawLen, dRawW, dRawH, BeamData.RAWCOL )
|
||||
EgtMoveToCornerRawPart( CurrentPart.idRaw, BeamData.ptOriXR, BeamData.dPosXR )
|
||||
EgtMoveRawPart( CurrentPart.idRaw, Vector3d( -dStartPos, 0, 0 ) )
|
||||
|
||||
@@ -555,7 +530,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b
|
||||
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 + dCrawLen )
|
||||
CurrentPart.dRestLength = dRawL - dMaxX
|
||||
idPrevRaw = CurrentPart.idRaw
|
||||
else
|
||||
@@ -822,7 +797,7 @@ local function AreDrillingsMirrored( Proc, ProcMirror, Part)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
|
||||
local function GetFeatureInfoAndDependency( vProcSingleRot, Part)
|
||||
-- gruppo per geometrie temporanee
|
||||
local idTempGroup = BeamLib.GetTempGroup()
|
||||
|
||||
@@ -834,10 +809,12 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
|
||||
-- ciclo tutte le feature
|
||||
for i = 1, #vProcSingleRot do
|
||||
local Proc = vProcSingleRot[i]
|
||||
if not HeadProcOriginal and Proc.Topology.sName == 'HeadCut' then
|
||||
if Proc.Topology.sName == 'HeadCut' then
|
||||
HeadProcOriginal = Proc
|
||||
elseif not TailProcOriginal and Proc.Topology.sName == 'TailCut' then
|
||||
HeadProcOriginal.bIsOriginalHeadcut = true
|
||||
elseif Proc.Topology.sName == 'TailCut' then
|
||||
TailProcOriginal = Proc
|
||||
TailProcOriginal.bIsOriginalTailcut = true
|
||||
end
|
||||
-- se feature abilitata alla lavorazione
|
||||
if Proc.nFlg ~= 0 then
|
||||
@@ -852,7 +829,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
|
||||
and ( FeatureLib.IsFeatureCuttingEntireSection( Proc.b3Box, Part) and FeatureLib.IsFeatureCuttingEntireSection( ProcB.b3Box, Part))
|
||||
|
||||
-- si trovano i veri tagli di testa e coda e si disattivano gli altri, se necessario
|
||||
if bIsFlipRot and Part.GeneralParameters.GEN_bGetAlternativesNesting2D and bAreBothTruncatingCuts then
|
||||
if bAreBothTruncatingCuts then
|
||||
-- testa
|
||||
if Proc.Faces[1].vtN:getX() > GEO.EPS_SMALL and ProcB.Faces[1].vtN:getX() > GEO.EPS_SMALL then
|
||||
-- il primo taglio è più verso il centro della trave
|
||||
@@ -872,7 +849,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
|
||||
ProcB.nFlg = 0
|
||||
end
|
||||
-- il secondo taglio è più verso il centro della trave
|
||||
else
|
||||
elseif Proc.b3Box:getMin():getX() >= ProcB.b3Box:getMin():getX() - 10 * GEO.EPS_SMALL then
|
||||
HeadProc = ProcB
|
||||
local idProcCopy = EgtCopyGlob( Proc.id, idTempGroup)
|
||||
local idProcBCopy = EgtCopyGlob( ProcB.id, idTempGroup)
|
||||
@@ -907,7 +884,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
|
||||
ProcB.nFlg = 0
|
||||
end
|
||||
-- il secondo taglio è più verso il centro della trave
|
||||
else
|
||||
elseif Proc.b3Box:getMax():getX() >= ProcB.b3Box:getMax():getX() - 10 * GEO.EPS_SMALL then
|
||||
TailProc = ProcB
|
||||
local idProcCopy = EgtCopyGlob( Proc.id, idTempGroup)
|
||||
local idProcBCopy = EgtCopyGlob( ProcB.id, idTempGroup)
|
||||
@@ -934,7 +911,6 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
|
||||
table.insert( Proc.SlaveProcIndexes, j)
|
||||
ProcB.nIndexMasterProc = i
|
||||
ProcB.nFlg = 0
|
||||
HeadProcOriginal = Proc
|
||||
end
|
||||
-- se entrambi tagli di coda, si tiene sempre il primo ( ma non quello aggiunto dall'automatismo)
|
||||
if ( ID.IsTailCut( Proc) and not EgtGetInfo( Proc.id, 'HEAD_ADD_CUT', 'i')) and ID.IsTailCut( ProcB) then
|
||||
@@ -944,7 +920,6 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
|
||||
table.insert( Proc.SlaveProcIndexes, j)
|
||||
ProcB.nIndexMasterProc = i
|
||||
ProcB.nFlg = 0
|
||||
TailProcOriginal = Proc
|
||||
end
|
||||
-- verifico se feature tipo LapJoint è attraversata da almeno un foro
|
||||
if ( Proc.Topology.sFamily == 'Pocket' or Proc.Topology.sFamily == 'Tunnel' or Proc.Topology.sFamily == 'Groove' or ID.IsMortise( Proc)) and
|
||||
@@ -966,24 +941,12 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
|
||||
end
|
||||
end
|
||||
|
||||
if not Part.GeneralParameters.GEN_bGetAlternativesNesting2D then
|
||||
return vProcSingleRot
|
||||
end
|
||||
|
||||
-- si tiene via il riferimento alla Proc Head/Tail originale in caso si dovesse rimpiazzare
|
||||
HeadProcOriginal.bIsOriginalHeadcut = true
|
||||
TailProcOriginal.bIsOriginalTailcut = true
|
||||
if not HeadProc then
|
||||
HeadProc = HeadProcOriginal
|
||||
else
|
||||
HeadProc.HeadProcOriginal = HeadProcOriginal
|
||||
end
|
||||
if not TailProc then
|
||||
TailProc = TailProcOriginal
|
||||
else
|
||||
TailProc.TailProcOriginal = TailProcOriginal
|
||||
end
|
||||
|
||||
HeadProc.Topology = {}
|
||||
TailProc.Topology = {}
|
||||
HeadProc.Topology.sFamily = 'HeadCut'
|
||||
@@ -1005,7 +968,7 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part, bIsFlipRot)
|
||||
local PtSortedTail = BeamLib.GetSortedVertices( TailProc)
|
||||
if PtSortedTail then
|
||||
TailcutInfo.OffsetX = {}
|
||||
for i = 1, #PtSortedTail do
|
||||
for i = 1, #PtSortedHead do
|
||||
table.insert( TailcutInfo.OffsetX, Part.b3Part:getMin():getX() - PtSortedTail[i]:getX())
|
||||
end
|
||||
end
|
||||
@@ -1453,7 +1416,7 @@ function BeamExec.GetProcessings( PARTS, bIsFlipRot)
|
||||
|
||||
-- recupero informazioni ausiliarie feature e dipendenze tra feature stesse
|
||||
-- TODO le dipendenze cambiano in base alla rotazione del pezzo? probabilmente no
|
||||
vProcRot[nIndex], HeadcutInfo, TailcutInfo = GetFeatureInfoAndDependency( vProcRot[nIndex], PARTS[nPart], bIsFlipRot)
|
||||
vProcRot[nIndex], HeadcutInfo, TailcutInfo = GetFeatureInfoAndDependency( vProcRot[nIndex], PARTS[nPart])
|
||||
else
|
||||
-- inserisco una tabella vuota
|
||||
table.insert( vProcRot, {})
|
||||
|
||||
@@ -347,7 +347,7 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
|
||||
return false
|
||||
end
|
||||
-- lavorazione in collisione con il pezzo: non fattibile
|
||||
local bCollisionFound, bMoveAfterSplit = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
|
||||
local bCollisionFound, bMoveAfterSplit = PreSimulationLib.CheckCollision( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters)
|
||||
if bCollisionFound then
|
||||
return false
|
||||
end
|
||||
@@ -373,7 +373,7 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
|
||||
CheckCollisionOptionalParameters.PointsToCheck = {}
|
||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadIn.ptPoint)
|
||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, PerpendicularLeadInOut.LeadOut.ptPoint)
|
||||
local bCollisionFoundPerpendicular, bMoveAfterSplitPerpendicular = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
|
||||
local bCollisionFoundPerpendicular, bMoveAfterSplitPerpendicular = PreSimulationLib.CheckCollision( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters)
|
||||
-- attacco perpendicolare possibile
|
||||
if not bCollisionFoundPerpendicular then
|
||||
LeadInOut.Perpendicular = PerpendicularLeadInOut
|
||||
@@ -403,7 +403,7 @@ local function TestEngagement( sBladeEngagement, Parameters, OptionalParameters)
|
||||
CheckCollisionOptionalParameters.PointsToCheck = {}
|
||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadIn.ptPoint)
|
||||
table.insert( CheckCollisionOptionalParameters.PointsToCheck, TangentLeadInOut.LeadOut.ptPoint)
|
||||
local bCollisionFoundTangent, bMoveAfterSplitTangent = PreSimulationLib.CheckCollision( CheckCollisionParameters, CheckCollisionOptionalParameters)
|
||||
local bCollisionFoundTangent, bMoveAfterSplitTangent = PreSimulationLib.CheckCollision( sBladeEngagement, CheckCollisionParameters, CheckCollisionOptionalParameters)
|
||||
-- attacco tangenziale possibile
|
||||
if not bCollisionFoundTangent then
|
||||
LeadInOut.Tangent = TangentLeadInOut
|
||||
@@ -625,7 +625,7 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
local bForceLongcutBlade = ToolSearchParameters.bForceLongcutBlade or false
|
||||
local EdgeToMachine = ToolSearchParameters.EdgeToMachine
|
||||
local Part = ToolSearchParameters.Part
|
||||
local idCheckCollisionTm = ToolSearchParameters.idCheckCollisionTm
|
||||
local bIsDicing = ToolSearchParameters.bIsDicing or false
|
||||
local sRestLengthSideForPreSimulation = ToolSearchParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||
local bCannotSplitRestLength = ToolSearchParameters.bCannotSplitRestLength or false
|
||||
local bDisableRealElevationCheck = ToolSearchParameters.bDisableRealElevationCheck or false
|
||||
@@ -660,7 +660,7 @@ function MachiningLib.FindBlade( Proc, ToolSearchParameters)
|
||||
dDepthToMachine = min( dElevation, TOOLS[i].dMaxDepth)
|
||||
}
|
||||
local BladeEngagementOptionalParameters = {
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength,
|
||||
bDisableRealElevationCheck = bDisableRealElevationCheck
|
||||
@@ -1584,8 +1584,8 @@ function MachiningLib.GetTimeToMachineAllStepsWithLeadInOut( Machining, Part)
|
||||
Machining.CloneStepsLongitudinal.nCount = 1
|
||||
end
|
||||
-- stima tempi di lavorazione per i diversi tratti
|
||||
local dTimeToMachineLeadIn = ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 0) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) / dToolStartFeed
|
||||
local dTimeToMachineLeadOut = ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 0) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) / dToolEndFeed
|
||||
local dTimeToMachineLeadIn = ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 60) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) / dToolStartFeed
|
||||
local dTimeToMachineLeadOut = ( Machining.dDepthToMachine + ( TOOLS[Machining.nToolIndex].SetupInfo.dZSafeDelta or 60) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)) / dToolEndFeed
|
||||
local dTimeToMachineEdge = Machining.dLengthToMachine / dToolFeed
|
||||
-- calcolo lunghezze e tempi
|
||||
if Machining.Steps.nStepType == MCH_MILL_ST.ZIGZAG then
|
||||
|
||||
@@ -305,7 +305,7 @@ local function MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm)
|
||||
local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, bCheckOnlyRestlength)
|
||||
|
||||
-- spostamento assi macchina in posizione
|
||||
local dDeltaXHeadOffset = MoveMachineAxesToPosition( ptOnToolTipCenter, vtHead, vtAux)
|
||||
@@ -337,32 +337,32 @@ local function CheckCollisionPoint( sAxis, ptOnToolTipCenter, vtHead, vtAux, Par
|
||||
|
||||
-- check collisione con pezzo
|
||||
local bCollisionFoundPiece = false
|
||||
if not idCheckCollisionTm then
|
||||
idCheckCollisionTm = Part.idBoxTm
|
||||
if not bCheckOnlyRestlength then
|
||||
local idCheckCollisionTm = Part.idBoxTm
|
||||
-- se testa o coda attaccate, si considerano nella superficie di collisione
|
||||
if bCannotSplitRestLength then
|
||||
local b3CheckCollision = BeamLib.GetPartBoxWithHeadTail( Part, sRestLengthSideForPreSimulation)
|
||||
idCheckCollisionTm = EgtSurfTmBBox( Part.idTempGroup, b3CheckCollision, false, GDB_RT.GLOB)
|
||||
end
|
||||
end
|
||||
for i = 1, #CollisionSurfTmId do
|
||||
bCollisionFoundPiece = EgtCDeSolidSolid( idCheckCollisionTm, CollisionSurfTmId[i], BeamData.COLL_SIC)
|
||||
if not type( bCollisionFoundPiece) == "boolean" then
|
||||
error( 'Presimulation fail')
|
||||
for i = 1, #CollisionSurfTmId do
|
||||
bCollisionFoundPiece = EgtCDeSolidSolid( idCheckCollisionTm, CollisionSurfTmId[i], BeamData.COLL_SIC)
|
||||
if not type( bCollisionFoundPiece) == "boolean" then
|
||||
error( 'Presimulation fail')
|
||||
end
|
||||
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
|
||||
EgtSetColor( CollisionSurfTmId[i], RED())
|
||||
end
|
||||
if bCollisionFoundPiece then
|
||||
break
|
||||
end
|
||||
end
|
||||
if EgtGetDebugLevel() >= 3 and bCollisionFoundPiece then
|
||||
EgtSetColor( CollisionSurfTmId[i], RED())
|
||||
end
|
||||
if bCollisionFoundPiece then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
-- se trovata collisione con pezzo è inutile procedere con il grezzo
|
||||
if bCollisionFoundPiece then
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- check collisione con grezzo restante, se con il pezzo non c'è collisione e non è un taglio di testa o coda
|
||||
local bCollisionFoundRestLength = false
|
||||
@@ -401,7 +401,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
|
||||
|
||||
-- parametri opzionali
|
||||
OptionalParameters = OptionalParameters or {}
|
||||
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||
local bCheckOnlyRestlength = OptionalParameters.bCheckOnlyRestlength or false
|
||||
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
||||
local vtAux = OptionalParameters.vtAux
|
||||
@@ -426,7 +426,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
|
||||
-- se non si trova collisione si ritorna se è necessario separare prima di effettuare la lavorazione (ossia non c'è collisione con il pezzo ma c'è con il grezzo restante)
|
||||
for i = 1, #PointsOnToolTipCenter do
|
||||
|
||||
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, idCheckCollisionTm)
|
||||
local bCollisionFoundPiece, bCollisionFoundRestLength = CheckCollisionPoint( sAxis, PointsOnToolTipCenter[i], vtHead, vtAux, Part, bCannotSplitRestLength, sRestLengthSideForPreSimulation, bCheckOnlyRestlength)
|
||||
|
||||
-- se trovata collisione con pezzo è inutile controllare gli altri punti
|
||||
if bCollisionFoundPiece then
|
||||
@@ -445,7 +445,7 @@ local function CheckCollisionWithAxis( sAxis, MachiningParameters, OptionalParam
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function PreSimulationLib.CheckCollision( Parameters, OptionalParameters)
|
||||
function PreSimulationLib.CheckCollision( sBladeEngagement, Parameters, OptionalParameters)
|
||||
|
||||
local bCollisionFound
|
||||
local bMoveAfterSplitL3, bMoveAfterSplitR3, bMoveAfterSplitR2, bMoveAfterSplitR1
|
||||
@@ -459,19 +459,24 @@ function PreSimulationLib.CheckCollision( Parameters, OptionalParameters)
|
||||
OptionalParameters = OptionalParameters or {}
|
||||
|
||||
local OptionalParametersCheckCollisionWithAxis = {}
|
||||
OptionalParametersCheckCollisionWithAxis.bCheckOnlyRestlength = false
|
||||
OptionalParametersCheckCollisionWithAxis.PointsToCheck = OptionalParameters.PointsToCheck or nil
|
||||
OptionalParametersCheckCollisionWithAxis.sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||
OptionalParametersCheckCollisionWithAxis.bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
||||
OptionalParametersCheckCollisionWithAxis.sBlockedAxis = OptionalParameters.sBlockedAxis
|
||||
OptionalParametersCheckCollisionWithAxis.vtAux = OptionalParameters.vtAux
|
||||
OptionalParametersCheckCollisionWithAxis.idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||
|
||||
local sBlockedAxis = OptionalParameters.sBlockedAxis
|
||||
local bIsDicing = OptionalParameters.bIsDicing or false
|
||||
local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false
|
||||
local bCheckOnlyRestlengthForAxisABC = false
|
||||
|
||||
-- se cubetti in modalità standard (no DownUp) gli assi AB e C si controllano solo con grezzo (ci sarebbe collisione con il materiale già rimosso controllando AB e C con pezzo)
|
||||
if bIsDicing and ( sBladeEngagement == 'Standard') then
|
||||
bCheckOnlyRestlengthForAxisABC = true
|
||||
-- se l'elevazione reale (rispetto al pezzo + eventuale materiale in testa/coda) è maggiore del massimo materiale è sempre collisione
|
||||
-- TODO rifare con funzione
|
||||
if not bDisableRealElevationCheck then
|
||||
elseif not bDisableRealElevationCheck then
|
||||
local Edge = Parameters.Edge
|
||||
local vtNFace = Parameters.vtNFace
|
||||
local dDepthToMachine = Parameters.dDepthToMachine
|
||||
@@ -518,6 +523,9 @@ function PreSimulationLib.CheckCollision( Parameters, OptionalParameters)
|
||||
-- ultimo asse lineare prima dei rotativi (solitamente Z) si controlla sempre
|
||||
bCollisionFound, bMoveAfterSplitL3 = CheckCollisionWithAxis( sL3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
||||
|
||||
-- assi rotativi: se richiesto si controlla la collisione solo col grezzo
|
||||
OptionalParametersCheckCollisionWithAxis.bCheckOnlyRestlength = bCheckOnlyRestlengthForAxisABC
|
||||
|
||||
if sR3 and not bCollisionFound then
|
||||
bCollisionFound, bMoveAfterSplitR3 = CheckCollisionWithAxis( sR3, Parameters, OptionalParametersCheckCollisionWithAxis)
|
||||
end
|
||||
|
||||
@@ -131,14 +131,6 @@ local function MyProcessInputData()
|
||||
else
|
||||
PARTS[i].b3PartOriginal = b3Solid
|
||||
end
|
||||
if BeamData.MAX_LENGTH and BeamData.MAX_LENGTH > 10 and b3Solid:getDimX() > BeamData.MAX_LENGTH then
|
||||
local sOut = 'Lunghezza (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
|
||||
'oltre i limiti della macchina (' .. EgtNumToString( BeamData.MAX_LENGTH, 2) .. ') '
|
||||
EgtOutLog( sOut)
|
||||
EgtOutBox( sOut, 'Lavora Travi', 'WARNING')
|
||||
EgtDraw()
|
||||
return false
|
||||
end
|
||||
end
|
||||
dRawW = PARTS[1].b3PartOriginal:getDimY()
|
||||
dRawH = PARTS[1].b3PartOriginal:getDimZ()
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
"sName": "GEN_bGetAlternativesNesting2D",
|
||||
"sNameNge": "GET_ALTERNATIVES_NEST2D",
|
||||
"sValue": "false",
|
||||
"sDescriptionShort": "Enable material optimization function in nesting (part rotation disabled)",
|
||||
"sDescriptionShort": "Enable material optimization function in nesting",
|
||||
"sDescriptionLong": "",
|
||||
"sType": "b",
|
||||
"sMessageId": " ",
|
||||
|
||||
@@ -87,7 +87,6 @@ local function GetTenonStrategy( Proc, Part)
|
||||
ToolSearchParameters.dElevation = EgtSurfTmFacetElevationInBBox( Strategy.idTenonCutPlane, 0, Part.b3Part, true, GDB_ID.ROOT)
|
||||
|
||||
ToolSearchParameters.vtToolDirection = Proc.FeatureInfo.vtTenonN
|
||||
ToolSearchParameters.sMillShape = 'STANDARD'
|
||||
ToolSearchParameters.AvailableToolList = MachiningLib.GetAvailableToolList( Proc, Strategy.Parameters.sPocketingList, 'Pocketing')
|
||||
Machining.Cutting.ToolInfo = MachiningLib.FindMill( Proc, ToolSearchParameters)
|
||||
|
||||
|
||||
@@ -415,8 +415,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
end
|
||||
|
||||
-- ancora materiale residuo - se possibile si lavora dal lato
|
||||
if ( Chainsaw.Result.Bottom[#Chainsaw.Result.Bottom].dResidualDepth > 10 * GEO.EPS_SMALL
|
||||
or not Chainsaw.Result.Bottom[#Chainsaw.Result.Bottom].bIsApplicable)
|
||||
if Chainsaw.Result.Bottom[#Chainsaw.Result.Bottom].dResidualDepth > 10 * GEO.EPS_SMALL
|
||||
and #Proc.MainFaces.SideFaces == 1 then
|
||||
|
||||
-- si lavora solamente l'impronta lama sul fondo
|
||||
@@ -699,13 +698,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
else
|
||||
Strategy.Result.sStatus = 'Not-Completed'
|
||||
end
|
||||
|
||||
if Proc.Topology.sName == 'Groove-4-Blind' or Proc.Topology.sName == 'Pocket-5-Blind' then
|
||||
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( 'SEMI')
|
||||
else
|
||||
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( Result)
|
||||
end
|
||||
|
||||
Strategy.Result.dQuality = FeatureLib.GetStrategyQuality( Result)
|
||||
Strategy.Result.dTimeToMachine = FeatureLib.GetStrategyTimeToMachine( Result)
|
||||
Strategy.Result.dMRR = ( dFeatureVolume / Strategy.Result.dTimeToMachine) / pow( 10, 6)
|
||||
else
|
||||
|
||||
@@ -215,6 +215,7 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters)
|
||||
end
|
||||
|
||||
-- se la lavorazione ostacola il pinzaggio, non posso farla, serve una lavorazioen che lasci il testimone
|
||||
-- TODO Girando il pezzo trova sempre che limitano il pinzaggio se pezzo piccolo!! Il controllo non va bene. Da rifare
|
||||
if MachiningLib.IsFeatureHinderingClamping( Proc, Part) then
|
||||
local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. StrategyLib.Config.sStrategyId .. ' not applicable ( Feature hinders clamping)'
|
||||
EgtOutLog( sErr)
|
||||
|
||||
@@ -260,7 +260,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
|
||||
local dShortPartLength = OptionalParameters.dShortPartLength or BeamData.LEN_SHORT_PART
|
||||
local EdgeToMachineTop = OptionalParameters.EdgeToMachineTop
|
||||
local EdgeToMachineBottom = OptionalParameters.EdgeToMachineBottom
|
||||
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||
local bIsDicing = OptionalParameters.bIsDicing
|
||||
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation
|
||||
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength
|
||||
-- TODO qui sarebbe meglio avere dExtra come OptionalParameter???
|
||||
@@ -289,7 +289,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
|
||||
FaceToMachine = Face,
|
||||
EdgeToMachine = EdgeToMachineTop,
|
||||
Part = Part,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength
|
||||
})
|
||||
@@ -304,7 +304,7 @@ local function GetBestBlade( Proc, Part, Face, OptionalParameters)
|
||||
FaceToMachine = Face,
|
||||
EdgeToMachine = EdgeToMachineBottom,
|
||||
Part = Part,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength
|
||||
})
|
||||
@@ -371,7 +371,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
|
||||
local bReduceBladePath = OptionalParameters.bReduceBladePath or false
|
||||
local bAllowFastCuts = OptionalParameters.bAllowFastCuts or false
|
||||
local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1]
|
||||
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||
local bIsDicing = OptionalParameters.bIsDicing or false
|
||||
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
||||
-- lati da lavorare in base al tipo di lama
|
||||
@@ -390,7 +390,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
|
||||
EdgeToMachineTop = EdgeToMachineList.Top,
|
||||
EdgeToMachineBottom = EdgeToMachineList.Bottom,
|
||||
nToolIndex = nToolIndex,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength
|
||||
}
|
||||
@@ -442,7 +442,7 @@ local function GetSingleCutStrategy( Proc, Part, OptionalParameters)
|
||||
FaceToMachine = FaceToMachine,
|
||||
EdgeToMachine = EdgeToMachineList.TopGuillotine,
|
||||
Part = Part,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength
|
||||
})
|
||||
@@ -475,7 +475,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
||||
OptionalParameters = OptionalParameters or {}
|
||||
local nToolIndex = OptionalParameters.nToolIndex
|
||||
local FaceToMachine = Proc.Faces[OptionalParameters.nFaceToMachineIndex or 1]
|
||||
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||
local bIsDicing = OptionalParameters.bIsDicing or false
|
||||
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
||||
|
||||
@@ -499,7 +499,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
||||
FaceToMachine = FaceToMachine,
|
||||
EdgeToMachine = EdgeToMachine,
|
||||
Part = Part,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength
|
||||
})
|
||||
@@ -512,7 +512,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
||||
FaceToMachine = FaceToMachine,
|
||||
EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN),
|
||||
Part = Part,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength
|
||||
})
|
||||
@@ -534,7 +534,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
||||
FaceToMachine = FaceToMachine,
|
||||
EdgeToMachine = BeamLib.FindEdgeBestOrientedAsDirection( FaceToMachine.Edges, -EdgeToMachine.vtN),
|
||||
Part = Part,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength
|
||||
})
|
||||
@@ -553,7 +553,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
||||
FaceToMachine = FaceToMachine,
|
||||
EdgeToMachine = EdgeToMachine,
|
||||
Part = Part,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength
|
||||
})
|
||||
@@ -589,7 +589,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
||||
FaceToMachine = FaceToMachine,
|
||||
EdgeToMachine = EdgeToMachine,
|
||||
Part = Part,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength
|
||||
})
|
||||
@@ -607,7 +607,7 @@ local function GetDualSideCutStrategy( Proc, Part, OptionalParameters)
|
||||
dDepthToMachine = dDepthToMachine
|
||||
}
|
||||
local BladeEngagementOptionalParameters = {
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
bIsDicing = bIsDicing,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength
|
||||
}
|
||||
@@ -782,52 +782,6 @@ local function CutWholeWaste( Proc, Part, OptionalParameters)
|
||||
end
|
||||
|
||||
|
||||
local function UpdateDiceRaw( idRaw, idParallelTm, idPerpendicularTm, Part, MainFace, OtherFace)
|
||||
|
||||
-- frame solidale alla feature
|
||||
local vtZ = MainFace.vtN
|
||||
local vtX = OtherFace and OtherFace.vtN or nil
|
||||
local frMainFace = Frame3d( MainFace.ptCenter, vtZ, vtX)
|
||||
|
||||
-- box del cubetto in riferimento feature
|
||||
local b3Surf = EgtGetBBoxRef( idParallelTm, GDB_BB.STANDARD, frMainFace)
|
||||
if idPerpendicularTm then
|
||||
local b3SurfPerpendicular = EgtGetBBoxRef( idPerpendicularTm, GDB_BB.STANDARD, frMainFace)
|
||||
b3Surf:Add( b3SurfPerpendicular)
|
||||
else
|
||||
-- se non arriva la superficie perpendicolare è un solo taglio parallelo: si estende il box in Z in modo da uscire dal pezzo
|
||||
local ptDeltaZ = b3Surf:getMax() + vtZ * ( MainFace.dElevation + 5)
|
||||
b3Surf:Add( ptDeltaZ)
|
||||
end
|
||||
|
||||
-- estensione box per non avere problemi nella sottrazione booleana
|
||||
if OtherFace and idPerpendicularTm then
|
||||
local vtY = vtZ ^ vtX
|
||||
local ptDeltaX = b3Surf:getMax() + vtX * 1
|
||||
local ptDeltaZ = b3Surf:getMax() + vtZ * 1
|
||||
local ptDeltaYplus = b3Surf:getMax() + vtY * 1
|
||||
local ptDeltaYminus = b3Surf:getMin() - vtY * 1
|
||||
b3Surf:Add( ptDeltaX)
|
||||
b3Surf:Add( ptDeltaZ)
|
||||
b3Surf:Add( ptDeltaYplus)
|
||||
b3Surf:Add( ptDeltaYminus)
|
||||
else
|
||||
b3Surf:expand( 1)
|
||||
end
|
||||
|
||||
-- si porta il box in riferimento globale
|
||||
b3Surf:toGlob( frMainFace)
|
||||
|
||||
-- conversione box cubetto in superficie
|
||||
local idSurfTmToSubtract = EgtSurfTmBBox( Part.idTempGroup, b3Surf, false, GDB_RT.GLOB)
|
||||
|
||||
-- sottrazione del cubetto dal grezzo
|
||||
EgtSurfTmSubtract( idRaw, idSurfTmToSubtract)
|
||||
|
||||
return idRaw
|
||||
end
|
||||
|
||||
|
||||
local function CalculateDiceMachinings( vCuts, Parameters)
|
||||
local Machinings = {}
|
||||
local bMoveAfterSplit = false
|
||||
@@ -835,7 +789,6 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
||||
local Proc = Parameters.Proc
|
||||
local Part = Parameters.Part
|
||||
local MainFace = Parameters.MainFace
|
||||
local OtherFace = next( Parameters.OtherFace) and Parameters.OtherFace or nil
|
||||
local Tool = Parameters.Tool
|
||||
local sChosenBladeType = Parameters.sChosenBladeType
|
||||
local dExtendAfterTail = Parameters.dExtendAfterTail
|
||||
@@ -844,15 +797,21 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
||||
local bCannotSplitRestLength = Parameters.bCannotSplitRestLength
|
||||
local bReduceDiceDepth = Parameters.bReduceDiceDepth
|
||||
|
||||
-- trimesh con RestLength
|
||||
local b3CheckCollision = BeamLib.GetPartBoxWithHeadTail( Part, sRestLengthSideForPreSimulation)
|
||||
local idCheckCollisionTm = EgtSurfTmBBox( Part.idTempGroup, b3CheckCollision, false, GDB_RT.GLOB)
|
||||
|
||||
-- eventuale inversione tagli ortogonali e aggiunta informazioni alla geometria
|
||||
local bAreOrthogonalCutsInverted = false
|
||||
for i = 1, #vCuts do
|
||||
for j = 1, #vCuts[i] do
|
||||
SetDiceFaceInfo( Proc, vCuts[i][j])
|
||||
-- TODO vedere se questa parte serve ancora; in teoria no perchè il taglio è girato automaticamente nella FaceByBlade
|
||||
-- if ( i % 2) == 1 then
|
||||
-- local vtO = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
|
||||
-- if MachiningLib.IsFaceZOutOfRange( vtO, Tool) then
|
||||
-- EgtInvertSurf( vCuts[i][j])
|
||||
-- local vtCurrentFaceNormal = EgtSurfTmFacetNormVersor( vCuts[i][j], 0, GDB_ID.ROOT)
|
||||
-- EgtMove( vCuts[i][j], -vtCurrentFaceNormal * Tool.dThickness, GDB_RT.GLOB)
|
||||
-- bAreOrthogonalCutsInverted = true
|
||||
-- end
|
||||
-- end
|
||||
end
|
||||
end
|
||||
-- calcolo lavorazioni
|
||||
@@ -893,17 +852,19 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
||||
end
|
||||
-- calcolo lavorazione della singola faccia
|
||||
-- per tagli paralleli e faccia aperta si prova a tagliare come se fosse una faccia singola, accorpando i tagli
|
||||
-- TODO bIsDicing è da mettere a true?
|
||||
local bCanMergeParallelCuts = ( ( i % 2) == 0) and ( Proc.nFct == 1)
|
||||
local bIsDicingOk = true
|
||||
if bCanMergeParallelCuts then
|
||||
local nAddGrpId = BeamLib.GetAddGroup( Part.id)
|
||||
local idSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
|
||||
local ProcTrimesh = FeatureLib.GetProcFromTrimesh( idSurfToCut, Part)
|
||||
local nSurfToCut = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
|
||||
local ProcTrimesh = FeatureLib.GetProcFromTrimesh( nSurfToCut, Part)
|
||||
|
||||
local OptionalParametersCutWholeWaste = {
|
||||
nToolIndex = Tool.nIndex,
|
||||
dExtendAfterTail = dExtendAfterTail,
|
||||
bReduceBladePath = bReduceBladePath,
|
||||
bIsDicing = false,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength
|
||||
}
|
||||
@@ -916,12 +877,8 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
||||
bMoveAfterSplit = true
|
||||
end
|
||||
end
|
||||
-- aggiornamento grezzo dinamico
|
||||
if i % 2 == 0 then
|
||||
UpdateDiceRaw( idCheckCollisionTm, idSurfToCut, vCuts[i-1][#vCuts[i-1]], Part, MainFace, OtherFace)
|
||||
end
|
||||
else
|
||||
EgtErase( idSurfToCut)
|
||||
EgtErase( nSurfToCut)
|
||||
bIsDicingOk = false
|
||||
end
|
||||
end
|
||||
@@ -962,10 +919,9 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
||||
dRadialStepSpan = 0,
|
||||
dExtendAfterTail = dExtendAfterTail,
|
||||
bIsDicing = true,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength,
|
||||
bDisableRealElevationCheck = true
|
||||
bDisableRealElevationCheck = ( i % 2) > 0 -- se taglio perpendicolare non si deve mai considerare il materiale precedente
|
||||
}
|
||||
Cutting = FaceByBlade.Make( ProcTrimesh, Part, FaceToMachine, EdgeToMachine, OptionalParametersFaceByBlade)
|
||||
Cutting.ptCenter = Point3d( ProcTrimesh.Faces[1].ptCenter:getX(), 0, 0)
|
||||
@@ -980,10 +936,6 @@ local function CalculateDiceMachinings( vCuts, Parameters)
|
||||
if Cutting.sStage == 'AfterTail' then
|
||||
bMoveAfterSplit = true
|
||||
end
|
||||
-- aggiornamento grezzo dinamico
|
||||
if i % 2 == 0 then
|
||||
UpdateDiceRaw( idCheckCollisionTm, vCuts[i][j], vCuts[i-1][j], Part, MainFace, OtherFace)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1061,7 +1013,6 @@ local function CutWithDicing( Proc, Part, OptionalParameters)
|
||||
Proc = Proc,
|
||||
Part = Part,
|
||||
MainFace = Face1,
|
||||
OtherFace = Face2,
|
||||
Tool = TOOLS[nToolIndex],
|
||||
sChosenBladeType = sChosenBladeType,
|
||||
dExtendAfterTail = dExtendAfterTail,
|
||||
|
||||
@@ -209,7 +209,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
||||
local dRadialStepSpan = OptionalParameters.dRadialStepSpan
|
||||
local sUserNotes = OptionalParameters.sUserNotes or ''
|
||||
local bIsDicing = OptionalParameters.bIsDicing or false
|
||||
local idCheckCollisionTm = OptionalParameters.idCheckCollisionTm
|
||||
local sRestLengthSideForPreSimulation = OptionalParameters.sRestLengthSideForPreSimulation or 'Tail'
|
||||
local bCannotSplitRestLength = OptionalParameters.bCannotSplitRestLength or false
|
||||
local bDisableRealElevationCheck = OptionalParameters.bDisableRealElevationCheck or false
|
||||
@@ -238,7 +237,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
||||
end
|
||||
local BladeEngagementOptionalParameters = {
|
||||
bIsDicing = bIsDicing,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength,
|
||||
bDisableRealElevationCheck = bDisableRealElevationCheck
|
||||
@@ -362,7 +360,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
||||
}
|
||||
local BladeEngagementOptionalParameters = {
|
||||
bIsDicing = bIsDicing,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength,
|
||||
bDisableRealElevationCheck = bDisableRealElevationCheck
|
||||
@@ -481,7 +478,6 @@ function FACEBYBLADE.Make( Proc, Part, FaceToMachine, EdgeToMachine, OptionalPar
|
||||
}
|
||||
local BladeEngagementOptionalParameters = {
|
||||
bIsDicing = bIsDicing,
|
||||
idCheckCollisionTm = idCheckCollisionTm,
|
||||
sRestLengthSideForPreSimulation = sRestLengthSideForPreSimulation,
|
||||
bCannotSplitRestLength = bCannotSplitRestLength,
|
||||
bDisableRealElevationCheck = bDisableRealElevationCheck
|
||||
|
||||
@@ -44,9 +44,8 @@ local function CalculateLeadInOut( Machining, EdgeToMachine, sSideToMachine, dLe
|
||||
end
|
||||
|
||||
-- punti dell'attacco
|
||||
local dLengthToAdd = EgtIf( Machining.bToolInvert, -Machining.dStartSafetyLength, EdgeToMachine.dElevation - ( Machining.dMaxElev or 0) + Machining.dStartSafetyLength)
|
||||
LeadIn.ptPoint = EdgeToMachine.ptStart - EdgeToMachine.vtEdge * LeadIn.dStartAddLength + EdgeToMachine.vtN * dLengthToAdd
|
||||
LeadOut.ptPoint = EdgeToMachine.ptEnd + EdgeToMachine.vtEdge * LeadOut.dEndAddLength + EdgeToMachine.vtN * dLengthToAdd
|
||||
LeadIn.ptPoint = EdgeToMachine.ptStart - EdgeToMachine.vtEdge * LeadIn.dStartAddLength + EdgeToMachine.vtN * ( EdgeToMachine.dElevation - Machining.dDepthToMachine)
|
||||
LeadOut.ptPoint = EdgeToMachine.ptEnd + EdgeToMachine.vtEdge * LeadOut.dEndAddLength + EdgeToMachine.vtN * ( EdgeToMachine.dElevation - Machining.dDepthToMachine)
|
||||
|
||||
return LeadIn, LeadOut
|
||||
end
|
||||
@@ -174,7 +173,7 @@ function FACEBYCHAINSAW.Make( Proc, Part, FaceToMachine, EdgeToMachine, Optional
|
||||
-- offset radiale
|
||||
Mortising.dRadialOffset = 0
|
||||
-- distanza di sicurezza
|
||||
Mortising.dStartSafetyLength = ( TOOLS[Mortising.nToolIndex].SetupInfo.dZSafeDelta or 0) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ)
|
||||
Mortising.dStartSafetyLength = max( EdgeToMachine.dElevation, ( TOOLS[Mortising.nToolIndex].SetupInfo.dZSafeDelta or 60) + EgtMdbGetGeneralParam( MCH_GP.SAFEZ))
|
||||
-- overlap
|
||||
Mortising.dOverlap = 0
|
||||
-- step
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
==== Beam Update Log ====
|
||||
|
||||
Versione 3.1e1 (29/05/2026)
|
||||
- Primo commit nuovo automatismo a strategie
|
||||
Versione 2.6-- (--/--/2024)
|
||||
- Primo commit creazione nuovo automatismo BEAM con strategie
|
||||
+2
-2
@@ -2,5 +2,5 @@
|
||||
-- Gestione della versione di Beam
|
||||
|
||||
NAME = 'Beam'
|
||||
VERSION = '3.1e1'
|
||||
MIN_EXE = '3.1e1'
|
||||
VERSION = '2.8a1'
|
||||
MIN_EXE = '2.7j2'
|
||||
|
||||
Reference in New Issue
Block a user