Compare commits

...

70 Commits

Author SHA1 Message Date
andrea.villa cb1aa22e9b Merge remote-tracking branch 'origin/develop' 2026-06-17 09:15:07 +02:00
andrea.villa a275719560 Cambio versione per rilasdcio a cliente 2026-06-17 09:14:58 +02:00
daniele.nicoli 8e491efb5d Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2026-06-16 16:36:46 +02:00
daniele.nicoli e482c60775 ProcessDrill - Nei fori dritti su parete inclinata sposta la MaxElev tenendo conto di inclinazione della parete e ToolHolder 2026-06-16 16:36:39 +02:00
andrea.villa 2b9c8539de Essetre ha cambiato la Q dello smusso nella feature "Mortasa". Ora è Q01. 2026-06-16 16:25:31 +02:00
daniele.nicoli e557d57dae Aggiunti commenti ad ultima modifica 2026-06-16 08:51:14 +02:00
daniele.nicoli d377a33420 Merge branch 'test_AddVertDice_T#3031' into develop 2026-06-16 08:42:45 +02:00
daniele.nicoli f5a5350e70 ProcessCut - Aggiunti tagli verticali anche in caso di tagli inclinati su testa o coda per rendere più piccoli i pezzi che possono cadere sul motore 2026-06-16 08:16:04 +02:00
daniele.nicoli 0d7e9e09b3 Merge branch 'test_SkipMortCut_T#3005' into develop 2026-06-12 16:33:15 +02:00
daniele.nicoli 198031a3c1 ProcessMortise - Elimina i tagli del piano ed eventuale cubettatura se già presente da un'altra feature, prima eliminava quelli della feature dando problemi con l'ordinamento. 2026-06-12 16:03:49 +02:00
daniele.nicoli ce2fcf4a42 ProcessCut e FacesBySaw.MakeOne - Modifica non ancora funzionante 2026-06-12 12:09:26 +02:00
andrea.villa 2f312c5cb8 Aggiunto controllo su massima lunghezza pezzo processabile 2026-06-10 15:05:12 +02:00
daniele.nicoli c9fae12574 Merge remote-tracking branch 'origin/HEAD' into develop 2026-06-09 09:47:02 +02:00
daniele.nicoli a137794c75 Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2026-06-09 09:46:01 +02:00
daniele.nicoli dac5b40d3b LapJoint - non viene eseguito Antisplint su facce chiuse e limitate da altre facce 2026-06-09 09:45:56 +02:00
luca.mazzoleni 2c3b6030c2 update log 2026-06-08 09:41:34 +02:00
luca.mazzoleni d255d8aaa9 update log 2026-06-08 09:38:13 +02:00
daniele.nicoli ce3fbd9b93 LapJoint CleanCorner - corretto calcolo inclinazione utensile (per utensili con angoli diversi) corretta e ottimizzata funzione controllo collisioni CalcInterference() e aggiunta inclinazione utensile in caso di Proc=25 Q01=2 2026-06-05 15:53:39 +02:00
daniele.nicoli fad52a8483 Merge remote-tracking branch 'origin/master' into develop 2026-06-04 09:05:29 +02:00
Dario Sassi e4f448bcf0 Merge commit 'bf58b58b478d65f06e3e14e6de47d58bd21be7e5' 2026-06-01 07:48:26 +02:00
Dario Sassi bf58b58b47 DataBeam 3.1e2 :
- piccoli aggiustamenti
- sistemazioni a DtMortise per macchina Oikos XL.
2026-06-01 07:47:20 +02:00
andrea.villa 3445fb2525 Smussi di testa in senso orario 2026-05-22 14:08:01 +02:00
daniele.nicoli 723713707f ProcessCut.Classify - Aggiunta Q18 che evita che la trave ruoti in caso di taglio di testa se la dimensione del taglio richiede dicecut. 2026-05-20 13:36:03 +02:00
luca.mazzoleni fd0a52ad6b Merge tag '3.1e1' into develop
3.1e1
2026-05-05 13:32:31 +02:00
luca.mazzoleni 3e2ae92adc Merge branch 'release/3.1e1' 2026-05-05 13:32:11 +02:00
luca.mazzoleni c746a11e45 update log e version 2026-05-05 13:32:02 +02:00
luca.mazzoleni d337e4cc18 Merge remote-tracking branch 'origin/Test_DrillDouble_NoLastStep' into develop 2026-05-05 13:28:46 +02:00
daniele.nicoli 5fcaf823a0 ProcessDrill - lavorazioni in doppio: tolto foro singolo di sfondamento se utensile non è abbastanza lungo.
In tal caso profondità lavorazione in doppio aumentata al massimo della possibilità dell'utensile.
2026-04-28 16:25:38 +02:00
daniele.nicoli 6b76dd2f4f Merge branch 'Test_Tick#2925' into develop 2026-04-28 11:01:39 +02:00
andrea.villa cc7f5abf40 Merge branch 'master' into develop 2026-04-22 14:33:58 +02:00
Dario Sassi 389e722f7c DataBean 3.1d3 :
- prime aggiunte per nuova gestione tipo robot di macchina con tre assi rotanti (Scm Oikos).
2026-04-21 08:20:09 +02:00
daniele.nicoli 946f5e8bf6 LapJoint - Tolto controllo nella BeamLib (situazione precedente) e inserito controllo direttamente nella MakeByChainOrSaw() 2026-04-17 15:29:14 +02:00
daniele.nicoli a5cd84172e LapJoint - Aggiunto caso di Slot su testa o coda con lato di fondo inclinato e lati aperti sui fianchi. 2026-04-17 12:54:35 +02:00
luca.mazzoleni 895740feff Merge tag '3.1d2' into develop
3.1d2
2026-04-10 09:42:55 +02:00
luca.mazzoleni 7e243bb9ea Merge branch 'release/3.1d2' 2026-04-10 09:42:48 +02:00
luca.mazzoleni ca21098226 - update log e txt 2026-04-10 09:42:21 +02:00
luca.mazzoleni 32052e3016 - piccola correzione in DtMortise 2026-04-09 16:46:18 +02:00
luca.mazzoleni 4138f89f69 Merge branch 'develop' of https://gitlab.steamware.net/egaltech/DataBeam into develop 2026-04-09 16:36:23 +02:00
luca.mazzoleni 66013f5e07 - in ProcessLapJoint MakePathsOnExtremePoints si costruisce il percorso solo per i punti sui bordi del grezzo 2026-04-09 16:36:20 +02:00
daniele.nicoli a9ec6744e3 In DtMortise - Aggiunto parametro Q01=1 per non eseguire l'antischeggia 2026-04-09 11:30:23 +02:00
daniele.nicoli 5c82ab27c8 ProcessStepJoint - Aggiunta possibilità di forzare lavorazione con fresa in caso di feature a 2 facce concava con angolo tra le facce > 90°. Q02=1 2026-04-08 17:10:25 +02:00
luca.mazzoleni 723f1a0d10 Merge tag '3.1d1' into develop
3.1d1
2026-04-08 16:01:22 +02:00
luca.mazzoleni 6c18d3fa95 Merge branch 'release/3.1d1' 2026-04-08 16:01:10 +02:00
luca.mazzoleni e910d6e6ba update log e version 2026-04-08 16:00:37 +02:00
daniele.nicoli 1f3906ab35 Merge branch 'develop' of https://gitlab.steamware.net/egalware-cadcam/lua/DataBeam into develop 2026-04-07 17:14:32 +02:00
daniele.nicoli 183a4a564a In ProcessLapJoint - aggiunto warning se non esiste il percorso e relativa disattivazione di esso in tutte le ApplyMachining(). 2026-04-07 17:14:25 +02:00
luca.mazzoleni be4575e984 - in DtMortise -> CalcPathAtHeight ora lo spostamento viene fatto correttamente anche nel caso di più curve 2026-04-07 14:58:39 +02:00
luca.mazzoleni 1af37a5589 - in BeamExec si abilita riduzione foratura con MaxElev anche per tagli di testa 2026-04-02 17:44:24 +02:00
luca.mazzoleni 7c9b20ae2e - in ProcessDrill correzione in caso il PreferredSide non sia definito nella macchina 2026-03-30 11:08:56 +02:00
luca.mazzoleni 5dd839dace - in LapJoint per Q02 solo contorno si inverte ordine lavorazione lato principale e opposto, in modo da avere sempre per ultima la lavorazione da sopra 2026-03-24 15:48:06 +01:00
daniele.nicoli 6ae1e94cd5 In LapJoint - FacesBySaw, nelle Slot di testa con forma a U, forzata lavorazione concorde a discapito della direzione (da sotto a sopra o viceversa) 2026-03-19 17:13:43 +01:00
luca.mazzoleni bbffd69e1e Merge tag '3.1c2' into develop
3.1c2
2026-03-18 15:38:49 +01:00
luca.mazzoleni 30028fecf0 Merge branch 'release/3.1c2' 2026-03-18 15:38:36 +01:00
luca.mazzoleni cf96d7bc90 update log e versione 2026-03-18 15:37:49 +01:00
luca.mazzoleni 89fefbcbad - in LapJoint per antischeggia Q06 contemplato valore 3 per scegliere in automatico la strategia (lama o fresa)
- in LapJoint Q17=0 significa nessun codolo (sempre abbinato a Q02)
2026-03-18 15:37:15 +01:00
luca.mazzoleni 6892759956 - in LapJoint per Q02 solo contorno sono ammessi anche i tunnel; aggiunti messagi in caso di lavorazione incompleta 2026-03-17 13:08:36 +01:00
luca.mazzoleni 78a3e907ce Merge branch 'ContourOnGroove3' into develop 2026-03-17 11:42:16 +01:00
luca.mazzoleni 63133c8813 - in BeamLib.GetToolfromMachining per le frese si leggono anche MaxDepth e StemDiameter. MaxDepth corretta se StemDiameter > Diameter
- in LapJoint correzioni a Q02 per solo contorno
2026-03-17 09:57:48 +01:00
luca.mazzoleni 58e32bdfd0 - in LapJoint aggiunta possibilità di fare solo contorno per tasche groove 3 aperte con Q02, pe L030 2026-03-16 18:23:16 +01:00
luca.mazzoleni 6528e6e77c Merge branch 'Test_Ticket#2842' into develop 2026-03-12 18:43:16 +01:00
luca.mazzoleni 48f1ac5e4d Merge branch 'develop' into Test_Ticket#2842 2026-03-12 18:43:05 +01:00
luca.mazzoleni fbca8d3abd - in ProcessSplit correzione per coda con spessore molto piccolo e separazione con testa sopra/sotto 2026-03-12 18:42:56 +01:00
luca.mazzoleni 6c61edc338 Merge branch 'develop' into Test_Ticket#2842 2026-03-11 17:42:41 +01:00
luca.mazzoleni 6643673196 - in LapJoint se svuotatura da due lati si usa la OpenPocket per groove3 aperta e rabbet 2026-03-11 17:38:13 +01:00
luca.mazzoleni 7d33ea6799 Merge branch 'DrillPocketDoubleFix' into develop 2026-03-11 09:50:05 +01:00
luca.mazzoleni 7dd0c14f5f - in ProcessDrill sistemato LastStep in caso di DrillPocket: ora si copia la lavorazione e si toglie il doppio 2026-03-11 09:22:00 +01:00
luca.mazzoleni 232adff332 Merge branch 'develop' into Test_Ticket#2842 2026-03-06 18:03:26 +01:00
luca.mazzoleni d55caac3c9 Merge tag '3.1c1' into develop
3.1c1
2026-03-04 17:59:15 +01:00
daniele.nicoli bd8a551005 Eliminata passata finale dopo il taglio di coda se non è presente un grezzo successivo. 2026-03-03 11:53:08 +01:00
daniele.nicoli 1729e57dbf ProcessLongDoubleCut, migliorata casistica pezzo da lavorare con testa 2 2026-03-02 16:38:08 +01:00
16 changed files with 1093 additions and 247 deletions
+18
View File
@@ -277,6 +277,15 @@ if bToProcess then
else else
vBeam[i].Box = b3Solid vBeam[i].Box = b3Solid
end end
if BD.MAX_LENGTH and BD.MAX_LENGTH > 10 and b3Solid:getDimX() > BD.MAX_LENGTH then
local sOut = 'Piece-Length (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
'out of machine limits (' .. EgtNumToString( BD.MAX_LENGTH, 2) .. ') '
BEAM.ERR = 17
BEAM.MSG = sOut
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
PostErrView( BEAM.ERR, BEAM.MSG)
return
end
end end
-- Assegno lunghezza della barra -- Assegno lunghezza della barra
dBarLen = vBeam[1].Box:getDimX() + 10 dBarLen = vBeam[1].Box:getDimX() + 10
@@ -330,6 +339,15 @@ if bToProcess then
else else
vBeam[i].Box = b3Solid vBeam[i].Box = b3Solid
end end
if BD.MAX_LENGTH and BD.MAX_LENGTH > 10 and b3Solid:getDimX() > BD.MAX_LENGTH then
local sOut = 'Piece-Length (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
'out of machine limits (' .. EgtNumToString( BD.MAX_LENGTH, 2) .. ') '
BEAM.ERR = 17
BEAM.MSG = sOut
WriteErrToLogFile( BEAM.ERR, BEAM.MSG)
PostErrView( BEAM.ERR, BEAM.MSG)
return
end
end end
end end
+10 -5
View File
@@ -443,7 +443,7 @@ local function CalcHeadTailMachBeforeIntersDrillings( vProc, b3Raw)
for i = 1, #vProc do for i = 1, #vProc do
local Proc = vProc[i] local Proc = vProc[i]
if Proc.Box and not Proc.Box:isEmpty() then if Proc.Box and not Proc.Box:isEmpty() then
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, b3Raw:getDimY(), b3Raw:getDimZ()) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 350 then
if Proc.Head and Proc.Box:getCenter():getX() < dHeadX then if Proc.Head and Proc.Box:getCenter():getX() < dHeadX then
dHeadX = Proc.Box:getCenter():getX() dHeadX = Proc.Box:getCenter():getX()
nHeadId = Proc.Id nHeadId = Proc.Id
@@ -1641,7 +1641,8 @@ local function SetCutsOnFrontMortises( vProc)
-- verifico se i piani coincidono -- verifico se i piani coincidono
local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0) local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0)
if bSamePlane then if bSamePlane then
vProc[i].CutFront = vProc[j].Id --vProc[i].CutFront = vProc[j].Id
vProc[j].bSkipCut = true
end end
-- log -- log
local sMsg = string.format( 'Cut %d meet Mortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '') local sMsg = string.format( 'Cut %d meet Mortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '')
@@ -1658,7 +1659,8 @@ local function SetCutsOnFrontMortises( vProc)
-- verifico se i piani coincidono -- verifico se i piani coincidono
local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0) local bSamePlane = ( ptC1 and vtN1 and ptC2 and vtN2 and AreSameVectorApprox( vtN1, vtN2) and ( ptC2 - ptC1) * vtN1 < 1.0)
if bSamePlane then if bSamePlane then
vProc[i].CutFront = vProc[j].Id --vProc[i].CutFront = vProc[j].Id
vProc[j].bSkipCut = true
end end
-- log -- log
local sMsg = string.format( 'Cut %d meet DtMortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '') local sMsg = string.format( 'Cut %d meet DtMortise %d', vProc[i].Id, vProc[j].Id) .. EgtIf( bSamePlane, ' with same plane', '')
@@ -1991,6 +1993,9 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
end end
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd') local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
local dToolDoubleMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) local dToolDoubleMaxDepth = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT)
if ( sType == 'Pocket_AT' or sType == 'Pocket') then
dToolDoubleMaxDepth = EgtTdbGetCurrToolMaxDepth()
end
dMachiningDepth = min( dMachiningDepth, dToolDoubleMaxDepth) dMachiningDepth = min( dMachiningDepth, dToolDoubleMaxDepth)
-- recupero la lunghezza della parte inclinata della punta -- recupero la lunghezza della parte inclinata della punta
local dToolDoubleTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN) local dToolDoubleTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN)
@@ -2211,14 +2216,14 @@ function GetFeatureInfoAndDependency( vProc, b3Raw, nPartId)
Proc.PassedByHole = true Proc.PassedByHole = true
end end
-- se taglio attraversato da foro, si definisce precedenza in base ad angolo -- se taglio attraversato da foro, si definisce precedenza in base ad angolo
if Drill.Identify( Proc) and Cut.Identify( ProcB) and Overlaps( Proc.Box, ProcB.Box) then if Drill.Identify( Proc) and ( Cut.Identify( ProcB) or ProcB.Prc == 340 or ProcB.Proc == 350) and Overlaps( Proc.Box, ProcB.Box) then
-- recupero e verifico l'entità foro -- recupero e verifico l'entità foro
local DrillAuxId = ( EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0) + Proc.Id local DrillAuxId = ( EgtGetInfo( Proc.Id, 'AUXID', 'i') or 0) + Proc.Id
local vtDrillExtr = EgtCurveExtrusion( DrillAuxId, GDB_RT.GLOB) local vtDrillExtr = EgtCurveExtrusion( DrillAuxId, GDB_RT.GLOB)
local bOpen = ( Proc.Fce ~= 0) and ( Proc.Fce ~= Proc.Fcs) local bOpen = ( Proc.Fce ~= 0) and ( Proc.Fce ~= Proc.Fcs)
local ptCut, vtCutN = EgtSurfTmFacetCenter( ProcB.Id, 0, GDB_ID.ROOT) local ptCut, vtCutN = EgtSurfTmFacetCenter( ProcB.Id, 0, GDB_ID.ROOT)
local dMaxAngleDrillOnCut = BD.MAX_ANGLE_DRILL_CUT or 10 local dMaxAngleDrillOnCut = BD.MAX_ANGLE_DRILL_CUT or 10
if GetAngle( vtDrillExtr, vtCutN) > dMaxAngleDrillOnCut then if ( GetAngle( vtDrillExtr, vtCutN) > dMaxAngleDrillOnCut) and not ( ProcB.Prc == 340 or ProcB.Proc == 350) then
if bOpen and GetAngle( -vtDrillExtr, vtCutN) < dMaxAngleDrillOnCut then if bOpen and GetAngle( -vtDrillExtr, vtCutN) < dMaxAngleDrillOnCut then
ProcB.Dependency = {} ProcB.Dependency = {}
ProcB.Dependency.ExecBefore = Proc ProcB.Dependency.ExecBefore = Proc
+49
View File
@@ -883,6 +883,25 @@ function BeamLib.GetBlockedAxis( sMachining, sBlockedAxis, b3Raw, vtTool, vtOut)
return '' return ''
end end
---------------------------------------------------------------------
function BeamLib.GetAuxDir( sMachining, sBlockedAxis, b3Raw, vtTool, vtOut)
-- informazioni sull'utensile della lavorazione
local nToolType, sHead
if EgtMdbSetCurrMachining( sMachining) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
nToolType = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
end
end
-- se presente funzione specifica nella macchina, la richiamo
if BD.GetAuxDir then
return BD.GetAuxDir( sHead, nToolType, sBlockedAxis, b3Raw, vtTool, vtOut)
end
-- niente
return nil
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Trova l'Ind (0 based) della faccia meglio orientata come l'asse vtAx. Restituisce anche vtN e ptC della faccia stessa. La faccia di indice (0 based) fctExclude non viene considerata nella ricerca. -- Trova l'Ind (0 based) della faccia meglio orientata come l'asse vtAx. Restituisce anche vtN e ptC della faccia stessa. La faccia di indice (0 based) fctExclude non viene considerata nella ricerca.
function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude) function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
@@ -1158,6 +1177,31 @@ function BeamLib.Is3EdgesApprox( Proc, nFacet, nAddGrpId)
return bResult return bResult
end end
-------------------------------------------------------------------------------------------------------------
function BeamLib.IsPointOnBoxLimits( ptPoint, b3Solid)
local dTol = 500 * GEO.EPS_SMALL
local dMinX = b3Solid:getMin():getX()
local dMinY = b3Solid:getMin():getY()
local dMinZ = b3Solid:getMin():getZ()
local dMaxX = b3Solid:getMax():getX()
local dMaxY = b3Solid:getMax():getY()
local dMaxZ = b3Solid:getMax():getZ()
-- Check di ogni piano limite
if abs( ptPoint:getX() - dMinX) < dTol then return true, "Left" end
if abs( ptPoint:getX() - dMaxX) < dTol then return true, "Right" end
if abs( ptPoint:getY() - dMinY) < dTol then return true, "Front" end
if abs( ptPoint:getY() - dMaxY) < dTol then return true, "Back" end
if abs( ptPoint:getZ() - dMinZ) < dTol then return true, "Bottom" end
if abs( ptPoint:getZ() - dMaxZ) < dTol then return true, "Top" end
return false
end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
-- restituisce le facce della parte interessate dalla feature Proc -- restituisce le facce della parte interessate dalla feature Proc
function BeamLib.GetProcessAffectedFaces( Proc) function BeamLib.GetProcessAffectedFaces( Proc)
@@ -1393,6 +1437,11 @@ function BeamLib.GetToolFromMachining( sMachiningName)
else else
Tool.IsOnAggregate = false Tool.IsOnAggregate = false
end end
Tool.StemDiameter = EgtTdbGetCurrToolParam( MCH_TP.STEMDIAM) or 0
Tool.MaxDepth = EgtTdbGetCurrToolMaxDepth() or 0
if Tool.StemDiameter > Tool.Diameter + GEO.EPS_SMALL then
Tool.MaxDepth = Tool.MaxDepth - BD.COLL_SIC
end
-- altri utensili al momento non previsti -- altri utensili al momento non previsti
else else
error( 'Wrong tool type') error( 'Wrong tool type')
+15 -3
View File
@@ -170,6 +170,12 @@ function MakeParallelOne( nSurfId, nFacet, sCutting, dSawDiam, nFaceUse, dVzLimD
end end
local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX()) local vtOut = EgtIf( vtN:getX() > 0, X_AX(), -X_AX())
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtTool, vtOut)) EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, 'perpendicular', b3Raw, vtTool, vtOut))
local sAuxDir, sInitAngs = BL.GetAuxDir( sCutting, 'perpendicular', b3Raw, vtTool, vtOut)
if sAuxDir then
sNotes = EgtSetValInNotes( sNotes, 'VtAuxDir', sAuxDir)
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
end
-- eventuali note -- eventuali note
if ( sLeadInOutType == 'PerpendicularOutraw') then if ( sLeadInOutType == 'PerpendicularOutraw') then
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3) sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
@@ -231,7 +237,7 @@ local function GetEdgeToMachineFromVector( nSurfId, nFacet, vtOrthO)
end end
--------------------------------------------------------------------- ---------------------------------------------------------------------
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, sLeadInOutType, Par5Alternative, dActualElevation) function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert, bMaximizeVerticalDepth, bSpecialTangentLeadInOut, sLeadInOutType, Par5Alternative, dActualElevation, bForceClimbCut)
-- se lama con asse parallelo alla faccia, passo alla apposita funzione -- se lama con asse parallelo alla faccia, passo alla apposita funzione
if ( Par5 == MCH_MILL_FU.PARAL_DOWN or if ( Par5 == MCH_MILL_FU.PARAL_DOWN or
Par5 == MCH_MILL_FU.PARAL_TOP or Par5 == MCH_MILL_FU.PARAL_TOP or
@@ -298,7 +304,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
if not BD.TURN or abs( ptP2:getY() - ptP1:getY()) < 250 then if not BD.TURN or abs( ptP2:getY() - ptP1:getY()) < 250 then
local bIsMachiningDownwards = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL) local bIsMachiningDownwards = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
local bIsMachiningUpwards = ( ptP2:getZ() > ptP1:getZ() + 100 * GEO.EPS_SMALL) local bIsMachiningUpwards = ( ptP2:getZ() > ptP1:getZ() + 100 * GEO.EPS_SMALL)
if ( bIsSawCCW ~= bDownUp) and ( bIsMachiningDownwards or not ( bIsMachiningDownwards or bIsMachiningUpwards)) then if ( bIsSawCCW ~= bDownUp) and ( bIsMachiningDownwards or not ( bIsMachiningDownwards or bIsMachiningUpwards) or bForceClimbCut) then
bInvert = true bInvert = true
elseif ( ( bIsSawCCW ~= bDownUp) ~= bIsMachiningDownwards) then elseif ( ( bIsSawCCW ~= bDownUp) ~= bIsMachiningDownwards) then
if Par5Alternative then if Par5Alternative then
@@ -451,7 +457,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
-- se distanza al punto è maggiore del raggio lama, significa che non ho già lavorato, quindi calcolo entrata opportunamente -- se distanza al punto è maggiore del raggio lama, significa che non ho già lavorato, quindi calcolo entrata opportunamente
if dDistPointToCenter > 0.5 * dSawDiam then if dDistPointToCenter > 0.5 * dSawDiam then
dLiTang = -dAllStart * dCosAlpha dLiTang = -dAllStart * dCosAlpha
dLiPerp = dDist1 * dSinAlpha dLiPerp = dDist1 * dSinAlpha
end end
end end
-- se ho accorciato uscita, setto componente tangente e perpendicolare sul percorso di uscita -- se ho accorciato uscita, setto componente tangente e perpendicolare sul percorso di uscita
@@ -631,6 +637,12 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
-- imposto angolo 3° asse rot -- imposto angolo 3° asse rot
local sBlockedAxis = EgtIf( bMaximizeVerticalDepth, 'parallel', 'perpendicular') local sBlockedAxis = EgtIf( bMaximizeVerticalDepth, 'parallel', 'perpendicular')
EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO)) EgtSetMachiningParam( MCH_MP.BLOCKEDAXIS, BL.GetBlockedAxis( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO))
local sAuxDir, sInitAngs = BL.GetAuxDir( sCutting, sBlockedAxis, b3Raw, vtN, vtOrthO)
if sAuxDir then
sNotes = EgtSetValInNotes( sNotes, 'VtAuxDir', sAuxDir)
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
end
-- eventuali note -- eventuali note
if ( sLeadInOutType == 'PerpendicularOutraw') then if ( sLeadInOutType == 'PerpendicularOutraw') then
sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3) sNotes = EgtSetValInNotes( sNotes, 'OutRaw', 3)
+51 -3
View File
@@ -63,6 +63,7 @@ function ProcessCut.Classify( Proc, b3Raw)
if ( BD.C_SIMM and BD.DOWN_HEAD) or BD.TURN then if ( BD.C_SIMM and BD.DOWN_HEAD) or BD.TURN then
return true return true
end end
local bForceNoBeamRotation = ( EgtGetInfo( Proc.Id, 'Q18', 'i') == 1)
-- recupero i dati del taglio -- recupero i dati del taglio
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
-- calcolo le massime estensioni lineari orizzontale e verticale della faccia -- calcolo le massime estensioni lineari orizzontale e verticale della faccia
@@ -73,7 +74,7 @@ function ProcessCut.Classify( Proc, b3Raw)
then then
-- confronto queste estensioni con la massima dimensione del DiceCut (impossibile lavorare se entrambe maggiori) -- confronto queste estensioni con la massima dimensione del DiceCut (impossibile lavorare se entrambe maggiori)
if DimH > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL and DimV > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL then if DimH > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL and DimV > BD.MAX_DIM_DICE + 100 * GEO.EPS_SMALL then
return true, true return true, not bForceNoBeamRotation
end end
end end
-- se è un taglio da sotto, lo verifico -- se è un taglio da sotto, lo verifico
@@ -96,7 +97,7 @@ function ProcessCut.Classify( Proc, b3Raw)
_, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0) _, DimH, DimV = BL.GetFaceHvRefDim( Proc.Id, 0)
-- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale) -- confronto questo ingombro con il doppio della massima dimensione del DiceCut (impossibile lavorare sotto da sopra se più di 2 tagli oppure se tipo PF, taglio inclinato in Y e non taglio singolo orizzontale)
if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and ( abs( vtN:getY()) > 0.1) and dMaxMat < DimH + BD.CUT_EXTRA) then if DimH > 2 * BD.MAX_DIM_DICE or ( BD.C_SIMM and ( abs( vtN:getY()) > 0.1) and dMaxMat < DimH + BD.CUT_EXTRA) then
return true, true return true, not bForceNoBeamRotation
end end
end end
return true, false return true, false
@@ -478,12 +479,16 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
-- determino il modo di tagliare -- determino il modo di tagliare
local vtOrthoO local vtOrthoO
local bNoPerpCuts = false local bNoPerpCuts = false
local vtO
-- Se tagli ortogonali (indice dispari)
if i % 2 == 1 then if i % 2 == 1 then
vtOrthoO = Vector3d( vtN) vtOrthoO = Vector3d( vtN)
-- Se tagli perpendicolari (indice pari)
else else
local vtO -- Se elemento precedente contiene tagli ortogonali
if #vCuts[i-1] > 0 then if #vCuts[i-1] > 0 then
vtO = EgtSurfTmFacetNormVersor( vCuts[i-1][1], 0, GDB_ID.ROOT) vtO = EgtSurfTmFacetNormVersor( vCuts[i-1][1], 0, GDB_ID.ROOT)
-- Se elemento successivo contiene tagli ortogonali
elseif vCuts[i+1] and #vCuts[i+1] > 0 then elseif vCuts[i+1] and #vCuts[i+1] > 0 then
-- lunghezza faccia nell'eventuale direzione ortogonale -- lunghezza faccia nell'eventuale direzione ortogonale
local asseX = EgtSurfTmFacetNormVersor( vCuts[i+1][1], 0, GDB_ID.ROOT) local asseX = EgtSurfTmFacetNormVersor( vCuts[i+1][1], 0, GDB_ID.ROOT)
@@ -551,8 +556,51 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
end end
local bOk2, sErr2 = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut2, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw) local bOk2, sErr2 = Fbs.MakeOne( nSurfToCut, 0, sCutting, dSawDiam, nFaceUseCut2, nil, dCutExtra, BD.CUT_SIC, 0, 0, 0, '', b3Raw)
if not bOk2 then return false, sErr2 end if not bOk2 then return false, sErr2 end
-- caso standard -- caso standard
else else
-- se necessario aggiungo tagli obliqui per cubettare pezzi lunghi che potrebbero cadere sul motore
if ( i % 2) == 0 and Proc.Fct == 1 and AreSameOrOppositeVectorApprox( vtO, Z_AX()) then
local vtOrthoVert = vtN ^ vtO
-- inverte direzione superfici per corretta direzione SCC
if ( vtN:getY() > 0 and vtOrthoVert:getY() > 0) or ( vtN:getY() < 0 and vtOrthoVert:getY() < 0) then
vtOrthoVert = -vtOrthoVert
end
local Frame = Frame3d( ptC, vtN, vtO)
local b3Fac = EgtGetBBoxRef( vCuts[i][1], GDB_BB.STANDARD, Frame)
-- se cubetto più grande di MAX_DIM_DICE
if abs( b3Fac:getDimY() - BD.MAX_DIM_DICE) > 10 * GEO.EPS_SMALL then
local nVerticalCuts = ceil( b3Fac:getDimY() / ( BD.MAX_LEN_DICE)) - 1
local dVerticalSliceDist = b3Fac:getDimY() / ( nVerticalCuts + 1)
-- selezione utensile
local dSawDiam = 400
if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
end
end
-- crea faccia per tagli verticali e le taglia a dimensione corretta
for k = 1, nVerticalCuts do
local nFaceUse = BL.GetNearestOrthoOpposite( vtN)
local dVerticalCutOffset = dVerticalSliceDist * k
local sLeadInOutType = 'Perpendicular'
local nMergedParallelSurfId = EgtSurfTmBySewing( nAddGrpId, vCuts[i], false)
local ptVertCut = EgtSurfTmFacetCenter( nMergedParallelSurfId, 0, GDB_ID.ROOT)
ptVertCut = ptVertCut + ( -b3Fac:getDimY()/2 + dVerticalCutOffset) * vtOrthoVert
local nSurfId = EgtSurfTmPlaneInBBox( nAddGrpId, ptVertCut, vtOrthoVert, b3Raw, GDB_RT.GLOB)
-- se non è il primo taglio parallelo taglia anche le superfici con la faccia parallela precedente
if i ~= 2 then
local nMergedPreviousParallelSurfId = EgtSurfTmBySewing( nAddGrpId, vCuts[i-2], false)
local ptOnPreviousParallelSurf = EgtSurfTmFacetCenter( nMergedPreviousParallelSurfId, 0, GDB_ID.ROOT)
EgtCutSurfTmPlane( nSurfId, ptOnPreviousParallelSurf, vtN, false, GDB_RT.GLOB)
end
EgtCutSurfTmPlane( nSurfId, ptVertCut, -vtN, false, GDB_RT.GLOB)
local bOk, sErr = Fbs.MakeOne( nSurfId, 0, sCutting, dSawDiam, nFaceUse, nil, -0.1, BD.CUT_SIC, 0, 0, 0, '', b3Raw, nil, nil, nil, sLeadInOutType, nil, 0, nil)
if not bOk then return bOk, sErr end
end
end
end
-- lavoro la faccia -- lavoro la faccia
for j = 1, #vCuts[i] do for j = 1, #vCuts[i] do
-- se taglio dal basso -- se taglio dal basso
+49 -24
View File
@@ -37,6 +37,7 @@ EgtOutLog( ' ProcessDrill started', 1)
-- Dati -- Dati
local BD = require( 'BeamData') local BD = require( 'BeamData')
local ML = require( 'MachiningLib') local ML = require( 'MachiningLib')
local FreeContour = require( 'ProcessFreeContour')
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Riconoscimento della feature -- Riconoscimento della feature
@@ -345,8 +346,6 @@ end
function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- Se forzato contorno foro forzo richiamo a FreeContour e uscita dalla funzione -- Se forzato contorno foro forzo richiamo a FreeContour e uscita dalla funzione
if EgtGetInfo( Proc.Id, 'Q04', 'i') == 1 then if EgtGetInfo( Proc.Id, 'Q04', 'i') == 1 then
_G.package.loaded.ProcessFreeContour = nil
local FreeContour = require( 'ProcessFreeContour')
return FreeContour.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH) return FreeContour.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- default per costanti -- default per costanti
@@ -542,11 +541,13 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if not bToInvert and Proc.Flg == 1 and bOpen and abs( vtExtr:getZ()) < 0.259 and abs( vtExtr:getY()) > 0.966 then if not bToInvert and Proc.Flg == 1 and bOpen and abs( vtExtr:getZ()) < 0.259 and abs( vtExtr:getY()) > 0.966 then
local Tool = BL.GetToolFromMachining( sDrilling) local Tool = BL.GetToolFromMachining( sDrilling)
-- lato testa e lato di lavoro devono corrispondere -- lato testa e lato di lavoro devono corrispondere
if ( ( Tool.PreferredSide.bFront == true) and vtExtr:getY() > 10 * GEO.EPS_SMALL) if Tool.PreferredSide then
or ( ( Tool.PreferredSide.bBack == true) and vtExtr:getY() < - 10 * GEO.EPS_SMALL) then if ( ( Tool.PreferredSide.bFront == true) and vtExtr:getY() > 10 * GEO.EPS_SMALL)
ptCen = ptCen - vtExtr * dLen or ( ( Tool.PreferredSide.bBack == true) and vtExtr:getY() < - 10 * GEO.EPS_SMALL) then
vtExtr = - vtExtr ptCen = ptCen - vtExtr * dLen
bToInvert = true vtExtr = - vtExtr
bToInvert = true
end
end end
end end
-- Determino la faccia di inizio del foro e dati correlati -- Determino la faccia di inizio del foro e dati correlati
@@ -593,8 +594,10 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local dHoleToCutDistance = vDistance[1] local dHoleToCutDistance = vDistance[1]
-- se il taglio accorcia realmente il foro -- se il taglio accorcia realmente il foro
if ( dHoleToCutDistance > 10 * GEO.EPS_SMALL or Proc.AffectedFaces.Right) and dHoleToCutDistance < dLen then if ( dHoleToCutDistance > 10 * GEO.EPS_SMALL or Proc.AffectedFaces.Right) and dHoleToCutDistance < dLen then
local dToolTipFromCenterDrill = ( ( dDiam / 2) - ( dToolDiam / 2))
local dExtraSicDistFromThToTiltedCut = sqrt( ( dToolTipFromCenterDrill / CosB)^2 - dToolTipFromCenterDrill^2) + sqrt( ( ( dDiamTh / 2) / CosB)^2 - (dDiamTh / 2)^2)
dMaxDepth = dMaxDepthOri dMaxDepth = dMaxDepthOri
dMaxElev = dLen - dHoleToCutDistance dMaxElev = dLen - ( dHoleToCutDistance - dExtraSicDistFromThToTiltedCut)
bTryDrill = true bTryDrill = true
local dToolAddLength = dLen - dMaxElev local dToolAddLength = dLen - dMaxElev
-- se l'utensile è comunque troppo corto lavoro il massimo possibile -- se l'utensile è comunque troppo corto lavoro il massimo possibile
@@ -612,6 +615,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
end end
end end
local dDepthOri = dDepth
-- se foro da saltare per eccessiva inclinazione -- se foro da saltare per eccessiva inclinazione
if not bTryDrill then if not bTryDrill then
sMyWarn = 'Warning in drill : too slant hole' sMyWarn = 'Warning in drill : too slant hole'
@@ -653,6 +657,9 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local dReduceDepth = MIRROR_POCKETS_MIN_DISTANCE / 2 + 10 local dReduceDepth = MIRROR_POCKETS_MIN_DISTANCE / 2 + 10
dLastStepDepth = dDepth + dReduceDepth dLastStepDepth = dDepth + dReduceDepth
dDepth = dDepth - dReduceDepth dDepth = dDepth - dReduceDepth
if ( dLastStepDepth > dMaxDepth + 10 * GEO.EPS_SMALL) and ( dMaxDepth <= ( dLen / 2) - dReduceDepth) and ( dDepthOri ~= dDepth) then
dDepth = dMaxDepth
end
end end
else else
sUserNotes = EgtSetValInNotes( sUserNotes, 'LastStep', MIRROR_DRILLINGS_MIN_DISTANCE / 2 + 15) sUserNotes = EgtSetValInNotes( sUserNotes, 'LastStep', MIRROR_DRILLINGS_MIN_DISTANCE / 2 + 15)
@@ -717,23 +724,41 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else else
-- se DrillPocket passante in doppio si fa lavorazione aggiuntiva dell'ultimo step -- se DrillPocket passante in doppio si fa lavorazione aggiuntiva dell'ultimo step
if Proc.Double and Proc.Double > 0 and ( sType == 'Pocket_AT' or sType == 'Pocket') and bOpen then if Proc.Double and Proc.Double > 0 and ( sType == 'Pocket_AT' or sType == 'Pocket') and bOpen then
local nAddGrpId = BL.GetAddGroup( Proc.PartId) if dLastStepDepth > dMaxDepth + 10 * GEO.EPS_SMALL then
local idProcLastStep = EgtCopyGlob( Proc.Id, nAddGrpId) sMyWarn = 'Warning in drill pocket last step: depth (' .. EgtNumToString( dLastStepDepth, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth, 1) .. ')'
local idAuxIdLastStep = EgtCopyGlob( AuxId, nAddGrpId) return false, sMyWarn
EgtModifyCurveThickness( idAuxIdLastStep, -dLastStepDepth)
local ProcLastStep = BL.TableCopyDeep( Proc)
ProcLastStep.Id = idProcLastStep
ProcLastStep.Flg = 1
ProcLastStep.Double = 0
ProcLastStep.dCustomMaxElev = dLastStepDepth - dDepth
local bOkLastStep, sWarnLastStep = ProcessDrill.Make( ProcLastStep, nPhase, nRawId, nPartId)
if not bOkLastStep then
sWarnLastStep = 'Drillpocket double : incomplete, last step missing'
end end
local sPreviousWarn = sMyWarn or sWarn local idMachiningLastStep = EgtCopyMachining( EgtIf( EgtStartsWith( sType, 'Predrill'), 'Predrill_', 'Drill_') .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)), sName)
if sWarnLastStep then EgtSetCurrMachining( idMachiningLastStep)
if not sPreviousWarn then sPreviousWarn = '' end local dMaxElevLastStep = dLastStepDepth - dDepth
sMyWarn = EgtIf( #sPreviousWarn > 0, sPreviousWarn .. '\n' .. sWarnLastStep, sWarnLastStep) sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElevLastStep, 1))
EgtSetMachiningParam( MCH_MP.DEPTH, dLastStepDepth)
sUserNotes = EgtSetValInNotes( sUserNotes, 'DOUBLE', '')
sUserNotes = EgtSetValInNotes( sUserNotes, 'StartZmax', '')
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
local bOkLastStep = ML.ApplyMachining( true, false)
if not bOkLastStep and bDownDrill and bOpen and abs( Proc.Flg) == 1 then
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
EgtSetMachiningParam( MCH_MP.INVERT, true)
else
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
end
bOkLastStep = ML.ApplyMachining( true, false)
end
if not bOkLastStep then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchId, false)
return false, sErr
else
local _, sWarnLastStep = EgtGetMachMgrWarning( 0)
if not bOkLastStep then
sWarnLastStep = 'Drillpocket double : incomplete, last step missing'
end
local sPreviousWarn = sMyWarn or sWarn
if sWarnLastStep then
if not sPreviousWarn then sPreviousWarn = '' end
sMyWarn = EgtIf( #sPreviousWarn > 0, sPreviousWarn .. '\n' .. sWarnLastStep, sWarnLastStep)
end
end end
end end
return true, ( sMyWarn or sWarn) return true, ( sMyWarn or sWarn)
+37 -10
View File
@@ -136,9 +136,11 @@ local function CalcPathAtHeight( nProcId, AuxId, nAddGrpId, dHeight, dSideAng, b
local vtBoxDiag = b3Solid:getMax() - b3Solid:getMin() local vtBoxDiag = b3Solid:getMax() - b3Solid:getMin()
local nCount local nCount
NewAuxId, nCount = EgtTrimFlatCurveWithBox( NewAuxId, refBox, vtBoxDiag, true, true, GDB_RT.GLOB) NewAuxId, nCount = EgtTrimFlatCurveWithBox( NewAuxId, refBox, vtBoxDiag, true, true, GDB_RT.GLOB)
-- eseguo traslazione e offset per portarla sul top -- per ogni curva creata, eseguo traslazione e offset per portarla sul top
local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dHeight - 10 * GEO.EPS_SMALL) local vtMove = EgtCurveExtrusion( AuxId, GDB_RT.GLOB) * ( dHeight - 10 * GEO.EPS_SMALL)
EgtMove( NewAuxId, vtMove, GDB_RT.GLOB) for i = 1, nCount do
EgtMove( NewAuxId + i - 1, vtMove, GDB_RT.GLOB)
end
-- se divisa in più parti, le unisco congiungendole con segmenti -- se divisa in più parti, le unisco congiungendole con segmenti
if nCount > 1 then if nCount > 1 then
if EgtGetType( NewAuxId) ~= GDB_TY.CRV_COMPO then if EgtGetType( NewAuxId) ~= GDB_TY.CRV_COMPO then
@@ -147,7 +149,7 @@ local function CalcPathAtHeight( nProcId, AuxId, nAddGrpId, dHeight, dSideAng, b
for i = 2, nCount do for i = 2, nCount do
local CrvId = NewAuxId + i - 1 local CrvId = NewAuxId + i - 1
local ptStart = EgtSP( CrvId) local ptStart = EgtSP( CrvId)
EgtAddCurveCompoLine( NewAuxId, ptStart) EgtAddCurveCompoLine( NewAuxId, ptStart)
EgtAddCurveCompoCurve( NewAuxId, CrvId) EgtAddCurveCompoCurve( NewAuxId, CrvId)
end end
end end
@@ -227,13 +229,14 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt) local b3DtMrt = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfDtMrt)
local dAltMort = b3DtMrt:getDimZ() local dAltMort = b3DtMrt:getDimZ()
-- verifico se di tipo pocket -- verifico se di tipo pocket o se antischeggia disabilitato
local bPocket = ( EgtGetInfo( Proc.Id, 'P05', 'i') == 1) local bPocket = ( EgtGetInfo( Proc.Id, 'P05', 'i') == 1)
if bPocket then bMakeAntiSplitPath = false end local bDisableAntiSplint = ( EgtGetInfo( Proc.Id, 'Q01', 'i') or 0) == 1
if bPocket or bDisableAntiSplint then bMakeAntiSplitPath = false end
-- verifico se frontale -- verifico se frontale
local bFront = ( Proc.Prc == 56) local bFront = ( Proc.Prc == 56)
-- se mortasa di fronte, eseguo il taglio della faccia -- se mortasa di fronte, eseguo il taglio della faccia
if bFront then if bFront and not Proc.bSkipCut then
-- verifico esista la faccia di taglio -- verifico esista la faccia di taglio
local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT) local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then
@@ -359,7 +362,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
dMaxMat = 30 dMaxMat = 30
dSideAng = 0 dSideAng = 0
bCW = true bCW = true
bMillOnAggregate = sMchExt == '_AT' bMillOnAggregate = ( sMchExt == '_AT')
if EgtMdbSetCurrMachining( sMilling) then if EgtMdbSetCurrMachining( sMilling) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
@@ -421,8 +424,16 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- aggiungo geometria -- aggiungo geometria
EgtSetMachiningGeometry( {{ Aux2Id, -1}}) EgtSetMachiningGeometry( {{ Aux2Id, -1}})
-- dichiaro non si generano sfridi per VMill -- recupero note utente per aggiornarle
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or '' local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
-- eventuali impostazioni per 3° asse rot
local sAuxDir, sInitAngs = BL.GetAuxDir( sPocketing, "", b3Solid, vtExtr, vtExtr)
if sAuxDir then
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtAuxDir', sAuxDir)
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
end
-- dichiaro non si generano sfridi per VMill
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1)) sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxMat - 0.1, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0) sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes) EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
@@ -534,8 +545,16 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if nSCC then if nSCC then
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end end
-- dichiaro non si generano sfridi per VMill -- recupero note utente per aggiornarle
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or '' local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
-- eventuali impostazioni per 3° asse rot
local sAuxDir, sInitAngs = BL.GetAuxDir( sMilling, "", b3Solid, vtExtr, vtExtr)
if sAuxDir then
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtAuxDir', sAuxDir)
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
end
-- dichiaro non si generano sfridi per VMill
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dAltMort, 1)) sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dAltMort, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0) sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
-- se lavorazione in doppio -- se lavorazione in doppio
@@ -694,12 +713,20 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
if nSCC then if nSCC then
EgtSetMachiningParam( MCH_MP.SCC, nSCC) EgtSetMachiningParam( MCH_MP.SCC, nSCC)
end end
-- recupero note utente per aggiornarle
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
-- eventuali impostazioni per 3° asse rot
local sAuxDir, sInitAngs = BL.GetAuxDir( sMilling, "", b3Solid, vtExtr, vtExtr)
if sAuxDir then
sUserNotes = EgtSetValInNotes( sUserNotes, 'VtAuxDir', sAuxDir)
EgtSetMachiningParam( MCH_MP.INITANGS, sInitAngs)
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.STD)
end
-- dichiaro massima elevazione e assenza sfridi per VMill -- dichiaro massima elevazione e assenza sfridi per VMill
local dMaxElev = dMaxMat local dMaxElev = dMaxMat
if bMultipleZPasses then if bMultipleZPasses then
dMaxElev = dVerticalStep dMaxElev = dVerticalStep
end end
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1)) sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dMaxElev - 0.1, 1))
sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0) sUserNotes = EgtSetValInNotes( sUserNotes, 'VMRS', 0)
-- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo -- in presenza di pocket dichiaro che non sto entrando e uscendo nel grezzo
+7 -4
View File
@@ -162,10 +162,11 @@ end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- smussi in testa -- smussi in testa
local function MakeHeadChamfer( idProc, nPartId) local function MakeHeadChamfer( idProc, nPartId)
local dDepthHeadChamfer = EgtGetInfo( idProc, 'Q08', 'd') or 0 local dDepthHeadChamfer = EgtGetInfo( idProc, 'Q08', 'd') or 0
-- se non attivo esco subito -- se non attivo esco subito
if dDepthHeadChamfer < 100 * GEO.EPS_SMALL then if dDepthHeadChamfer < 100 * GEO.EPS_SMALL then
return return true, nil
end end
-- recupero gruppo per geometria aggiuntiva -- recupero gruppo per geometria aggiuntiva
@@ -254,7 +255,8 @@ local function MakeHeadChamfer( idProc, nPartId)
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthHeadChamfer + dExtra) EgtSetMachiningParam( MCH_MP.DEPTH, dDepthHeadChamfer + dExtra)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
-- assegno lato di lavoro -- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -639,11 +641,12 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, HeadCutType, Cutting1Data, Cutting2Data, nil, dOvmHead) local bOk, sErr = MakeStandardCuts( Proc, b3Raw, nCuts, dOffsL, HeadCutType, Cutting1Data, Cutting2Data, nil, dOvmHead)
-- alla fine del taglio si aggiungono gli smussi in testa -- alla fine del taglio si aggiungono gli smussi in testa
local _, sErrHeadChamfer = MakeHeadChamfer( nOriId or Proc.Id, nPartId) local _, sErrHeadChamfer = MakeHeadChamfer( nOriId or Proc.Id, nPartId)
if sErr then if sErr then
sErr = sErr..'\n'..sErrHeadChamfer if sErrHeadChamfer then
sErr = sErr..'\n'..sErrHeadChamfer
end
else else
sErr = sErrHeadChamfer sErr = sErrHeadChamfer
end end
File diff suppressed because it is too large Load Diff
+30 -26
View File
@@ -1151,7 +1151,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end end
-- recupero la lavorazione -- recupero la lavorazione
local sMilling local sMilling
local bDownHead = ( nSide == -1 and BD.DOWN_HEAD) local bDownHead = ( BD.DOWN_HEAD and ( nSide == -1 or AreSameVectorApprox( vtN[vOrd[1]], -Z_AX())))
sMilling = ML.FindMilling( 'Long2Cut', dElev, nil, nil, nil, not bDownHead, bDownHead) sMilling = ML.FindMilling( 'Long2Cut', dElev, nil, nil, nil, not bDownHead, bDownHead)
if not sMilling then if not sMilling then
@@ -1277,31 +1277,35 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
local dLimitAngle = -0.5 - 20 * GEO.EPS_SMALL local dLimitAngle = -0.5 - 20 * GEO.EPS_SMALL
-- se facce ortogonali (concave), mantengo la lavorazione di testa sulla faccia più grande purchè non superi di 30 gradi il sottosquadra -- se facce ortogonali (concave), mantengo la lavorazione di testa sulla faccia più grande purchè non superi di 30 gradi il sottosquadra
if bOrtho then if bOrtho then
local vtN1 = vtN[vOrd[1]] if bDownHead and AreSameVectorApprox( vtN[vOrd[1]], -Z_AX()) then
local vtN2 = vtN[vOrd[2]] nFin = 1
if vtN1:getZ() > 0.001 and vtN2:getZ() > 0.001 then
if vtN1:getZ() >= vtN2:getZ() then
nFin = 1
else
nIni = 2
end
else else
if vtN1:getZ() < dLimitAngle then local vtN1 = vtN[vOrd[1]]
nIni = 2 local vtN2 = vtN[vOrd[2]]
elseif vtN2:getZ() < dLimitAngle then if vtN1:getZ() > 0.001 and vtN2:getZ() > 0.001 then
nFin = 1
else
if vtN1:getZ() >= vtN2:getZ() then if vtN1:getZ() >= vtN2:getZ() then
if vtN1:getZ() < dLimitAngle then nFin = 1
nIni = 2
else
nFin = 1
end
else else
if vtN1:getZ() < dLimitAngle then nIni = 2
nIni = 2 end
else
if vtN1:getZ() < dLimitAngle then
nIni = 2
elseif vtN2:getZ() < dLimitAngle then
nFin = 1
else
if vtN1:getZ() >= vtN2:getZ() then
if vtN1:getZ() < dLimitAngle then
nIni = 2
else
nFin = 1
end
else else
nFin = 1 if vtN1:getZ() < dLimitAngle then
nIni = 2
else
nFin = 1
end
end end
end end
end end
@@ -1325,7 +1329,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
-- valore sovrapposizione tra passate con fresa di fianco -- valore sovrapposizione tra passate con fresa di fianco
local dOverLapExtend = 2 local dOverLapExtend = 2
-- Verifico se da fare di fianco perchè normale troppo verso il basso (minore di -30deg) -- Verifico se da fare di fianco perchè normale troppo verso il basso (minore di -30deg)
local bSide = ( vtN[vOrd[i]]:getZ() < dLimitAngle and not ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN))) local bSide = ( vtN[vOrd[i]]:getZ() < dLimitAngle and not ( bDownHead or ( nSide == -1 and ( BD.DOWN_HEAD or BD.TURN))))
-- Limitazioni della lavorazione -- Limitazioni della lavorazione
local nPos = EgtIf( i == 1, j, nC - j + 1) local nPos = EgtIf( i == 1, j, nC - j + 1)
local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC + EgtIf( bSide, dOverLapExtend, 0)) local dSal = EgtIf( nPos == 1, - EgtIf( i == nIni, dStartDist, dEndDist), - EgtIf( i == nIni, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC + EgtIf( bSide, dOverLapExtend, 0))
@@ -1470,7 +1474,7 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
end end
end end
end end
if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left then if not Proc.bMoveAfterSplit and not bConvex and Proc.AffectedFaces.Left and Proc.DistanceToNextPart < ( dToolDiam / 2 + 5) then
-- recupero gruppo per geometria addizionale -- recupero gruppo per geometria addizionale
local nAddGrpId = BL.GetAddGroup( nPartId) local nAddGrpId = BL.GetAddGroup( nPartId)
if not nAddGrpId then if not nAddGrpId then
@@ -1503,8 +1507,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster
sMilling = ML.FindMilling( sMchType) sMilling = ML.FindMilling( sMchType)
sPrefix = 'L2CS_' sPrefix = 'L2CS_'
nExtendMach = nUseMillOnSide nExtendMach = nUseMillOnSide
if nUseMillOnSide == 2 then if nUseMillOnSide == 2 then
bRemoveToolRadius = true bRemoveToolRadius = true
end end
-- se testa da sotto -- se testa da sotto
if nSide ~= 1 and BD.DOWN_HEAD then if nSide ~= 1 and BD.DOWN_HEAD then
+2 -2
View File
@@ -32,7 +32,7 @@ local BD = require( 'BeamData')
local ML = require( 'MachiningLib') local ML = require( 'MachiningLib')
-- variabili assegnazione parametri Q -- variabili assegnazione parametri Q
local Q_DEPTH_CHAMFER = 'Q02' -- d local Q_DEPTH_CHAMFER = 'Q01' -- d
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Riconoscimento della feature -- Riconoscimento della feature
@@ -467,7 +467,7 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end end
-- se mortasa di fronte, eseguo il taglio della faccia -- se mortasa di fronte, eseguo il taglio della faccia
if bFront then if bFront and not Proc.bSkipCut then
-- verifico esista la faccia di taglio -- verifico esista la faccia di taglio
local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT) local ptCutC, vtCutN = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then if ptCutC and vtCutN and AreSameVectorApprox( vtExtr, vtCutN) then
+3 -2
View File
@@ -258,7 +258,8 @@ local function MakeTailChamfer( idProc, nPartId, dDepthTailChamfer)
EgtSetMachiningParam( MCH_MP.DEPTH, dDepthTailChamfer + dExtra) EgtSetMachiningParam( MCH_MP.DEPTH, dDepthTailChamfer + dExtra)
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra) EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
-- assegno lato di lavoro -- assegno lato di lavoro
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT) EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
-- eseguo -- eseguo
if not ML.ApplyMachining( true, false) then if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError() local _, sErr = EgtGetLastMachMgrError()
@@ -834,7 +835,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
-- determinazione materiale da asportare -- determinazione materiale da asportare
local dSawThickCheck = dSawThick local dSawThickCheck = dSawThick
if dSawThick2 > 0 and bDoubleHorizCut then if dSawThick2 > 0 and bDoubleHorizCut then
dSawThickCheck = min( dSawThick, dSawThick2) dSawThickCheck = max( min( dSawThick, dSawThick2), dOvmTail)
end end
local dMaxElev = 0 local dMaxElev = 0
if vtN:getX() > 0 then if vtN:getX() > 0 then
+154 -34
View File
@@ -140,6 +140,112 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
return true return true
end end
---------------------------------------------------------------------
local function MakePocket( Proc, nPartId, ptPs, vtN, nFaceRef, nDiffWidth, sMchFind, nUseRoughTool, tBHx)
-- calcolo il elevazione dal punto medio
local dElev
local dLenIn, dLedOut = BL.GetPointDirDepth( nPartId, ptPs, vtN[nFaceRef])
if dLenIn > 0 then
dElev = dLenIn
elseif dLedOut then
dElev = dLedOut
end
local dCollSic = 2 * BD.COLL_SIC
local sTuuidMstr
-- calcolo il diametro utensile
local dDiamTool
if nUseRoughTool == 1 then
-- se feature passante prendo utensile più grande possibile
if ( Proc.AffectedFaces.Top and Proc.AffectedFaces.Bottom) or ( Proc.AffectedFaces.Front and Proc.AffectedFaces.Back) then
dDiamTool = nil
else
dDiamTool = max( 80, min( tBHx[nFaceRef][1], tBHx[nFaceRef][2]))
end
else
-- se non uso truciolatore prendo il valore dalle dimensioni minime delle facce
dDiamTool = min( tBHx[nFaceRef][1], tBHx[nFaceRef][2])
end
-- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -30deg)
local bTopHead = ( BD.DOWN_HEAD and vtN[nFaceRef]:getZ() > -0.1)
local bDownHead = ( BD.DOWN_HEAD and vtN[nFaceRef]:getZ() < 0.1)
-- recupero la lavorazione
local sPocketing, _, _, bDownHead = ML.FindPocketing( sMchFind.. EgtIf( bDownHead, '_H2', ''), dDiamTool, dElev + dCollSic, nil, bTopHead, bDownHead)
if not sPocketing then
local sErr = 'Error : pocketing not found in library'
EgtOutLog( sErr)
return false, sErr
end
-- recupero il diametro dell'utensile
if EgtMdbSetCurrMachining( sPocketing) then
sTuuidMstr = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuidMstr) or '') then
dDiamTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dDiamTool
end
end
-- inserisco la lavorazione di svuotatura
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id)) .. 'F' .. tostring( nFaceRef - 1)
local nMchFId = EgtAddMachining( sName, sPocketing)
if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
EgtOutLog( sErr)
return false, sErr
end
-- aggiungo geometria
EgtSetMachiningGeometry( {{ Proc.Id, (nFaceRef-1)}})
-- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_CONT)
-- imposto posizione braccio porta testa
if vtN[nFaceRef]:getY() < GEO.EPS_SMALL then
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YM)
else
EgtSetMachiningParam( MCH_MP.SCC, MCH_SCC.ADIR_YP)
end
-- La tasca ha sempre almeno un lato aperto, imposto opportuno attacco
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
-- imposto elevazione
local sUserNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
sUserNotes = EgtSetValInNotes( sUserNotes, 'MaxElev', EgtNumToString( dElev, 1))
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
if not ML.ApplyMachining( true, false) then
-- provo ad allargare leggermente la tasca
EgtSetMachiningParam( MCH_MP.OFFSR, -0.1)
if not ML.ApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
end
return true, '', sTuuidMstr
end
---------------------------------------------------------------------
local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN, nBigInd, nSmaInd, ptPs, tBHx, b3Raw, nDiffWidth, nUseRoughTool, dAng)
local sMchFind = 'Pocket'
-- se feature é larga come trave imposto openpocket
if nDiffWidth == 0 then
sMchFind = 'OpenPocket'
-- altrimenti se non è passante disabilito il truciolatore
else
nUseRoughTool = 0
end
-- applico la svuotatura
local bOk, sErr, sTuuidMstr = MakePocket( Proc, nPartId, ptPs, vtN, nBigInd, nDiffWidth, sMchFind, nUseRoughTool, tBHx)
if not bOk then
return bOk, sErr
end
-- se angolo tra le facce maggiore di 90, inserisco la contornatura o svuotatura del lato più corto
if dAng > -90 then
-- applico la svuotatura
local bOk, sErr = MakePocket( Proc, nPartId, ptPs, vtN, nSmaInd, nDiffWidth, sMchFind, nUseRoughTool, tBHx)
if not bOk then
return bOk, sErr
end
end
return true
end
--------------------------------------------------------------------- ---------------------------------------------------------------------
-- Applicazione della lavorazione al caso due facce -- Applicazione della lavorazione al caso due facce
local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead) local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
@@ -156,6 +262,7 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
return false, sErr return false, sErr
end end
-- dati delle facce -- dati delle facce
local tBHx = {}
local ptC = {} local ptC = {}
local vtN = {} local vtN = {}
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT) ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
@@ -183,11 +290,13 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
end end
-- recupero i dati dell'utensile -- recupero i dati dell'utensile
local dSawDiam = 400 local dSawDiam = 400
local dSawThick = 2
local dMaxDepth = 0 local dMaxDepth = 0
if EgtMdbSetCurrMachining( sCutting) then if EgtMdbSetCurrMachining( sCutting) then
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
dSawThick = EgtTdbGetCurrToolParam( MCH_TP.THICK) or dSawThick
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
end end
end end
@@ -239,47 +348,58 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
vtRef[2] = vtN[2] ^ vtTg vtRef[2] = vtN[2] ^ vtTg
if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end if vtRef[2] * vtN[1] < 0 then vtRef[2] = - vtRef[2] end
-- determino quale faccia è più grande -- determino quale faccia è più grande
local _, dB1, dH1 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0) local rfFac1, dB1, dH1 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0)
local _, dB2, dH2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 1) local rfFac2, dB2, dH2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 1)
local nBigInd = EgtIf( dB1 * dH1 >= dB2 * dH2, 1, 2) local nBigInd = EgtIf( dB1 * dH1 >= dB2 * dH2, 1, 2)
local nSmaInd = 3 - nBigInd local nSmaInd = 3 - nBigInd
-- calcolo extra taglio tBHx[1] = {dH1, dV1, rfFac1}
local dCutExtra = dExtraUp tBHx[2] = {dH2, dV2, rfFac2}
if dAng < -90.5 and dAng > -179.5 then local nUseRoughTool = EgtGetInfo( Proc.Id, 'Q02', 'i')
dCutExtra = - dSawThick / tan( 180 + dAng) + dExtraUp if nUseRoughTool == 1 and dAng < -0.1 and dAng > -90 then
end local bOk, sErr = MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, ptC, vtN, nBigInd, nSmaInd, ptPs, tBHx, b3Raw, 0, nUseRoughTool, dAng)
-- verifico se necessari tagli supplementari
local vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[nBigInd], vtN[nBigInd], false, ptC[nSmaInd], vtN[nSmaInd])
--DC.PrintOrderCut( vCuts)
if #vCuts > 0 then
-- sistemo posizione nel DB e nome
for i = 1, #vCuts do
for j = 1, #vCuts[i] do
EgtSetName( vCuts[i][j], 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
end
end
-- eseguo
for i = 1, #vCuts do
-- assegno il modo di tagliare
local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nSmaInd], vtRef[nBigInd])
-- lavoro la faccia
for j = 1, #vCuts[i] do
local dLocCutExtra = EgtIf( j == #vCuts[i], dCutExtra - dExtraUp, dCutExtra)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, nil, dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
end
end
-- altrimenti, tagli diretti delle facce
else
local bOk, sErr = Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, EgtIf( bHead, 'HeadSide', 'TailSide'))
if not bOk then if not bOk then
return bOk, sErr return bOk, sErr
end end
else
-- calcolo extra taglio
local dCutExtra = dExtraUp
if dAng < -90.5 and dAng > -179.5 then
dCutExtra = - dSawThick / tan( 180 + dAng) + dExtraUp
end
-- verifico se necessari tagli supplementari
local vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC[nBigInd], vtN[nBigInd], false, ptC[nSmaInd], vtN[nSmaInd])
--DC.PrintOrderCut( vCuts)
if #vCuts > 0 then
-- sistemo posizione nel DB e nome
for i = 1, #vCuts do
for j = 1, #vCuts[i] do
EgtSetName( vCuts[i][j], 'AddCut_' .. tostring( Proc.Id))
EgtSetInfo( vCuts[i][j], 'TASKID', Proc.TaskId)
end
end
-- eseguo
for i = 1, #vCuts do
-- assegno il modo di tagliare
local vtOrthO = EgtIf( ( i % 2) == 1, vtRef[nSmaInd], vtRef[nBigInd])
-- lavoro la faccia
for j = 1, #vCuts[i] do
local dLocCutExtra = EgtIf( j == #vCuts[i], dCutExtra - dExtraUp, dCutExtra)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, nil, dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
end
end
-- altrimenti, tagli diretti delle facce
else
local bOk, sErr = Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, EgtIf( bHead, 'HeadSide', 'TailSide'))
if not bOk then
return bOk, sErr
end
end
end end
end end
-- eventuale segnalazione ingombro di testa o coda -- eventuale segnalazione ingombro di testa o coda
if Proc.Head then if Proc.Head then
local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX() local dOffs = b3Raw:getMax():getX() - dOvmHead - Proc.Box:getMin():getX()
+8
View File
@@ -89,6 +89,14 @@ local function MyProcessInputData()
else else
vBeam[i].Box = b3Solid vBeam[i].Box = b3Solid
end end
if BD.MAX_LENGTH and BD.MAX_LENGTH > 10 and b3Solid:getDimX() > BD.MAX_LENGTH then
local sOut = 'Lunghezza (' .. EgtNumToString( b3Solid:getDimX(), 2) .. ') ' ..
'oltre i limiti della macchina (' .. EgtNumToString( BD.MAX_LENGTH, 2) .. ') '
EgtOutLog( sOut)
EgtOutBox( sOut, 'Lavora Travi', 'WARNING')
EgtDraw()
return false
end
end end
dRawW = vBeam[1].Box:getDimY() dRawW = vBeam[1].Box:getDimY()
dRawH = vBeam[1].Box:getDimZ() dRawH = vBeam[1].Box:getDimZ()
+34
View File
@@ -1,4 +1,38 @@
==== Beam Update Log ==== ==== Beam Update Log ====
Versione 3.1f1 (17/06/2026)
- Added : Tagli per dividere il cubetto in caso sia troppo lungo
- Modif : DepthChamfer su feature Mortase (050 e 051) cambio di Q. Prima era Q02, ora è Q01
Versione 3.1e2 (01/06/2026)
- Added : in Cut aggiunta Q18 per evitare di ruotare
- Modif : gli smussi di testa sono in senso orario
- Modif : in mortasa coda di rondine piccole correzioni
Versione 3.1e1 (05/05/2026)
- Modif : in LapJoint migliorate slot con sega a catena
- Fixed : in DrillPocket in doppio eliminata lavorazione aggiuntiva in caso di utensile non abbastanza lungo
Versione 3.1d2 (10/04/2026)
- Added : in StepJoint aggiunto Q02=1 per forzare fresa
- Added : in DtMortise aggiunto Q01=1 per disabilitare antischeggia
- Fixed : in LapJoint correzione a antischeggia con fresa in caso di feature spezzata
Versione 3.1d1 (08/04/2026)
- Added : le forature vengono accorciate con massima elevazione anche in presenza di tagli di testa
- Modif : nelle slot con lama verticali si lavora sempre in concordanza
- Fixed : in DtMortise correzione a lavorazione antischeggia
- Fixed : in LapJoint, se lavorazione vuota, si disattiva sempre; in Q02 si lavora sempre prima il lato sotto.
Versione 3.1c2 (18/03/2026)
- Added : in LapJoint (solo L030) aggiunto Q02 per fare solo contorno per forme a "C" e tunnel; Q17 spessore di eventuale codolo
- Modif : per LapJoint e simili il Q06 per antischeggia ora contempla il valore 3 per scegliere la strategia in automatico (lama o fresa)
- Modif : in LapJoint migliorie nella lavorazione delle tasche aperte
- Modif : in LongDoubleCut e LapJoint lunghe migliorata scelta fresa in caso di tasca che guarda verso il basso
- Fixed : in forature in doppio con svuotatura corretto ultimo step
- Fixed : in split correzione in caso di materiale di coda molto sottile e testa sotto
- Fixed : in LongDoubleCut e LapJoint lunghe eliminata passate finale dopo taglio di coda se non è presente un grezzo successivo
Versione 3.1c1 (04/03/2026) Versione 3.1c1 (04/03/2026)
- Fixed : correzione in ordinamento (fori vs tagli) - Fixed : correzione in ordinamento (fori vs tagli)
- Fixed : in drilling rimosso preforo duplicato - Fixed : in drilling rimosso preforo duplicato
+2 -2
View File
@@ -1,6 +1,6 @@
-- Version.lua by Egaltech s.r.l. 2026/02/09 -- Version.lua by Egaltech s.r.l. 2026/05/31
-- Gestione della versione di Beam -- Gestione della versione di Beam
NAME = 'Beam' NAME = 'Beam'
VERSION = '3.1c1' VERSION = '3.1f1'
MIN_EXE = '3.1b1' MIN_EXE = '3.1b1'