Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a31c026430 | |||
| 982b07ad32 | |||
| f147f77133 | |||
| 9c5b23d15d | |||
| 62b1c186f7 | |||
| 55f4effbb6 | |||
| 70b9f9fe89 | |||
| 2ff160f555 | |||
| 7ff3a8eba6 | |||
| 59934d0fdf | |||
| df99424632 | |||
| 61b1375c00 | |||
| 07c76f60c8 | |||
| 2c88c295c8 | |||
| f0bd3d2e6f | |||
| a0d3bb9114 | |||
| 8f890f35e2 | |||
| 30e2028ebf | |||
| 04454ac44f | |||
| d73dbfbffb | |||
| b7ec0031e1 | |||
| d5f2422729 | |||
| 1c25ca7667 | |||
| f54cfa7eb3 | |||
| 8cef86ffd5 | |||
| 7402062859 | |||
| 36a663199c | |||
| b628a4200d | |||
| 0d3b3d1f04 | |||
| c490d5d388 | |||
| bc401eef07 | |||
| a93326e3cd | |||
| 6b5d7525a1 | |||
| 111a733365 | |||
| 7ce6ca9f13 | |||
| 6902620f5d | |||
| 7c6b5cf12c | |||
| 9c0d2111f5 |
+2
-1
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
REM Compilazione degli script Beam Egaltech 2023.02.27
|
REM Compilazione degli script Beam Egaltech 2023.09.26
|
||||||
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
|
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
|
||||||
|
|
||||||
REM Compilazione 32 e 64 bit
|
REM Compilazione 32 e 64 bit
|
||||||
@@ -9,6 +9,7 @@ REM Compilazione 32 e 64 bit
|
|||||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\DiceCut.lua LuaLibs\DiceCut.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\DiceCut.lua LuaLibs\DiceCut.lua
|
||||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FaceByPocket.lua LuaLibs\FaceByPocket.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FaceByPocket.lua LuaLibs\FaceByPocket.lua
|
||||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FacesBySaw.lua LuaLibs\FacesBySaw.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FacesBySaw.lua LuaLibs\FacesBySaw.lua
|
||||||
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\FeatureTopology.lua LuaLibs\FeatureTopology.lua
|
||||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\MachiningLib.lua LuaLibs\MachiningLib.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\MachiningLib.lua LuaLibs\MachiningLib.lua
|
||||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessBlockHausFront.lua LuaLibs\ProcessBlockHausFront.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessBlockHausFront.lua LuaLibs\ProcessBlockHausFront.lua
|
||||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessChamfer.lua LuaLibs\ProcessChamfer.lua
|
\EgtProg\Dll32\luac54 -o bin\LuaLibs\ProcessChamfer.lua LuaLibs\ProcessChamfer.lua
|
||||||
|
|||||||
+40
-15
@@ -46,6 +46,9 @@
|
|||||||
-- 2023/02/20 Ora le mortase a coda di rondine laterali sono sempre fatte prima dei tagli longitudinali.
|
-- 2023/02/20 Ora le mortase a coda di rondine laterali sono sempre fatte prima dei tagli longitudinali.
|
||||||
-- 2023/03/31 Corretto ordinamento per fori di coda da lasciare in coda.
|
-- 2023/03/31 Corretto ordinamento per fori di coda da lasciare in coda.
|
||||||
-- 2023/07/31 Corretto errore nelle mortase in doppio.
|
-- 2023/07/31 Corretto errore nelle mortase in doppio.
|
||||||
|
-- 2023/09/13 Aggiunta ClassifyTopology per la classificazione topologica delle feature. In CollectFeatures aggiunta la raccolta preliminare di alcune informazioni.
|
||||||
|
-- 2022/09/26 Funzione IsFeatureCuttingEntireSection spostata in BeamLib
|
||||||
|
-- 2022/09/26 In ClassifyTopology aggiunto passaggio del parametro nRawId
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local BeamExec = {}
|
local BeamExec = {}
|
||||||
@@ -102,6 +105,7 @@ _G.package.loaded.ProcessFreeContour = nil
|
|||||||
_G.package.loaded.ProcessDecor = nil
|
_G.package.loaded.ProcessDecor = nil
|
||||||
local ML = require( 'MachiningLib')
|
local ML = require( 'MachiningLib')
|
||||||
local BL = require( 'BeamLib')
|
local BL = require( 'BeamLib')
|
||||||
|
local Topology = require( 'FeatureTopology')
|
||||||
local DC = require( 'DiceCut')
|
local DC = require( 'DiceCut')
|
||||||
local Fbs = require( 'FacesBySaw')
|
local Fbs = require( 'FacesBySaw')
|
||||||
local Hcut= require( 'ProcessHeadCut')
|
local Hcut= require( 'ProcessHeadCut')
|
||||||
@@ -247,12 +251,6 @@ local function IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
|
||||||
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H
|
|
||||||
local function IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH)
|
|
||||||
return ((abs(b3Proc:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or b3Proc:getDimY() > dRawW) and (abs(b3Proc:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or b3Proc:getDimZ() > dRawH))
|
|
||||||
end
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||||
local dRawW = b3Raw:getDimY()
|
local dRawW = b3Raw:getDimY()
|
||||||
@@ -280,6 +278,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
local nAddMainId = EgtGetInfo( ProcId, 'MAINID', 'i')
|
local nAddMainId = EgtGetInfo( ProcId, 'MAINID', '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.Id = ProcId
|
Proc.Id = ProcId
|
||||||
Proc.Grp = nGrp
|
Proc.Grp = nGrp
|
||||||
Proc.Prc = nPrc
|
Proc.Prc = nPrc
|
||||||
@@ -297,10 +296,19 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
Proc.MainId = Proc.Id + nAddMainId
|
Proc.MainId = Proc.Id + nAddMainId
|
||||||
end
|
end
|
||||||
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
|
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
|
||||||
|
if b3Raw then
|
||||||
|
-- recupero l'elenco delle facce della parte interessate dalla feature
|
||||||
|
Proc.AffectedFaces = BL.GetProcessAffectedFaces( Proc)
|
||||||
|
-- recupero informazioni sulle facce della feature
|
||||||
|
Proc.Face = {}
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
Proc.Face[i] = { Id = i - 1, VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT ), Elevation = BL.GetFaceElevation( Proc.Id, i - 1, PartId)}
|
||||||
|
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)
|
||||||
if Proc.Fct == 1 and IsFeatureCuttingEntireSection( Proc.Box , dRawW, dRawH) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
|
if Proc.Fct == 1 and BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH) and ( Proc.Head or Proc.Tail) and Proc.Prc ~= 340 and Proc.Prc ~= 350 then
|
||||||
if Proc.Head and Proc.Box:getCenter():getX() < dMachineBeforeIntersectingDrillingsXHead then
|
if Proc.Head and Proc.Box:getCenter():getX() < dMachineBeforeIntersectingDrillingsXHead then
|
||||||
dMachineBeforeIntersectingDrillingsXHead = Proc.Box:getCenter():getX()
|
dMachineBeforeIntersectingDrillingsXHead = Proc.Box:getCenter():getX()
|
||||||
nMachineBeforeIntersectingDrillingsIdHead = Proc.Id
|
nMachineBeforeIntersectingDrillingsIdHead = Proc.Id
|
||||||
@@ -324,6 +332,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
Proc.Tail = Drill.IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
|
Proc.Tail = Drill.IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT)
|
||||||
-- definisco dati seconda parte
|
-- definisco dati seconda parte
|
||||||
local Proc2 = {}
|
local Proc2 = {}
|
||||||
|
Proc2.PartId = PartId
|
||||||
Proc2.Id = ProcId
|
Proc2.Id = ProcId
|
||||||
Proc2.Grp = nGrp
|
Proc2.Grp = nGrp
|
||||||
Proc2.Prc = nPrc
|
Proc2.Prc = nPrc
|
||||||
@@ -343,7 +352,7 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
end
|
end
|
||||||
-- se BlockHaus HalfLap
|
-- se BlockHaus HalfLap
|
||||||
elseif Proc.Prc == 37 then
|
elseif Proc.Prc == 37 then
|
||||||
local nFacInd = BL.GetFaceWithMostAdj( Proc.Id, PartId)
|
local nFacInd = BL.GetFaceWithMostAdj( Proc, PartId)
|
||||||
if nFacInd then
|
if nFacInd then
|
||||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
if vtN then
|
if vtN then
|
||||||
@@ -387,7 +396,7 @@ local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH)
|
|||||||
end
|
end
|
||||||
if Proc.Head and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 340 then
|
if Proc.Head and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 340 then
|
||||||
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
|
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
|
||||||
bHeadFinishingNeeded = not IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
bHeadFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return bHeadFinishingNeeded, nReplacedFeatureId
|
return bHeadFinishingNeeded, nReplacedFeatureId
|
||||||
@@ -410,7 +419,7 @@ local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH)
|
|||||||
end
|
end
|
||||||
if Proc.Tail and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 350 then
|
if Proc.Tail and Proc.Id ~= nReplacedFeatureId and Proc.Prc ~= 350 then
|
||||||
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
|
-- controllo se la feature taglia l'intera sezione; in caso positivo la finitura non è necessaria
|
||||||
bTailFinishingNeeded = not IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
bTailFinishingNeeded = not BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return bTailFinishingNeeded, nReplacedFeatureId
|
return bTailFinishingNeeded, nReplacedFeatureId
|
||||||
@@ -651,11 +660,11 @@ local function PrintFeatures( vProc, b3Raw)
|
|||||||
EgtOutLog( ' RawBox=' .. tostring( b3Raw))
|
EgtOutLog( ' RawBox=' .. tostring( b3Raw))
|
||||||
for i = 1, #vProc do
|
for i = 1, #vProc do
|
||||||
local Proc = vProc[i]
|
local Proc = vProc[i]
|
||||||
local sOut = string.format( ' Id=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Down=%s Side=%s Head=%s Tail=%s Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s',
|
local sOut = string.format( ' Id=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Down=%s Side=%s Head=%s Tail=%s Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s TopoName=%s',
|
||||||
Proc.Id, Proc.Grp, Proc.Prc, Proc.TaskId, Proc.CutId,
|
Proc.Id, Proc.Grp, Proc.Prc, Proc.TaskId, Proc.CutId,
|
||||||
Proc.Flg, EgtIf( Proc.Down, 'T', 'F'), EgtIf( Proc.Side, 'T', 'F'),
|
Proc.Flg, EgtIf( Proc.Down, 'T', 'F'), EgtIf( Proc.Side, 'T', 'F'),
|
||||||
EgtIf( Proc.Head, 'T', 'F'), EgtIf( Proc.Tail, 'T', EgtIf( Proc.AdvTail, 'A', 'F')),
|
EgtIf( Proc.Head, 'T', 'F'), EgtIf( Proc.Tail, 'T', EgtIf( Proc.AdvTail, 'A', 'F')),
|
||||||
Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, tostring( Proc.Box))
|
Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, tostring( Proc.Box), Proc.TopologyLongName or '')
|
||||||
-- info speciali per Block Haus Half Lap
|
-- info speciali per Block Haus Half Lap
|
||||||
if Proc.Prc == 37 then
|
if Proc.Prc == 37 then
|
||||||
local sSpec = string.format( ' N=%s Hd=%s', tostring( Proc.vtN or V_NULL()), EgtIf( Proc.HeadDir, 'T', 'F'))
|
local sSpec = string.format( ' N=%s Hd=%s', tostring( Proc.vtN or V_NULL()), EgtIf( Proc.HeadDir, 'T', 'F'))
|
||||||
@@ -1137,6 +1146,20 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
|
|||||||
return bAllOk, bSomeDown, bSomeSide, bSplitRot
|
return bAllOk, bSomeDown, bSomeSide, bSplitRot
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
local function ClassifyTopology( vProc, nRawId)
|
||||||
|
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||||
|
local nRecognized = 0
|
||||||
|
for i = 1, #vProc do
|
||||||
|
local Proc = vProc[i]
|
||||||
|
if Topology.Classify( Proc, b3Raw) then
|
||||||
|
nRecognized = nRecognized + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return nRecognized
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT)
|
local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bNeedHCut, b3Raw, nOrd, sDownOrSideOrStd, bPreMove, vtMove, dCurrOvmT)
|
||||||
local bOk = true
|
local bOk = true
|
||||||
@@ -1521,7 +1544,7 @@ local function VerifyMortiseMirrored( Proc, vProc, b3Raw)
|
|||||||
end
|
end
|
||||||
-- recupero eventuale utensile in doppio e suo diametro
|
-- recupero eventuale utensile in doppio e suo diametro
|
||||||
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
|
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
|
||||||
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then
|
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtFindToolInCurrSetup( sToolDoubleName) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
|
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
|
||||||
@@ -1590,7 +1613,7 @@ local function VerifyDtMortiseMirrored( Proc, vProc, b3Raw)
|
|||||||
end
|
end
|
||||||
-- recupero eventuale utensile in doppio e suo diametro
|
-- recupero eventuale utensile in doppio e suo diametro
|
||||||
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
|
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
|
||||||
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then
|
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtFindToolInCurrSetup( sToolDoubleName) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
|
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
|
||||||
@@ -1671,7 +1694,7 @@ local function VerifyDrillMirrored( Proc, vProc, b3Raw)
|
|||||||
local dToolTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
local dToolTipLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) - EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||||
-- recupero eventuale utensile in doppio, suo diametro e massima lavorazione
|
-- recupero eventuale utensile in doppio, suo diametro e massima lavorazione
|
||||||
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
|
local sToolDoubleName = EgtTdbGetCurrToolValInNotes( MCH_TP.USERNOTES, 'DOUBLE', 's')
|
||||||
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then
|
if not sToolDoubleName or not EgtTdbSetCurrTool( sToolDoubleName) or not EgtFindToolInCurrSetup( sToolDoubleName) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
|
local dToolDoubleDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM, 'd')
|
||||||
@@ -1816,6 +1839,8 @@ function BeamExec.ProcessFeatures()
|
|||||||
if BD.TWO_EQUAL_HEADS or BD.DOWN_HEAD then
|
if BD.TWO_EQUAL_HEADS or BD.DOWN_HEAD then
|
||||||
SetMirroredFeatures( vProc, b3Raw)
|
SetMirroredFeatures( vProc, b3Raw)
|
||||||
end
|
end
|
||||||
|
-- classifico topologicamente le feature
|
||||||
|
ClassifyTopology( vProc, nRawId)
|
||||||
-- le ordino lungo X
|
-- le ordino lungo X
|
||||||
OrderFeatures( vProc, b3Raw)
|
OrderFeatures( vProc, b3Raw)
|
||||||
-- le classifico
|
-- le classifico
|
||||||
|
|||||||
+122
-33
@@ -22,6 +22,10 @@
|
|||||||
-- 2023/01/31 Aggiunta funzione ConvertToClosedCurve, precedentemente parte di ProcessMortise.Make
|
-- 2023/01/31 Aggiunta funzione ConvertToClosedCurve, precedentemente parte di ProcessMortise.Make
|
||||||
-- 2023/02/22 Modifiche a SetOpenSide, aggiunte ChangeOrOpenStart e CurveWithOnlyStraightLines.
|
-- 2023/02/22 Modifiche a SetOpenSide, aggiunte ChangeOrOpenStart e CurveWithOnlyStraightLines.
|
||||||
-- 2023/06/12 In ChangeOrOpenStart corretta ricerca segmento più lungo.
|
-- 2023/06/12 In ChangeOrOpenStart corretta ricerca segmento più lungo.
|
||||||
|
-- 2023/09/13 Aggiunte funzioni Is3EdgesApprox e GetProcessAffectedFaces.
|
||||||
|
-- 2023/09/25 In GetFaceWithMostAdj aggiunta verifica sottosquadro anche per facce non adiacenti.
|
||||||
|
-- 2023/09/26 In GetFaceWithMostAdj gestito primo parametro anche come Proc; gestito caso strip con facce tutte in sottosquadro.
|
||||||
|
-- 2023/09/26 Spostata qui funzione IsFeatureCuttingEntireSection da BeamExec.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local BeamLib = {}
|
local BeamLib = {}
|
||||||
@@ -509,7 +513,8 @@ function BeamLib.GetFaceElevationFromPointDir( nSurfId, nPartId, ptC, vtN, nIdGe
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
function BeamLib.GetFaceWithMostAdj( Proc, nPartId, bCompare3Fc, dCosSideAng)
|
||||||
|
local nSurfId = Proc.Id
|
||||||
-- verifica che la superficie non sia chiusa e quindi non lavorabile
|
-- verifica che la superficie non sia chiusa e quindi non lavorabile
|
||||||
if EgtSurfIsClosed( nSurfId) then
|
if EgtSurfIsClosed( nSurfId) then
|
||||||
return
|
return
|
||||||
@@ -521,14 +526,17 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
|||||||
end
|
end
|
||||||
-- recupero le normali delle facce
|
-- recupero le normali delle facce
|
||||||
local vvtN = {}
|
local vvtN = {}
|
||||||
|
local vPtC = {}
|
||||||
for i = 1, nFacCnt do
|
for i = 1, nFacCnt do
|
||||||
local vtN = EgtSurfTmFacetNormVersor( nSurfId, i - 1, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, i - 1, GDB_ID.ROOT)
|
||||||
vvtN[i] = vtN ;
|
vvtN[i] = vtN ;
|
||||||
|
vPtC[i] = ptC
|
||||||
end
|
end
|
||||||
-- adiacenze e sottosquadra delle facce
|
-- adiacenze e sottosquadra delle facce
|
||||||
local vAdj = {}
|
local vAdj = {}
|
||||||
local vUcut = {}
|
local vUcut = {}
|
||||||
local vOrtho = {}
|
local vOrtho = {}
|
||||||
|
local nFacesWithUnderCut = 0
|
||||||
for i = 1, nFacCnt do
|
for i = 1, nFacCnt do
|
||||||
-- recupero le adiacenze del loop esterno
|
-- recupero le adiacenze del loop esterno
|
||||||
local vFacAdj = EgtSurfTmFacetAdjacencies( nSurfId, i - 1)[1]
|
local vFacAdj = EgtSurfTmFacetAdjacencies( nSurfId, i - 1)[1]
|
||||||
@@ -540,7 +548,7 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
vAdj[i] = nCount
|
vAdj[i] = nCount
|
||||||
-- ne determino eventuale sottosquadra ( dal valore passato o - 3deg) e ortogonalità
|
-- ne determino eventuale sottosquadro ( dal valore passato o - 3deg) e ortogonalità, per facce adiacenti
|
||||||
local bUcut = false
|
local bUcut = false
|
||||||
local bOrtho = true
|
local bOrtho = true
|
||||||
for j = 1, #vFacAdj do
|
for j = 1, #vFacAdj do
|
||||||
@@ -556,39 +564,58 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- determino evenutale sottosquadro per facce non adiacenti
|
||||||
|
for j = 1, nFacCnt do
|
||||||
|
local bIsFaceAdjacent = false
|
||||||
|
for k = 1, #vFacAdj do
|
||||||
|
if j - 1 == vFacAdj[k] then
|
||||||
|
bIsFaceAdjacent = true
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not ( bIsFaceAdjacent or ( j == i)) then
|
||||||
|
-- recupero gruppo per geometria addizionale
|
||||||
|
local nAddGrpId = BeamLib.GetAddGroup( nPartId)
|
||||||
|
if not nAddGrpId then
|
||||||
|
EgtOutLog( 'Error : missing AddGroup')
|
||||||
|
return 0, 0, 0
|
||||||
|
end
|
||||||
|
-- verifico eventuale intersezione tra la faccia i-1 esima e la proiezione dell'altra sulla stessa
|
||||||
|
local nShadowFacetId = EgtCopySurfTmFacet( nSurfId, j - 1, nAddGrpId)
|
||||||
|
local nMasterContourId = EgtExtractSurfTmFacetLoops( nSurfId, i - 1, nAddGrpId)
|
||||||
|
local nShadowContourId = EgtExtractSurfTmLoops( nShadowFacetId, nAddGrpId)
|
||||||
|
EgtCutSurfTmPlane( nShadowFacetId, vPtC[i], -vvtN[i], false, GDB_RT.GLOB)
|
||||||
|
if nMasterContourId and nShadowContourId then
|
||||||
|
local nMasterSurfFlatId = EgtSurfFlatRegion( nAddGrpId, nMasterContourId)
|
||||||
|
local frOCSMaster = Frame3d( vPtC[i], vvtN[i])
|
||||||
|
EgtScale( nShadowContourId, frOCSMaster, 1, 1, 0, GDB_RT.GLOB)
|
||||||
|
EgtModifyCurveExtrusion( nShadowContourId, vvtN[i], GDB_RT.GLOB)
|
||||||
|
local dResV = vvtN[i] * vvtN[j]
|
||||||
|
EgtOffsetCurve( nShadowContourId, EgtIf( dResV > GEO.EPS_SMALL, - 50, 50) * GEO.EPS_SMALL)
|
||||||
|
local nShadowSurfFlatId = EgtSurfFlatRegion( nAddGrpId, nShadowContourId)
|
||||||
|
local bShadowSurfIsExternal = EgtSurfFrTestExternal( nMasterSurfFlatId, nShadowSurfFlatId)
|
||||||
|
if not bShadowSurfIsExternal then
|
||||||
|
bUcut = true
|
||||||
|
end
|
||||||
|
EgtErase( { nMasterSurfFlatId, nShadowSurfFlatId})
|
||||||
|
end
|
||||||
|
EgtErase( { nMasterContourId, nShadowContourId, nShadowFacetId})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if bUcut then
|
||||||
|
nFacesWithUnderCut = nFacesWithUnderCut + 1
|
||||||
|
end
|
||||||
vUcut[i] = bUcut
|
vUcut[i] = bUcut
|
||||||
vOrtho[i] = bOrtho
|
vOrtho[i] = bOrtho
|
||||||
end
|
end
|
||||||
-- se 4 facce tutte con adiacenza 2, allora è un tunnel
|
local bEveryFaceHasUndercut = ( nFacesWithUnderCut == nFacCnt)
|
||||||
if nFacCnt == 4 then
|
-- tunnel o assimilabile
|
||||||
if vAdj[1] == 2 and vAdj[2] == 2 and vAdj[3] == 2 and vAdj[4] == 2 then
|
if Proc.Topology == 'Tunnel' or ( bCompare3Fc and Proc.Topology == 'Groove' and Proc.IsThrough) or ( Proc.Topology == 'Strip' and bEveryFaceHasUndercut) then
|
||||||
-- se tutte le facce sono ortogonali tra loro esco con un flag che ne indica questa propietà
|
if Proc.IsParallel or Proc.AllRightAngles then
|
||||||
if vOrtho[1] == true and vOrtho[2] == true and vOrtho[3] == true and vOrtho[4] == true then
|
return -1, GEO.INFINITO, true
|
||||||
return -1, GEO.INFINITO, true
|
else
|
||||||
else
|
-- non gestito nella LapJoint
|
||||||
return -1, GEO.INFINITO
|
return -1, GEO.INFINITO
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se 3 facce con una che ha 2 adiacenze e le altre hanno 1 adiacenza, allora è una semi-fessura
|
|
||||||
if bCompare3Fc and nFacCnt == 3 then
|
|
||||||
local nCount2Adc = 0
|
|
||||||
local nCount1Adc = 0
|
|
||||||
-- ottengo il numero di facce con due adiacenze e il numero di facce con una adiacenza
|
|
||||||
for i = 1, #vAdj do
|
|
||||||
if vAdj[i] == 2 then
|
|
||||||
nCount2Adc = nCount2Adc + 1
|
|
||||||
elseif vAdj[i] == 1 then
|
|
||||||
nCount1Adc = nCount1Adc + 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se il numero di adiacenze corrisponde
|
|
||||||
if nCount2Adc == 1 and nCount1Adc == 2 then
|
|
||||||
if vOrtho[1] == true and vOrtho[2] == true and vOrtho[3] == true then
|
|
||||||
return -1, GEO.INFINITO, true
|
|
||||||
else
|
|
||||||
return -1, GEO.INFINITO
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- recupero le facce non in sottosquadra e con il maggior numero di adiacenze
|
-- recupero le facce non in sottosquadra e con il maggior numero di adiacenze
|
||||||
@@ -1058,5 +1085,67 @@ function BeamLib.CurveWithOnlyStraightLines( nPathInt)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- Funzione per determinare se la faccia ha lati molto corti (trascurabili) ed è quindi approssimabile ad una 3 facce
|
||||||
|
function BeamLib.Is3EdgesApprox( Proc, nFacet, nAddGrpId)
|
||||||
|
nAddGrpId = nAddGrpId or BeamLib.GetAddGroup( Proc.PartId)
|
||||||
|
local bResult = false
|
||||||
|
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.Id, nFacet, nAddGrpId)
|
||||||
|
if not nContourId then return false end
|
||||||
|
EgtMergeCurvesInCurveCompo( nContourId)
|
||||||
|
-- recupero il numero effettivo di lati
|
||||||
|
local _, nEntityCount = EgtCurveDomain( nContourId)
|
||||||
|
local nEdges = nEntityCount
|
||||||
|
if nEntityCount and nEntityCount == 3 then
|
||||||
|
bResult = true
|
||||||
|
-- rimuovo i lati molto corti dal conteggio totale
|
||||||
|
elseif nEntityCount then
|
||||||
|
for i = 1, nEntityCount do
|
||||||
|
local dLength = EgtCurveCompoLength( nContourId, i - 1)
|
||||||
|
if dLength < 15 then nEdges = nEdges - 1 end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if nEdges == 3 then bResult = true end
|
||||||
|
-- cancello tutti i contorni appena creati
|
||||||
|
EgtErase( EgtTableFill( nContourId, nContourCnt))
|
||||||
|
return bResult
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
-- restituisce le facce della parte interessate dalla feature Proc
|
||||||
|
function BeamLib.GetProcessAffectedFaces( Proc)
|
||||||
|
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.PartId or GDB_ID.NULL, 'Box')
|
||||||
|
local b3Part = EgtGetBBoxGlob( nBoxSolidId, GDB_BB.STANDARD)
|
||||||
|
local vtFacesAffected = { Top = false, Bottom = false, Front = false, Back = false, Left = false, Right = false}
|
||||||
|
if Proc.Box and not Proc.Box:isEmpty() then
|
||||||
|
if Proc.Box:getMax():getZ() > b3Part:getMax():getZ() - 500 * GEO.EPS_SMALL then
|
||||||
|
vtFacesAffected.Top = true
|
||||||
|
end
|
||||||
|
if Proc.Box:getMin():getZ() < b3Part:getMin():getZ() + 500 * GEO.EPS_SMALL then
|
||||||
|
vtFacesAffected.Bottom = true
|
||||||
|
end
|
||||||
|
if Proc.Box:getMin():getY() < b3Part:getMin():getY() + 500 * GEO.EPS_SMALL then
|
||||||
|
vtFacesAffected.Front = true
|
||||||
|
end
|
||||||
|
if Proc.Box:getMax():getY() > b3Part:getMax():getY() - 500 * GEO.EPS_SMALL then
|
||||||
|
vtFacesAffected.Back = true
|
||||||
|
end
|
||||||
|
if Proc.Box:getMin():getX() < b3Part:getMin():getX() + 500 * GEO.EPS_SMALL then
|
||||||
|
vtFacesAffected.Left = true
|
||||||
|
end
|
||||||
|
if Proc.Box:getMax():getX() > b3Part:getMax():getX() - 500 * GEO.EPS_SMALL then
|
||||||
|
vtFacesAffected.Right = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return vtFacesAffected
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
-- restituisce vero se la feature con box b3Proc taglia l'intera sezione della barra, rappresentata dalle sue dimensioni W e H
|
||||||
|
function BeamLib.IsFeatureCuttingEntireSection( b3Proc, dRawW, dRawH)
|
||||||
|
return ((abs(b3Proc:getDimY() - dRawW) < 10 * GEO.EPS_SMALL or b3Proc:getDimY() > dRawW) and (abs(b3Proc:getDimZ() - dRawH) < 10 * GEO.EPS_SMALL or b3Proc:getDimZ() > dRawH))
|
||||||
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
return BeamLib
|
return BeamLib
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- FacesBySaw.lua by Egaltech s.r.l. 2023/06/14
|
-- FacesBySaw.lua by Egaltech s.r.l. 2023/09/26
|
||||||
-- Gestione taglio con lama di feature con una o due facce
|
-- Gestione taglio con lama di feature con una o due facce
|
||||||
-- 2021/01/06 Cambiato limite per attacco Tg con lama e CalcLeadInOutGeom rinominata in CalcLeadInOutPerpGeom.
|
-- 2021/01/06 Cambiato limite per attacco Tg con lama e CalcLeadInOutGeom rinominata in CalcLeadInOutPerpGeom.
|
||||||
-- 2021/02/03 In taglio lama si accettano anche due lati con deviazione minore di 20deg.
|
-- 2021/02/03 In taglio lama si accettano anche due lati con deviazione minore di 20deg.
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
-- 2023/04/20 Alcune modifiche per gestire tagli con faceuse parallelo.
|
-- 2023/04/20 Alcune modifiche per gestire tagli con faceuse parallelo.
|
||||||
-- 2023/05/18 Imposto in ogni caso dVzLimDwnUp prima anche di bDownHead.
|
-- 2023/05/18 Imposto in ogni caso dVzLimDwnUp prima anche di bDownHead.
|
||||||
-- 2023/06/14 Aggiunta MakeParallelOne e tolti parametri nForceWorkSide, nForceSCC da MakeOne.
|
-- 2023/06/14 Aggiunta MakeParallelOne e tolti parametri nForceWorkSide, nForceSCC da MakeOne.
|
||||||
|
-- 2023/09/26 Piccola modifica per Turn su bInvert di MakeOne.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local FacesBySaw = {}
|
local FacesBySaw = {}
|
||||||
@@ -183,7 +184,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
local bInvert = bForceInvert
|
local bInvert = bForceInvert
|
||||||
-- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento
|
-- se la lama ruota in senso antiorario inverto la direzione di lavorazione, per avere rotazione lama opposta a avanzamento
|
||||||
if bInvert == nil then
|
if bInvert == nil then
|
||||||
if not BD.TURN then
|
if not BD.TURN or abs( ptP2:getY() - ptP1:getY()) < 250 then
|
||||||
if bIsSawCCW ~= bDownUp then
|
if bIsSawCCW ~= bDownUp then
|
||||||
bInvert = ( ptP2:getZ() < ptP1:getZ() + 100 * GEO.EPS_SMALL)
|
bInvert = ( ptP2:getZ() < ptP1:getZ() + 100 * GEO.EPS_SMALL)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -0,0 +1,250 @@
|
|||||||
|
-- FeatureTopology.lua by Egaltech s.r.l. 2023/09/12
|
||||||
|
-- Libreria per classificazione topologica feature travi
|
||||||
|
-- 2023/09/26 Aggiunte topologie Strip e Cut.
|
||||||
|
-- 2023/09/27 Modificata GetFacesParallelToPart per tunnel, pocket e groove 3 lati
|
||||||
|
-- 2023/10/16 In GetFacesParallelToPart rimossa Pocket e aggiunto Rabbet al check solo direzione principale
|
||||||
|
|
||||||
|
-- Tabella per definizione modulo
|
||||||
|
local FeatureTopology = {}
|
||||||
|
|
||||||
|
-- Include
|
||||||
|
require( 'EgtBase')
|
||||||
|
|
||||||
|
-- Carico le librerie
|
||||||
|
local BL = require( 'BeamLib')
|
||||||
|
|
||||||
|
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 = {}
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
vAdj[i] = {}
|
||||||
|
for j = 1, Proc.Fct do
|
||||||
|
if i == j then
|
||||||
|
vAdj[i][j] = 0
|
||||||
|
else
|
||||||
|
_, _, _, 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
|
||||||
|
j = j + 1
|
||||||
|
end
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
return vAdj
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- restituisce gli id delle facce di Proc che hanno il numero di adiacenze nAdj
|
||||||
|
function FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, nAdj)
|
||||||
|
local vAdj = GetAdjacencyMatrix( Proc)
|
||||||
|
local vFacesWithGivenAdj = {}
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
local nAdjCount = 0
|
||||||
|
for j = 1, Proc.Fct do
|
||||||
|
if vAdj[i][j] and vAdj[i][j] ~= 0 then
|
||||||
|
nAdjCount = nAdjCount + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if nAdjCount == nAdj then
|
||||||
|
table.insert( vFacesWithGivenAdj, i - 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return vFacesWithGivenAdj
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- restituisce true se Proc ha tutti gli angoli concavi (bAllConcave) e, nei casi in cui ha senso, se questi sono esattamente 90 deg (bAllRight)
|
||||||
|
local function AreAllAnglesConcaveOrRight( Proc)
|
||||||
|
local vAdj = GetAdjacencyMatrix( Proc)
|
||||||
|
local bAllConcave, bAllRight = true, true
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
for j = 1, Proc.Fct do
|
||||||
|
-- se trovo un angolo convesso restituisco falso e esco subito
|
||||||
|
if vAdj[i][j] and vAdj[i][j] > 0 then
|
||||||
|
bAllConcave = false
|
||||||
|
bAllRight = false
|
||||||
|
break
|
||||||
|
elseif vAdj[i][j] and vAdj[i][j] ~= 0 and vAdj[i][j] + 90 > 500 * GEO.EPS_ANG_SMALL then
|
||||||
|
bAllRight = false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- se 1 faccia oppure 2 facce con angolo convesso non ha senso ritornare valori per bAllRight
|
||||||
|
if Proc.Fct < 2 or ( Proc.Fct == 2 and vAdj[1][2] > 0) then
|
||||||
|
return bAllConcave
|
||||||
|
else
|
||||||
|
return bAllConcave, bAllRight
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- restituisce true se almeno una delle dimensioni della feature è maggiore o uguale ad una delle dimensioni principali del pezzo (tolleranza 1 mm)
|
||||||
|
local function IsAnyDimensionLongAsPart( Proc)
|
||||||
|
local bResult = false
|
||||||
|
local nBoxSolidId = EgtGetFirstNameInGroup( Proc.PartId or GDB_ID.NULL, 'Box')
|
||||||
|
local b3Solid = EgtGetBBoxGlob( nBoxSolidId, GDB_BB.STANDARD)
|
||||||
|
if Proc.Box:getDimX() > b3Solid:getDimX() - 1000 * GEO.EPS_SMALL or
|
||||||
|
Proc.Box:getDimY() > b3Solid:getDimY() - 1000 * GEO.EPS_SMALL or
|
||||||
|
Proc.Box:getDimZ() > b3Solid:getDimZ() - 1000 * GEO.EPS_SMALL then
|
||||||
|
bResult = true
|
||||||
|
end
|
||||||
|
return bResult
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- retituisce un vettore con gli indici (0 based) delle facce triangolari (o quasi) di Proc
|
||||||
|
local function GetTriangularFaces( Proc)
|
||||||
|
local vTriangularFaces = {}
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
if BL.Is3EdgesApprox( Proc, i - 1) then
|
||||||
|
table.insert( vTriangularFaces, i - 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return vTriangularFaces
|
||||||
|
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
|
||||||
|
local function GetFacesParallelToPart( Proc, sFamily, bIsThrough)
|
||||||
|
local vFacesParallelToPart = {}
|
||||||
|
for i = 0, Proc.Fct - 1 do
|
||||||
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i, GDB_ID.ROOT)
|
||||||
|
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 bIsTriangularFace = false
|
||||||
|
-- verifico se la faccia è triangolare
|
||||||
|
for j = 1, #vTriangularFaces do
|
||||||
|
if i == vTriangularFaces[j] then
|
||||||
|
bIsTriangularFace = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- se faccia triangolare deve avere la normale parallela ad una direzione principale
|
||||||
|
if bIsTriangularFace then
|
||||||
|
if AreSameOrOppositeVectorApprox( vtN, X_AX()) or AreSameOrOppositeVectorApprox( vtN, Y_AX()) or AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||||
|
table.insert( vFacesParallelToPart, i)
|
||||||
|
end
|
||||||
|
-- altrimenti deve avere una componente della normale nulla
|
||||||
|
else
|
||||||
|
if abs( vtN:getX()) < 10 * GEO.EPS_SMALL or abs( vtN:getY()) < 10 * GEO.EPS_SMALL or abs( vtN:getZ()) < 10 * GEO.EPS_SMALL then
|
||||||
|
table.insert( vFacesParallelToPart, i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
-- la normale deve essere parallela ad una direzione principale
|
||||||
|
if AreSameOrOppositeVectorApprox( vtN, X_AX()) or AreSameOrOppositeVectorApprox( vtN, Y_AX()) or AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||||
|
table.insert( vFacesParallelToPart, i)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return vFacesParallelToPart
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- restituisce una stringa con il nome esteso della topologia della feature
|
||||||
|
-- *famiglia-passante-angoli tutti concavi a 90deg-facce tutte parallele alle dimensioni principali-numero di facce*
|
||||||
|
local function GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, nNumberOfFaces)
|
||||||
|
-- feature passante o cieca
|
||||||
|
local sThrough = '_'
|
||||||
|
if bIsThrough ~= nil then sThrough = EgtIf( bIsThrough, 'Through', 'Blind') end
|
||||||
|
-- tutti gli angoli della feature sono retti oppure no
|
||||||
|
local sAllRightAngles = '_'
|
||||||
|
if bAllRightAngles ~= nil then sAllRightAngles = EgtIf( bAllRightAngles, 'RightAngles', 'NotRightAngles') end
|
||||||
|
-- tutte le dimensioni della feature sono parallele agli assi principali del pezzo oppure no
|
||||||
|
local sParallel = '_'
|
||||||
|
if bIsParallel ~= nil then sParallel = EgtIf( bIsParallel, 'Parallel', 'NotParallel') end
|
||||||
|
|
||||||
|
local sLongName = sFamily .. '-' .. sThrough .. '-' .. sAllRightAngles .. '-' .. sParallel .. '-' .. nNumberOfFaces
|
||||||
|
return sLongName
|
||||||
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
-- riconosce se Proc è una delle topologie standard e, in caso positivo, ne scrive le caratteristiche in campi specifici della Proc stessa restituendo true
|
||||||
|
function FeatureTopology.Classify( Proc, b3Raw)
|
||||||
|
|
||||||
|
if not Proc.Box or Proc.Box:isEmpty() then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local bRecognized = false
|
||||||
|
local sFamily
|
||||||
|
local bIsThrough
|
||||||
|
local bAllRightAngles
|
||||||
|
local bIsParallel
|
||||||
|
local sLongName = ''
|
||||||
|
|
||||||
|
-- SE NON HA TUTTE LE FACCE PIANE RITORNARE NIL!!
|
||||||
|
|
||||||
|
local bAllAnglesConcave
|
||||||
|
bAllAnglesConcave, bAllRightAngles = AreAllAnglesConcaveOrRight( Proc)
|
||||||
|
local vTriangularFaces = GetTriangularFaces( Proc)
|
||||||
|
local bIsAnyDimensionLongAsPart = IsAnyDimensionLongAsPart( Proc)
|
||||||
|
local vFacesWithOneAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 1)
|
||||||
|
local vFacesWithTwoAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 2)
|
||||||
|
local vFacesWithThreeAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 3)
|
||||||
|
local vFacesWithFourAdj = FeatureTopology.GetFacesWithGivenAdjacencyNumber( Proc, 4)
|
||||||
|
local dRawW, dRawH = b3Raw:getDimY(), b3Raw:getDimZ()
|
||||||
|
local bIsFeatureCuttingEntireSection = BL.IsFeatureCuttingEntireSection( Proc.Box, dRawW, dRawH)
|
||||||
|
|
||||||
|
if Proc.IsOutline then
|
||||||
|
sFamily = 'OUTLINE'
|
||||||
|
elseif Proc.Prc == 40 then
|
||||||
|
sFamily = 'DRILLING'
|
||||||
|
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart and bIsFeatureCuttingEntireSection then
|
||||||
|
sFamily = 'Cut'
|
||||||
|
elseif Proc.Fct == 1 and bIsAnyDimensionLongAsPart then
|
||||||
|
sFamily = 'Bevel'
|
||||||
|
bIsThrough = true
|
||||||
|
elseif Proc.Fct == 2 and bAllAnglesConcave and #vTriangularFaces == 1 then
|
||||||
|
sFamily = 'Bevel'
|
||||||
|
bIsThrough = false
|
||||||
|
elseif Proc.Fct == 2 and bAllAnglesConcave then
|
||||||
|
sFamily = 'Rabbet'
|
||||||
|
bIsThrough = true
|
||||||
|
elseif Proc.Fct == 2 and not bAllAnglesConcave and bIsAnyDimensionLongAsPart then
|
||||||
|
sFamily = 'DoubleBevel'
|
||||||
|
bIsThrough = true
|
||||||
|
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 1 and #vTriangularFaces == 2 then
|
||||||
|
sFamily = 'Bevel'
|
||||||
|
bIsThrough = false
|
||||||
|
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 1 and bIsAnyDimensionLongAsPart then
|
||||||
|
sFamily = 'Groove'
|
||||||
|
bIsThrough = true
|
||||||
|
elseif Proc.Fct == 3 and bAllAnglesConcave and #vFacesWithTwoAdj == 3 then
|
||||||
|
sFamily = 'Groove'
|
||||||
|
bIsThrough = false
|
||||||
|
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesWithThreeAdj == 2 then
|
||||||
|
sFamily = 'Groove'
|
||||||
|
bIsThrough = false
|
||||||
|
elseif Proc.Fct == 4 and bAllAnglesConcave and #vFacesWithTwoAdj == 4 and bIsAnyDimensionLongAsPart then
|
||||||
|
sFamily = 'Tunnel'
|
||||||
|
bIsThrough = true
|
||||||
|
elseif Proc.Fct >= 4 and #vFacesWithOneAdj == 2 and bIsAnyDimensionLongAsPart then
|
||||||
|
sFamily = 'Strip'
|
||||||
|
bIsThrough = true
|
||||||
|
elseif Proc.Fct == 5 and bAllAnglesConcave and #vFacesWithFourAdj == 1 then
|
||||||
|
sFamily = 'Pocket'
|
||||||
|
bIsThrough = false
|
||||||
|
end
|
||||||
|
local vFacesParallelToPart = GetFacesParallelToPart( Proc, sFamily, bIsThrough)
|
||||||
|
bIsParallel = ( #vFacesParallelToPart == Proc.Fct)
|
||||||
|
|
||||||
|
if sFamily == 'OUTLINE' or sFamily == 'DRILLING' then
|
||||||
|
Proc.Topology = sFamily
|
||||||
|
Proc.TopologyLongName = sFamily
|
||||||
|
bRecognized = true
|
||||||
|
elseif sFamily then
|
||||||
|
sLongName = GetTopologyLongName( sFamily, bIsThrough, bAllRightAngles, bIsParallel, Proc.Fct)
|
||||||
|
Proc.Topology, Proc.IsThrough, Proc.AllRightAngles, Proc.IsParallel, Proc.TopologyLongName = sFamily, bIsThrough, bAllRightAngles, bIsParallel, sLongName
|
||||||
|
bRecognized = true
|
||||||
|
else
|
||||||
|
Proc.Topology = 'OTHER'
|
||||||
|
Proc.TopologyLongName = 'OTHER'
|
||||||
|
end
|
||||||
|
|
||||||
|
return bRecognized
|
||||||
|
end
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
return FeatureTopology
|
||||||
@@ -108,7 +108,7 @@ local function SetCurrMachiningAndTool( sMachName)
|
|||||||
local sTool = EgtTdbGetToolFromUUID( sTuuid)
|
local sTool = EgtTdbGetToolFromUUID( sTuuid)
|
||||||
if not sTool then return false end
|
if not sTool then return false end
|
||||||
if not EgtTdbSetCurrTool( sTool) then return false end
|
if not EgtTdbSetCurrTool( sTool) then return false end
|
||||||
local bActive = EgtTdbGetCurrToolParam( MCH_TP.ACTIVE)
|
local bActive = EgtFindToolInCurrSetup( sTool)
|
||||||
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
|
||||||
local nHead = tonumber( sHead:sub( 2, #sHead))
|
local nHead = tonumber( sHead:sub( 2, #sHead))
|
||||||
local bH2 = ( nHead >= 21 and nHead <= 29)
|
local bH2 = ( nHead >= 21 and nHead <= 29)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
-- ProcessDovetail.lua by Egaltech s.r.l. 2021/02/04
|
-- ProcessDovetail.lua by Egaltech s.r.l. 2021/02/04
|
||||||
-- Gestione calcolo giunzione coda di rondine
|
-- Gestione calcolo giunzione coda di rondine
|
||||||
-- 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)
|
||||||
|
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessDovetail = {}
|
local ProcessDovetail = {}
|
||||||
@@ -280,7 +281,7 @@ function ProcessDovetail.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
-- deve avere la normale principale diretta verso la testa
|
-- deve avere la normale principale diretta verso la testa
|
||||||
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
|
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
|
||||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
if vtN:getZ() < BD.NZ_MINA and nFacInd2 then
|
if vtN:getZ() < BD.NZ_MINA and nFacInd2 then
|
||||||
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||||
@@ -341,7 +342,7 @@ function ProcessDovetail.IsTailFeature( Proc, b3Raw)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- deve avere la normale principale diretta verso la coda
|
-- deve avere la normale principale diretta verso la coda
|
||||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
if vtN:getZ() < BD.NZ_MINA and nFacInd2 then
|
if vtN:getZ() < BD.NZ_MINA and nFacInd2 then
|
||||||
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||||
@@ -933,10 +934,10 @@ local function MachSideFaces( Proc, nPartId, b3Raw, nFacetCnt, bForceUseRough,
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, sin(dSideAngle))
|
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, sin(dSideAngle))
|
||||||
if not nFacInd or nFacInd < 0 then
|
if not nFacInd or nFacInd < 0 then
|
||||||
-- provo eliminando i sottosquadra
|
-- provo eliminando i sottosquadra
|
||||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, -2)
|
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, -2)
|
||||||
if not nFacInd or nFacInd < 0 then
|
if not nFacInd or nFacInd < 0 then
|
||||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MachSideFaces could not find reference face'
|
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MachSideFaces could not find reference face'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessDrill.lua by Egaltech s.r.l. 2023/05/11
|
-- ProcessDrill.lua by Egaltech s.r.l. 2023/09/26
|
||||||
-- Gestione calcolo forature per Travi
|
-- Gestione calcolo forature per Travi
|
||||||
-- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile.
|
-- 2021/04/14 DS Corretta gestione Invert con testa da sotto. Migliorato calcolo ingombro portautensile.
|
||||||
-- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto.
|
-- 2021/05/03 DS Su macchina con testa da sotto aggiunta possibilità di fare fori verticali metà sopra e l'altra sotto.
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
-- 2022/12/28 Implementata gestione forature in doppio
|
-- 2022/12/28 Implementata gestione forature in doppio
|
||||||
-- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax.
|
-- 2023/05/11 Se lavorazione in doppio e precedente no oppure di tipo diverso, forzo risalita a Zmax.
|
||||||
-- 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.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessDrill = {}
|
local ProcessDrill = {}
|
||||||
@@ -166,7 +167,7 @@ function ProcessDrill.Classify( Proc, b3Raw)
|
|||||||
return false, false, false
|
return false, false, false
|
||||||
end
|
end
|
||||||
local bOpen = ( Proc.Fce ~= 0)
|
local bOpen = ( Proc.Fce ~= 0)
|
||||||
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and ( Proc.Flg == 2 or Proc.Flg == -2))))
|
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + 2 and (( not Proc.Head and not Proc.Tail) or (( BD.ROT90 or BD.DOWN_HEAD or BD.TURN) and abs( Proc.Flg) == 2)))
|
||||||
-- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco
|
-- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco
|
||||||
if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then
|
if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then
|
||||||
if not bOpen then
|
if not bOpen then
|
||||||
@@ -516,7 +517,7 @@ function ProcessDrill.Make( Proc, nPhase, nRawId, nPartId)
|
|||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
local bOk = ML.ApplyMachining( true, false)
|
local bOk = ML.ApplyMachining( true, false)
|
||||||
if not bOk and bDownDrill then
|
if not bOk and bDownDrill and bOpen and abs( Proc.Flg) == 1 then
|
||||||
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
|
if sType == 'Drill' or sType == 'Drill_H2' or sType == 'AngleDrill' then
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta
|
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta
|
||||||
-- 2023/04/20 Per travi alte aggiunti tagli orizzontali per ridurre le dimensioni degli scarti
|
-- 2023/04/20 Per travi alte aggiunti tagli orizzontali per ridurre le dimensioni degli scarti
|
||||||
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo
|
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo
|
||||||
|
-- 2023/10/17 Corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessHeadCut = {}
|
local ProcessHeadCut = {}
|
||||||
@@ -267,10 +268,20 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
|
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
|
||||||
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
|
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
|
||||||
local dKL = dSawRad - dMaxDepth + EgtIf( bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
|
local dKL = dSawRad - dMaxDepth + EgtIf( bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
|
||||||
|
-- lunghezza minima del percorso di lavorazione, in caso accorciamento porti a lunghezza negativa
|
||||||
|
local dMinSawingLength = 5
|
||||||
if BD.C_SIMM then
|
if BD.C_SIMM then
|
||||||
dAccEnd = sqrt( dSawRad * dSawRad - dKL * dKL)
|
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
||||||
|
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo entrata
|
||||||
|
if dAccEnd > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
|
||||||
|
dAccStart = b3Raw:getDimZ() - dAccEnd - dMinSawingLength
|
||||||
|
end
|
||||||
else
|
else
|
||||||
dAccStart = sqrt( dSawRad * dSawRad - dKL * dKL)
|
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
||||||
|
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo uscita
|
||||||
|
if dAccStart > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
|
||||||
|
dAccEnd = b3Raw:getDimZ() - dAccStart - dMinSawingLength
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+135
-120
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2023/08/10
|
-- ProcessLapJoint.lua by Egaltech s.r.l. 2023/09/26
|
||||||
-- Gestione calcolo mezzo-legno per Travi
|
-- Gestione calcolo mezzo-legno per Travi
|
||||||
-- 2019/10/08 Agg. gestione OpenPocket.
|
-- 2019/10/08 Agg. gestione OpenPocket.
|
||||||
-- 2021/01/24 Con sega a catena ora sempre impostato asse A.
|
-- 2021/01/24 Con sega a catena ora sempre impostato asse A.
|
||||||
@@ -74,6 +74,11 @@
|
|||||||
-- 2023/08/02 Corretto incremento della profondità pari al raggio utensile per tunnel con sega a catena.
|
-- 2023/08/02 Corretto incremento della profondità pari al raggio utensile per tunnel con sega a catena.
|
||||||
-- 2023/08/10 Modificata scelta SCC per tasche in Y+/- in coda o quasi (anche per relativi antischeggia con lama).
|
-- 2023/08/10 Modificata scelta SCC per tasche in Y+/- in coda o quasi (anche per relativi antischeggia con lama).
|
||||||
-- 2023/09/12 In MakeByPockets gestito correttamente il ritorno nil di GetUShapeWidth.
|
-- 2023/09/12 In MakeByPockets gestito correttamente il ritorno nil di GetUShapeWidth.
|
||||||
|
-- 2023/09/26 In MakeLongMoreFaces migliorata gestione spezzatura di Tunnel.
|
||||||
|
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
|
||||||
|
-- 2023/09/27 In MakeMoreFaces e Classify refactoring della gestione scanalatura chiusa.
|
||||||
|
-- 2023/09/27 In MakeLongMoreFaces aggiunto Topology.Classify alla Proc creata.
|
||||||
|
-- 2023/10/03 In MakePocket aggiunto messaggio in caso si rovini il pezzo successivo.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLapJoint = {}
|
local ProcessLapJoint = {}
|
||||||
@@ -86,6 +91,7 @@ local Cut = require( 'ProcessCut')
|
|||||||
local DoubleCut = require( 'ProcessDoubleCut')
|
local DoubleCut = require( 'ProcessDoubleCut')
|
||||||
local LongCut = require( 'ProcessLongCut')
|
local LongCut = require( 'ProcessLongCut')
|
||||||
local Long2Cut = require( 'ProcessLongDoubleCut')
|
local Long2Cut = require( 'ProcessLongDoubleCut')
|
||||||
|
local Topology = require( 'FeatureTopology')
|
||||||
|
|
||||||
EgtOutLog( ' ProcessLapJoint started', 1)
|
EgtOutLog( ' ProcessLapJoint started', 1)
|
||||||
|
|
||||||
@@ -634,7 +640,8 @@ function ProcessLapJoint.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- deve avere la normale principale diretta verso la testa
|
-- deve avere la normale principale diretta verso la testa
|
||||||
local nFacInd, dElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
Topology.Classify( Proc, b3Raw)
|
||||||
|
local nFacInd, dElev = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
if vtN and vtN:getX() < 0.499 then
|
if vtN and vtN:getX() < 0.499 then
|
||||||
return false
|
return false
|
||||||
@@ -688,7 +695,8 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- deve avere la normale principale diretta verso la coda (oppure tunnel)
|
-- deve avere la normale principale diretta verso la coda (oppure tunnel)
|
||||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
Topology.Classify( Proc, b3Raw)
|
||||||
|
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
if vtN and vtN:getZ() < BD.NZ_MINA and nFacInd2 then
|
if vtN and vtN:getZ() < BD.NZ_MINA and nFacInd2 then
|
||||||
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, nFacInd2, GDB_ID.ROOT)
|
||||||
@@ -737,7 +745,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
|||||||
local nDeletedFace
|
local nDeletedFace
|
||||||
-- recupero la faccia con il maggior numero di adiacenze e minor elevazione
|
-- recupero la faccia con il maggior numero di adiacenze e minor elevazione
|
||||||
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
|
local nPartId = EgtGetParent( EgtGetParent( Proc.Id) or GDB_ID.NULL)
|
||||||
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
if not nFacInd or nFacInd < 0 then
|
if not nFacInd or nFacInd < 0 then
|
||||||
if nFacInd == -1 then
|
if nFacInd == -1 then
|
||||||
bClosedOrthoFaces = nFacInd2
|
bClosedOrthoFaces = nFacInd2
|
||||||
@@ -752,45 +760,11 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
|||||||
return true, false
|
return true, false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se è una feature scanalatura (con 5 facce) e non è stata riconosciuta come fessura, eseguo altre verifiche
|
-- se scanalatura chiusa lavoro la faccia di fondo
|
||||||
if Proc.Prc == 16 and Proc.Fct == 5 and not bClosedOrthoFaces then
|
if Proc.Topology == 'Pocket' and ( Proc.IsParallel or Proc.AllRightAngles) and not bClosedOrthoFaces then
|
||||||
-- recupero gruppo per geometria addizionale
|
nFacInd = Topology.GetFacesWithGivenAdjacencyNumber( Proc, 4)[1]
|
||||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
nFacInd2 = nil
|
||||||
if not nAddGrpId then
|
dElev = Proc.Face[ nFacInd + 1].Elevation
|
||||||
return false
|
|
||||||
end
|
|
||||||
-- dalla copia della superfice, ciclo eliminando una faccia per volta per verificare se trova fessura
|
|
||||||
for i = 1, Proc.Fct do
|
|
||||||
local nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
|
||||||
-- elimino una faccia
|
|
||||||
nDeletedFace = i - 1
|
|
||||||
if EgtSurfTmRemoveFacet( nNewProc, nDeletedFace) then
|
|
||||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
|
||||||
nFacInd, dElev, nFacInd2, dElev2 = BL.GetFaceWithMostAdj( nNewProc, nPartId)
|
|
||||||
if not nFacInd or nFacInd < 0 then
|
|
||||||
if nFacInd == -1 then
|
|
||||||
bClosedOrthoFaces = nFacInd2
|
|
||||||
EgtErase( nNewProc)
|
|
||||||
break
|
|
||||||
else
|
|
||||||
EgtErase( nNewProc)
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- altrimenti esco
|
|
||||||
else
|
|
||||||
EgtErase( nNewProc)
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se riconosciuta fessura ricalcolo l'elevazione dalla faccia di fondo
|
|
||||||
if bClosedOrthoFaces then
|
|
||||||
nFacInd = nDeletedFace
|
|
||||||
-- rendo nulla la faccia opzionale perchè si tratta di una fessura
|
|
||||||
nFacInd2 = nil
|
|
||||||
dElev = BL.GetFaceElevation( Proc.Id, nFacInd)
|
|
||||||
bClosedOrthoFaces = false -- non lo setto come tunnel
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
-- se facce formano un tunnel e sono ortogonali
|
-- se facce formano un tunnel e sono ortogonali
|
||||||
if bClosedOrthoFaces then
|
if bClosedOrthoFaces then
|
||||||
@@ -2681,7 +2655,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|||||||
local bIs3Faces = ( Proc.Fct == 3)
|
local bIs3Faces = ( Proc.Fct == 3)
|
||||||
if bIs3Faces then
|
if bIs3Faces then
|
||||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||||
local nFacInd1, dFacElev1, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId, bIs3Faces)
|
local nFacInd1, dFacElev1, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc, nPartId, bIs3Faces)
|
||||||
if not nFacInd1 or nFacInd1 < 0 then
|
if not nFacInd1 or nFacInd1 < 0 then
|
||||||
if nFacInd1 == -1 then
|
if nFacInd1 == -1 then
|
||||||
bOrthoFaces = nFacInd2
|
bOrthoFaces = nFacInd2
|
||||||
@@ -3104,8 +3078,9 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng, bOpenOutRaw, bLapJointAngTrasm)
|
local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng, bOpenOutRaw, bLapJointAngTrasm, nPhase, nRawId)
|
||||||
|
-- distanza dal pezzo successivo
|
||||||
|
local dDistToNextPiece = BL.GetDistanceToNextPart( nRawId, nPhase)
|
||||||
-- calcolo l'elevazione dal punto medio
|
-- calcolo l'elevazione dal punto medio
|
||||||
local dElev
|
local dElev
|
||||||
local dLenIn, dLedOut = BL.GetPointDirDepth( nPartId, ptPs, tvtN[2])
|
local dLenIn, dLedOut = BL.GetPointDirDepth( nPartId, ptPs, tvtN[2])
|
||||||
@@ -3228,6 +3203,11 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- se la lavorazione rovina il pezzo successivo emetto warning
|
||||||
|
if ( not Proc.Tail or Proc.AdvTail) and Proc.AffectedFaces.Left and dDistToNextPiece < dDiamTool / 2 then
|
||||||
|
sWarn = 'Warning on pocketing ' .. sName .. ': machining can damage next piece. Minimum distance needed : ' .. ( 1 + dDiamTool / 2) .. ' mm'
|
||||||
|
EgtOutLog( sWarn)
|
||||||
|
end
|
||||||
if BD.TURN then
|
if BD.TURN then
|
||||||
-- centro del pezzo
|
-- centro del pezzo
|
||||||
local ptCen = ORIG()
|
local ptCen = ORIG()
|
||||||
@@ -3271,7 +3251,7 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
|||||||
-- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura
|
-- se l'angolo dalla verticale si discosta di più dell'angolo limite impostato, utilizzo la svuotatura
|
||||||
if cos( dDiffFromSqAng) < cos( dAngLimit) then
|
if cos( dDiffFromSqAng) < cos( dAngLimit) then
|
||||||
-- applico la svuotatura
|
-- applico la svuotatura
|
||||||
local bOk, sWarn, sTuuidPk, dDiamTool, dElev = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nSideFace, sMchFind, nUseRoughTool, sPocketing, dPrevFaceElev, tDimAndRef, dAng)
|
local bOk, sWarn, sTuuidPk, dDiamTool, dElev = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nSideFace, sMchFind, nUseRoughTool, sPocketing, dPrevFaceElev, tDimAndRef, dAng, nil, nil, nPhase, nRawId)
|
||||||
if not bOk then
|
if not bOk then
|
||||||
-- se ho id utensile e diametro è perchè non ha fatto svuotatura perchè la faccia è più stretta del diametro utensile
|
-- se ho id utensile e diametro è perchè non ha fatto svuotatura perchè la faccia è più stretta del diametro utensile
|
||||||
-- e provo ad inserire singola passata di testa
|
-- e provo ad inserire singola passata di testa
|
||||||
@@ -3480,7 +3460,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
end
|
end
|
||||||
if bIs3Faces then
|
if bIs3Faces then
|
||||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||||
local nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId, bIs3Faces)
|
local nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc, nPartId, bIs3Faces)
|
||||||
if not nFacInd or nFacInd < 0 then
|
if not nFacInd or nFacInd < 0 then
|
||||||
if nFacInd == -1 then
|
if nFacInd == -1 then
|
||||||
bOrthoFaces = nFacInd2
|
bOrthoFaces = nFacInd2
|
||||||
@@ -3503,7 +3483,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
dDimMin = 2 * dDimMin
|
dDimMin = 2 * dDimMin
|
||||||
-- se tre facce aumento il diametro di quanto possibile
|
-- se tre facce aumento il diametro di quanto possibile
|
||||||
elseif Proc.Fct == 3 then
|
elseif Proc.Fct == 3 then
|
||||||
local nFacInd = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false)
|
local nFacInd = BL.GetFaceWithMostAdj( Proc, nPartId, false)
|
||||||
local dWidth = GetUShapeWidth( Proc, nFacInd or -1) or dDimMin
|
local dWidth = GetUShapeWidth( Proc, nFacInd or -1) or dDimMin
|
||||||
if dWidth > dDimMin then
|
if dWidth > dDimMin then
|
||||||
dDimMin = min( 2 * dDimMin, dWidth)
|
dDimMin = min( 2 * dDimMin, dWidth)
|
||||||
@@ -3530,7 +3510,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
EgtInvertSurf( nSurfInt)
|
EgtInvertSurf( nSurfInt)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
local bMakeContour = false
|
local bMakeContour = false
|
||||||
local sMilling
|
local sMilling
|
||||||
@@ -3877,7 +3857,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
-- se non completo e U, cerco di lavorare anche la faccia di fondo (con il massimo affondamento possibile)
|
-- se non completo e U, cerco di lavorare anche la faccia di fondo (con il massimo affondamento possibile)
|
||||||
if not bComplete and bIs3Faces then
|
if not bComplete and bIs3Faces then
|
||||||
-- recupero la faccia da lavorare
|
-- recupero la faccia da lavorare
|
||||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
local vtN
|
local vtN
|
||||||
local bPock3rd = false
|
local bPock3rd = false
|
||||||
if nFacInd then
|
if nFacInd then
|
||||||
@@ -4502,7 +4482,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local nBottomFace
|
local nBottomFace
|
||||||
local sMchFindBackUp
|
local sMchFindBackUp
|
||||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||||
nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
if not nFacInd or nFacInd < 0 then
|
if not nFacInd or nFacInd < 0 then
|
||||||
if nFacInd == -1 then
|
if nFacInd == -1 then
|
||||||
bClosedOrthoFaces = nFacInd2
|
bClosedOrthoFaces = nFacInd2
|
||||||
@@ -4512,42 +4492,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se è una feature scanalatura (con 5 facce) e non è stata riconosciuta come fessura, eseguo altre verifiche
|
-- se scanalatura chiusa lavoro la faccia di fondo
|
||||||
if Proc.Prc == 16 and Proc.Fct == 5 and not bClosedOrthoFaces then
|
if Proc.Topology == 'Pocket' and ( Proc.IsParallel or Proc.AllRightAngles) and not bClosedOrthoFaces then
|
||||||
-- dalla copia della superfice, ciclo eliminando una faccia per volta per verificare se trova fessura
|
nFacInd = Topology.GetFacesWithGivenAdjacencyNumber( Proc, 4)[1]
|
||||||
for i = 1, Proc.Fct do
|
nFacInd2 = nil
|
||||||
local nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
dFacElev = Proc.Face[ nFacInd + 1].Elevation
|
||||||
-- elimino una faccia
|
|
||||||
nBottomFace = i - 1
|
|
||||||
if EgtSurfTmRemoveFacet( nNewProc, nBottomFace) then
|
|
||||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
|
||||||
nFacInd, dFacElev, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( nNewProc, nPartId)
|
|
||||||
if not nFacInd or nFacInd < 0 then
|
|
||||||
if nFacInd == -1 then
|
|
||||||
bClosedOrthoFaces = nFacInd2
|
|
||||||
EgtErase( nNewProc)
|
|
||||||
break
|
|
||||||
else
|
|
||||||
EgtErase( nNewProc)
|
|
||||||
local sErr = 'Error : MakeMoreFaces could not find reference face'
|
|
||||||
EgtOutLog( sErr)
|
|
||||||
return false, sErr
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- altrimenti esco
|
|
||||||
else
|
|
||||||
EgtErase( nNewProc)
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se riconosciuta fessura ricalcolo l'elevazione dalla faccia di fondo
|
|
||||||
if bClosedOrthoFaces then
|
|
||||||
nFacInd = nBottomFace
|
|
||||||
-- rendo nulla la faccia opzionale perchè si tratta di una fessura
|
|
||||||
nFacInd2 = nil
|
|
||||||
dFacElev = BL.GetFaceElevation( Proc.Id, nFacInd)
|
|
||||||
bClosedOrthoFaces = false -- non setto come tunnel
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
-- se proviene da divisione in parti lungo X ed è un tunnel non è fattibile
|
-- se proviene da divisione in parti lungo X ed è un tunnel non è fattibile
|
||||||
if not bSinglePart and bClosedOrthoFaces then
|
if not bSinglePart and bClosedOrthoFaces then
|
||||||
@@ -5161,7 +5110,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local bMadeASbyBld = false
|
local bMadeASbyBld = false
|
||||||
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1)
|
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1)
|
||||||
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
||||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacIndOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
||||||
local bOk
|
local bOk
|
||||||
@@ -5189,7 +5138,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
-- 3 facce non a L ma con una faccia favorevole a Y, oppure
|
-- 3 facce non a L ma con una faccia favorevole a Y, oppure
|
||||||
-- 4 facce
|
-- 4 facce
|
||||||
-- lancio la MakePocket ( lavorazione solo da un lato, fondo della tasca la faccia più favorevole a Y)
|
-- lancio la MakePocket ( lavorazione solo da un lato, fondo della tasca la faccia più favorevole a Y)
|
||||||
if bForceSideMill and (( Proc.Fct == 3 and bIsL) or ( ( Proc.Fct == 3 or Proc.Fct == 2) and abs( vtNFacApproxY:getY()) >= 0.707 ) or Proc.Fct == 4) then
|
if bForceSideMill and (( Proc.Fct == 3 and bIsL) or ( ( Proc.Fct == 3 or Proc.Fct == 2) and abs( vtNFacApproxY:getY()) >= 0.707 ) or ( Proc.Fct == 4 and Proc.Topology == 'Groove')) then
|
||||||
nFacInd, vtN, ptC = nFacApproxY, vtNFacApproxY, ptCFacApproxY
|
nFacInd, vtN, ptC = nFacApproxY, vtNFacApproxY, ptCFacApproxY
|
||||||
local tvtNx = {}
|
local tvtNx = {}
|
||||||
tvtNx[2] = vtN
|
tvtNx[2] = vtN
|
||||||
@@ -5236,7 +5185,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam)
|
dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam)
|
||||||
end
|
end
|
||||||
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
|
local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind)
|
||||||
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap)
|
bOk, sWarn2, sTuuidPk, dDiamTool, dDepth = MakePocket( Proc, nPartId, b3Solid, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap, nil, nPhase, nRawId)
|
||||||
if not bOk then return false, sWarn2 end
|
if not bOk then return false, sWarn2 end
|
||||||
if sWarn2 then
|
if sWarn2 then
|
||||||
if not sWarn then sWarn = '' end
|
if not sWarn then sWarn = '' end
|
||||||
@@ -5299,7 +5248,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
sWarn = sErr
|
sWarn = sErr
|
||||||
-- se ho antischeggia con fresa le inserisco
|
-- se ho antischeggia con fresa le inserisco
|
||||||
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
||||||
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacIndOri, dFacElevOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||||
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||||
nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
|
nFacIndOri, nAddGrpId, bMillDown, dDiamTool, nil,
|
||||||
@@ -5400,7 +5349,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local bMadeASbyBld = false
|
local bMadeASbyBld = false
|
||||||
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1)
|
local bPassThrou = ( Proc.Box:getDimY() > b3Raw:getDimY() - 1 or Proc.Box:getDimZ() > b3Raw:getDimZ() - 1)
|
||||||
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
local bPassEdge = ((( bIsU and Proc.Fct == 3) or ( bIsL and Proc.Fct == 2)) and bSinglePart and Proc.Box:getDimX() < 0.9 * b3Raw:getDimX())
|
||||||
local nFacIndOri = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacIndOri = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
local vtNOri = EgtSurfTmFacetNormVersor( Proc.Id, nFacIndOri, GDB_ID.ROOT)
|
||||||
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) and ( vtNOri:getZ() > -0.087 or BD.DOWN_HEAD or BD.TURN) then
|
||||||
local bOk
|
local bOk
|
||||||
@@ -5446,7 +5395,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
dMachiningDepth = dFacElev + dCollSic
|
dMachiningDepth = dFacElev + dCollSic
|
||||||
end
|
end
|
||||||
local bOk, sWarn2
|
local bOk, sWarn2
|
||||||
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap, bLapJointAngTrasm)
|
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dMachiningDepth, nil, nil, bAllWithEndCap, bLapJointAngTrasm, nPhase, nRawId)
|
||||||
if not bOk then return false, sWarn2 end
|
if not bOk then return false, sWarn2 end
|
||||||
if sWarn2 then
|
if sWarn2 then
|
||||||
if not sWarn then sWarn = '' end
|
if not sWarn then sWarn = '' end
|
||||||
@@ -5544,62 +5493,104 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- ottengo la distanza tra la fine del pezzo e il pezzo successivo
|
-- ottengo la distanza tra la fine del pezzo e il pezzo successivo
|
||||||
local dDistToNextPiece = BL.GetDistanceToNextPart( nRawId, nPhase)
|
local dDistToNextPiece = BL.GetDistanceToNextPart( nRawId, nPhase)
|
||||||
-- verifico se applicare gestione speciale delle giunzioni (U diretta come asse X)
|
-- verifico se applicare gestione speciale delle giunzioni (U diretta come asse X)
|
||||||
local bAddEndCap = false
|
local bAddEndCapLeftSide, bAddEndCapRightSide = false, false
|
||||||
local dAddLen = 0
|
local dAddLen = 0
|
||||||
local bIsOpenU = ( Proc.Fct == 3 and not TestElleShape3( Proc))
|
local bIsOpenU = ( Proc.Fct == 3 and not TestElleShape3( Proc))
|
||||||
if bIsOpenU then
|
if bIsOpenU then
|
||||||
local ptC0, vtN0 = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
local ptC0, vtN0 = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||||
local ptC1, vtN1 = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
|
local ptC1, vtN1 = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
|
||||||
local ptC2, vtN2 = EgtSurfTmFacetCenter( Proc.Id, 2, GDB_ID.ROOT)
|
local ptC2, vtN2 = EgtSurfTmFacetCenter( Proc.Id, 2, GDB_ID.ROOT)
|
||||||
if vtN0:getX() < 0.0175 and vtN1:getX() < 0.0175 and vtN2:getX() < 0.0175 then
|
if abs( vtN0:getX()) < 0.0175 and abs( vtN1:getX()) < 0.0175 and abs( vtN2:getX()) < 0.0175 then
|
||||||
local dWidth = 0
|
local dWidth = 0
|
||||||
if vtN0 * vtN1 < -0.9998 then
|
if vtN0 * vtN1 < -0.9998 then
|
||||||
bAddEndCap = true
|
bAddEndCapLeftSide = true
|
||||||
dWidth = ( ptC1 - ptC0) * vtN0
|
dWidth = ( ptC1 - ptC0) * vtN0
|
||||||
elseif vtN0 * vtN2 < -0.9998 then
|
elseif vtN0 * vtN2 < -0.9998 then
|
||||||
bAddEndCap = true
|
bAddEndCapLeftSide = true
|
||||||
dWidth = ( ptC2 - ptC0) * vtN0
|
dWidth = ( ptC2 - ptC0) * vtN0
|
||||||
elseif vtN1 * vtN2 < -0.9998 then
|
elseif vtN1 * vtN2 < -0.9998 then
|
||||||
bAddEndCap = true
|
bAddEndCapLeftSide = true
|
||||||
dWidth = ( ptC2 - ptC1) * vtN1
|
dWidth = ( ptC2 - ptC1) * vtN1
|
||||||
end
|
end
|
||||||
dAddLen = min( dWidth, 100) / 2
|
dAddLen = min( dWidth, 100) / 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- verifico se applicare gestione speciale per tunnel
|
||||||
|
local nSurfBottomId
|
||||||
|
if Proc.Topology == 'Tunnel' then
|
||||||
|
bAddEndCapLeftSide = true
|
||||||
|
bAddEndCapRightSide = true
|
||||||
|
-- recupero centro e normale delle facce
|
||||||
|
local vtN = {}
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
vtN[i] = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT)
|
||||||
|
end
|
||||||
|
-- calcolo l'orientamento del tunnel
|
||||||
|
local vtOrtho
|
||||||
|
local bAdj = EgtSurfTmFacetsContact( Proc.Id, 0, 1)
|
||||||
|
if bAdj then
|
||||||
|
vtOrtho = vtN[1] ^ vtN[2]
|
||||||
|
else
|
||||||
|
if Proc.Fct >= 3 then
|
||||||
|
vtOrtho = vtN[1] ^ vtN[3]
|
||||||
|
else
|
||||||
|
local sErr = 'Error : disconnected tunnel'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
|
end
|
||||||
|
vtOrtho = EgtIf( abs( vtOrtho:getY()) > abs( vtOrtho:getZ()), -Y_AX(), -Z_AX())
|
||||||
|
local ptMaxBox = Proc.Box:getMax()
|
||||||
|
-- per creare le superfici di cap nei tunnel serve aggiungere una faccia di fondo
|
||||||
|
-- recupero il box della trave e lo ingrandisco di poco per essere sicuro di avere intersezione con il piano di fondo
|
||||||
|
local b3SolidExtended = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||||
|
b3SolidExtended:expand( 100 * GEO.EPS_SMALL)
|
||||||
|
-- superficie di fondo
|
||||||
|
nSurfBottomId = EgtSurfTmPlaneInBBox( nAddGrpId, ptMaxBox, vtOrtho, b3SolidExtended, GDB_ID.ROOT)
|
||||||
|
-- calcolo di quanto allargare le superfici
|
||||||
|
local dWidth = EgtIf( Proc.AffectedFaces.Front, Proc.Box:getDimZ(), Proc.Box:getDimY())
|
||||||
|
dAddLen = min( dWidth, 100) / 2
|
||||||
|
end
|
||||||
-- la divido in parti lungo X
|
-- la divido in parti lungo X
|
||||||
local vAddId = {}
|
local vAddId = {}
|
||||||
local bAllWithEndCap = bAddEndCap
|
local bAllWithEndCap = bAddEndCapLeftSide or bAddEndCapRightSide
|
||||||
local nPart = max( ceil( Proc.Box:getDimX() / BD.LONGCUT_MAXLEN), 2)
|
local nPart = max( ceil( Proc.Box:getDimX() / BD.LONGCUT_MAXLEN), 2)
|
||||||
local dPartLen = Proc.Box:getDimX() / nPart
|
local dPartLen = Proc.Box:getDimX() / nPart
|
||||||
local Xmin = Proc.Box:getMin():getX()
|
local Xmin = Proc.Box:getMin():getX()
|
||||||
|
-- trimesh per la creazione degli EndCap
|
||||||
|
local AddIdCopy = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||||
|
-- aggiunta di eventuale fondo alla trimesh per creare correttamente le superfici EndCap
|
||||||
|
if nSurfBottomId then EgtSurfTmAdd( AddIdCopy, nSurfBottomId) end
|
||||||
for i = 1, nPart do
|
for i = 1, nPart do
|
||||||
|
local nCapIdLeftSide, nCapIdRightSide
|
||||||
-- eseguo divisione
|
-- eseguo divisione
|
||||||
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
local AddId = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||||
if i > 1 or bAddEndCap then
|
if i > 1 or bAddEndCapLeftSide then
|
||||||
-- definizione del piano
|
-- definizione del piano sinsitro
|
||||||
local dAdd = EgtIf( i > 1, dAddLen, 0)
|
local dAdd = EgtIf( i > 1, dAddLen, 0)
|
||||||
local ptOn = Point3d( Xmin - dAdd + ( i - 1) * dPartLen, 0, 0)
|
local ptOn = Point3d( Xmin - dAdd + ( i - 1) * dPartLen, 0, 0)
|
||||||
local vtN = -X_AX()
|
local vtN = -X_AX()
|
||||||
-- se richiesto, creazione tappo
|
-- se richiesto, creazione tappo sinistro
|
||||||
local CapId
|
if bAddEndCapLeftSide then
|
||||||
if bAddEndCap then
|
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOn, vtN, AddIdCopy, nAddGrpId, GDB_RT.GLOB)
|
||||||
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOn, vtN, AddId, nAddGrpId, GDB_RT.GLOB)
|
|
||||||
if nPnt == 0 and nCrv == 1 and nSrf == 0 then
|
if nPnt == 0 and nCrv == 1 and nSrf == 0 then
|
||||||
EgtCloseCurveCompo( nFirstId)
|
EgtCloseCurveCompo( nFirstId)
|
||||||
CapId = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
|
nCapIdLeftSide = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
|
||||||
if not CapId then bAllWithEndCap = false end
|
if not nCapIdLeftSide then bAllWithEndCap = false end
|
||||||
end
|
|
||||||
if nFirstId then
|
|
||||||
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
|
|
||||||
EgtErase( nId)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
if nFirstId then
|
||||||
|
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
|
||||||
|
EgtErase( nId)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
-- taglio della superficie
|
if i > 1 then
|
||||||
EgtCutSurfTmPlane( AddId, ptOn, vtN, true, GDB_RT.GLOB)
|
-- taglio della superficie lato sinistro
|
||||||
-- se esiste, aggiunta del tappo
|
EgtCutSurfTmPlane( AddId, ptOn, vtN, true, GDB_RT.GLOB)
|
||||||
if CapId then
|
end
|
||||||
AddId = EgtSurfTmBySewing( nAddGrpId, { AddId, CapId})
|
-- se esiste, aggiunta del tappo sinistro
|
||||||
|
if nCapIdLeftSide then
|
||||||
|
AddId = EgtSurfTmBySewing( nAddGrpId, { AddId, nCapIdLeftSide})
|
||||||
-- se prima spezzatura, allungamento per non lasciare archi
|
-- se prima spezzatura, allungamento per non lasciare archi
|
||||||
if i == 1 then
|
if i == 1 then
|
||||||
local b3Box = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD)
|
local b3Box = EgtGetBBoxGlob( AddId, GDB_BB.STANDARD)
|
||||||
@@ -5609,21 +5600,45 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if i < nPart then
|
if i < nPart then
|
||||||
local ptOn = Point3d( Xmin + i * dPartLen, 0, 0)
|
-- definizione del piano destro
|
||||||
|
local dAdd = EgtIf( i < nPart, dAddLen, 0)
|
||||||
|
local ptOn = Point3d( Xmin + dAdd + i * dPartLen, 0, 0)
|
||||||
local vtN = X_AX()
|
local vtN = X_AX()
|
||||||
|
-- taglio della superficie lato destro
|
||||||
EgtCutSurfTmPlane( AddId, ptOn, vtN, true, GDB_RT.GLOB)
|
EgtCutSurfTmPlane( AddId, ptOn, vtN, true, GDB_RT.GLOB)
|
||||||
|
-- se richiesto, creazione tappo destro
|
||||||
|
if bAddEndCapRightSide then
|
||||||
|
local nFirstId, nPnt, nCrv, nSrf = EgtPlaneSurfTmInters( ptOn, vtN, AddIdCopy, nAddGrpId, GDB_RT.GLOB)
|
||||||
|
if nPnt == 0 and nCrv == 1 and nSrf == 0 then
|
||||||
|
EgtCloseCurveCompo( nFirstId)
|
||||||
|
nCapIdRightSide = EgtSurfTmByFlatContour( nAddGrpId, nFirstId)
|
||||||
|
if not nCapIdRightSide then bAllWithEndCap = false end
|
||||||
|
end
|
||||||
|
if nFirstId then
|
||||||
|
for nId = nFirstId, nFirstId + nPnt + nCrv + nSrf - 1 do
|
||||||
|
EgtErase( nId)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- se esiste, aggiunta del tappo destro
|
||||||
|
if nCapIdRightSide then
|
||||||
|
AddId = EgtSurfTmBySewing( nAddGrpId, { AddId, nCapIdRightSide})
|
||||||
end
|
end
|
||||||
EgtSetName( AddId, 'AddPart_' .. tostring( Proc.Id) .. '_' .. tostring( i))
|
EgtSetName( AddId, 'AddPart_' .. tostring( Proc.Id) .. '_' .. tostring( i))
|
||||||
-- eseguo inserimento in modo da ordinare da X+ a X-
|
-- eseguo inserimento in modo da ordinare da X+ a X-
|
||||||
table.insert( vAddId, 1, AddId)
|
table.insert( vAddId, 1, AddId)
|
||||||
end
|
end
|
||||||
|
EgtErase( AddIdCopy)
|
||||||
-- applico le lavorazioni sulle diverse parti
|
-- applico le lavorazioni sulle diverse parti
|
||||||
local sWarn
|
local sWarn
|
||||||
local bPrevBhSideMill
|
local bPrevBhSideMill
|
||||||
for i = 1, #vAddId do
|
for i = 1, #vAddId do
|
||||||
local b3Box = EgtGetBBoxGlob( vAddId[i], GDB_BB.STANDARD)
|
local b3Box = EgtGetBBoxGlob( vAddId[i], GDB_BB.STANDARD)
|
||||||
local nFct = EgtSurfTmFacetCount( vAddId[i])
|
local nFct = EgtSurfTmFacetCount( vAddId[i])
|
||||||
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg}
|
local AddProc = { Id = vAddId[i], Grp = Proc.Grp, Prc = Proc.Prc, Box = b3Box, TotBox = Proc.Box, Fct = nFct, Flg = Proc.Flg, PartId = Proc.PartId}
|
||||||
|
Topology.Classify( AddProc, b3Raw)
|
||||||
|
AddProc.AffectedFaces = BL.GetProcessAffectedFaces( AddProc)
|
||||||
-- lasciare il false nel sesto parametro (perchè internamente viene verificato se diverso da nil)
|
-- lasciare il false nel sesto parametro (perchè internamente viene verificato se diverso da nil)
|
||||||
local bOk, sMyWarn
|
local bOk, sMyWarn
|
||||||
bOk, sMyWarn, bPrevBhSideMill = MakeMoreFaces( AddProc, nPhase, nRawId, nPartId, dOvmHead, bAllWithEndCap, bPrevBhSideMill, bAllWithEndCap)
|
bOk, sMyWarn, bPrevBhSideMill = MakeMoreFaces( AddProc, nPhase, nRawId, nPartId, dOvmHead, bAllWithEndCap, bPrevBhSideMill, bAllWithEndCap)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
-- 2023/05/03 Corretto SCC in caso di asse utensile allineato con Z.
|
-- 2023/05/03 Corretto SCC in caso di asse utensile allineato con Z.
|
||||||
-- 2023/05/19 Migliorato calcolo e verifica affondamento per lavorazione con lama con codolo in mezzo.
|
-- 2023/05/19 Migliorato calcolo e verifica affondamento per lavorazione con lama con codolo in mezzo.
|
||||||
-- 2023/08/01 Ammesso uso lama da sotto fino a N +3deg in verticale.
|
-- 2023/08/01 Ammesso uso lama da sotto fino a N +3deg in verticale.
|
||||||
|
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLongCut = {}
|
local ProcessLongCut = {}
|
||||||
@@ -437,7 +438,7 @@ end
|
|||||||
-- Applicazione della lavorazione
|
-- Applicazione della lavorazione
|
||||||
local function MakeByPocketing( Proc, nPhase, nRawId, nPartId)
|
local function MakeByPocketing( Proc, nPhase, nRawId, nPartId)
|
||||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId)
|
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId)
|
||||||
-- cerco la svuotatura opportuna
|
-- cerco la svuotatura opportuna
|
||||||
local sPocketing = ML.FindPocketing( 'OpenPocket', Proc.Box:getDimX())
|
local sPocketing = ML.FindPocketing( 'OpenPocket', Proc.Box:getDimX())
|
||||||
if not sPocketing then
|
if not sPocketing then
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
-- 2023/05/09 Aggiunta richiesta risalita preliminare a Zmax per tagli da sopra su macchine PF e ONE.
|
-- 2023/05/09 Aggiunta richiesta risalita preliminare a Zmax per tagli da sopra su macchine PF e ONE.
|
||||||
-- 2023/06/13 Corrette note Precut e Cut per tagli aggiuntivi orizzontali.
|
-- 2023/06/13 Corrette note Precut e Cut per tagli aggiuntivi orizzontali.
|
||||||
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo.
|
-- 2023/08/02 Corretto calcolo allungamenti/accorciamenti pezzi alti per contemplare anche taglio singolo.
|
||||||
|
-- 2023/10/17 Corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessSplit = {}
|
local ProcessSplit = {}
|
||||||
@@ -471,10 +472,20 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
|
-- distanza in Y tra il centro della lama e l'intersezione tra la lama stessa e la massima Z della trave, + extra
|
||||||
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
|
-- se taglio doppio l'intersezione sarà in mezzeria, se taglio singolo sarà all'estremo opposto della trave
|
||||||
local dKL = dSawRad - dMaxDepth + EgtIf( bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
|
local dKL = dSawRad - dMaxDepth + EgtIf( bDoubleCut, b3Raw:getDimY() / 2 + BD.CUT_EXTRA_MIN, b3Raw:getDimY() + BD.CUT_EXTRA)
|
||||||
|
-- lunghezza minima del percorso di lavorazione, in caso accorciamento porti a lunghezza negativa
|
||||||
|
local dMinSawingLength = 5
|
||||||
if BD.C_SIMM then
|
if BD.C_SIMM then
|
||||||
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
dAccEnd = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
||||||
|
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo entrata
|
||||||
|
if dAccEnd > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
|
||||||
|
dAccStart = b3Raw:getDimZ() - dAccEnd - dMinSawingLength
|
||||||
|
end
|
||||||
else
|
else
|
||||||
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
dAccStart = sqrt( max( dSawRad * dSawRad - dKL * dKL, 0))
|
||||||
|
-- non posso comunque accorciare più della dimensione della geometria, quindi in caso allungo uscita
|
||||||
|
if dAccStart > b3Raw:getDimZ() - 100 * GEO.EPS_SMALL then
|
||||||
|
dAccEnd = b3Raw:getDimZ() - dAccStart - dMinSawingLength
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessTenon.lua by Egaltech s.r.l. 2023/03/27
|
-- ProcessTenon.lua by Egaltech s.r.l. 2023/09/26
|
||||||
-- Gestione calcolo tenone per Travi
|
-- Gestione calcolo tenone per Travi
|
||||||
-- 2021/10/04 Corretto calcolo HCING per pezzi piccoli.
|
-- 2021/10/04 Corretto calcolo HCING per pezzi piccoli.
|
||||||
-- 2022/02/15 Aggiornata VerifyOrientation per macchine con testa da sotto.
|
-- 2022/02/15 Aggiornata VerifyOrientation per macchine con testa da sotto.
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
-- 2022/12/20 Aggiunta gestione smusso. Migliorata scelta tra sopra e sotto per il punto di inizio. In VerifyOrientation aggiunta trave medio alta.
|
-- 2022/12/20 Aggiunta gestione smusso. Migliorata scelta tra sopra e sotto per il punto di inizio. In VerifyOrientation aggiunta trave medio alta.
|
||||||
-- 2023/01/20 Modificata scelta lato di attacco per pezzo piccolo su macchine con pinza speciale (pinza 5).
|
-- 2023/01/20 Modificata scelta lato di attacco per pezzo piccolo su macchine con pinza speciale (pinza 5).
|
||||||
-- 2023/03/27 Migliorate condizioni scelta pretaglio con lama o fresa; gestione unificata con ProcessDtTenon. Migliorato calcolo altezza tenone.
|
-- 2023/03/27 Migliorate condizioni scelta pretaglio con lama o fresa; gestione unificata con ProcessDtTenon. Migliorato calcolo altezza tenone.
|
||||||
|
-- 2023/09/26 Per macchina TURN si assegna SCC per privilegiare accesso dal lato corto della trave.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessTenon = {}
|
local ProcessTenon = {}
|
||||||
@@ -325,7 +326,13 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
-- imposto posizione braccio porta testa
|
-- imposto posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = MCH_SCC.NONE
|
||||||
if not BD.C_SIMM and not BD.TURN then
|
if BD.TURN then
|
||||||
|
if b3Solid:getDimY() >= b3Solid:getDimZ() then
|
||||||
|
nSCC = MCH_SCC.ADIR_ZP
|
||||||
|
else
|
||||||
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
|
end
|
||||||
|
elseif not BD.C_SIMM then
|
||||||
nSCC = MCH_SCC.ADIR_YM
|
nSCC = MCH_SCC.ADIR_YM
|
||||||
if abs( vtExtr:getY()) > 0.088 then
|
if abs( vtExtr:getY()) > 0.088 then
|
||||||
nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
nSCC = EgtIf( vtExtr:getX() < GEO.EPS_SMALL, MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
-- ProcessTyroleanDovetail.lua by Egaltech s.r.l. 2022/03/21
|
-- ProcessTyroleanDovetail.lua by Egaltech s.r.l. 2022/03/21
|
||||||
-- Gestione calcolo giunzione tirolese
|
-- Gestione calcolo giunzione tirolese
|
||||||
-- 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)
|
||||||
|
-- 2023/09/26 Modificata chiamata a GetFaceWithMostAdj.
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessTyroleanDovetail = {}
|
local ProcessTyroleanDovetail = {}
|
||||||
@@ -510,10 +511,10 @@ local function MakeMachByMill( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b
|
|||||||
dStepmach = dMaxMat * 0.5
|
dStepmach = dMaxMat * 0.5
|
||||||
end
|
end
|
||||||
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
-- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa
|
||||||
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, sin(dSideAngle))
|
local nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, sin(dSideAngle))
|
||||||
if not nFacInd or nFacInd < 0 then
|
if not nFacInd or nFacInd < 0 then
|
||||||
-- provo eliminando i sottosquadra
|
-- provo eliminando i sottosquadra
|
||||||
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc.Id, nPartId, false, -2)
|
nFacInd, dFacElev = BL.GetFaceWithMostAdj( Proc, nPartId, false, -2)
|
||||||
if not nFacInd or nFacInd < 0 then
|
if not nFacInd or nFacInd < 0 then
|
||||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MakeMachByMill could not find reference face'
|
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' MakeMachByMill could not find reference face'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
|
|||||||
+23
-19
@@ -115,23 +115,6 @@ local function MyProcessInputData()
|
|||||||
end
|
end
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
|
|
||||||
-- Le ordino in senso di lunghezza crescente
|
|
||||||
table.sort( vBeam, function( B1, B2)
|
|
||||||
if abs( B1.Box:getDimX() - B2.Box:getDimX()) < 1 then
|
|
||||||
return B1.Ind < B2.Ind
|
|
||||||
else
|
|
||||||
return B1.Box:getDimX() < B2.Box:getDimX()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
do
|
|
||||||
local sOut = ''
|
|
||||||
for i = 1, #vBeam do
|
|
||||||
sOut = sOut .. vBeam[i].Name .. ', '
|
|
||||||
end
|
|
||||||
sOut = sOut:sub( 1, -3)
|
|
||||||
EgtOutLog( 'Travi ordinate : ' .. sOut, 1)
|
|
||||||
end
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -152,12 +135,13 @@ local function MyProcessBeams()
|
|||||||
local dAddLen = BD.OVM_HEAD + ( #vBeam - 1) * BD.OVM_MID
|
local dAddLen = BD.OVM_HEAD + ( #vBeam - 1) * BD.OVM_MID
|
||||||
EgtOutLog( 'Ltot : '..EgtNumToString( dTotLen, 1) .. ' Lagg : '..EgtNumToString( dAddLen, 1)..' MinUnloadRaw : '.. EgtNumToString( BD.MinRaw + BD.OVM_MID, 1), 1)
|
EgtOutLog( 'Ltot : '..EgtNumToString( dTotLen, 1) .. ' Lagg : '..EgtNumToString( dAddLen, 1)..' MinUnloadRaw : '.. EgtNumToString( BD.MinRaw + BD.OVM_MID, 1), 1)
|
||||||
|
|
||||||
-- Richiedo lunghezza del grezzo e sovramateriale di testa
|
-- Richiedo lunghezza del grezzo, sovramateriale di testa, forzatura verticale e ordinamento automatico secondo la lunghezza
|
||||||
local vsVal = EgtDialogBox( 'Lavora Travi' .. ' (Ltot='..EgtNumToString( dTotLen + dAddLen + 0.5, 0)..
|
local vsVal = EgtDialogBox( 'Lavora Travi' .. ' (Ltot='..EgtNumToString( dTotLen + dAddLen + 0.5, 0)..
|
||||||
', Lmax='..EgtNumToString( BD.MAX_RAW, 0)..',MinUlr='..EgtNumToString( BD.MinRaw + BD.OVM_MID, 0)..')',
|
', Lmax='..EgtNumToString( BD.MAX_RAW, 0)..',MinUlr='..EgtNumToString( BD.MinRaw + BD.OVM_MID, 0)..')',
|
||||||
{'Lunghezza grezzo', EgtNumToString( BD.STD_RAW, 0)},
|
{'Lunghezza grezzo', EgtNumToString( BD.STD_RAW, 0)},
|
||||||
{'Sovramateriale di testa', EgtNumToString( BD.OVM_HEAD, 0)},
|
{'Sovramateriale di testa', EgtNumToString( BD.OVM_HEAD, 0)},
|
||||||
{'Forza sezione verticale', ' CB:true,*false'})
|
{'Forza sezione verticale', ' CB:true,*false'},
|
||||||
|
{'Ordina per lunghezza', ' CB:true,*false'})
|
||||||
if not vsVal then
|
if not vsVal then
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
return
|
return
|
||||||
@@ -221,6 +205,26 @@ local function MyProcessBeams()
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Se richiesto, ordino le travi in senso di lunghezza crescente
|
||||||
|
local bOrd = ( vsVal[4] == 'true')
|
||||||
|
if bOrd then
|
||||||
|
table.sort( vBeam, function( B1, B2)
|
||||||
|
if abs( B1.Box:getDimX() - B2.Box:getDimX()) < 1 then
|
||||||
|
return B1.Ind < B2.Ind
|
||||||
|
else
|
||||||
|
return B1.Box:getDimX() < B2.Box:getDimX()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
do
|
||||||
|
local sOut = ''
|
||||||
|
for i = 1, #vBeam do
|
||||||
|
sOut = sOut .. vBeam[i].Name .. ', '
|
||||||
|
end
|
||||||
|
sOut = sOut:sub( 1, -3)
|
||||||
|
EgtOutLog( 'Travi ordinate : ' .. sOut, 1)
|
||||||
|
end
|
||||||
|
|
||||||
-- Sistemo le travi nel grezzo
|
-- Sistemo le travi nel grezzo
|
||||||
local bOk, sErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)
|
local bOk, sErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)
|
||||||
if not bOk then
|
if not bOk then
|
||||||
|
|||||||
+21
-1
@@ -1,7 +1,27 @@
|
|||||||
==== Beam Update Log ====
|
==== Beam Update Log ====
|
||||||
|
|
||||||
|
Versione 2.5j1 (23/10/2023)
|
||||||
|
- Added : in Process (lancio da EgtCAM5 quindi uso praticamente solo interno) aggiunta possibilità di tenere ordine pezzi in barra come da selezione
|
||||||
|
- Fixed : piccola correzione a Classify di FeatureTopology per casi senza geometria
|
||||||
|
- Fixed : in HeadCut e Split corretto calcolo allungamenti/accorciamenti per evitare lunghezze del percorso negative
|
||||||
|
- Fixed : in Lapjoint -> MakePocket aggiunto messaggio in caso si rovini il pezzo successivo
|
||||||
|
- Modif : in Topology aggiunti casi al check solo direzione principale
|
||||||
|
- Modif : nella ricerca lavorazione da usare controllo di utensile attivo sostituito con controllo utensile presente nel setup corrente
|
||||||
|
|
||||||
|
Versione 2.5i2 (27/09/2023)
|
||||||
|
- Added : aggiunto riconoscimento sottosquadro da facce non adiacenti
|
||||||
|
- Fixed : in LapJoint corretto caso tunnel lungo non lavorato correttamente
|
||||||
|
- Fixed : in foratura quando errore in applicazione lavorazione si inverte e riprova solo se singola su foro aperto
|
||||||
|
- Modif : in lavorazione tenoni per Turn si assegna SCC per privilegiare accesso dal lato corto della trave.
|
||||||
|
|
||||||
Versione 2.5i1 (12/09/2023)
|
Versione 2.5i1 (12/09/2023)
|
||||||
- Fixed : in LapJoint gestito correttamente il ritorno nil di GetUShapeWidth [Ticket #1354].
|
- Fixed : in LapJoint gestito correttamente il ritorno nil di GetUShapeWidth [Ticket #1354]
|
||||||
|
- Modif : in Cut abbassato a 590 mm il limite per convertire in LongCut [Ticket #1448].
|
||||||
|
|
||||||
|
Versione 2.5h2 (11/08/2023)
|
||||||
|
- Fixed : corrette forature con aggregato quando lato aperto
|
||||||
|
- Fixed : in RidgeLap corretto ingombro lavorazione in testa e coda quando rivolta verso il basso
|
||||||
|
- Modif : in LapJoint e Mortise modificata posizione braccio per FAST quando vicino alla coda della trave.
|
||||||
|
|
||||||
Versione 2.5h1 (07/08/2023)
|
Versione 2.5h1 (07/08/2023)
|
||||||
- Fixed : tagli doppi di lato non effettuati se macchina tipo PF e pezzo alto [Ticket #1400]
|
- Fixed : tagli doppi di lato non effettuati se macchina tipo PF e pezzo alto [Ticket #1400]
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
-- Version.lua by Egaltech s.r.l. 2023/08/10
|
-- Version.lua by Egaltech s.r.l. 2023/10/18
|
||||||
-- Gestione della versione di Beam
|
-- Gestione della versione di Beam
|
||||||
|
|
||||||
NAME = 'Beam'
|
NAME = 'Beam'
|
||||||
VERSION = '2.5i1'
|
VERSION = '2.5j1'
|
||||||
MIN_EXE = '2.5c1'
|
MIN_EXE = '2.5c1'
|
||||||
|
|||||||
Reference in New Issue
Block a user