DataBeam :
- scorporato in Beam e BeamWall.
@@ -3,13 +3,6 @@ BtlEnable=1
|
|||||||
BaseDir=C:\EgtData\Beam
|
BaseDir=C:\EgtData\Beam
|
||||||
BtlExec=BatchProcess.lua
|
BtlExec=BatchProcess.lua
|
||||||
Button1=Process.lua,Images\Process.png,Lavora Travi
|
Button1=Process.lua,Images\Process.png,Lavora Travi
|
||||||
Button2=ClearProcess.lua,Images\ClearProcess.png,Cancella Lavorazione Trave
|
Button2=Swap.lua,Images\Swap.png,Scambia estremi trave
|
||||||
Button3=Swap.lua,Images\Swap.png,Scambia estremi trave
|
Button3=Rotate.lua,Images\Rotate.png,Ruota trave
|
||||||
Button4=Rotate.lua,Images\Rotate.png,Ruota trave
|
Button4=BeamMachinings,Images\BeamMachinings.png,Lista lavorazioni
|
||||||
Button5=DisableFeatures.lua,Images\DisableFeatures.png,Disabilita lavorazioni
|
|
||||||
Button6=EnableFeatures.lua,Images\EnableFeatures.png,Abilita lavorazioni
|
|
||||||
Button7=BeamMachinings,Images\BeamMachinings.png,Lista lavorazioni
|
|
||||||
Button8=HideAll.lua,Images\HideAll.png,Nascondi tutte le travi non selezionate
|
|
||||||
Button9=ShowAll.lua,Images\ShowAll.png,Visualizza tutte le travi
|
|
||||||
Button10=ShowSolid.lua,Images\ShowSolid.png,Visualizza/Nascondi solido
|
|
||||||
Button11=ShowBuilding.lua,Images\ShowBuilding.png,Visualizza struttura/Visualizza pezzi
|
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
-- ClearProcess.lua by Egaltech s.r.l. 2020/03/30
|
|
||||||
-- Se la trave non è parte di un gruppo di lavoro, cancello geometrie aggiunte
|
|
||||||
|
|
||||||
-- Intestazioni
|
|
||||||
require( 'EgtBase')
|
|
||||||
_ENV = EgtProtectGlobal()
|
|
||||||
EgtEnableDebug( false)
|
|
||||||
|
|
||||||
-- Recupero la prima trave selezionata
|
|
||||||
local ObjId = EgtGetFirstSelectedObj()
|
|
||||||
local PartId = EgtGetParent( EgtGetParent( ObjId or GDB_ID.NULL) or GDB_ID.NULL)
|
|
||||||
if not PartId then return end
|
|
||||||
|
|
||||||
-- Recupero appartenenza a gruppi di lavoro
|
|
||||||
local vMGrps = {}
|
|
||||||
local sLst = EgtGetInfo( PartId, GDB_SI.LIST)
|
|
||||||
if sLst then
|
|
||||||
vLst = EgtSplitString( sLst)
|
|
||||||
if vLst then
|
|
||||||
for i = 1, #vLst do
|
|
||||||
local MGrpId = EgtGetParent( EgtGetParent( EgtGetParent( vLst[i]) or GDB_ID.NULL) or GDB_ID.NULL)
|
|
||||||
if MGrpId then
|
|
||||||
table.insert( vMGrps, EgtGetName( MGrpId))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Chiedo conferma della cancellazione
|
|
||||||
if #vMGrps > 0 then
|
|
||||||
local sOut = 'I seguenti gruppi di lavoro verranno cancellati :\n ' .. table.concat( vMGrps, ',') .. '.\nConfermi ?'
|
|
||||||
if not EgtOutBox( sOut, 'Cancella Lavorazioni', 'QUESTION') then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Cancello i gruppi di lavoro e le geometrie aggiuntive relative
|
|
||||||
for i = 1, #vMGrps do
|
|
||||||
EgtRemoveMachGroup( EgtGetMachGroupId( vMGrps[i]) or GDB_ID.NULL)
|
|
||||||
EgtErase( EgtGetFirstNameInGroup( PartId, vMGrps[i]) or GDB_ID.NULL)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Cancello eventuali altre geometrie aggiuntive per gruppi di lavoro
|
|
||||||
local LayId = EgtGetFirstLayer( PartId)
|
|
||||||
while LayId do
|
|
||||||
local NextLayId = EgtGetNextLayer( LayId)
|
|
||||||
if EgtGetInfo( LayId, GDB_SI.MGRPONLY) then
|
|
||||||
EgtErase( LayId)
|
|
||||||
end
|
|
||||||
LayId = NextLayId
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Aggiorno interfaccia grafica
|
|
||||||
EgtDeselectPartObjs( PartId)
|
|
||||||
EgtDraw()
|
|
||||||
|
|
||||||
-- end
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
-- DisableFeatures.lua by Egaltech s.r.l. 2019/11/22
|
|
||||||
-- Gestione disabilitazione delle feature selezionate
|
|
||||||
|
|
||||||
-- Intestazioni
|
|
||||||
require( 'EgtBase')
|
|
||||||
_ENV = EgtProtectGlobal()
|
|
||||||
EgtEnableDebug( false)
|
|
||||||
|
|
||||||
if EgtGetSelectedObjCount() == 0 then
|
|
||||||
EgtOutBox( 'Nessuna lavorazione selezionata', 'Disabilita lavorazioni', 'ERROR')
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Elenco dei pezzi interessati
|
|
||||||
local vParts = {}
|
|
||||||
|
|
||||||
-- Disabilito features selezionate
|
|
||||||
local nId = EgtGetFirstSelectedObj()
|
|
||||||
while nId do
|
|
||||||
-- verifico sia una feature
|
|
||||||
local nParentId = EgtGetParent( nId)
|
|
||||||
if EgtIsLayer( nParentId or GDB_ID.NULL) and EgtGetName( nParentId) == 'Processings' and
|
|
||||||
EgtGetInfo( nId, 'GRP', 'i') and EgtGetInfo( nId, 'PRC', 'i') then
|
|
||||||
EgtSetInfo( nId, 'DO', 0)
|
|
||||||
EgtSetColor( nId, Color3d( 160, 160, 160))
|
|
||||||
local nAuxId = EgtGetInfo( nId, 'AUXID', 'i')
|
|
||||||
if nAuxId then
|
|
||||||
EgtSetColor( nId + nAuxId, Color3d( 160, 160, 160))
|
|
||||||
end
|
|
||||||
table.insert( vParts, EgtGetParent( nParentId))
|
|
||||||
end
|
|
||||||
nId = EgtGetNextSelectedObj()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Cancello eventuale solido dei pezzi interessati
|
|
||||||
table.sort( vParts)
|
|
||||||
local PrevPartId = GDB_ID.NULL
|
|
||||||
for i = 1, #vParts do
|
|
||||||
if vParts[i] ~= PrevPartId then
|
|
||||||
local SolidLy = EgtGetFirstNameInGroup( vParts[i], 'Solid')
|
|
||||||
EgtErase( SolidLy or GDB_ID.NULL)
|
|
||||||
PrevPartId = vParts[i]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
EgtDeselectAll()
|
|
||||||
EgtZoom( SCE_ZM.ALL)
|
|
||||||
|
|
||||||
-- end
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
-- DisableFeatures.lua by Egaltech s.r.l. 2019/11/22
|
|
||||||
-- Gestione abilitazione delle feature selezionate
|
|
||||||
|
|
||||||
-- Intestazioni
|
|
||||||
require( 'EgtBase')
|
|
||||||
_ENV = EgtProtectGlobal()
|
|
||||||
EgtEnableDebug( false)
|
|
||||||
|
|
||||||
if EgtGetSelectedObjCount() == 0 then
|
|
||||||
EgtOutBox( 'Nessuna lavorazione selezionata', 'Abilita lavorazioni', 'ERROR')
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Elenco dei pezzi interessati
|
|
||||||
local vParts = {}
|
|
||||||
|
|
||||||
-- Abilito features selezionate
|
|
||||||
local nId = EgtGetFirstSelectedObj()
|
|
||||||
while nId do
|
|
||||||
-- verifico sia una feature
|
|
||||||
local nParentId = EgtGetParent( nId)
|
|
||||||
if EgtIsLayer( nParentId or GDB_ID.NULL) and EgtGetName( nParentId) == 'Processings' and
|
|
||||||
EgtGetInfo( nId, 'GRP', 'i') and EgtGetInfo( nId, 'PRC', 'i') then
|
|
||||||
EgtRemoveInfo( nId, 'DO')
|
|
||||||
EgtResetColor( nId)
|
|
||||||
local nAuxId = EgtGetInfo( nId, 'AUXID', 'i')
|
|
||||||
if nAuxId then
|
|
||||||
EgtResetColor( nId + nAuxId)
|
|
||||||
end
|
|
||||||
table.insert( vParts, EgtGetParent( nParentId))
|
|
||||||
end
|
|
||||||
nId = EgtGetNextSelectedObj()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Cancello eventuale solido dei pezzi interessati
|
|
||||||
table.sort( vParts)
|
|
||||||
local PrevPartId = GDB_ID.NULL
|
|
||||||
for i = 1, #vParts do
|
|
||||||
if vParts[i] ~= PrevPartId then
|
|
||||||
local SolidLy = EgtGetFirstNameInGroup( vParts[i], 'Solid')
|
|
||||||
EgtErase( SolidLy or GDB_ID.NULL)
|
|
||||||
PrevPartId = vParts[i]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
EgtDeselectAll()
|
|
||||||
EgtZoom( SCE_ZM.ALL)
|
|
||||||
|
|
||||||
-- end
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
-- HideAll.lua by Egaltech s.r.l. 2019/03/16
|
|
||||||
-- Gestione nascondimento di tutte le Travi non selezionate
|
|
||||||
|
|
||||||
-- Intestazioni
|
|
||||||
require( 'EgtBase')
|
|
||||||
_ENV = EgtProtectGlobal()
|
|
||||||
EgtEnableDebug( false)
|
|
||||||
|
|
||||||
-- se non ci sono pezzi selezionati, esco
|
|
||||||
if not EgtGetFirstSelectedObj() then return end
|
|
||||||
|
|
||||||
-- nascondo tutti i pezzi non selezionati
|
|
||||||
local bCurrPL = false
|
|
||||||
local nPartId = EgtGetFirstPart()
|
|
||||||
while nPartId do
|
|
||||||
local nStat = GDB_ST.ON
|
|
||||||
local nLayId = EgtGetFirstLayer( nPartId)
|
|
||||||
while nLayId do
|
|
||||||
local nEntId = EgtGetFirstInGroup( nLayId)
|
|
||||||
if nEntId then
|
|
||||||
nStat = EgtGetCalcStatus( nEntId)
|
|
||||||
break
|
|
||||||
else
|
|
||||||
nLayId = EgtGetNextLayer( nLayId)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if nStat ~= GDB_ST.SEL then
|
|
||||||
EgtSetMode( nPartId, GDB_MD.HIDDEN)
|
|
||||||
else
|
|
||||||
EgtDeselectPartObjs( nPartId)
|
|
||||||
if not bCurrPL then
|
|
||||||
bCurrPL = EgtSetCurrPartLayer( nPartId, EgtGetFirstLayer( nPartId))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
nPartId = EgtGetNextPart( nPartId)
|
|
||||||
end
|
|
||||||
|
|
||||||
EgtZoom( SCE_ZM.ALL)
|
|
||||||
|
|
||||||
-- end
|
|
||||||
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 303 B |
|
Before Width: | Height: | Size: 303 B |
|
Before Width: | Height: | Size: 775 B |
|
Before Width: | Height: | Size: 901 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 604 B |
|
Before Width: | Height: | Size: 785 B |
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/03/31
|
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/04/06
|
||||||
-- Gestione calcolo mezzo-legno per Travi
|
-- Gestione calcolo mezzo-legno per Travi
|
||||||
-- 2019/10/08 Agg. gestione OpenPocket.
|
-- 2019/10/08 Agg. gestione OpenPocket.
|
||||||
|
|
||||||
@@ -43,6 +43,7 @@ function ProcessLapJoint.Identify( Proc)
|
|||||||
return ( (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16) or
|
return ( (( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 16) or
|
||||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17) or
|
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 17) or
|
||||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20) or
|
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 20) or
|
||||||
|
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 25) or
|
||||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30) or
|
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30) or
|
||||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32) or
|
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 32) or
|
||||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33) or
|
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 33) or
|
||||||
@@ -83,6 +84,8 @@ local function AssignQValues( Proc)
|
|||||||
sUseRoughToolWithBAxis90 = 'Q04' -- i
|
sUseRoughToolWithBAxis90 = 'Q04' -- i
|
||||||
sUseRoughToolWithBAxis0 = 'Q05' -- i
|
sUseRoughToolWithBAxis0 = 'Q05' -- i
|
||||||
sInsertBoreOnCorner = 'Q06' -- i
|
sInsertBoreOnCorner = 'Q06' -- i
|
||||||
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 25 then
|
||||||
|
sInsertBoreOnCorner = 'Q01' -- i
|
||||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30 then
|
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 30 then
|
||||||
sMakeContourWithSmallTool = 'Q01' -- i
|
sMakeContourWithSmallTool = 'Q01' -- i
|
||||||
sMakeOnlyContourOrFullPocket = 'Q02' -- i
|
sMakeOnlyContourOrFullPocket = 'Q02' -- i
|
||||||
@@ -440,6 +443,7 @@ function ProcessLapJoint.Classify( Proc)
|
|||||||
-- se più di 2 facce
|
-- se più di 2 facce
|
||||||
else
|
else
|
||||||
local bClosedOrthoFaces
|
local bClosedOrthoFaces
|
||||||
|
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.Id, nPartId)
|
||||||
@@ -450,6 +454,46 @@ function ProcessLapJoint.Classify( Proc)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- se è una feature scanalatura (con 5 facce) e non è stata riconosciuta come fessura, eseguo altre verifiche
|
||||||
|
if Proc.Prc == 16 and Proc.Fct == 5 and not bClosedOrthoFaces then
|
||||||
|
-- recupero gruppo per geometria addizionale
|
||||||
|
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||||
|
if not nAddGrpId then
|
||||||
|
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
|
||||||
-- se facce formano un tunnel e sono ortogonali
|
-- se facce formano un tunnel e sono ortogonali
|
||||||
if bClosedOrthoFaces then
|
if bClosedOrthoFaces then
|
||||||
-- ottengo le dimensioni del tunnel
|
-- ottengo le dimensioni del tunnel
|
||||||
@@ -1402,7 +1446,7 @@ local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd,
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dElev, bForceUseBlade, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces)
|
local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dElev, bForceUseBlade, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces, nBottomFace)
|
||||||
local sWarn
|
local sWarn
|
||||||
-- Recupero le facce adiacenti alla principale
|
-- Recupero le facce adiacenti alla principale
|
||||||
local vAdj = EgtSurfTmFacetAdjacencies( Proc.Id, nFacInd)[1]
|
local vAdj = EgtSurfTmFacetAdjacencies( Proc.Id, nFacInd)[1]
|
||||||
@@ -1439,6 +1483,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac,
|
|||||||
-- Determino se estremi aperti o chiusi
|
-- Determino se estremi aperti o chiusi
|
||||||
local bOpenStart = false
|
local bOpenStart = false
|
||||||
local bOpenEnd = false
|
local bOpenEnd = false
|
||||||
|
-- se non ho la faccia di fondo ( che comporta essere una fessura) verifico se ho lati aperti
|
||||||
|
if not nBottomFace then
|
||||||
local vAdj2 = EgtSurfTmFacetAdjacencies( Proc.Id, nFacAdj)[1]
|
local vAdj2 = EgtSurfTmFacetAdjacencies( Proc.Id, nFacAdj)[1]
|
||||||
EgtOutLog( 'Adj2=' .. table.concat( vAdj2, ' ,'), 3)
|
EgtOutLog( 'Adj2=' .. table.concat( vAdj2, ' ,'), 3)
|
||||||
for j = 1, #vAdj2 do
|
for j = 1, #vAdj2 do
|
||||||
@@ -1457,6 +1503,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac,
|
|||||||
bOpenEnd = ( vAdj2[k] < 0)
|
bOpenEnd = ( vAdj2[k] < 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
-- Recupero il massimo affondamento possibile con la lama
|
-- Recupero il massimo affondamento possibile con la lama
|
||||||
local dSawMaxDepth = 0
|
local dSawMaxDepth = 0
|
||||||
local sCutting = ML.FindCutting( 'HeadSide')
|
local sCutting = ML.FindCutting( 'HeadSide')
|
||||||
@@ -1534,10 +1581,9 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac,
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
local bGoFromHead = true
|
local bGoFromHead = true
|
||||||
-- verifico se la lunghezza utensile riesce ad arrivare sul fondo procedo nella modalità precedente
|
-- se la lunghezza utensile non riesce ad arrivare sul fondo assegno la possibilità di lavorare di testa o di fianco
|
||||||
-- altrimenti se feature ha il flag come semitunnel allora provo a lavorarla come le fessure
|
|
||||||
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||||
-- se ho il flag che indica che ha forma di semitunnel lavoro dal fianco
|
-- lavora di testa se è un tunnel, lavora di fianco se non è un tunnel
|
||||||
bGoFromHead = not bOrthoFaces
|
bGoFromHead = not bOrthoFaces
|
||||||
end
|
end
|
||||||
-- se continuo a lavorare di testa
|
-- se continuo a lavorare di testa
|
||||||
@@ -2682,11 +2728,18 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part)
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
-- recupero gruppo per geometria addizionale
|
||||||
|
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||||
|
if not nAddGrpId then
|
||||||
|
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup'
|
||||||
|
EgtOutLog( sErr)
|
||||||
|
return false, sErr
|
||||||
|
end
|
||||||
local bClosedOrthoFaces
|
local bClosedOrthoFaces
|
||||||
local nFacInd, dFacElev, nFacInd2, dFacElev2
|
local nFacInd, dFacElev, nFacInd2, dFacElev2
|
||||||
|
local nBottomFace
|
||||||
-- 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.Id, 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
|
||||||
@@ -2696,13 +2749,43 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part)
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- recupero gruppo per geometria addizionale
|
-- se è una feature scanalatura (con 5 facce) e non è stata riconosciuta come fessura, eseguo altre verifiche
|
||||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
if Proc.Prc == 16 and Proc.Fct == 5 and not bClosedOrthoFaces then
|
||||||
if not nAddGrpId then
|
-- dalla copia della superfice, ciclo eliminando una faccia per volta per verificare se trova fessura
|
||||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup'
|
for i = 1, Proc.Fct do
|
||||||
|
local nNewProc = EgtCopyGlob( Proc.Id, nAddGrpId) or GDB_ID.NULL
|
||||||
|
-- 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 on process ' .. tostring( Proc.Id) .. ' MakeMoreFaces could not find reference face'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
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
|
||||||
-- verifico se sono presenti i parametri Q per la profondità smusso e
|
-- verifico se sono presenti i parametri Q per la profondità smusso e
|
||||||
-- per eseguire in esclusiva solo lo smusso
|
-- per eseguire in esclusiva solo lo smusso
|
||||||
local nChamfer, dDepthCham, sErrCham, bForceUseBlade = EvaluateQParam( Proc, nRawId, false, sDepthChamferMill, sPreemptiveChamfer, sForceUseBlade)
|
local nChamfer, dDepthCham, sErrCham, bForceUseBlade = EvaluateQParam( Proc, nRawId, false, sDepthChamferMill, sPreemptiveChamfer, sForceUseBlade)
|
||||||
@@ -2711,7 +2794,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part)
|
|||||||
if nChamfer < 0 then
|
if nChamfer < 0 then
|
||||||
return false, sErrCham
|
return false, sErrCham
|
||||||
end
|
end
|
||||||
-- se è un tunnel provo a vedere se è possibile lavorarlo di con la svuotatura o con la sega catena
|
-- se è un tunnel provo a vedere se è possibile lavorarlo con la svuotatura o con la sega catena
|
||||||
if bClosedOrthoFaces then
|
if bClosedOrthoFaces then
|
||||||
local bTryWithBlades = true
|
local bTryWithBlades = true
|
||||||
-- lavoro fessura con svuotature (singola o doppia contrapposta)
|
-- lavoro fessura con svuotature (singola o doppia contrapposta)
|
||||||
@@ -3062,7 +3145,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part)
|
|||||||
end
|
end
|
||||||
-- Se la svuotatura precedente non è stata fatta e smusso non è esclusivo, provo con le lame
|
-- Se la svuotatura precedente non è stata fatta e smusso non è esclusivo, provo con le lame
|
||||||
if bTryWithBlades and nChamfer < 2 then
|
if bTryWithBlades and nChamfer < 2 then
|
||||||
bOk, sWarn, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, bForceUseBlade, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces)
|
bOk, sWarn, sStat = MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, rfFac, dH, dV, dFacElev, bForceUseBlade, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFaces, nBottomFace)
|
||||||
if not bOk and sStat == 'MNF' then
|
if not bOk and sStat == 'MNF' then
|
||||||
sPocketing = ML.FindPocketing( sMchFind, dDiam)
|
sPocketing = ML.FindPocketing( sMchFind, dDiam)
|
||||||
if not sPocketing then
|
if not sPocketing then
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
-- ClearAll.lua by Egaltech s.r.l. 2017/11/16
|
|
||||||
-- Gestione visualizzazione di tutte le Travi
|
|
||||||
|
|
||||||
-- Intestazioni
|
|
||||||
require( 'EgtBase')
|
|
||||||
_ENV = EgtProtectGlobal()
|
|
||||||
EgtEnableDebug( false)
|
|
||||||
|
|
||||||
local nId = EgtGetFirstPart()
|
|
||||||
while nId do
|
|
||||||
EgtSetMode( nId, GDB_MD.STD)
|
|
||||||
-- EgtSetStatus( nId, GDB_ST.ON)
|
|
||||||
nId = EgtGetNextPart( nId)
|
|
||||||
end
|
|
||||||
|
|
||||||
EgtZoom( SCE_ZM.ALL)
|
|
||||||
|
|
||||||
-- end
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
-- ShowBuilding.lua by Egaltech s.r.l. 2018/11/21
|
|
||||||
-- Gestione visualizzazione travi come struttura
|
|
||||||
|
|
||||||
-- Intestazioni
|
|
||||||
require( 'EgtBase')
|
|
||||||
_ENV = EgtProtectGlobal()
|
|
||||||
EgtEnableDebug( false)
|
|
||||||
|
|
||||||
-- recupero il gruppo di assemblaggio
|
|
||||||
local AsseBaseId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'AsseBase')
|
|
||||||
if not AsseBaseId then return end
|
|
||||||
|
|
||||||
-- recupero il primo oggetto nel gruppo e verifico se devo assemblare o disassemblare
|
|
||||||
local AsseId = EgtGetFirstInGroup( AsseBaseId)
|
|
||||||
if not AsseId then return end
|
|
||||||
local bMake = ( EgtGetGroupObjs( AsseId) == 0)
|
|
||||||
|
|
||||||
-- ciclo sul gruppo di assemblaggio
|
|
||||||
while AsseId do
|
|
||||||
-- salvo il successivo nel gruppo dell'assemblato
|
|
||||||
local NextId = EgtGetNext( AsseId)
|
|
||||||
-- costruisco l'assemblato
|
|
||||||
if bMake then
|
|
||||||
-- recupero il pezzo sorgente
|
|
||||||
local SouId = EgtGetInfo( AsseId, GDB_SI.SOURCE, 'i')
|
|
||||||
if SouId then
|
|
||||||
EgtSetMode( SouId, GDB_MD.STD)
|
|
||||||
EgtSetStatus( SouId, GDB_ST.ON)
|
|
||||||
-- se già utilizzato, ne faccio una copia
|
|
||||||
if not EgtIsPart( SouId) then
|
|
||||||
local CopyId = EgtCopy( SouId, GDB_ID.ROOT)
|
|
||||||
if CopyId then
|
|
||||||
EgtRemoveInfo( CopyId, GDB_SI.BASE)
|
|
||||||
EgtRemoveInfo( CopyId, GDB_SI.LIST)
|
|
||||||
EgtSetInfo( CopyId, GDB_SI.COPY, SouId)
|
|
||||||
SouId = CopyId
|
|
||||||
EgtSetInfo( AsseId, GDB_SI.SOURCE, SouId)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
EgtSetStatus( EgtGetFirstNameInGroup( SouId, 'Box') or GDB_ID.NULL, GDB_ST.OFF)
|
|
||||||
EgtGroupSwap( SouId, AsseId, true, true)
|
|
||||||
end
|
|
||||||
-- ritorno ai pezzi
|
|
||||||
else
|
|
||||||
local BasId = EgtGetInfo( AsseId, GDB_SI.BASE, 'i')
|
|
||||||
if BasId then
|
|
||||||
EgtGroupSwap( AsseId, BasId, true, true)
|
|
||||||
local CopId = EgtGetInfo( AsseId, GDB_SI.COPY, 'i')
|
|
||||||
if CopId then
|
|
||||||
EgtErase( AsseId)
|
|
||||||
EgtSetInfo( BasId, GDB_SI.SOURCE, CopId)
|
|
||||||
else
|
|
||||||
EgtSetStatus( EgtGetFirstNameInGroup( AsseId, 'Box') or GDB_ID.NULL, GDB_ST.ON)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- passo al successivo
|
|
||||||
AsseId = NextId
|
|
||||||
end
|
|
||||||
|
|
||||||
EgtZoom( SCE_ZM.ALL)
|
|
||||||
|
|
||||||
-- end
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
-- ShowSolid.lua by Egaltech s.r.l. 2020/01/03
|
|
||||||
-- Gestione calcolo solido di una Trave
|
|
||||||
|
|
||||||
require( 'EgtBase')
|
|
||||||
_ENV = EgtProtectGlobal()
|
|
||||||
EgtEnableDebug( false)
|
|
||||||
|
|
||||||
-- Funzione per visualizzazione del solido o standard
|
|
||||||
local function Show( PartId, bSolid)
|
|
||||||
local BoxLy = EgtGetFirstNameInGroup( PartId, 'Box')
|
|
||||||
EgtSetStatus( BoxLy or GDB_ID.NULL, EgtIf( bSolid, GDB_ST.OFF, GDB_ST.ON))
|
|
||||||
local OutlineLy = EgtGetFirstNameInGroup( PartId, 'Outline')
|
|
||||||
EgtSetStatus( OutlineLy or GDB_ID.NULL, EgtIf( bSolid, GDB_ST.OFF, GDB_ST.ON))
|
|
||||||
local ProcessingsLy = EgtGetFirstNameInGroup( PartId, 'Processings')
|
|
||||||
EgtSetStatus( ProcessingsLy or GDB_ID.NULL, EgtIf( bSolid, GDB_ST.OFF, GDB_ST.ON))
|
|
||||||
local SolidLy = EgtGetFirstNameInGroup( PartId, 'Solid')
|
|
||||||
EgtSetStatus( SolidLy or GDB_ID.NULL, EgtIf( bSolid, GDB_ST.ON, GDB_ST.OFF))
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Funzione per regolarizzare, se necessario, la superficie della feature
|
|
||||||
local function RegularizeTriMesh( SurfId, DestGrpId, dStep)
|
|
||||||
-- solo per superfici trimesh con poche facce (max4)
|
|
||||||
local nFacetCnt = EgtSurfTmFacetCount( SurfId)
|
|
||||||
if nFacetCnt > 4 then
|
|
||||||
return SurfId
|
|
||||||
end
|
|
||||||
-- box della superficie
|
|
||||||
local b3Surf = EgtGetBBox( SurfId, GDB_BB.STANDARD)
|
|
||||||
if not b3Surf or b3Surf:isEmpty() or b3Surf:getDimX() < 2 * dStep then
|
|
||||||
return SurfId
|
|
||||||
end
|
|
||||||
-- recupero le facce e le divido in X
|
|
||||||
local dXmin = b3Surf:getMin():getX() - 1
|
|
||||||
local dXmax = b3Surf:getMax():getX() + 1
|
|
||||||
local nStep = floor( ( dXmax - dXmin) / dStep + 0.9)
|
|
||||||
dStep = ( dXmax - dXmin) / nStep
|
|
||||||
local NewSurfId
|
|
||||||
for nF = 0, nFacetCnt - 1 do
|
|
||||||
local FacId = EgtCopySurfTmFacet( SurfId, nF, DestGrpId)
|
|
||||||
local b3Fac = EgtGetBBox( FacId, GDB_BB.STANDARD)
|
|
||||||
local dX2 = dXmin
|
|
||||||
for nI = 1, nStep do
|
|
||||||
local dX1 = dX2
|
|
||||||
dX2 = dX2 + dStep
|
|
||||||
if b3Fac:getMin():getX() < dX2 and b3Fac:getMax():getX() > dX1 then
|
|
||||||
EgtCutSurfTmPlane( FacId, Point3d( dX1, 0, 0), -X_AX(), true)
|
|
||||||
EgtCutSurfTmPlane( FacId, Point3d( dX2, 0, 0), X_AX(), false)
|
|
||||||
local LoopId = EgtExtractSurfTmFacetLoops( FacId, 0, DestGrpId)
|
|
||||||
EgtMergeCurvesInCurveCompo( LoopId, 0.001)
|
|
||||||
local TmpSurfId = EgtSurfTmByFlatContour( DestGrpId, LoopId, 0.01)
|
|
||||||
EgtErase( LoopId)
|
|
||||||
if NewSurfId then
|
|
||||||
NewSurfId = EgtSurfTmBySewing( DestGrpId, {NewSurfId, TmpSurfId})
|
|
||||||
else
|
|
||||||
NewSurfId = TmpSurfId
|
|
||||||
end
|
|
||||||
EgtErase( FacId)
|
|
||||||
FacId = EgtCopySurfTmFacet( SurfId, nF, DestGrpId)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
EgtErase( FacId)
|
|
||||||
end
|
|
||||||
return NewSurfId
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Recupero il pezzo del primo oggetto selezionato
|
|
||||||
local ObjId = EgtGetFirstSelectedObj()
|
|
||||||
local PartId = EgtGetParent( EgtGetParent( ObjId or GDB_ID.NULL) or GDB_ID.NULL)
|
|
||||||
if not PartId or not EgtIsPart( PartId) then
|
|
||||||
EgtOutBox( 'Nessuna trave selezionata', 'Show Solid', 'ERROR')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
EgtDeselectAll()
|
|
||||||
|
|
||||||
-- Recupero il Box
|
|
||||||
local BoxLy = EgtGetFirstNameInGroup( PartId, 'Box')
|
|
||||||
local BoxId = EgtGetFirstNameInGroup( BoxLy or GDB_ID.NULL, 'Box')
|
|
||||||
if not BoxId then
|
|
||||||
EgtOutBox( 'Trave senza Box', 'Show Solid', 'ERROR')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Verifico esistenza del solido
|
|
||||||
local SolidLy = EgtGetFirstNameInGroup( PartId, 'Solid')
|
|
||||||
if not SolidLy then
|
|
||||||
SolidLy = EgtGroup( PartId)
|
|
||||||
EgtSetName( SolidLy, 'Solid')
|
|
||||||
end
|
|
||||||
local SolidId = EgtGetFirstNameInGroup( SolidLy, 'Solid')
|
|
||||||
if not SolidId then
|
|
||||||
SolidId = EgtSurfTmBBox( SolidLy, EgtGetBBoxGlob( BoxId, GDB_BB.STANDARD), true, GDB_RT.GLOB)
|
|
||||||
EgtSetName( SolidId, 'Solid')
|
|
||||||
EgtSetColor( SolidId, Color3d( 228, 196, 64))
|
|
||||||
Show( PartId, true)
|
|
||||||
else
|
|
||||||
Show( PartId, ( EgtGetStatus( SolidLy) == GDB_ST.OFF))
|
|
||||||
EgtDraw()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local b3Solid = EgtGetBBox( SolidId, GDB_BB.STANDARD)
|
|
||||||
local dStep = 1.23 * min( max( b3Solid:getDimY(), b3Solid:getDimZ()), 2 * min( b3Solid:getDimY(), b3Solid:getDimZ()))
|
|
||||||
|
|
||||||
-- Ciclo sulle features
|
|
||||||
local ProcLy = EgtGetFirstNameInGroup( PartId, 'Processings')
|
|
||||||
local ProcId = EgtGetFirstInGroup( ProcLy)
|
|
||||||
while ProcId do
|
|
||||||
if EgtGetInfo( ProcId, 'DO', 'i') ~= 0 and EgtGetInfo( ProcId, 'TRIM', 'i') ~= 0 and EgtGetType( ProcId) == GDB_TY.SRF_MESH then
|
|
||||||
local NewSurfId = RegularizeTriMesh( ProcId, SolidLy, dStep)
|
|
||||||
EgtSurfTmIntersect( SolidId, NewSurfId)
|
|
||||||
if NewSurfId ~= ProcId then
|
|
||||||
EgtErase( NewSurfId)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
ProcId = EgtGetNext( ProcId)
|
|
||||||
end
|
|
||||||
|
|
||||||
EgtDraw()
|
|
||||||