Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c8a1f2de6 |
+4
-4
@@ -24,14 +24,14 @@ variables:
|
|||||||
$FileList = Get-ChildItem("*.lua")
|
$FileList = Get-ChildItem("*.lua")
|
||||||
ForEach ($File in $FileList) {
|
ForEach ($File in $FileList) {
|
||||||
$FileName = Split-Path $File -leaf
|
$FileName = Split-Path $File -leaf
|
||||||
lua54 -o bin\$FileName -s $FileName
|
lua54 -o bin\$FileName $FileName
|
||||||
echo "lua54 -o bin\$FileName -s $FileName"
|
echo "lua54 -o bin\$FileName $FileName"
|
||||||
}
|
}
|
||||||
$FileList = Get-ChildItem("LuaLibs\*.lua")
|
$FileList = Get-ChildItem("LuaLibs\*.lua")
|
||||||
ForEach ($File in $FileList) {
|
ForEach ($File in $FileList) {
|
||||||
$FileName = Split-Path $File -leaf
|
$FileName = Split-Path $File -leaf
|
||||||
lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName
|
lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName
|
||||||
echo "lua54 -o bin\LuaLibs\$FileName -s LuaLibs\$FileName"
|
echo "lua54 -o bin\LuaLibs\$FileName LuaLibs\$FileName"
|
||||||
}
|
}
|
||||||
|
|
||||||
# helper copia SORGENTI verso cartella di rete X:\ dei SORGENTI
|
# helper copia SORGENTI verso cartella di rete X:\ dei SORGENTI
|
||||||
|
|||||||
+25
-49
@@ -60,9 +60,6 @@
|
|||||||
-- 2024/03/04 Creata funzione calcolo dipendenze tra feature con calcolo topologia.
|
-- 2024/03/04 Creata funzione calcolo dipendenze tra feature con calcolo topologia.
|
||||||
-- 2024/03/07 Implementate le lavorazioni in doppio per fori specchiati non passanti e DrillPocket.
|
-- 2024/03/07 Implementate le lavorazioni in doppio per fori specchiati non passanti e DrillPocket.
|
||||||
-- 2024/03/11 In CollectFeatures si scrive ora Width e Height della faccia sia trimmate con il grezzo che intere.
|
-- 2024/03/11 In CollectFeatures si scrive ora Width e Height della faccia sia trimmate con il grezzo che intere.
|
||||||
-- 2024/03/13 In CollectFeatures si scrive lunghezza foro su Proc e si controla se serve Predrill
|
|
||||||
-- In OrderFeature, preforo sempre prima del foro
|
|
||||||
-- 2024/04/11 In CollectFeatures aggiunta lettura info PRID, scritta in Proc.FeatureId
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local BeamExec = {}
|
local BeamExec = {}
|
||||||
@@ -324,7 +321,6 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
-- leggo se ci sono feature collegate
|
-- leggo se ci sono feature collegate
|
||||||
local nAddAdjId = EgtGetInfo( ProcId, 'ADJID', 'i')
|
local nAddAdjId = EgtGetInfo( ProcId, 'ADJID', 'i')
|
||||||
local nAddMainId = EgtGetInfo( ProcId, 'MAINID', 'i')
|
local nAddMainId = EgtGetInfo( ProcId, 'MAINID', 'i')
|
||||||
local nFeatureId = EgtGetInfo( ProcId, 'PRID', 'i')
|
|
||||||
if nGrp and nPrc and nDo == 1 then
|
if nGrp and nPrc and nDo == 1 then
|
||||||
local Proc = {}
|
local Proc = {}
|
||||||
Proc.PartId = PartId
|
Proc.PartId = PartId
|
||||||
@@ -338,7 +334,6 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
Proc.Fce = 0
|
Proc.Fce = 0
|
||||||
Proc.CutId = nCutId
|
Proc.CutId = nCutId
|
||||||
Proc.TaskId = nTaskId
|
Proc.TaskId = nTaskId
|
||||||
Proc.FeatureId = nFeatureId or Proc.TaskId
|
|
||||||
-- se ci sono feature collegate ne scrivo il riferimento nella Proc
|
-- se ci sono feature collegate ne scrivo il riferimento nella Proc
|
||||||
if nAddAdjId then
|
if nAddAdjId then
|
||||||
Proc.AdjId = Proc.Id + nAddAdjId
|
Proc.AdjId = Proc.Id + nAddAdjId
|
||||||
@@ -347,28 +342,41 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
end
|
end
|
||||||
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
|
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
|
||||||
if b3Raw then
|
if b3Raw then
|
||||||
|
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( PartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||||
-- recupero l'elenco delle facce della parte interessate dalla feature
|
-- recupero l'elenco delle facce della parte interessate dalla feature
|
||||||
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
|
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
|
||||||
-- recupero informazioni sulle facce della feature
|
-- recupero informazioni sulle facce della feature
|
||||||
if not Proc.Face then
|
if not Proc.Face then
|
||||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
Proc.Face = {}
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
Proc.Face[i] = { Id = i - 1, VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT )}
|
||||||
|
if Proc.Fct < 10 then
|
||||||
|
local frHV, dFaceWidthTrimmed, dFaceHeightTrimmed = BL.GetFaceHvRefDim( Proc.Id, i - 1, b3Raw)
|
||||||
|
-- frame OCS faccia
|
||||||
|
Proc.Face[i].FrameHV = frHV
|
||||||
|
-- larghezza OCS faccia trimmata con grezzo
|
||||||
|
Proc.Face[i].WidthTrimmed = dFaceWidthTrimmed
|
||||||
|
-- altezza OCS faccia trimmata con grezzo
|
||||||
|
Proc.Face[i].HeightTrimmed = dFaceHeightTrimmed
|
||||||
|
local _, dFaceWidth, dFaceHeight = BL.GetFaceHvRefDim( Proc.Id, i - 1)
|
||||||
|
-- larghezza OCS faccia
|
||||||
|
Proc.Face[i].Width = dFaceWidth
|
||||||
|
-- altezza OCS faccia
|
||||||
|
Proc.Face[i].Height = dFaceHeight
|
||||||
|
-- elevazione calcolata rispetto al box della parte
|
||||||
|
Proc.Face[i].Elevation = EgtSurfTmFacetElevationInBBox( Proc.Id, i - 1, b3Solid, true, GDB_ID.ROOT)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if Proc.Box and not Proc.Box:isEmpty() then
|
if Proc.Box and not Proc.Box:isEmpty() then
|
||||||
Proc.Head = IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
Proc.Head = IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
||||||
Proc.Tail, Proc.AdvTail = IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
|
Proc.Tail, Proc.AdvTail = IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||||
table.insert( vProc, Proc)
|
table.insert( vProc, Proc)
|
||||||
-- se foro
|
-- se foro
|
||||||
if Drill.Identify( Proc) then
|
if Drill.Identify( Proc) then
|
||||||
-- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento)
|
-- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento)
|
||||||
Proc.Diam, Proc.Len, Proc.Fcs, Proc.Fce = Drill.GetData( Proc, b3Raw)
|
Proc.Diam, Proc.Fcs, Proc.Fce = Drill.GetData( Proc, b3Raw)
|
||||||
-- verifico se devo inserire i prefori
|
|
||||||
if Drill.IsPredrillNeeded( Proc) then
|
|
||||||
local bAddProc, PredrillProc= Drill.AddPredrillFromDrillProc( Proc)
|
|
||||||
if bAddProc then
|
|
||||||
table.insert( vProc, PredrillProc)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- verifico se necessaria seconda lavorazione da parte opposta per foro più lungo della punta
|
-- verifico se necessaria seconda lavorazione da parte opposta per foro più lungo della punta
|
||||||
if Drill.Split( Proc, b3Raw) then
|
if Drill.Split( Proc, b3Raw) then
|
||||||
-- aggiorno flags prima parte foro (dati tabelle sempre per riferimento)
|
-- aggiorno flags prima parte foro (dati tabelle sempre per riferimento)
|
||||||
@@ -385,7 +393,6 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
Proc2.Box = BBox3d( Proc.Box)
|
Proc2.Box = BBox3d( Proc.Box)
|
||||||
Proc2.Fct = Proc.Fct
|
Proc2.Fct = Proc.Fct
|
||||||
Proc2.Diam = Proc.Diam
|
Proc2.Diam = Proc.Diam
|
||||||
Proc2.Len = Proc.Len
|
|
||||||
Proc2.Head = Drill.IsHeadFeature( Proc2, b3Raw, dCurrOvmH)
|
Proc2.Head = Drill.IsHeadFeature( Proc2, b3Raw, dCurrOvmH)
|
||||||
Proc2.Tail = Drill.IsTailFeature( Proc2, b3Raw, dCurrOvmH)
|
Proc2.Tail = Drill.IsTailFeature( Proc2, b3Raw, dCurrOvmH)
|
||||||
Proc2.Fcs = Proc.Fce
|
Proc2.Fcs = Proc.Fce
|
||||||
@@ -395,13 +402,6 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
Proc2.AdjId = Proc.AdjId
|
Proc2.AdjId = Proc.AdjId
|
||||||
Proc2.MainId = Proc.MainId
|
Proc2.MainId = Proc.MainId
|
||||||
table.insert( vProc, Proc2)
|
table.insert( vProc, Proc2)
|
||||||
-- verifico se devo inserire i prefori
|
|
||||||
if Drill.IsPredrillNeeded( Proc2) then
|
|
||||||
local bAddProc, PredrillProc= Drill.AddPredrillFromDrillProc( Proc2)
|
|
||||||
if bAddProc then
|
|
||||||
table.insert( vProc, PredrillProc)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
-- se BlockHaus HalfLap
|
-- se BlockHaus HalfLap
|
||||||
elseif Proc.Prc == 37 then
|
elseif Proc.Prc == 37 then
|
||||||
@@ -922,11 +922,7 @@ local function OrderFeatures( vProc, b3Raw)
|
|||||||
end
|
end
|
||||||
-- se entrambi fori con posizione praticamente uguale ordino secondo diametro e faccia di inizio (Fcs)
|
-- se entrambi fori con posizione praticamente uguale ordino secondo diametro e faccia di inizio (Fcs)
|
||||||
if B1.Prc == 40 and B2.Prc == 40 and abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < dSmallDrillRange then
|
if B1.Prc == 40 and B2.Prc == 40 and abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < dSmallDrillRange then
|
||||||
if B1.IsPredrill and not B2.IsPredrill then
|
if abs( B1.Diam - B2.Diam) < 1.0 then
|
||||||
return true
|
|
||||||
elseif not B1.IsPredrill and B2.IsPredrill then
|
|
||||||
return false
|
|
||||||
elseif abs( B1.Diam - B2.Diam) < 1.0 then
|
|
||||||
if B1.Fcs == B2.Fcs then
|
if B1.Fcs == B2.Fcs then
|
||||||
if abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < 1.0 then
|
if abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < 1.0 then
|
||||||
if abs( B1.Box:getCenter():getY() - B2.Box:getCenter():getY()) < 1.0 then
|
if abs( B1.Box:getCenter():getY() - B2.Box:getCenter():getY()) < 1.0 then
|
||||||
@@ -1974,11 +1970,6 @@ local function AreDrillingsMirrored( Proc, ProcMirror, b3Raw)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- fori della stessa profondità
|
|
||||||
if abs( Proc.Len - ProcMirror.Len) > 10 * GEO.EPS_SMALL then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -2056,7 +2047,7 @@ function BeamExec.ProcessFeatures()
|
|||||||
|
|
||||||
-- verifica presenza forature influenzate da lavorazioni di testa o coda
|
-- verifica presenza forature influenzate da lavorazioni di testa o coda
|
||||||
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
|
if BD.IMPROVE_HEAD_TAIL_DRILLINGS then
|
||||||
local vMachBeforeIntersDrillings = CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
|
vMachBeforeIntersDrillings = CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
|
||||||
SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachBeforeIntersDrillings)
|
SetDrillingsToMachineAfterHeadOrTailCut( vProc, vMachBeforeIntersDrillings)
|
||||||
end
|
end
|
||||||
-- verifica presenza di feature specchiate per eventuali lavorazioni simultanee
|
-- verifica presenza di feature specchiate per eventuali lavorazioni simultanee
|
||||||
@@ -2100,11 +2091,6 @@ function BeamExec.ProcessFeatures()
|
|||||||
-- creo la lavorazione
|
-- creo la lavorazione
|
||||||
local Proc = vProc[i]
|
local Proc = vProc[i]
|
||||||
if Proc.Flg ~= 0 and Proc.Down then
|
if Proc.Flg ~= 0 and Proc.Down then
|
||||||
-- dato che ho ruotato, aggiorno alcune proprietà della feature
|
|
||||||
Proc.Box = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD)
|
|
||||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
|
||||||
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
|
|
||||||
Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase)
|
|
||||||
Proc.PrevDouble = nPrevDouble
|
Proc.PrevDouble = nPrevDouble
|
||||||
nPrevDouble = Proc.Double
|
nPrevDouble = Proc.Double
|
||||||
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
||||||
@@ -2182,11 +2168,6 @@ function BeamExec.ProcessFeatures()
|
|||||||
-- creo la lavorazione
|
-- creo la lavorazione
|
||||||
local Proc = vProc[i]
|
local Proc = vProc[i]
|
||||||
if Proc.Flg ~= 0 and Proc.Side then
|
if Proc.Flg ~= 0 and Proc.Side then
|
||||||
-- dato che ho ruotato, aggiorno alcune proprietà della feature
|
|
||||||
Proc.Box = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD)
|
|
||||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
|
||||||
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
|
|
||||||
Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase)
|
|
||||||
Proc.PrevDouble = nPrevDouble
|
Proc.PrevDouble = nPrevDouble
|
||||||
nPrevDouble = Proc.Double
|
nPrevDouble = Proc.Double
|
||||||
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT)
|
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT)
|
||||||
@@ -2252,11 +2233,6 @@ function BeamExec.ProcessFeatures()
|
|||||||
-- creo la lavorazione
|
-- creo la lavorazione
|
||||||
local Proc = vProc[i]
|
local Proc = vProc[i]
|
||||||
if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD or BD.TURN) then
|
if Proc.Flg ~= 0 and ( not ( Proc.Down or Proc.Side) or BD.DOWN_HEAD or BD.TURN) then
|
||||||
-- dato che ho ruotato, aggiorno alcune proprietà della feature
|
|
||||||
Proc.Box = EgtGetBBoxGlob( Proc.Id, GDB_BB.STANDARD)
|
|
||||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
|
||||||
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
|
|
||||||
Proc.DistanceToNextPart = BL.GetDistanceToNextPart( nRawId, nPhase)
|
|
||||||
Proc.PrevDouble = nPrevDouble
|
Proc.PrevDouble = nPrevDouble
|
||||||
nPrevDouble = Proc.Double
|
nPrevDouble = Proc.Double
|
||||||
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
local bOk, sMsg, nNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, false, b3Raw, nOrd, sDownOrSideOrStd, nil, nil, dCurrOvmT)
|
||||||
|
|||||||
+4
-130
@@ -814,10 +814,9 @@ function BeamLib.GetDistanceToNextPart( nRawId, nPhase)
|
|||||||
-- se segue una parte rimanente riutilizzabile, modifico opportunamente questa distanza
|
-- se segue una parte rimanente riutilizzabile, modifico opportunamente questa distanza
|
||||||
if not BeamLib.IsSplittedPartPhase( nPhase) then
|
if not BeamLib.IsSplittedPartPhase( nPhase) then
|
||||||
local nNextRawId = EgtGetNextRawPart( nRawId)
|
local nNextRawId = EgtGetNextRawPart( nRawId)
|
||||||
if nNextRawId and
|
if nNextRawId and
|
||||||
EgtGetPartInRawPartCount( nNextRawId) <= 0 and
|
EgtGetPartInRawPartCount( nNextRawId) <= 0 and
|
||||||
EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw then
|
EgtGetRawPartBBox( nNextRawId):getDimX() >= BD.MinRaw then
|
||||||
|
|
||||||
dDistToNextPiece = BD.OVM_MID
|
dDistToNextPiece = BD.OVM_MID
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1170,129 +1169,4 @@ function BeamLib.IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
function BeamLib.GetAdjacentFaces( Proc, nFacet)
|
return BeamLib
|
||||||
local AdjacentFaces = {}
|
|
||||||
local vFaceAdjacencies = EgtSurfTmFacetAdjacencies( Proc.Id, nFacet)[1]
|
|
||||||
for i = 1, #vFaceAdjacencies do
|
|
||||||
if vFaceAdjacencies[i] > -1 then
|
|
||||||
local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, nFacet, vFaceAdjacencies[i], GDB_ID.ROOT)
|
|
||||||
local dLen = dist( ptP1, ptP2)
|
|
||||||
table.insert( AdjacentFaces, { Id = vFaceAdjacencies[i], LengthOnMainFace = dLen})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return AdjacentFaces
|
|
||||||
end
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
|
||||||
function BeamLib.GetFacetsInfo( Proc, b3Raw)
|
|
||||||
local Face = {}
|
|
||||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Proc.PartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
|
||||||
local vAdj
|
|
||||||
if Proc.AdjacencyMatrix then
|
|
||||||
vAdj = Proc.AdjacencyMatrix
|
|
||||||
else
|
|
||||||
vAdj = BeamLib.GetAdjacencyMatrix( Proc)
|
|
||||||
end
|
|
||||||
|
|
||||||
for i = 1, Proc.Fct do
|
|
||||||
Face[i] = {}
|
|
||||||
Face[i].Id = i - 1
|
|
||||||
Face[i].PtCenter, Face[i].VtN = EgtSurfTmFacetCenter( Proc.Id, i - 1, GDB_ID.ROOT)
|
|
||||||
if Proc.Fct < 10 then
|
|
||||||
local frHV, dFaceWidthTrimmed, dFaceHeightTrimmed = BeamLib.GetFaceHvRefDim( Proc.Id, i - 1, b3Raw)
|
|
||||||
-- frame OCS faccia
|
|
||||||
Face[i].FrameHV = frHV
|
|
||||||
-- larghezza OCS faccia trimmata con grezzo
|
|
||||||
Face[i].WidthTrimmed = dFaceWidthTrimmed
|
|
||||||
-- altezza OCS faccia trimmata con grezzo
|
|
||||||
Face[i].HeightTrimmed = dFaceHeightTrimmed
|
|
||||||
local _, dFaceWidth, dFaceHeight = BeamLib.GetFaceHvRefDim( Proc.Id, i - 1)
|
|
||||||
-- larghezza OCS faccia
|
|
||||||
Face[i].Width = dFaceWidth
|
|
||||||
-- altezza OCS faccia
|
|
||||||
Face[i].Height = dFaceHeight
|
|
||||||
-- elevazione calcolata rispetto al box della parte
|
|
||||||
Face[i].Elevation = EgtSurfTmFacetElevationInBBox( Proc.Id, i - 1, b3Solid, true, GDB_ID.ROOT)
|
|
||||||
-- area della faccia
|
|
||||||
-- TODO qui sarebbe meglio l'area vera e non quella del rettangolo minimo
|
|
||||||
local _, dLongEdgeDimension, dShortEdgeDimension = EgtSurfTmFacetMinAreaRectangle( Proc.Id, i - 1, GDB_ID.ROOT)
|
|
||||||
Face[i].Area = dShortEdgeDimension * dLongEdgeDimension
|
|
||||||
-- adiacenze della faccia
|
|
||||||
-- TODO chiamarle in modo che si capisca che sono solo gli id e non l'intero oggetto faccia
|
|
||||||
Face[i].Adjacencies = {}
|
|
||||||
for j = 1, Proc.Fct do
|
|
||||||
if vAdj[i][j] and vAdj[i][j] ~= 0 and ( i ~= j) then
|
|
||||||
table.insert( Face[i].Adjacencies, j - 1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return Face
|
|
||||||
end
|
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
-- restituisce la matrice delle adiacenze di Proc dove i e j sono le facce e a(ij) è l'angolo tra di esse; 0 se nessuna adiacenza
|
|
||||||
function BeamLib.GetAdjacencyMatrix( Proc)
|
|
||||||
local vAdj = {}
|
|
||||||
-- essendo la matrice simmetrica a diagonale nulla, ne calcolo solo la metà superiore
|
|
||||||
for i = 1, Proc.Fct do
|
|
||||||
vAdj[i] = {}
|
|
||||||
for j = i + 1, Proc.Fct do
|
|
||||||
_, _, _, vAdj[i][j] = EgtSurfTmFacetsContact( Proc.Id, i - 1, j - 1, GDB_ID.ROOT)
|
|
||||||
if not vAdj[i][j] then vAdj[i][j] = 0 end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- riempio di conseguenza il resto della matrice
|
|
||||||
for i = 1, Proc.Fct do
|
|
||||||
vAdj[i][i] = 0
|
|
||||||
for j = i + 1, Proc.Fct do
|
|
||||||
vAdj[j][i] = vAdj[i][j]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return vAdj
|
|
||||||
end
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
|
||||||
function BeamLib.GetMachiningSteps( dMachiningDepth, dStep)
|
|
||||||
|
|
||||||
local MachiningSteps = {}
|
|
||||||
MachiningSteps.StepLength = 0
|
|
||||||
MachiningSteps.Count = ceil( ( dMachiningDepth - 10 * GEO.EPS_SMALL) / dStep)
|
|
||||||
if MachiningSteps.Count > 1 then
|
|
||||||
MachiningSteps.StepLength = ( dMachiningDepth - dStep) / ( MachiningSteps.Count - 1)
|
|
||||||
end
|
|
||||||
|
|
||||||
return MachiningSteps
|
|
||||||
end
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
|
||||||
function BeamLib.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail)
|
|
||||||
if not dOvmTail then
|
|
||||||
dOvmTail = BD.OVM_MID
|
|
||||||
end
|
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
|
||||||
|
|
||||||
if Proc.Head then
|
|
||||||
-- se coincide con il taglio di separazione precedente, non va fatto
|
|
||||||
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
-- altrimenti taglio di coda
|
|
||||||
else
|
|
||||||
-- se coincide con taglio di separazione, non va fatto
|
|
||||||
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se coincide con un taglio frontale non va fatto
|
|
||||||
if Proc.CutFront then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
|
||||||
return BeamLib
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
-- 2024/01/18 Gestita lama con aggregato con asse bloccato per massimizzare capacità di taglio verticale, se da sotto.
|
-- 2024/01/18 Gestita lama con aggregato con asse bloccato per massimizzare capacità di taglio verticale, se da sotto.
|
||||||
-- Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
-- Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||||
-- 2024/02/22 Migliorato calcolo area non pinzabile in testa HCING e coda TCING
|
-- 2024/02/22 Migliorato calcolo area non pinzabile in testa HCING e coda TCING
|
||||||
-- 2024/03/27 In MakeTwo rimossa gestione calcolo differente su ultima passata in caso di macchina FAST
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local FacesBySaw = {}
|
local FacesBySaw = {}
|
||||||
@@ -407,10 +406,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
|
EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
|
||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = MCH_SCC.NONE
|
||||||
if not BD.TURN then
|
if not BD.TURN then
|
||||||
-- per ora aggregato usato in verticale solo in split e headcut; Fast non influenzata
|
if abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
|
||||||
if BD.C_SIMM and bMaximizeVerticalDepth then
|
|
||||||
nSCC = MCH_SCC.ADIR_ZM
|
|
||||||
elseif abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
|
|
||||||
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
|
||||||
else
|
else
|
||||||
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||||
@@ -622,7 +618,12 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
|
|||||||
local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nOtInd], vtRef[nUpInd])
|
local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nOtInd], vtRef[nUpInd])
|
||||||
-- lavoro la faccia
|
-- lavoro la faccia
|
||||||
for j = 1, #vCuts[i] do
|
for j = 1, #vCuts[i] do
|
||||||
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
-- se FAST, pezzo alto e ultimo taglio verticale -> allungo uscita per consentire eventuale rotazione B sul posto
|
||||||
|
local dAccEnd = 0
|
||||||
|
if not BD.C_SIMM and BD.MAX_HEIGHT_ROT_B_ABOVE and b3Raw:getDimZ() > BD.MAX_HEIGHT_ROT_B_ABOVE and vtOrthO:getZ() > 0.866 and j == #vCuts[i] then
|
||||||
|
dAccEnd = - ( dSawDiam / 2 + BD.CUT_SIC)
|
||||||
|
end
|
||||||
|
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, dAccEnd, nil, b3Raw)
|
||||||
if not bOk then
|
if not bOk then
|
||||||
return bOk, sErr
|
return bOk, sErr
|
||||||
end
|
end
|
||||||
|
|||||||
+28
-14
@@ -6,7 +6,6 @@
|
|||||||
-- 2023/11/03 In Classify ora si settano le AffectedFaces nella Proc, se non già presenti.
|
-- 2023/11/03 In Classify ora si settano le AffectedFaces nella Proc, se non già presenti.
|
||||||
-- Aggiunta groove 2 facce, differenziata da rabbet.
|
-- Aggiunta groove 2 facce, differenziata da rabbet.
|
||||||
-- 2024/03/04 Feature senza topologia, calcolato in BeamExec
|
-- 2024/03/04 Feature senza topologia, calcolato in BeamExec
|
||||||
-- 2024/05/06 A topologia Cut aggiunta IsThrough = true
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local FeatureTopology = {}
|
local FeatureTopology = {}
|
||||||
@@ -19,10 +18,32 @@ local BL = require( 'BeamLib')
|
|||||||
|
|
||||||
EgtOutLog( ' FeatureTopology started', 1)
|
EgtOutLog( ' FeatureTopology started', 1)
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- restituisce la matrice delle adiacenze di Proc dove i e j sono le facce e a(ij) è l'angolo tra di esse; 0 se nessuna adiacenza
|
||||||
|
local function GetAdjacencyMatrix( Proc)
|
||||||
|
local vAdj = {}
|
||||||
|
-- essendo la matrice simmetrica a diagonale nulla, ne calcolo solo la metà superiore
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
vAdj[i] = {}
|
||||||
|
for j = i + 1, Proc.Fct do
|
||||||
|
_, _, _, vAdj[i][j] = EgtSurfTmFacetsContact( Proc.Id, i - 1, j - 1, GDB_ID.ROOT)
|
||||||
|
if not vAdj[i][j] then vAdj[i][j] = 0 end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- riempio di conseguenza il resto della matrice
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
vAdj[i][i] = 0
|
||||||
|
for j = i + 1, Proc.Fct do
|
||||||
|
vAdj[j][i] = vAdj[i][j]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return vAdj
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- restituisce gli id delle facce di Proc che hanno il numero di adiacenze nAdj
|
-- restituisce gli id delle facce di Proc che hanno il numero di adiacenze nAdj
|
||||||
function FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, nAdj)
|
function FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, vAdj, nAdj)
|
||||||
if not vAdj then vAdj = BL.GetAdjacencyMatrix( Proc) end
|
if not vAdj then vAdj = GetAdjacencyMatrix( Proc) end
|
||||||
local nFct = #( vAdj or {})
|
local nFct = #( vAdj or {})
|
||||||
local vFacesWithGivenAdj = {}
|
local vFacesWithGivenAdj = {}
|
||||||
for i = 1, nFct do
|
for i = 1, nFct do
|
||||||
@@ -92,11 +113,11 @@ end
|
|||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- restituisce un vettore contenente gli indici delle facce di Proc parallele ad una delle direzioni principali; il check varia in base alla famiglia topologica
|
-- restituisce un vettore contenente gli indici delle facce di Proc parallele ad una delle direzioni principali; il check varia in base alla famiglia topologica
|
||||||
local function GetFacesParallelToPart( Proc, sFamily)
|
local function GetFacesParallelToPart( Proc, sFamily, bIsThrough)
|
||||||
local vFacesParallelToPart = {}
|
local vFacesParallelToPart = {}
|
||||||
for i = 0, Proc.Fct - 1 do
|
for i = 0, Proc.Fct - 1 do
|
||||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i, GDB_ID.ROOT)
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i, GDB_ID.ROOT)
|
||||||
if sFamily == 'Rabbet' or sFamily == 'Bevel' or sFamily == 'DoubleBevel' or sFamily == 'Strip' then
|
if sFamily == 'Rabbet' or sFamily == 'Bevel' or sFamily == 'DoubleBevel' or sFamily == 'Strip' or sFamily == 'Tunnel' or ( sFamily == 'Groove' and bIsThrough) then
|
||||||
local vTriangularFaces = GetTriangularFaces( Proc)
|
local vTriangularFaces = GetTriangularFaces( Proc)
|
||||||
local bIsTriangularFace = false
|
local bIsTriangularFace = false
|
||||||
-- verifico se la faccia è triangolare
|
-- verifico se la faccia è triangolare
|
||||||
@@ -159,14 +180,9 @@ function FeatureTopology.Classify( Proc, b3Raw)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- calcoli
|
-- calcoli
|
||||||
if not Proc.AffectedFaces then
|
if not Proc.AffectedFaces then Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc) end
|
||||||
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
|
|
||||||
end
|
|
||||||
if not Proc.Face then
|
|
||||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
|
||||||
end
|
|
||||||
|
|
||||||
local vAdj = Proc.AdjacencyMatrix or BL.GetAdjacencyMatrix( Proc)
|
local vAdj = GetAdjacencyMatrix( Proc)
|
||||||
local bAllAnglesConcave, bAllRightAngles = AreAllAnglesConcaveOrRight( vAdj)
|
local bAllAnglesConcave, bAllRightAngles = AreAllAnglesConcaveOrRight( vAdj)
|
||||||
local vTriangularFaces = GetTriangularFaces( Proc)
|
local vTriangularFaces = GetTriangularFaces( Proc)
|
||||||
local bIsAnyDimensionLongAsPart = IsAnyDimensionLongAsPart( Proc)
|
local bIsAnyDimensionLongAsPart = IsAnyDimensionLongAsPart( Proc)
|
||||||
@@ -183,7 +199,6 @@ function FeatureTopology.Classify( Proc, b3Raw)
|
|||||||
local bIsThrough
|
local bIsThrough
|
||||||
if Proc.Fct == 1 and bIsAnyDimensionLongAsPart and bIsFeatureCuttingEntireSection then
|
if Proc.Fct == 1 and bIsAnyDimensionLongAsPart and bIsFeatureCuttingEntireSection then
|
||||||
sFamily = 'Cut'
|
sFamily = 'Cut'
|
||||||
bIsThrough = true
|
|
||||||
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart then
|
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart then
|
||||||
sFamily = 'Bevel'
|
sFamily = 'Bevel'
|
||||||
bIsThrough = true
|
bIsThrough = true
|
||||||
@@ -224,7 +239,7 @@ function FeatureTopology.Classify( Proc, b3Raw)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- verifico se facce parallele a quelle della trave
|
-- verifico se facce parallele a quelle della trave
|
||||||
local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily)
|
local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily, bIsThrough)
|
||||||
local bIsParallel = ( #vFacesParallelToPart == Proc.Fct)
|
local bIsParallel = ( #vFacesParallelToPart == Proc.Fct)
|
||||||
|
|
||||||
-- assegnazioni
|
-- assegnazioni
|
||||||
@@ -234,7 +249,6 @@ function FeatureTopology.Classify( Proc, b3Raw)
|
|||||||
Proc.IsThrough = bIsThrough
|
Proc.IsThrough = bIsThrough
|
||||||
Proc.AllRightAngles = bAllRightAngles
|
Proc.AllRightAngles = bAllRightAngles
|
||||||
Proc.IsParallel = bIsParallel
|
Proc.IsParallel = bIsParallel
|
||||||
Proc.vAdj = vAdj
|
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
Proc.Topology = 'OTHER'
|
Proc.Topology = 'OTHER'
|
||||||
|
|||||||
+49
-42
@@ -13,7 +13,6 @@
|
|||||||
-- 2024/01/23 Nella GetMachinings vengono ora raccolti i parametri utensile necessari per i VerifyTool, scritti direttamente nella tabella Machining.Tool.
|
-- 2024/01/23 Nella GetMachinings vengono ora raccolti i parametri utensile necessari per i VerifyTool, scritti direttamente nella tabella Machining.Tool.
|
||||||
-- Le lavorazioni possono essere ora ordinate per dimensioni utensile (Longest, Shortest, Biggest, Smallest) se passato l'apposito parametro SortingCriterion in FindMachining. Al momento implementato solo per FindSawing.
|
-- Le lavorazioni possono essere ora ordinate per dimensioni utensile (Longest, Shortest, Biggest, Smallest) se passato l'apposito parametro SortingCriterion in FindMachining. Al momento implementato solo per FindSawing.
|
||||||
-- 2024/03/01 In VerifyPocketing implementato l'ordinamento per dimensioni utensile.
|
-- 2024/03/01 In VerifyPocketing implementato l'ordinamento per dimensioni utensile.
|
||||||
-- 2024/03/13 Aggiunta gestione Predrill
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local MachiningLib = {}
|
local MachiningLib = {}
|
||||||
@@ -74,34 +73,40 @@ local function SetCurrMachineHeadType()
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- setta ultimi testa e utensile utilizzati se compatibili con ottimizzazione testa
|
-- funzione che conferma e rende attivi testa e utensile ipotizzati
|
||||||
local function ConfirmNextMachining()
|
local function ConfirmNextMachining()
|
||||||
-- utensile corrente
|
-- se non definita testa successiva, esco
|
||||||
local sToolUuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
if not nNextMachHead or nNextMachHead < 1 or nNextMachHead > 2 then return end
|
||||||
local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '')
|
-- altrimenti, la confermo come attiva
|
||||||
EgtTdbSetCurrTool( sToolName or '')
|
nActiveHead = nNextMachHead
|
||||||
-- testa dell'utensile corrente
|
if nNextMachHead == 1 then
|
||||||
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
H1_TOOL = H1_NEXT_TOOL
|
||||||
local nHead = tonumber( sHead:sub( 2, #sHead)) + 0
|
elseif nNextMachHead == 2 then
|
||||||
|
H2_TOOL = H2_NEXT_TOOL
|
||||||
if ( nHead < 10 and nHead >= 30) or vFixedHeads[nHead] then
|
|
||||||
-- testa che non richiede ottimizzazione
|
|
||||||
return
|
|
||||||
elseif nHead >= 20 then
|
|
||||||
nHead = 2
|
|
||||||
elseif nHead >= 10 then
|
|
||||||
nHead = 1
|
|
||||||
end
|
|
||||||
|
|
||||||
-- se la testa richiede ottimizzazione, confermo testa attiva
|
|
||||||
nActiveHead = nHead
|
|
||||||
if nActiveHead == 1 then
|
|
||||||
H1_TOOL = sToolName
|
|
||||||
elseif nActiveHead == 2 then
|
|
||||||
H2_TOOL = sToolName
|
|
||||||
end
|
end
|
||||||
|
-- reset prossima testa
|
||||||
|
nNextMachHead = 0
|
||||||
|
H1_NEXT_TOOL = ''
|
||||||
|
H2_NEXT_TOOL = ''
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- funzione che traccia testa e utensile ipotizzati
|
||||||
|
local function SetNextMachining( sToolName, nHead, bFixed)
|
||||||
|
if nHead < 1 or nHead > 2 then return end
|
||||||
|
if bFixed then
|
||||||
|
nNextMachHead = 0
|
||||||
|
H1_NEXT_TOOL = ''
|
||||||
|
H2_NEXT_TOOL = ''
|
||||||
|
end
|
||||||
|
nNextMachHead = nHead
|
||||||
|
if nHead == 1 then
|
||||||
|
H1_NEXT_TOOL = sToolName
|
||||||
|
elseif nHead == 2 then
|
||||||
|
H2_NEXT_TOOL = sToolName
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function SetCurrMachiningAndTool( Machining)
|
local function SetCurrMachiningAndTool( Machining)
|
||||||
EgtMdbSetCurrMachining( Machining.Name)
|
EgtMdbSetCurrMachining( Machining.Name)
|
||||||
@@ -164,7 +169,7 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function VerifyTool( Machining, MachiningType, Params, bH2)
|
function VerifyTool( Machining, MachiningType, Params, bH2)
|
||||||
if MachiningType == MCH_MY.DRILLING then
|
if MachiningType == MCH_MY.DRILLING then
|
||||||
if Machining.SubType == 'Drill' or Machining.SubType == 'AngleDrill' or Machining.SubType == 'Predrill' then
|
if Machining.SubType == 'Drill' or Machining.SubType == 'AngleDrill' then
|
||||||
return VerifyDrill( Machining, Params.Diam, Params.Depth, bH2)
|
return VerifyDrill( Machining, Params.Diam, Params.Depth, bH2)
|
||||||
elseif Machining.SubType == 'DrillPocket' then
|
elseif Machining.SubType == 'DrillPocket' then
|
||||||
return VerifyDrillPocket( Machining, Params.Diam, Params.Depth, bH2)
|
return VerifyDrillPocket( Machining, Params.Diam, Params.Depth, bH2)
|
||||||
@@ -220,8 +225,6 @@ function GetMachinings( MachiningType, sType)
|
|||||||
Machining.SubType = 'AngleDrill'
|
Machining.SubType = 'AngleDrill'
|
||||||
elseif EgtStartsWith( Machining.Type, 'Pocket') then
|
elseif EgtStartsWith( Machining.Type, 'Pocket') then
|
||||||
Machining.SubType = 'DrillPocket'
|
Machining.SubType = 'DrillPocket'
|
||||||
elseif EgtStartsWith( Machining.Type, 'Predrill') then
|
|
||||||
Machining.SubType = 'Predrill'
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||||
@@ -297,7 +300,7 @@ end
|
|||||||
function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
|
function ReturnParams( MachiningType, MachiningName, sType, ToolParams)
|
||||||
if MachiningType == MCH_MY.DRILLING then
|
if MachiningType == MCH_MY.DRILLING then
|
||||||
local _, sOrigType = EgtEndsWith( sType, '_H2')
|
local _, sOrigType = EgtEndsWith( sType, '_H2')
|
||||||
return MachiningName, sType, EgtIf( sOrigType == 'Drill' or sOrigType == 'Drill_AT' or sOrigType == 'AngleDrill' or sOrigType == 'Predrill' , ToolParams.TMaxMat, ToolParams.TMaxDepth), ToolParams.MaxToolLength, ToolParams.ToolDiam, ToolParams.DiamTh, ToolParams.FreeLen
|
return MachiningName, sType, EgtIf( sOrigType == 'Drill' or sOrigType == 'Drill_AT' or sOrigType == 'AngleDrill' , ToolParams.TMaxMat, ToolParams.TMaxDepth), ToolParams.MaxToolLength, ToolParams.ToolDiam, ToolParams.DiamTh, ToolParams.FreeLen
|
||||||
elseif MachiningType == MCH_MY.SAWING then
|
elseif MachiningType == MCH_MY.SAWING then
|
||||||
return MachiningName, ToolParams.H2
|
return MachiningName, ToolParams.H2
|
||||||
elseif MachiningType == MCH_MY.MILLING then
|
elseif MachiningType == MCH_MY.MILLING then
|
||||||
@@ -350,16 +353,16 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
|||||||
end
|
end
|
||||||
if ( BEAM and BEAM.BW) or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then
|
if ( BEAM and BEAM.BW) or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then
|
||||||
_, sType = EgtEndsWith( sType, '_H2')
|
_, sType = EgtEndsWith( sType, '_H2')
|
||||||
elseif not ( BEAM and BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then
|
elseif ( not BEAM or not BEAM.BW) and MachineHeadType == TWO_UP_DOWN_HEADS and bDownHead then
|
||||||
if not EgtEndsWith( sType, '_H2') then
|
if not EgtEndsWith( sType, '_H2') then
|
||||||
sType = sType .. '_H2'
|
sType = sType .. '_H2'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local MachineHeadUse = MachineHeadType
|
local MachineHeadUse = MachineHeadType
|
||||||
if not ( BEAM and BEAM.BW) and MachineHeadUse == TWO_EQUAL_HEADS then
|
if not BEAM or not BEAM.BW then
|
||||||
MachineHeadUse = ONE_HEAD
|
MachineHeadUse = ONE_HEAD
|
||||||
end
|
end
|
||||||
if MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
|
if BEAM and BEAM.BW and MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then
|
||||||
-- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra
|
-- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra
|
||||||
MachineHeadUse = TWO_EQUAL_HEADS
|
MachineHeadUse = TWO_EQUAL_HEADS
|
||||||
end
|
end
|
||||||
@@ -368,7 +371,7 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
|||||||
for i = ForStart, ForEnd, ForStep do
|
for i = ForStart, ForEnd, ForStep do
|
||||||
local Machining = Machinings[i]
|
local Machining = Machinings[i]
|
||||||
local sMachiningType = Machining.Type
|
local sMachiningType = Machining.Type
|
||||||
if ( BEAM and BEAM.BW) or MachineHeadUse == TWO_EQUAL_HEADS then
|
if BEAM and BEAM.BW then
|
||||||
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
|
_, sMachiningType = EgtEndsWith( Machining.Type, '_H2')
|
||||||
end
|
end
|
||||||
-- recupero dati utensile
|
-- recupero dati utensile
|
||||||
@@ -377,15 +380,18 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
|||||||
local bOk, ToolParams = VerifyTool( Machining, MachiningType, Params, bH2)
|
local bOk, ToolParams = VerifyTool( Machining, MachiningType, Params, bH2)
|
||||||
if bOk then
|
if bOk then
|
||||||
if MachineHeadUse == ONE_HEAD then
|
if MachineHeadUse == ONE_HEAD then
|
||||||
|
SetNextMachining( sToolName, 1, bFixed)
|
||||||
return ReturnParams(MachiningType, Machining.Name, Machining.Type, ToolParams)
|
return ReturnParams(MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||||
elseif MachineHeadUse == TWO_EQUAL_HEADS then
|
elseif MachineHeadUse == TWO_EQUAL_HEADS then
|
||||||
-- se nessuna testa attiva, prendo la prima lavorazione disponibile
|
-- se nessuna testa attiva, prendo la prima lavorazione disponibile
|
||||||
if nActiveHead == 0 then
|
if nActiveHead == 0 then
|
||||||
|
SetNextMachining( sToolName, EgtIf( bH2, 2, 1), bFixed)
|
||||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||||
-- verifico se posso usare lo stesso utensile della testa attiva
|
-- verifico se posso usare lo stesso utensile della testa attiva
|
||||||
elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then
|
elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then
|
||||||
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo
|
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo
|
||||||
if ( not sH1Param or not sH1Param.TDiam or sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam) and ( not sH2Param or not sH2Param.TDiam or sH2Param.TDiam < 1.25 * ToolParams.TDiam) then
|
if ( not sH1Param or not sH1Param.TDiam or sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam) and ( not sH2Param or not sH2Param.TDiam or sH2Param.TDiam < 1.25 * ToolParams.TDiam) then
|
||||||
|
SetNextMachining( sToolName, nActiveHead, bFixed)
|
||||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -405,8 +411,10 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
|||||||
end
|
end
|
||||||
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
|
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
|
||||||
if bTopHead and not bH2 then
|
if bTopHead and not bH2 then
|
||||||
|
SetNextMachining( sToolName, 1, bFixed)
|
||||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||||
elseif bDownHead and bH2 then
|
elseif bDownHead and bH2 then
|
||||||
|
SetNextMachining( sToolName, 2, bFixed)
|
||||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -417,25 +425,31 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead,
|
|||||||
-- se uno dei due utensili è molto più grande dell'altro scelgo quello senza fare altre analisi
|
-- se uno dei due utensili è molto più grande dell'altro scelgo quello senza fare altre analisi
|
||||||
if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then
|
if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then
|
||||||
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
|
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
|
||||||
|
SetNextMachining( sH1Tool, 1, bFixed)
|
||||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||||
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
|
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
|
||||||
|
SetNextMachining( sH2Tool, 2, bFixed)
|
||||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- verifico se cambiare testa o cambiare utensile su quella corrente
|
-- verifico se cambiare testa o cambiare utensile su quella corrente
|
||||||
if nActiveHead == 1 then
|
if nActiveHead == 1 then
|
||||||
if sH2Mach ~= "" then
|
if sH2Mach ~= "" then
|
||||||
|
SetNextMachining( sH2Tool, 2, bFixed)
|
||||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||||
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
|
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
|
||||||
elseif sH1Mach ~= "" then
|
elseif sH1Mach ~= "" then
|
||||||
|
SetNextMachining( sH1Tool, 1, bFixed)
|
||||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||||
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
|
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
|
||||||
end
|
end
|
||||||
elseif nActiveHead == 2 then
|
elseif nActiveHead == 2 then
|
||||||
if sH1Mach ~= "" then
|
if sH1Mach ~= "" then
|
||||||
|
SetNextMachining( sH1Tool, 1, bFixed)
|
||||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
||||||
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
|
--return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen
|
||||||
elseif sH2Mach ~= "" then
|
elseif sH2Mach ~= "" then
|
||||||
|
SetNextMachining( sH2Tool, 2, bFixed)
|
||||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
||||||
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
|
--return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen
|
||||||
end
|
end
|
||||||
@@ -453,15 +467,8 @@ function MachiningLib.FindCutting( sType, bTopHead, bDownHead)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission, bIsPredrill)
|
function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission)
|
||||||
local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5, sTypeMach
|
local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Drill_AT', 'Drill'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2)
|
||||||
-- se il foro è un predrill, cerco solo punte abilitate al Predrill
|
|
||||||
if bIsPredrill then
|
|
||||||
sTypeMach = 'Predrill'
|
|
||||||
else
|
|
||||||
sTypeMach = EgtIf( bAngleTransmission, 'Drill_AT', 'Drill')
|
|
||||||
end
|
|
||||||
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, sTypeMach, { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2)
|
|
||||||
if ( not MachiningName or MachiningName == '') then
|
if ( not MachiningName or MachiningName == '') then
|
||||||
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Pocket_AT', 'Pocket'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead)
|
MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Pocket_AT', 'Pocket'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
-- ProcessBlockHausFront.lua by Egaltech s.r.l. 2020/08/03
|
-- ProcessBlockHausFront.lua by Egaltech s.r.l. 2020/08/03
|
||||||
-- Gestione calcolo giunzione block house in testa
|
-- Gestione calcolo giunzione block house in testa
|
||||||
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
-- 2022/06/10 Aggiunto il parametro dOvmTail per gestire sovramateriali in coda diversi da OVM_MID (sezioni alte e larghe)
|
||||||
|
-- 2024/03/11 Chiamate a GetFaceHvRefDim sostituite con lettura di Proc.Face[]
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessBlockHausFront = {}
|
local ProcessBlockHausFront = {}
|
||||||
@@ -268,7 +269,9 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dO
|
|||||||
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
|
||||||
-- se non ho il taglio sulla faccia interna
|
-- se non ho il taglio sulla faccia interna
|
||||||
if not bIntCut then
|
if not bIntCut then
|
||||||
local frHV, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, vFaceOrd[3] - 1)
|
local frHV = Proc.Face[ vFaceOrd[3]].FrameHV
|
||||||
|
local DimH = Proc.Face[ vFaceOrd[3]].Width
|
||||||
|
local DimV = Proc.Face[ vFaceOrd[3]].Height
|
||||||
if DimV > DimH then
|
if DimV > DimH then
|
||||||
vtRef2 = Vector3d( frHV:getVersX())
|
vtRef2 = Vector3d( frHV:getVersX())
|
||||||
end
|
end
|
||||||
|
|||||||
+15
-11
@@ -25,7 +25,6 @@
|
|||||||
-- 2023/10/27 In MakeFromTop corretto massimo materiale in caso di lavorazione da sotto.
|
-- 2023/10/27 In MakeFromTop corretto massimo materiale in caso di lavorazione da sotto.
|
||||||
-- 2023/12/07 Correzione in Classify in scelta ribaltamento trave quando si è in condizioni downUp.
|
-- 2023/12/07 Correzione in Classify in scelta ribaltamento trave quando si è in condizioni downUp.
|
||||||
-- 2024/01/18 Gestita superficie limitante opzionale da passare a diceCut.
|
-- 2024/01/18 Gestita superficie limitante opzionale da passare a diceCut.
|
||||||
-- 2024/05/10 In MakeFromTop ricalcolo direzione di lavorazione su facce a cubetti
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessCut = {}
|
local ProcessCut = {}
|
||||||
@@ -480,15 +479,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
if vtO then
|
if vtO then
|
||||||
vtOrthoO = Vector3d( vtO) * EgtIf( bOrthInv, -1, 1)
|
vtOrthoO = Vector3d( vtO) * EgtIf( bOrthInv, -1, 1)
|
||||||
else
|
else
|
||||||
-- ricalcolo tipo taglio perché "bHorizCut" è calcolato sulla feature, mentre il cubetto potrebbe essere lavorato in un altro modo
|
if bHorizCut then
|
||||||
local _, dLen, dWidth = BL.GetFaceHvRefDim( vCuts[i][1], 0, b3Raw)
|
|
||||||
local bCutDirection = bHorizCut
|
|
||||||
-- se bisogna tagliare di fianco ma la lunghezza faccia è più del massimo materiale, forzo lavorazione da sopra
|
|
||||||
if not bHorizCut and dLen > dMaxDepth then
|
|
||||||
bCutDirection = true
|
|
||||||
end
|
|
||||||
|
|
||||||
if bCutDirection then
|
|
||||||
vtOrthoO = Z_AX()
|
vtOrthoO = Z_AX()
|
||||||
else
|
else
|
||||||
if vtN:getZ() < dNzLimDwnUp then
|
if vtN:getZ() < dNzLimDwnUp then
|
||||||
@@ -821,7 +812,20 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
|||||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||||
-- se taglio di testa
|
-- se taglio di testa
|
||||||
if not bForced then
|
if not bForced then
|
||||||
if not BL.IsCutNeeded( Proc, b3Raw, dOvmHead, dOvmTail) then
|
if Proc.Head then
|
||||||
|
-- se coincide con il taglio di separazione precedente, non va fatto
|
||||||
|
if AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Raw:getMax():getX() + dOvmHead) < 10 * GEO.EPS_SMALL then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
-- altrimenti taglio di coda
|
||||||
|
else
|
||||||
|
-- se coincide con taglio di separazione, non va fatto
|
||||||
|
if AreSameVectorApprox( vtN, - X_AX()) and abs( ptC:getX() - b3Raw:getMin():getX()) < dOvmTail + 10 * GEO.EPS_SMALL then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- se coincide con un taglio frontale non va fatto
|
||||||
|
if Proc.CutFront then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,8 +20,6 @@
|
|||||||
-- 2023/07/28 Aggiunta gestione rinvio 90deg solo per forature da sotto esattamente verticali.
|
-- 2023/07/28 Aggiunta gestione rinvio 90deg solo per forature da sotto esattamente verticali.
|
||||||
-- 2023/09/26 Se errore in applicazione lavorazione si inverte e riprova solo se foratura singola su foro aperto.
|
-- 2023/09/26 Se errore in applicazione lavorazione si inverte e riprova solo se foratura singola su foro aperto.
|
||||||
-- 2023/11/06 Migliorata gestione dei fori con AngularTransmission.
|
-- 2023/11/06 Migliorata gestione dei fori con AngularTransmission.
|
||||||
-- 2024/03/13 Aggiunta gestione Predrill
|
|
||||||
-- 2024/03/18 Per Predrill corretta direzione estrusione per fori con direzione verso il basso
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessDrill = {}
|
local ProcessDrill = {}
|
||||||
@@ -98,21 +96,20 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Recupero dati foro e adattamento se speciale
|
-- Recupero dati foro e adattamento se speciale
|
||||||
function ProcessDrill.GetData( Proc, b3Raw)
|
function ProcessDrill.GetData( Proc, b3Raw)
|
||||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
|
||||||
-- verifico se foro da adattare
|
-- verifico se foro da adattare
|
||||||
if EgtExistsInfo( Proc.Id, 'DiamUser') then
|
if EgtExistsInfo( Proc.Id, 'DiamUser') then
|
||||||
|
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||||
if AuxId then AuxId = AuxId + Proc.Id end
|
if AuxId then AuxId = AuxId + Proc.Id end
|
||||||
if AuxId and EgtGetType( AuxId) == GDB_TY.CRV_ARC and BD.USER_HOLE_DIAM and BD.USER_HOLE_DIAM > 1 then
|
if AuxId and EgtGetType( AuxId) == GDB_TY.CRV_ARC and BD.USER_HOLE_DIAM and BD.USER_HOLE_DIAM > 1 then
|
||||||
EgtModifyArcRadius( AuxId, BD.USER_HOLE_DIAM / 2)
|
EgtModifyArcRadius( AuxId, BD.USER_HOLE_DIAM / 2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- recupero diametro e lunghezza
|
-- recupero diametro
|
||||||
local dDiam = EgtGetInfo( Proc.Id, 'P12', 'd') or 0
|
local dDiam = EgtGetInfo( Proc.Id, 'P12', 'd') or 0
|
||||||
local dLen = abs( EgtCurveThickness( Proc.Id + AuxId)) or 0
|
|
||||||
-- recupero faccia di entrata e uscita
|
-- recupero faccia di entrata e uscita
|
||||||
local nFcs = EgtGetInfo( Proc.Id, 'FCS', 'i') or 0
|
local nFcs = EgtGetInfo( Proc.Id, 'FCS', 'i') or 0
|
||||||
local nFce = EgtGetInfo( Proc.Id, 'FCE', 'i') or 0
|
local nFce = EgtGetInfo( Proc.Id, 'FCE', 'i') or 0
|
||||||
return dDiam, dLen, nFcs, nFce
|
return dDiam, nFcs, nFce
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
@@ -142,75 +139,6 @@ function ProcessDrill.Split( Proc, b3Raw)
|
|||||||
return ( bOpen and ( bHoriz or BD.ROT90 or BD.DOWN_HEAD or BD.TURN or bAngTransm) and not bSlant)
|
return ( bOpen and ( bHoriz or BD.ROT90 or BD.DOWN_HEAD or BD.TURN or bAngTransm) and not bSlant)
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
-- Verifica se bisogna aggiungere un preforo
|
|
||||||
function ProcessDrill.IsPredrillNeeded( Proc)
|
|
||||||
local dDepthPredrill = EgtGetInfo( Proc.Id, 'Q03', 'i')
|
|
||||||
-- se non c'è la Q oppure se zero, allora non è da fare
|
|
||||||
if not dDepthPredrill or dDepthPredrill <= 0 then
|
|
||||||
return false
|
|
||||||
-- altrimenti Predrill da fare
|
|
||||||
else
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
-- Aggiunge il preforo alla feature passata
|
|
||||||
function ProcessDrill.AddPredrillFromDrillProc( Proc)
|
|
||||||
local dDepthPredrill = EgtGetInfo( Proc.Id, 'Q03', 'i')
|
|
||||||
-- foro più corto del preforo, allora è il foro che diventa il preforo stesso
|
|
||||||
if Proc.Len <= dDepthPredrill then
|
|
||||||
Proc.IsPredrill = true
|
|
||||||
Proc.IsPredrillOf = Proc.Id
|
|
||||||
return false
|
|
||||||
-- altrimenti creo un nuovo process
|
|
||||||
else
|
|
||||||
-- recupero gruppo per geometria aggiuntiva
|
|
||||||
local nAddGrpId = BL.GetAddGroup( Proc.PartId)
|
|
||||||
-- recupero e verifico l'entità foro
|
|
||||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0
|
|
||||||
local ptCen = EgtCP( Proc.Id + AuxId, GDB_RT.GLOB)
|
|
||||||
local vtExtr = EgtCurveExtrusion( Proc.Id + AuxId, GDB_RT.GLOB)
|
|
||||||
|
|
||||||
-- copio foro originale
|
|
||||||
local nPreHoleId = EgtCopyGlob( Proc.Id, nAddGrpId)
|
|
||||||
local nPreHoleAux = EgtCopyGlob( Proc.Id + AuxId, nAddGrpId)
|
|
||||||
|
|
||||||
-- se foro invertito sposto geometria dall'altro lato del foro e inverto direzione estrusione
|
|
||||||
if Proc.Flg == -2 then
|
|
||||||
local vsExtr = -vtExtr * Proc.Len
|
|
||||||
EgtMove( nPreHoleAux, vsExtr, GDB_RT.GLOB)
|
|
||||||
EgtModifyCurveExtrusion( nPreHoleAux, -vtExtr, GDB_RT.GLOB)
|
|
||||||
end
|
|
||||||
EgtModifyCurveThickness( nPreHoleAux, -dDepthPredrill)
|
|
||||||
|
|
||||||
local PredrillProc = {}
|
|
||||||
-- definisco dati seconda parte
|
|
||||||
PredrillProc.PartId = Proc.PartId
|
|
||||||
PredrillProc.Id = nPreHoleId
|
|
||||||
PredrillProc.Grp = Proc.Grp
|
|
||||||
PredrillProc.Prc = Proc.Prc
|
|
||||||
PredrillProc.Flg = 1
|
|
||||||
PredrillProc.Box = Proc.Box
|
|
||||||
PredrillProc.Fct = Proc.Fct
|
|
||||||
PredrillProc.Diam = Proc.Diam
|
|
||||||
PredrillProc.Len = dDepthPredrill
|
|
||||||
PredrillProc.Head = Proc.Head
|
|
||||||
PredrillProc.Tail = Proc.Tail
|
|
||||||
PredrillProc.Fcs = Proc.Fcs
|
|
||||||
PredrillProc.Fce = 0 -- il preforo è sempre chiuso, non ha faccia di uscita
|
|
||||||
PredrillProc.CutId = Proc.CutId
|
|
||||||
PredrillProc.TaskId = Proc.TaskId
|
|
||||||
PredrillProc.AdjId = Proc.AdjId
|
|
||||||
PredrillProc.MainId = Proc.MainId
|
|
||||||
PredrillProc.IsPredrill = true
|
|
||||||
PredrillProc.IsPredrillOf = Proc.Id
|
|
||||||
|
|
||||||
return true, PredrillProc
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Classificazione della feature
|
-- Classificazione della feature
|
||||||
function ProcessDrill.Classify( Proc, b3Raw)
|
function ProcessDrill.Classify( Proc, b3Raw)
|
||||||
@@ -361,15 +289,15 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
local bDrillUp = ( bDownDrill and vtExtr:getZ() > -0.421)
|
local bDrillUp = ( bDownDrill and vtExtr:getZ() > -0.421)
|
||||||
local bExcludeH2 = false
|
local bExcludeH2 = false
|
||||||
if Proc.Double and Proc.Double > 0 then
|
if Proc.Double and Proc.Double > 0 then
|
||||||
-- bMillUp = true
|
bMillUp = true
|
||||||
bDrillDown = false
|
bDrillDown = false
|
||||||
bExcludeH2 = true
|
bExcludeH2 = true
|
||||||
end
|
end
|
||||||
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
|
-- primo gruppo di controlli con lunghezza utensile pari a metà foro se passante
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
local sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, dCheckDepth, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm)
|
||||||
if not sDrilling and dCheckDepth then
|
if not sDrilling and dCheckDepth then
|
||||||
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm, Proc.IsPredrill)
|
sDrilling, sType, dMaxDepth, dMaxToolLength, dToolDiam, dDiamTh, dToolFreeLen = ML.FindDrilling( dDiam, 0, bDrillUp, bDrillDown, bExcludeH2, bDrillAngTrasm)
|
||||||
if sDrilling then dCheckDepth = nil end
|
if sDrilling then dCheckDepth = nil end
|
||||||
end
|
end
|
||||||
if not sDrilling then
|
if not sDrilling then
|
||||||
@@ -526,7 +454,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
dMaxElev = dMaxDepth
|
dMaxElev = dMaxDepth
|
||||||
end
|
end
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
local sName = EgtIf( EgtStartsWith( sType, 'Predrill'), 'Predrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'Drill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchId = EgtAddMachining( sName, sDrilling)
|
local nMchId = EgtAddMachining( sName, sDrilling)
|
||||||
if not nMchId then
|
if not nMchId then
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sDrilling
|
||||||
@@ -536,7 +464,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
-- aggiungo geometria
|
-- aggiungo geometria
|
||||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||||
-- eventuale inversione
|
-- eventuale inversione
|
||||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'Drill_AT' or sType == 'AngleDrill' or sType == 'Predrill' then
|
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'Drill_AT' or sType == 'AngleDrill' then
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, bToInvert)
|
EgtSetMachiningParam( MCH_MP.INVERT, bToInvert)
|
||||||
else
|
else
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, bToInvert)
|
||||||
|
|||||||
+14
-1084
File diff suppressed because it is too large
Load Diff
+46
-62
@@ -34,8 +34,6 @@
|
|||||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
||||||
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||||
-- 2024/01/22 Implementata gestione seghe a catena multiple.
|
-- 2024/01/22 Implementata gestione seghe a catena multiple.
|
||||||
-- 2024/05/09 In Make, allungamento percorso ingresso per evitare collisioni durante approccio pezzo quando si setta OutRaw=3
|
|
||||||
-- In Make, se non trova fresa per pulizia, da messaggio di warning anziché di errore
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLongCut = {}
|
local ProcessLongCut = {}
|
||||||
@@ -295,7 +293,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
|||||||
-- laterale sul punto medio della linea in comune
|
-- laterale sul punto medio della linea in comune
|
||||||
local frFc = Frame3d( ptPm, vtN) ;
|
local frFc = Frame3d( ptPm, vtN) ;
|
||||||
local b3BoxLoc = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frFc)
|
local b3BoxLoc = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frFc)
|
||||||
local dDepth = b3BoxLoc:getDimZ() or 0
|
dDepth = b3BoxLoc:getDimZ() or 0
|
||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dSawDiam = 400
|
local dSawDiam = 400
|
||||||
local dSawThick = 0
|
local dSawThick = 0
|
||||||
@@ -512,7 +510,6 @@ local function MakeSideFaceByChainSaw( nSurfId, dDepth, dOffs, dSal, dEal, bShor
|
|||||||
local dSawCornerRad = 0
|
local dSawCornerRad = 0
|
||||||
local dSawThick = 0
|
local dSawThick = 0
|
||||||
local dSawDiameter = 0
|
local dSawDiameter = 0
|
||||||
local sWarn
|
|
||||||
-- se non trova una lavorazione di sawing esco
|
-- se non trova una lavorazione di sawing esco
|
||||||
if not sSawing then
|
if not sSawing then
|
||||||
local sErr = 'Error : Sawing not found in library'
|
local sErr = 'Error : Sawing not found in library'
|
||||||
@@ -972,57 +969,58 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
local dElev = BL.GetFaceElevation( Proc, 0, b3Solid)
|
local dElev = BL.GetFaceElevation( Proc, 0, b3Solid)
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sMilling = ML.FindMilling( 'Long2Cut_H2', dElev, nil, nil, nil, not bCanUseUnderBlade, bCanUseUnderBlade)
|
local sMilling = ML.FindMilling( 'Long2Cut_H2', dElev, nil, nil, nil, not bCanUseUnderBlade, bCanUseUnderBlade)
|
||||||
if sMilling then
|
if not sMilling then
|
||||||
-- recupero i dati dell'utensile
|
local sErr = 'Error : milling Long2Cut (_H2) not found in library'
|
||||||
local dToolDiam = 0
|
EgtOutLog( sErr)
|
||||||
local dMaxDepth = 0
|
return false, sErr
|
||||||
if EgtMdbSetCurrMachining( sMilling) then
|
end
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
-- recupero i dati dell'utensile
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
local dToolDiam = 0
|
||||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
local dMaxDepth = 0
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
if EgtMdbSetCurrMachining( sMilling) then
|
||||||
end
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
|
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||||
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||||
end
|
end
|
||||||
-- se ho facce di chiusura, per prima cosa faccio antischeggia
|
end
|
||||||
-- come richiesto da Fabio Squaratti il 03/09/2021
|
-- se ho facce di chiusura, per prima cosa faccio antischeggia
|
||||||
if ( bLimXmin and not bForcedLim) or bLimXmax then
|
-- come richiesto da Fabio Squaratti il 03/09/2021
|
||||||
local bMadeASbyBld, bOk, nFacet
|
if ( bLimXmin and not bForcedLim) or bLimXmax then
|
||||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, (( bLimXmin and not bForcedLim) and bLimXmax), vtN, nFacet, 0, sWarn, bCanUseUnderBlade, nil, sCutting)
|
local bOk, nFacet
|
||||||
if not bOk then return false, sWarn end
|
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, (( bLimXmin and not bForcedLim) and bLimXmax), vtN, nFacet, 0, sWarn, bCanUseUnderBlade, nil, sCutting)
|
||||||
end
|
if not bOk then return false, sWarn end
|
||||||
-- eventuale lavorazione della faccia limitante l'inizio
|
end
|
||||||
if not bStartFixed then
|
-- eventuale lavorazione della faccia limitante l'inizio
|
||||||
local vtIni = -X_AX()
|
if not bStartFixed then
|
||||||
for j = 1, Proc.Fct - 1 do
|
local vtIni = -X_AX()
|
||||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
for j = 1, Proc.Fct - 1 do
|
||||||
if vtIni * vtN > 0 and nCountMilHead < 2 then
|
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||||
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade)
|
if vtIni * vtN > 0 and nCountMilHead < 2 then
|
||||||
nCountMilHead = nCountMilHead + 1
|
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade)
|
||||||
end
|
|
||||||
end
|
|
||||||
if bForcedLim and nCountMilHead < 1 then
|
|
||||||
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade)
|
|
||||||
nCountMilHead = nCountMilHead + 1
|
nCountMilHead = nCountMilHead + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if bForcedLim and nCountMilHead < 1 then
|
||||||
|
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dStartDistUp,dStartDistDn), bCanUseUnderBlade)
|
||||||
|
nCountMilHead = nCountMilHead + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- eventuale lavorazione della faccia limitante la fine
|
-- eventuale lavorazione della faccia limitante la fine
|
||||||
if not bEndFixed then
|
if not bEndFixed then
|
||||||
local vtFin = X_AX()
|
local vtFin = X_AX()
|
||||||
for j = 1, Proc.Fct - 1 do
|
for j = 1, Proc.Fct - 1 do
|
||||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||||
if vtFin * vtN > 0 and nCountMilHead < 2 then
|
if vtFin * vtN > 0 and nCountMilHead < 2 then
|
||||||
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade)
|
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade)
|
||||||
nCountMilHead = nCountMilHead + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if bForcedLim and nCountMilHead < 2 then
|
|
||||||
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade)
|
|
||||||
nCountMilHead = nCountMilHead + 1
|
nCountMilHead = nCountMilHead + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
if bForcedLim and nCountMilHead < 2 then
|
||||||
sWarn = 'Warning: milling Long2Cut (_H2) not found in library'
|
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, max(dEndDistUp,dEndDistDn), bCanUseUnderBlade)
|
||||||
|
nCountMilHead = nCountMilHead + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1217,6 +1215,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
if not bChainSawOk then return false, sErr end
|
if not bChainSawOk then return false, sErr end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut
|
-- se non è sotto e non uso fresa di fianco: lavorazione Long2Cut
|
||||||
elseif ( nSide ~= - 1 or BD.DOWN_HEAD) and nUseMillOnSide == 0 then
|
elseif ( nSide ~= - 1 or BD.DOWN_HEAD) and nUseMillOnSide == 0 then
|
||||||
-- determino la massima elevazione
|
-- determino la massima elevazione
|
||||||
@@ -1427,21 +1426,6 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
if k < nO then
|
if k < nO then
|
||||||
local sNotes = 'OutRaw=3;'
|
local sNotes = 'OutRaw=3;'
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||||
-- aumento ingresso su spezzoni per evitare collisione durante approccio pezzo
|
|
||||||
if bFront then
|
|
||||||
-- se invertito si allunga ingresso su tutti tranne su ultimo
|
|
||||||
if bInvert and i ~= nC then
|
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, ( nO - k) * dStep + 10)
|
|
||||||
-- se non invertito si allunga solo il primo
|
|
||||||
elseif not bInvert and i == 1 then
|
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, ( nO - k) * dStep + 10)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- se invertito si allunga ingresso su tutti
|
|
||||||
if bInvert then
|
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, ( nO - k) * dStep + 10)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
-- 2023/11/24 Aggiunta Q05 per utilizzo lama anche in feature cieche conme per LongCut.
|
-- 2023/11/24 Aggiunta Q05 per utilizzo lama anche in feature cieche conme per LongCut.
|
||||||
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
-- 2023/11/30 Calcolo elevazione velocizzato e centralizzato tramite la funzione GetFaceElevation.
|
||||||
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
-- 2024/01/18 Implementata GetBlockedAxis che gestisce gli assi bloccati per tutti i tipi di utensile.
|
||||||
-- 2024/03/21 Corretto parametro passato a funzione BL.GetBlockedAxis. Ora tiene in considerazione anche testa sotto
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLong2Cut = {}
|
local ProcessLong2Cut = {}
|
||||||
@@ -834,13 +833,11 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
|
|
||||||
-- recupero alcune informazioni utili dalla lavorazione attuale
|
-- recupero alcune informazioni utili dalla lavorazione attuale
|
||||||
local bIsCurrentBladeCCW
|
local bIsCurrentBladeCCW
|
||||||
local sCuttingNameMach
|
|
||||||
if bIsTopBladeCurrent then
|
if bIsTopBladeCurrent then
|
||||||
sCuttingNameMach = sCutting
|
EgtMdbSetCurrMachining( sCutting)
|
||||||
else
|
else
|
||||||
sCuttingNameMach = sCuttingDn
|
EgtMdbSetCurrMachining( sCuttingDn)
|
||||||
end
|
end
|
||||||
EgtMdbSetCurrMachining( sCuttingNameMach)
|
|
||||||
bIsCurrentBladeCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
|
bIsCurrentBladeCCW = EgtMdbGetCurrMachiningParam( MCH_MP.SPEED) < 0
|
||||||
|
|
||||||
-- imposto la direzione di lavoro per avere scarico del truciolo ottimale
|
-- imposto la direzione di lavoro per avere scarico del truciolo ottimale
|
||||||
@@ -883,7 +880,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
-- imposto angolo 3° asse rot
|
-- imposto angolo 3° asse rot
|
||||||
local vtOut = EgtIf( vtN[vOrd[j]]:getX() > 0, X_AX(), -X_AX())
|
local vtOut = EgtIf( vtN[vOrd[j]]:getX() > 0, X_AX(), -X_AX())
|
||||||
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCuttingNameMach, 'perpendicular', b3Raw, vtN, vtOut))
|
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtN, vtOut))
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
local _, sErr = EgtGetLastMachMgrError()
|
||||||
@@ -1780,6 +1777,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepthDn - dCollSic, 1) .. ')'
|
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepthDn - dCollSic, 1) .. ')'
|
||||||
end
|
end
|
||||||
dDepth = min( dMaxDepthDn - dCollSic, vWidth[vOrd[i]] + dAgg)
|
dDepth = min( dMaxDepthDn - dCollSic, vWidth[vOrd[i]] + dAgg)
|
||||||
|
dDepth2 = vWidth[vOrd[i]] + dAgg - dDepth
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev)
|
||||||
else
|
else
|
||||||
dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN[vOrd[i]]:getY()) >= abs(vtN[vOrd[i]]:getZ()), vtN[vOrd[i]]:getZ(), vtN[vOrd[i]]:getY()) / dNz)))
|
dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( EgtIf( abs(vtN[vOrd[i]]:getY()) >= abs(vtN[vOrd[i]]:getZ()), vtN[vOrd[i]]:getZ(), vtN[vOrd[i]]:getY()) / dNz)))
|
||||||
@@ -1787,6 +1785,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
|
|||||||
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth - dCollSic, 1) .. ')'
|
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth - dCollSic, 1) .. ')'
|
||||||
end
|
end
|
||||||
dDepth = min( dMaxDepth - dCollSic, vWidth[vOrd[i]] + dAgg)
|
dDepth = min( dMaxDepth - dCollSic, vWidth[vOrd[i]] + dAgg)
|
||||||
|
dDepth2 = vWidth[vOrd[i]] + dAgg - dDepth
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev)
|
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth - dExtraElev)
|
||||||
end
|
end
|
||||||
-- eseguo
|
-- eseguo
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ end
|
|||||||
local nFaceUse = BL.GetNearestParalOpposite( vtN)
|
local nFaceUse = BL.GetNearestParalOpposite( vtN)
|
||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
||||||
-- applico il parametro plunge, che setta la lavorazione per affondare solamente, senza lavorare tutto il contorno; 1: solo lato iniziale, 2: solo lato finale, 3: entrambi
|
-- applico il parametro plunge, che setta la lavorazione per affondare solamente, senza lavorare tutto il contorno; 1: solo lato iniziale, 2: solo lato finale, 3: entrambi
|
||||||
local sNotes = 'Plunge=3;'
|
sNotes = 'Plunge=3;'
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||||
-- imposto angolo 3° asse rot
|
-- imposto angolo 3° asse rot
|
||||||
local vtOrtho = BL.GetVersRef( nFaceUse)
|
local vtOrtho = BL.GetVersRef( nFaceUse)
|
||||||
@@ -442,7 +442,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
-- recupero i dati della curva e del profilo
|
-- recupero i dati della curva e del profilo
|
||||||
local dDepth = dMorH
|
local dDepth = dMorH
|
||||||
local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
||||||
local bToolInv = ( not bDownHead and vtExtr:getZ() < -0.1 and Proc.Box:getDimZ() > b3Solid:getDimZ() - 5)
|
local bToolInv = ( not bDownHead and vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5)
|
||||||
local dExtra = 2
|
local dExtra = 2
|
||||||
|
|
||||||
-- verifico se servono gli smussi. Se lavorazione principale di svuotatura significa che è solo da un lato
|
-- verifico se servono gli smussi. Se lavorazione principale di svuotatura significa che è solo da un lato
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ local BL = require( 'BeamLib')
|
|||||||
local Fbs = require( 'FacesBySaw')
|
local Fbs = require( 'FacesBySaw')
|
||||||
local Cut = require( 'ProcessCut')
|
local Cut = require( 'ProcessCut')
|
||||||
local DC = require( 'DiceCut')
|
local DC = require( 'DiceCut')
|
||||||
local LapJoint = require( 'ProcessLapJoint')
|
|
||||||
|
|
||||||
EgtOutLog( ' ProcessRidgeLap started', 1)
|
EgtOutLog( ' ProcessRidgeLap started', 1)
|
||||||
|
|
||||||
@@ -49,7 +48,6 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Applicazione della lavorazione
|
-- Applicazione della lavorazione
|
||||||
function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||||
local nForceUseBladeOnNotContinueFace = EgtGetInfo( Proc.Id, 'Q04', 'i') or 0
|
|
||||||
-- recupero l'ingombro del grezzo di appartenenza
|
-- recupero l'ingombro del grezzo di appartenenza
|
||||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||||
-- ingombro del pezzo
|
-- ingombro del pezzo
|
||||||
@@ -135,15 +133,8 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
|
local b3Cut = EgtGetBBoxGlob( AddId or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||||
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
|
local CutProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Cut, Fct = 1, Flg = Proc.Flg,
|
||||||
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
Head = Proc.Head, Tail = Proc.Tail, CutId = Proc.CutId, TaskId = Proc.TaskId}
|
||||||
if BL.IsCutNeeded( CutProc, b3Raw, dOvmHead) then
|
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false)
|
||||||
local bOk, sErr = Cut.Make( CutProc, nPhase, nRawId, nPartId, dOvmHead, false)
|
if not bOk then return bOk, sErr end
|
||||||
if not bOk then return bOk, sErr end
|
|
||||||
elseif nForceUseBladeOnNotContinueFace > 0 then
|
|
||||||
EgtSurfTmRemoveFacet( Proc.Id, vFaceOrd[1] - 1)
|
|
||||||
Proc.Fct = Proc.Fct - 1
|
|
||||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
|
||||||
return LapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- recupero gruppo per geometria addizionale
|
-- recupero gruppo per geometria addizionale
|
||||||
|
|||||||
@@ -320,12 +320,10 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
if bAdj12 then
|
if bAdj12 then
|
||||||
if dAng12 < 0 then
|
if dAng12 < 0 then
|
||||||
EgtSurfTmSwapFacets( Proc.Id, 0, 2)
|
EgtSurfTmSwapFacets( Proc.Id, 0, 2)
|
||||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
|
||||||
end
|
end
|
||||||
elseif bAdj20 then
|
elseif bAdj20 then
|
||||||
if dAng20 < 0 then
|
if dAng20 < 0 then
|
||||||
EgtSurfTmSwapFacets( Proc.Id, 1, 2)
|
EgtSurfTmSwapFacets( Proc.Id, 1, 2)
|
||||||
Proc.Face = BL.GetFacetsInfo( Proc, b3Raw)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- dati delle facce
|
-- dati delle facce
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ local BL = require( 'BeamLib')
|
|||||||
local Fbs = require( 'FacesBySaw')
|
local Fbs = require( 'FacesBySaw')
|
||||||
local DC = require( 'DiceCut')
|
local DC = require( 'DiceCut')
|
||||||
local Cut = require( 'ProcessCut')
|
local Cut = require( 'ProcessCut')
|
||||||
local Topology = require( 'FeatureTopology')
|
|
||||||
|
|
||||||
EgtOutLog( ' ProcessStepJointNotch started', 1)
|
EgtOutLog( ' ProcessStepJointNotch started', 1)
|
||||||
|
|
||||||
@@ -385,8 +384,6 @@ local function MakeFourFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidt
|
|||||||
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
EgtSetName( AddId, 'AddCut_' .. tostring( Proc.Id))
|
||||||
-- applico lavorazione
|
-- applico lavorazione
|
||||||
local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg}
|
local NewProc = { Id = AddId, Grp = Proc.Grp, Prc = Proc.Prc, Box = Proc.Box, Fct = Proc.Fct, Flg = Proc.Flg}
|
||||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
|
||||||
Topology.Classify( NewProc, b3Raw)
|
|
||||||
local bOk, sErr = MakeTwoFaces( NewProc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth)
|
local bOk, sErr = MakeTwoFaces( NewProc, nPhase, nRawId, nPartId, dOvmHead, nDiffWidth)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,64 +1,5 @@
|
|||||||
==== Beam Update Log ====
|
==== Beam Update Log ====
|
||||||
|
|
||||||
Versione 2.6f2 (17/06/2024)
|
|
||||||
- Modif : correzione a tagli a cubetti (ripristinata versione pre 2.6f1)
|
|
||||||
|
|
||||||
Versione 2.6f1 (06/06/2024)
|
|
||||||
- Added : Q04 (tipo longcut) abilitato anche in RidgeLap (T30), se riconducibile a 2 facce
|
|
||||||
- Modif : migliorie al taglio a cubetti
|
|
||||||
- Modif : in LapJoint -> MakePocket abilitata Q per forzare massima elevazione
|
|
||||||
- Fixed : correzione a SCC per lama da sotto con aggregato
|
|
||||||
- Fixed : correzioni a ottimizzazione teste per macchine con teste sopra/sotto
|
|
||||||
|
|
||||||
Versione 2.6e5 (27/05/2024)
|
|
||||||
- Modif : in LapJoint corretto typo in lavorazione lamello che impediva il funzionamento corretto.
|
|
||||||
|
|
||||||
Versione 2.6e4 (20/05/2024)
|
|
||||||
- Modif : in SawPlusChain le lavorazioni di sega a catena aggiuntive (side) si fermano in mezzeria se tasca passante
|
|
||||||
- Modif : in SawPlusChain il tunnel con sega a catena viene fatto da un solo lato se possibile
|
|
||||||
|
|
||||||
Versione 2.6e3 (14/05/2024)
|
|
||||||
- Modif : in SawPlusChain aggiunta gestione lavorazioni aggiuntive lati aperti e tunnel
|
|
||||||
- Fixed : in Cut -> MakeFromTop ricalcolo direzione di lavorazione su facce a cubetti.
|
|
||||||
|
|
||||||
Versione 2.6e2 (10/05/2024)
|
|
||||||
- Modif : in FeatureTopology aggiunta proprietà IsTrough = true anche a Cut
|
|
||||||
- Modif : LongCut : se non trova fresa per pulizia, da messaggio di warning anziché di errore
|
|
||||||
- Fixed : LongCut : allungamento percorso ingresso per evitare collisioni durante approccio pezzo quando si setta OutRaw.
|
|
||||||
|
|
||||||
Versione 2.6e1 (03/05/2024)
|
|
||||||
- Modif : in LapJoint Groove verso il basso lavorata di preferenza dal lato
|
|
||||||
- Modif : in LapJoint -> SideMillAsSaw gestito anche rabbet passante
|
|
||||||
- Fixed : in BeamExec box della feature aggiornato dopo rotazione
|
|
||||||
- Fixed : in BeamExec GetProcessAffectedFaces e GetFacetsInfo rilanciati dopo rotazione
|
|
||||||
- Fixed : In LapJoint -> MakeMoreLongFaces corretto calcolo divisione in parti per evitare problemi di ceil con interi perfetti
|
|
||||||
|
|
||||||
Versione 2.6d2 (11/04/2024)
|
|
||||||
- Added : in LapJoint aggiunta strategia per fare tasche con lama + sega a catena, attivata da Q11
|
|
||||||
|
|
||||||
Versione 2.6d1 (08/04/2024)
|
|
||||||
- Fixed : in Long2Cut corretto nome passato alla BL.GetBlockedAxis
|
|
||||||
- Fixed : in MakeTwo rimossa gestione calcolo differente su ultima passata in caso di macchina FAST
|
|
||||||
- Fixed : in LapJoint -> ForceSideMill escluso caso 4 facce senza possibilità di ingresso lungo Y.
|
|
||||||
|
|
||||||
Versione 2.6c4 (18/03/2024)
|
|
||||||
- Fixed : correzioni a gestione prefori.
|
|
||||||
|
|
||||||
Versione 2.6c3 (15/03/2024)
|
|
||||||
- Added : Aggiunta gestione prefori
|
|
||||||
- Fixed : in LapJoint correzione a calcolo ingombro per feature basse e lunghe dalla testa.
|
|
||||||
|
|
||||||
Versione 2.6c2 (12/03/2024)
|
|
||||||
- Added : in Mortase Aggiunta possibilità di inserire lavorazione di smusso
|
|
||||||
- Added : in FreeContour aggiunto smusso se lav. di svuotatura
|
|
||||||
- Added : in BeamExec creata funzione calcolo dipendenze tra feature
|
|
||||||
- Added : In BeamExec -> CollectFeatures si scrive ora Width e Height della faccia sia trimmate con il grezzo che intere
|
|
||||||
- Added : implementate le lavorazioni in doppio per fori specchiati non passanti e DrillPocket
|
|
||||||
- Modif : in LapJoint migliorata ricerca pocket (VerifyPocket)
|
|
||||||
- Modif : implementato attacco esterno se tasca 4 facce sulla coda ma nessun pezzo successivo
|
|
||||||
- Modif : rimossi simboli di debug da compile
|
|
||||||
- Fixed : In FreeContour corretto caso di smusso non passante
|
|
||||||
|
|
||||||
Versione 2.6c1 (29/02/2024)
|
Versione 2.6c1 (29/02/2024)
|
||||||
- Modif : in FacesBySaw e LapJoint migliorato calcolo area non pinzabile in testa HCING e coda TCING
|
- Modif : in FacesBySaw e LapJoint migliorato calcolo area non pinzabile in testa HCING e coda TCING
|
||||||
- Modif : vari miglioramenti all'ordinamento delle lavorazioni
|
- Modif : vari miglioramenti all'ordinamento delle lavorazioni
|
||||||
|
|||||||
+2
-2
@@ -2,5 +2,5 @@
|
|||||||
-- Gestione della versione di Beam
|
-- Gestione della versione di Beam
|
||||||
|
|
||||||
NAME = 'Beam'
|
NAME = 'Beam'
|
||||||
VERSION = '2.6f2'
|
VERSION = '2.6c1'
|
||||||
MIN_EXE = '2.6e2'
|
MIN_EXE = '2.6a1'
|
||||||
|
|||||||
Reference in New Issue
Block a user