Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 624a188481 | |||
| d3c2787f81 | |||
| 93b4adfdec | |||
| 1d672af81e | |||
| 8a79a7838e | |||
| 172fc5180a | |||
| 6064a19a2c | |||
| 5cc85a8735 | |||
| 7af9a9affb | |||
| e26a42dfd9 |
+3
-2
@@ -2,8 +2,9 @@ variables:
|
|||||||
VERS_MAIN: '1.0'
|
VERS_MAIN: '1.0'
|
||||||
APP_NAME: 'Beam'
|
APP_NAME: 'Beam'
|
||||||
NEW_REL: ''
|
NEW_REL: ''
|
||||||
NET_SHARE_R: '\\10.74.82.201\EgwTech'
|
NET_SHARE_R: '\\10.74.82.201\Artifacts\EGT_SRV\EgtTech'
|
||||||
NET_SHARE_Z: '\\10.74.82.201\Artifacts'
|
NET_USER: '10.74.82.50\Server'
|
||||||
|
NET_SHARE_Z: '\\10.74.82.200\Artifacts'
|
||||||
NET_USERQ: 'steamw\egalware'
|
NET_USERQ: 'steamw\egalware'
|
||||||
|
|
||||||
#Note compilazione LUA:
|
#Note compilazione LUA:
|
||||||
|
|||||||
+1
-1
@@ -41,4 +41,4 @@ GWD.OVM_MID = BD.OVM_MID
|
|||||||
-- Tutto ok
|
-- Tutto ok
|
||||||
GWD.ERR = 0
|
GWD.ERR = 0
|
||||||
|
|
||||||
EgtOutLog( ' +++ GetBeamData completed')
|
EgtOutLog( ' +++ GetWallData completed')
|
||||||
|
|||||||
+3
-26
@@ -1,4 +1,4 @@
|
|||||||
-- BeamExec.lua by Egaltech s.r.l. 2022/09/28
|
-- BeamExec.lua by Egaltech s.r.l. 2022/08/18
|
||||||
-- Libreria esecuzione lavorazioni per Travi
|
-- Libreria esecuzione lavorazioni per Travi
|
||||||
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
|
-- 2019/07/11 Aggiunta gestione stato rotazione di feature per TS3.
|
||||||
-- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
|
-- 2019/09/04 Corretto controllo feature di testa e coda con sovramateriale di testa elevato.
|
||||||
@@ -35,8 +35,6 @@
|
|||||||
-- 2022/08/01 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL).
|
-- 2022/08/01 Tolleranza su sezione portata a 0.1 mm (100 * GEO.EPS_SMALL).
|
||||||
-- 2022/08/08 Modifica per macchine senza BD.MAX_WIDTH2 e BD.MAX_HEIGHT2.
|
-- 2022/08/08 Modifica per macchine senza BD.MAX_WIDTH2 e BD.MAX_HEIGHT2.
|
||||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
||||||
-- 2022/09/21 Nella funzione di ordinamento il foro del birdsmouth viene sempre fatto prima della lavorazione stessa
|
|
||||||
-- 2022/09/28 I fori vengono sempre fatti prima delle tacche.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local BeamExec = {}
|
local BeamExec = {}
|
||||||
@@ -260,9 +258,6 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
local nDo = EgtGetInfo( ProcId, 'DO', 'i') or 1
|
local nDo = EgtGetInfo( ProcId, 'DO', 'i') or 1
|
||||||
local nCutId = EgtGetInfo( EgtGetParent( EgtGetParent( ProcId)), 'CUTID', 'i') or 0
|
local nCutId = EgtGetInfo( EgtGetParent( EgtGetParent( ProcId)), 'CUTID', 'i') or 0
|
||||||
local nTaskId = EgtGetInfo( ProcId, 'TASKID', 'i') or 0
|
local nTaskId = EgtGetInfo( ProcId, 'TASKID', 'i') or 0
|
||||||
-- leggo se ci sono feature collegate
|
|
||||||
local nAddAdjId = EgtGetInfo( ProcId, 'ADJID', '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.Id = ProcId
|
Proc.Id = ProcId
|
||||||
@@ -275,12 +270,6 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
Proc.Fce = 0
|
Proc.Fce = 0
|
||||||
Proc.CutId = nCutId
|
Proc.CutId = nCutId
|
||||||
Proc.TaskId = nTaskId
|
Proc.TaskId = nTaskId
|
||||||
-- se ci sono feature collegate ne scrivo il riferimento nella Proc
|
|
||||||
if nAddAdjId then
|
|
||||||
Proc.AdjId = Proc.Id + nAddAdjId
|
|
||||||
elseif nAddMainId then
|
|
||||||
Proc.MainId = Proc.Id + nAddMainId
|
|
||||||
end
|
|
||||||
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
|
Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD)
|
||||||
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)
|
||||||
@@ -322,8 +311,6 @@ local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT)
|
|||||||
Proc2.Fce = Proc.Fcs
|
Proc2.Fce = Proc.Fcs
|
||||||
Proc2.CutId = Proc.CutId
|
Proc2.CutId = Proc.CutId
|
||||||
Proc2.TaskId = Proc.TaskId
|
Proc2.TaskId = Proc.TaskId
|
||||||
Proc2.AdjId = Proc.AdjId
|
|
||||||
Proc2.MainId = Proc.MainId
|
|
||||||
table.insert( vProc, Proc2)
|
table.insert( vProc, Proc2)
|
||||||
end
|
end
|
||||||
-- se BlockHaus HalfLap
|
-- se BlockHaus HalfLap
|
||||||
@@ -654,7 +641,7 @@ end
|
|||||||
local function OrderFeatures( vProc, b3Raw)
|
local function OrderFeatures( vProc, b3Raw)
|
||||||
|
|
||||||
local dDrillPenalty = EgtIf( BD.PRESS_ROLLER, 200, 100)
|
local dDrillPenalty = EgtIf( BD.PRESS_ROLLER, 200, 100)
|
||||||
local dSmallDrillRange = EgtIf( b3Raw:getDimX() < BD.LEN_SHORT_PART, BD.DRILL_RANGE_SP or 200, BD.DRILL_RANGE or 600)
|
local dSmallDrillRange = EgtIf( b3Raw:getDimX() < BD.LEN_SHORT_PART, 200, 600)
|
||||||
|
|
||||||
-- funzione di confronto
|
-- funzione di confronto
|
||||||
-- secondo centro box in X (taglio di intestazione prima di altri tagli di testa e taglio di separazione però prima di altri tagli di coda)
|
-- secondo centro box in X (taglio di intestazione prima di altri tagli di testa e taglio di separazione però prima di altri tagli di coda)
|
||||||
@@ -683,16 +670,6 @@ local function OrderFeatures( vProc, b3Raw)
|
|||||||
if B1.Head ~= B2.Head then
|
if B1.Head ~= B2.Head then
|
||||||
return B1.Head
|
return B1.Head
|
||||||
end
|
end
|
||||||
-- se primo è foro e secondo è un ribasso, il foro va sempre prima
|
|
||||||
if Drill.Identify(B1) and LapJoint.Identify(B2) and
|
|
||||||
B1.Box:getCenter():getX() > B2.Box:getMin():getX() and B1.Box:getCenter():getX() < B2.Box:getMax():getX() then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
-- se primo è un ribasso e secondo è un foro, il ribasso va sempre dopo
|
|
||||||
if LapJoint.Identify(B1) and Drill.Identify(B2) and
|
|
||||||
B2.Box:getCenter():getX() > B1.Box:getMin():getX() and B2.Box:getCenter():getX() < B1.Box:getMax():getX() then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
-- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone
|
-- se entrambi tenoni e si intersecano, metto prima tenone vero e poi base tenone
|
||||||
if ( Tenon.Identify( B1) or DtTenon.Identify( B1)) and ( Tenon.Identify( B2) or DtTenon.Identify( B2)) and
|
if ( Tenon.Identify( B1) or DtTenon.Identify( B1)) and ( Tenon.Identify( B2) or DtTenon.Identify( B2)) and
|
||||||
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
|
B1.Box:getMin():getX() < B2.Box:getMax():getX() + 100 * GEO.EPS_SMALL and B2.Box:getMin():getX() < B1.Box:getMax():getX() + 100 * GEO.EPS_SMALL then
|
||||||
@@ -1261,7 +1238,7 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, bN
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
bOk = false
|
bOk = false
|
||||||
end
|
end
|
||||||
return bOk, sErr, ( nNewPhase or -1)
|
return bOk, sErr, nNewPhase
|
||||||
end
|
end
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
+2
-237
@@ -16,7 +16,6 @@
|
|||||||
-- 2022/07/12 A GetFaceHvRefDim aggiunta possibilità di confronto e limitazione dimensioni con grezzo/pezzo (conta solo la sezione).
|
-- 2022/07/12 A GetFaceHvRefDim aggiunta possibilità di confronto e limitazione dimensioni con grezzo/pezzo (conta solo la sezione).
|
||||||
-- 2022/07/26 Aggiunta la funzione FindFaceBestOrientedAsAxis, precedentemente in ProcessLapJoint
|
-- 2022/07/26 Aggiunta la funzione FindFaceBestOrientedAsAxis, precedentemente in ProcessLapJoint
|
||||||
-- 2022/07/26 Alla funzione FindFaceBestOrientedAsAxis aggiunta la possibilità di escludere una faccia dalla ricerca
|
-- 2022/07/26 Alla funzione FindFaceBestOrientedAsAxis aggiunta la possibilità di escludere una faccia dalla ricerca
|
||||||
-- 2022/09/01 Aggiunte le funzioni GetTunnelDimension, CalcCollisionSafety, SetOpenSide, precedentemente in ProcessLapJoint.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local BeamLib = {}
|
local BeamLib = {}
|
||||||
@@ -308,7 +307,7 @@ function BeamLib.GetNearestOrthoOpposite( vtRef, vtNorm)
|
|||||||
vtMyRef:normalize()
|
vtMyRef:normalize()
|
||||||
end
|
end
|
||||||
-- se prevalente una componente orizzontale (con piccolissimo vantaggio)
|
-- se prevalente una componente orizzontale (con piccolissimo vantaggio)
|
||||||
if abs( vtMyRef:getX()) > 0.91 * abs( vtMyRef:getZ()) or abs( vtMyRef:getY()) > 0.91 * abs( vtMyRef:getZ()) then
|
if abs( vtMyRef:getX()) > 0.95 * abs( vtMyRef:getZ()) or abs( vtMyRef:getY()) > 0.95 * abs( vtMyRef:getZ()) then
|
||||||
-- se prevale la componente destra/sinistra
|
-- se prevale la componente destra/sinistra
|
||||||
if abs( vtMyRef:getX()) > 0.95 * abs( vtMyRef:getY()) then
|
if abs( vtMyRef:getX()) > 0.95 * abs( vtMyRef:getY()) then
|
||||||
if vtMyRef:getX() > -GEO.EPS_SMALL then
|
if vtMyRef:getX() > -GEO.EPS_SMALL then
|
||||||
@@ -703,10 +702,8 @@ end
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
|
function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho)
|
||||||
if BD.C_SIMM then
|
if BD.C_SIMM or BD.TURN then
|
||||||
return -0.484
|
return -0.484
|
||||||
elseif BD.TURN then
|
|
||||||
return -2
|
|
||||||
else
|
else
|
||||||
if vtOrtho and vtOrtho:getZ() > 0.35 then
|
if vtOrtho and vtOrtho:getZ() > 0.35 then
|
||||||
-- N_HorAng < 15° or N_HorAng > 55°
|
-- N_HorAng < 15° or N_HorAng > 55°
|
||||||
@@ -817,237 +814,5 @@ function BeamLib.FindFaceBestOrientedAsAxis( Proc, vtAx, fctExclude)
|
|||||||
return nFaceIndMax, ptC, vtN
|
return nFaceIndMax, ptC, vtN
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
function BeamLib.GetTunnelDimension( Proc, nPartId)
|
|
||||||
-- sono necessarie almeno due facce
|
|
||||||
if Proc.Fct < 2 then return 0, 0, 0 end
|
|
||||||
-- recupero l'ingombro della trave
|
|
||||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
|
||||||
-- recupero centro e normale delle facce
|
|
||||||
local ptC = {}
|
|
||||||
local vtN = {}
|
|
||||||
for i = 1, Proc.Fct do
|
|
||||||
ptC[i], vtN[i] = EgtSurfTmFacetCenter( 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
|
|
||||||
return 0, 0, 0
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- ottengo il boundingBox e prendo le dimensioni lungo la direzione (Z locale) che rappresenta la profondità della fessura
|
|
||||||
local frFc = Frame3d( ptC[1], vtOrtho) ;
|
|
||||||
local b3BoxLoc = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frFc)
|
|
||||||
local dDepth = b3BoxLoc:getDimZ()
|
|
||||||
-- recupero gruppo per geometria addizionale
|
|
||||||
local nAddGrpId = BeamLib.GetAddGroup( nPartId)
|
|
||||||
if not nAddGrpId then
|
|
||||||
EgtOutLog( 'Error : missing AddGroup')
|
|
||||||
return 0, 0, 0
|
|
||||||
end
|
|
||||||
-- centro del bounding box locale
|
|
||||||
local ptCen = b3BoxLoc:getCenter()
|
|
||||||
ptCen:toGlob( frFc)
|
|
||||||
-- creo superficie intermedia
|
|
||||||
local nSurfInt = EgtSurfTmPlaneInBBox( nAddGrpId, ptCen, vtOrtho, b3Solid, GDB_ID.ROOT)
|
|
||||||
if not nSurfInt then return 0, 0, 0 end
|
|
||||||
-- ritaglio la superficie con le facce della fessura
|
|
||||||
for i = 1, Proc.Fct do
|
|
||||||
EgtCutSurfTmPlane( nSurfInt, ptC[i], -vtN[i], false, GDB_ID.ROOT)
|
|
||||||
end
|
|
||||||
local frSurfInt, dDimMax, dDimMin = EgtSurfTmFacetMinAreaRectangle( nSurfInt, 0, GDB_ID.ROOT)
|
|
||||||
-- cerco la faccia con larghezza pari a dimensione massima della fessura
|
|
||||||
local nLongIdFace = 0
|
|
||||||
for i = 1, Proc.Fct do
|
|
||||||
if abs( vtN[i] * frSurfInt:getVersX()) < 0.5 then
|
|
||||||
nLongIdFace = i - 1
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return dDimMin, dDimMax, dDepth, vtOrtho, nLongIdFace, nSurfInt
|
|
||||||
end
|
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
function BeamLib.CalcCollisionSafety( vtDir)
|
|
||||||
local dCollSic = 10 * BD.COLL_SIC
|
|
||||||
if abs( vtDir:getX()) > 0.999 or abs( vtDir:getY()) > 0.999 or abs( vtDir:getZ()) > 0.999 then
|
|
||||||
dCollSic = 0
|
|
||||||
elseif abs( vtDir:getX()) > 0.996 or abs( vtDir:getY()) > 0.996 or abs( vtDir:getZ()) > 0.996 then
|
|
||||||
dCollSic = 1 * BD.COLL_SIC
|
|
||||||
elseif abs( vtDir:getX()) > 0.89 or abs( vtDir:getY()) > 0.89 or abs( vtDir:getZ()) > 0.89 then
|
|
||||||
dCollSic = 2.5 * BD.COLL_SIC
|
|
||||||
elseif abs( vtDir:getX()) > 0.86 or abs( vtDir:getY()) > 0.86 or abs( vtDir:getZ()) > 0.86 then
|
|
||||||
dCollSic = 4 * BD.COLL_SIC
|
|
||||||
elseif abs( vtDir:getX()) > 0.707 or abs( vtDir:getY()) > 0.707 or abs( vtDir:getZ()) > 0.707 then
|
|
||||||
dCollSic = 5.5 * BD.COLL_SIC
|
|
||||||
end
|
|
||||||
return dCollSic
|
|
||||||
end
|
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
function BeamLib.SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId, nStartPoint)
|
|
||||||
|
|
||||||
-- fondo tra loro le curve compatibili
|
|
||||||
EgtMergeCurvesInCurveCompo( nPathInt)
|
|
||||||
local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt)
|
|
||||||
local pLastPIni, pLastPEnd
|
|
||||||
|
|
||||||
-- faccio una copia della curva e la esplodo
|
|
||||||
if nStartIdEnt then
|
|
||||||
-- prendo i punti
|
|
||||||
for i = 1, nNumEnt do
|
|
||||||
local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB)
|
|
||||||
local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB)
|
|
||||||
-- Se normale lungo la Z considero il box in X e Y
|
|
||||||
if abs(vtOrtho:getZ()) > 0.999 then
|
|
||||||
-- se corrisponde a X
|
|
||||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
|
||||||
-- setto l'entità open
|
|
||||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
|
||||||
if #sActInfo > 0 then
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
|
||||||
else
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
|
||||||
end
|
|
||||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
|
||||||
pLastPIni = pPini
|
|
||||||
pLastPEnd = pPend
|
|
||||||
-- altrimenti se corrisponde a Y
|
|
||||||
elseif ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
|
||||||
-- setto l'entità open
|
|
||||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
|
||||||
if #sActInfo > 0 then
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
|
||||||
else
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
|
||||||
end
|
|
||||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
|
||||||
pLastPIni = pPini
|
|
||||||
pLastPEnd = pPend
|
|
||||||
end
|
|
||||||
-- altrimenti se normale lungo la Y considero il box in X e Z
|
|
||||||
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getY()) > 0.999 then
|
|
||||||
-- se corrisponde a X
|
|
||||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
|
||||||
-- setto l'entità open
|
|
||||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
|
||||||
if #sActInfo > 0 then
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
|
||||||
else
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
|
||||||
end
|
|
||||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
|
||||||
pLastPIni = pPini
|
|
||||||
pLastPEnd = pPend
|
|
||||||
-- altrimenti se corrisponde a Z
|
|
||||||
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
|
||||||
-- setto l'entità open
|
|
||||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
|
||||||
if #sActInfo > 0 then
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
|
||||||
else
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
|
||||||
end
|
|
||||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
|
||||||
pLastPIni = pPini
|
|
||||||
pLastPEnd = pPend
|
|
||||||
end
|
|
||||||
-- caso che non dovrebbe mai capitare ma gestito per completezza
|
|
||||||
-- altrimenti se normale lungo la X considero il box in Y e Z
|
|
||||||
elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getX()) > 0.999 then
|
|
||||||
-- se corrisponde a Y
|
|
||||||
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
|
||||||
-- setto l'entità open
|
|
||||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
|
||||||
if #sActInfo > 0 then
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
|
||||||
else
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
|
||||||
end
|
|
||||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
|
||||||
pLastPIni = pPini
|
|
||||||
pLastPEnd = pPend
|
|
||||||
-- altrimenti se corrisponde a Z
|
|
||||||
elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
|
||||||
-- setto l'entità open
|
|
||||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
|
||||||
if #sActInfo > 0 then
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
|
||||||
else
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
|
||||||
end
|
|
||||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
|
||||||
pLastPIni = pPini
|
|
||||||
pLastPEnd = pPend
|
|
||||||
end
|
|
||||||
-- se asse Z orizzontale verifico se si avvicina piú a Y
|
|
||||||
elseif abs(vtOrtho:getZ()) < 0.001 then
|
|
||||||
if abs(vtOrtho:getY()) > 0.75 then
|
|
||||||
-- se corrisponde a Z
|
|
||||||
if ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
|
||||||
-- setto l'entità open
|
|
||||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
|
||||||
if #sActInfo > 0 then
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
|
||||||
else
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
|
||||||
end
|
|
||||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
|
||||||
pLastPIni = pPini
|
|
||||||
pLastPEnd = pPend
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se asse Y a 0 (fresa ne davanti ne dietro) verifico se si avvicina piú a Z+
|
|
||||||
elseif abs(vtOrtho:getY()) < 0.001 then
|
|
||||||
if abs(vtOrtho:getZ()) > 0.75 then
|
|
||||||
-- se corrisponde a Y
|
|
||||||
if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
|
||||||
-- setto l'entità open
|
|
||||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
|
||||||
if #sActInfo > 0 then
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
|
||||||
else
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
|
||||||
end
|
|
||||||
-- prendo i punti per eventuale modifica del punto di inizio percorso
|
|
||||||
pLastPIni = pPini
|
|
||||||
pLastPEnd = pPend
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se devo cambiare il punto di partenza
|
|
||||||
if nStartPoint then
|
|
||||||
if pLastPIni and pLastPEnd then
|
|
||||||
-- calcolo il punto medio con gli ultimi punti utilizzati
|
|
||||||
local ptPs = ( pLastPIni + pLastPEnd) / 2
|
|
||||||
EgtChangeClosedCurveStartPoint( nPathInt, ptPs, GDB_RT.GLOB)
|
|
||||||
-- se devo eliminare la parte open
|
|
||||||
if nStartPoint == 2 then
|
|
||||||
EgtRemoveCurveCompoCurve( nPathInt, true)
|
|
||||||
EgtRemoveCurveCompoCurve( nPathInt, false)
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
return BeamLib
|
return BeamLib
|
||||||
|
|||||||
+2
-9
@@ -377,13 +377,12 @@ end
|
|||||||
-- ptCBond*: il punto centrale della superfice limitante (se non esistono altre superfici può essere omesso)
|
-- ptCBond*: il punto centrale della superfice limitante (se non esistono altre superfici può essere omesso)
|
||||||
-- vtNBond*: il versore normale della superfice limitante (se non esistono altre superfici può essere omesso)
|
-- vtNBond*: il versore normale della superfice limitante (se non esistono altre superfici può essere omesso)
|
||||||
-- dOrthoMaxDim : massima profondità taglio se faccia singola perpendicolare facce laterali trave
|
-- dOrthoMaxDim : massima profondità taglio se faccia singola perpendicolare facce laterali trave
|
||||||
-- dCustMaxDimDice: dimensione massima customizzata, sostituisce il parametro BD.MAX_DIM_DICE (se negativa qualunque, se positiva deve stare nel MAX)
|
-- dCustMaxDimDice: dimensione massima customizzata, sostituisce il parametro BD.MAX_DIM_DICE
|
||||||
-- bDownHead : taglio con testa da sotto
|
-- bDownHead : taglio con testa da sotto
|
||||||
----------------------------------------------------------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPlanes, ptCBond, vtNBond, dOrthoMaxDim, dCustMaxDimDice, bDownHead)
|
function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPlanes, ptCBond, vtNBond, dOrthoMaxDim, dCustMaxDimDice, bDownHead)
|
||||||
|
|
||||||
local dMaxDimDice = BD.MAX_DIM_DICE
|
local dMaxDimDice = EgtIf( dCustMaxDimDice and dCustMaxDimDice < BD.MAX_DIM_DICE, dCustMaxDimDice, BD.MAX_DIM_DICE)
|
||||||
if dCustMaxDimDice and dCustMaxDimDice < BD.MAX_DIM_DICE then dMaxDimDice = abs( dCustMaxDimDice) end
|
|
||||||
local dTolerance = 0 -- distanza di sicurezza per i tagli ortogonali
|
local dTolerance = 0 -- distanza di sicurezza per i tagli ortogonali
|
||||||
local OffsetP = dMaxDimDice -- distanza tra i piani paralleli
|
local OffsetP = dMaxDimDice -- distanza tra i piani paralleli
|
||||||
local StepP = 100 -- numero massimo di piani paralleli da generare
|
local StepP = 100 -- numero massimo di piani paralleli da generare
|
||||||
@@ -497,12 +496,6 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
|
|||||||
if bDownHead and vtO:getZ() > 0.05 then
|
if bDownHead and vtO:getZ() > 0.05 then
|
||||||
vtO = -vtO
|
vtO = -vtO
|
||||||
end
|
end
|
||||||
-- per macchina TURN
|
|
||||||
if BD.TURN then
|
|
||||||
if vtO:getY() > 0.707 then
|
|
||||||
vtO = -vtO
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- calcolo le dimensioni dell'offset e dove posizionare la prima faccia:
|
-- calcolo le dimensioni dell'offset e dove posizionare la prima faccia:
|
||||||
-- CopyPlane: 0 => crea la prima faccia direttamente sul punto passato
|
-- CopyPlane: 0 => crea la prima faccia direttamente sul punto passato
|
||||||
-- CopyPlane: 1 => crea la prima faccia e tutte le altre con l'offset passato
|
-- CopyPlane: 1 => crea la prima faccia e tutte le altre con l'offset passato
|
||||||
|
|||||||
+45
-59
@@ -1,4 +1,4 @@
|
|||||||
-- FacesBySaw.lua by Egaltech s.r.l. 2022/09/24
|
-- FacesBySaw.lua by Egaltech s.r.l. 2022/06/29
|
||||||
-- 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.
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
-- 2021/11/26 DS Spostate qui MakeOneFaceBySaw (ora MakeOne), CalcLeadInOutPerpGeom e CalcLeadInOutTangGeom.
|
-- 2021/11/26 DS Spostate qui MakeOneFaceBySaw (ora MakeOne), CalcLeadInOutPerpGeom e CalcLeadInOutTangGeom.
|
||||||
-- 2022/04/12 DS Aggiunta gestione speciale cubetti con fresa da sotto.
|
-- 2022/04/12 DS Aggiunta gestione speciale cubetti con fresa da sotto.
|
||||||
-- 2022/06/29 DS In MakeTwo modificato controllo facce dirette verso il basso.
|
-- 2022/06/29 DS In MakeTwo modificato controllo facce dirette verso il basso.
|
||||||
-- 2022/09/08 In MakeOne aggiunto argomento bForceInvert per poter forzare l'inversione del percorso.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local FacesBySaw = {}
|
local FacesBySaw = {}
|
||||||
@@ -29,7 +28,7 @@ local BD = require( 'BeamData')
|
|||||||
local ML = require( 'MachiningLib')
|
local ML = require( 'MachiningLib')
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw, bForceInvert)
|
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
|
||||||
-- dati della faccia
|
-- dati della faccia
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
|
||||||
-- risolvo parametro ambiguo
|
-- risolvo parametro ambiguo
|
||||||
@@ -52,10 +51,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
return true, ''
|
return true, ''
|
||||||
end
|
end
|
||||||
vtV1 = - vtV1
|
vtV1 = - vtV1
|
||||||
local bInvert = bForceInvert
|
local bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
||||||
if bInvert == nil then
|
|
||||||
bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
|
|
||||||
end
|
|
||||||
if bInvert then
|
if bInvert then
|
||||||
ptP1, ptP2 = ptP2, ptP1
|
ptP1, ptP2 = ptP2, ptP1
|
||||||
vtV1, vtV2 = vtV2, vtV1
|
vtV1, vtV2 = vtV2, vtV1
|
||||||
@@ -126,7 +122,7 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
local ptP1act = ptP1 + vtN * dCutOffset
|
local ptP1act = ptP1 + vtN * dCutOffset
|
||||||
local ptP2act = ptP2 + vtN * dCutOffset
|
local ptP2act = ptP2 + vtN * dCutOffset
|
||||||
-- attacco perpendicolare
|
-- attacco perpendicolare
|
||||||
local dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio = FacesBySaw.CalcLeadInOutPerpGeom( ptP1act, ptP2act, vtV1, vtV2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
|
local dLiTang, dLiPerp, dLoTang, dLoPerp = FacesBySaw.CalcLeadInOutPerpGeom( ptP1act, ptP2act, vtV1, vtV2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
|
||||||
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
|
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
|
||||||
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
|
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
|
||||||
-- attacco tangente
|
-- attacco tangente
|
||||||
@@ -160,26 +156,11 @@ function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDw
|
|||||||
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if bTurnTang then
|
local vtTest = EgtIf( bTurnTang, EgtIf( bInvert, vtTg, -vtTg), vtOut)
|
||||||
local vtTest = EgtIf( bInvert, vtTg, -vtTg)
|
if abs( vtTest:getY()) > abs( vtTest:getZ()) then
|
||||||
if abs( vtTest:getY()) > abs( vtTest:getZ()) then
|
nSCC = EgtIf( vtTest:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||||
nSCC = EgtIf( vtTest:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
|
||||||
else
|
|
||||||
nSCC = EgtIf( vtTest:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
local vtTest = vtOut -- vtLio
|
nSCC = EgtIf( vtTest:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
||||||
if abs( vtN:getY()) < 0.174 and abs( vtN:getZ()) < 0.174 then
|
|
||||||
if abs( vtTest:getY()) > abs( vtTest:getZ()) then
|
|
||||||
nSCC = EgtIf( vtTest:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
|
||||||
else
|
|
||||||
nSCC = EgtIf( vtTest:getZ() > 0, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
|
||||||
end
|
|
||||||
elseif abs( vtN:getZ()) < 0.174 then
|
|
||||||
nSCC = EgtIf( vtTest:getZ() > -0.017, MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
|
||||||
else
|
|
||||||
nSCC = EgtIf( vtTest:getY() > 0, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- inserisco la lavorazione di taglio
|
-- inserisco la lavorazione di taglio
|
||||||
@@ -479,24 +460,29 @@ function FacesBySaw.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dRad, vt
|
|||||||
local vtX = vtTg ^ vtN
|
local vtX = vtTg ^ vtN
|
||||||
local frFace = Frame3d( ptP1, vtX, vtTg, vtN)
|
local frFace = Frame3d( ptP1, vtX, vtTg, vtN)
|
||||||
EgtOutLog( 'Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3)
|
EgtOutLog( 'Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3)
|
||||||
-- Versore di attacco e uscita
|
-- Versori di attacco e uscita
|
||||||
local dCos1 = vtV1 * vtRef
|
local dCos1 = vtV1 * vtRef
|
||||||
local dCos2 = vtV2 * vtRef
|
local dCos2 = vtV2 * vtRef
|
||||||
local vtLio
|
local vtLi, vtLo
|
||||||
if abs( dCos1 - dCos2) < 0.001 then
|
if abs( dCos1 - dCos2) < 0.001 then
|
||||||
if abs( vtV1:getZ()) < abs( vtV2:getZ()) then
|
if abs( vtV1:getZ()) < abs( vtV2:getZ()) then
|
||||||
vtLio = vtV1
|
vtLi = vtV1
|
||||||
|
vtLo = vtV1
|
||||||
else
|
else
|
||||||
vtLio = vtV2
|
vtLi = vtV2
|
||||||
|
vtLo = vtV2
|
||||||
end
|
end
|
||||||
elseif dCos1 > dCos2 then
|
elseif dCos1 > dCos2 then
|
||||||
vtLio = vtV1
|
vtLi = vtV1
|
||||||
|
vtLo = vtV1
|
||||||
else
|
else
|
||||||
vtLio = vtV2
|
vtLi = vtV2
|
||||||
|
vtLo = vtV2
|
||||||
end
|
end
|
||||||
local bRight = ( vtX * vtLio > 0)
|
local bRight = ( vtX * vtLi > 0)
|
||||||
-- Versore di attacco e uscita nel riferimento intrinseco al taglio
|
-- Versori di attacco e uscita nel riferimento intrinseco al taglio
|
||||||
local vtLioL = Vector3d( vtLio) ; vtLioL:toLoc( frFace)
|
local vtLiL = Vector3d( vtLi) ; vtLiL:toLoc( frFace)
|
||||||
|
local vtLoL = Vector3d( vtLo) ; vtLoL:toLoc( frFace)
|
||||||
-- Spostamento punti per effetto dell'extra o della deficienza di taglio
|
-- Spostamento punti per effetto dell'extra o della deficienza di taglio
|
||||||
ptP1 = ptP1 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra))
|
ptP1 = ptP1 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra))
|
||||||
ptP2 = ptP2 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra))
|
ptP2 = ptP2 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra))
|
||||||
@@ -506,30 +492,30 @@ function FacesBySaw.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dRad, vt
|
|||||||
-- Attacco
|
-- Attacco
|
||||||
local dLiTang = 10000
|
local dLiTang = 10000
|
||||||
local dLiPerp = 10000
|
local dLiPerp = 10000
|
||||||
local bLiOk, _, vLiPar = EgtLineBoxInters( ptP1, vtLio, b3MyBox)
|
local bLiOk, _, vLiPar = EgtLineBoxInters( ptP1, vtLi, b3MyBox)
|
||||||
if bLiOk and #vLiPar > 0 then
|
if bLiOk and #vLiPar > 0 then
|
||||||
-- con la prima faccia di uscita
|
-- con la prima faccia di uscita
|
||||||
local dLen = vLiPar[#vLiPar]
|
local dLen = vLiPar[#vLiPar]
|
||||||
local ptInt = ptP1 + vtLio * dLen
|
local ptInt = ptP1 + vtLi * dLen
|
||||||
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtLio)
|
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtLi)
|
||||||
EgtOutLog( 'LiFaceNorm=' .. tostring( vtFN), 3)
|
EgtOutLog( 'LiFaceNorm=' .. tostring( vtFN), 3)
|
||||||
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLio * vtFN)
|
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLi * vtFN)
|
||||||
local dLiLen = dLen + dAddLen
|
local dLiLen = dLen + dAddLen
|
||||||
EgtOutLog( 'LeadIn Dist=' .. EgtNumToString( dLiLen), 3)
|
EgtOutLog( 'LeadIn Dist=' .. EgtNumToString( dLiLen), 3)
|
||||||
dLiTang = - dLiLen * vtLioL:getY()
|
dLiTang = - dLiLen * vtLiL:getY()
|
||||||
dLiPerp = EgtIf( bRight, dLiLen, - dLiLen) * vtLioL:getX()
|
dLiPerp = EgtIf( bRight, dLiLen, - dLiLen) * vtLiL:getX()
|
||||||
-- verifico se miglioro calcolando con faccia successiva
|
-- verifico se miglioro calcolando con faccia successiva
|
||||||
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
|
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
|
||||||
local bLiOk2, _, vLiPar2 = EgtLineBoxInters( ptP1, vtLio, b3Mod)
|
local bLiOk2, _, vLiPar2 = EgtLineBoxInters( ptP1, vtLi, b3Mod)
|
||||||
if bLiOk2 and #vLiPar2 > 0 then
|
if bLiOk2 and #vLiPar2 > 0 then
|
||||||
local dLen2 = vLiPar2[#vLiPar2]
|
local dLen2 = vLiPar2[#vLiPar2]
|
||||||
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP1 + vtLio * dLen2, vtLio)
|
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP1 + vtLi * dLen2, vtLi)
|
||||||
EgtOutLog( 'LiFaceNorm2=' .. tostring( vtFN2), 3)
|
EgtOutLog( 'LiFaceNorm2=' .. tostring( vtFN2), 3)
|
||||||
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLio * vtFN2)
|
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLi * vtFN2)
|
||||||
local dLiLen2 = dLen2 + dAddLen2
|
local dLiLen2 = dLen2 + dAddLen2
|
||||||
EgtOutLog( 'LeadIn Dist2=' .. EgtNumToString( dLiLen2), 3)
|
EgtOutLog( 'LeadIn Dist2=' .. EgtNumToString( dLiLen2), 3)
|
||||||
local dLiTang2 = - dLiLen2 * vtLioL:getY()
|
local dLiTang2 = - dLiLen2 * vtLiL:getY()
|
||||||
local dLiPerp2 = EgtIf( bRight, dLiLen2, - dLiLen2) * vtLioL:getX()
|
local dLiPerp2 = EgtIf( bRight, dLiLen2, - dLiLen2) * vtLiL:getX()
|
||||||
if dLiLen2 < dLiLen then
|
if dLiLen2 < dLiLen then
|
||||||
dLiTang = dLiTang2
|
dLiTang = dLiTang2
|
||||||
dLiPerp = dLiPerp2
|
dLiPerp = dLiPerp2
|
||||||
@@ -539,37 +525,37 @@ function FacesBySaw.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dRad, vt
|
|||||||
-- Lunghezza di uscita
|
-- Lunghezza di uscita
|
||||||
local dLoTang = 10000
|
local dLoTang = 10000
|
||||||
local dLoPerp = 10000
|
local dLoPerp = 10000
|
||||||
local bLoOk, _, vLoPar = EgtLineBoxInters( ptP2, vtLio, b3MyBox)
|
local bLoOk, _, vLoPar = EgtLineBoxInters( ptP2, vtLo, b3MyBox)
|
||||||
if bLoOk and #vLoPar > 0 then
|
if bLoOk and #vLoPar > 0 then
|
||||||
-- con la prima faccia di uscita
|
-- con la prima faccia di uscita
|
||||||
local dLen = vLoPar[#vLoPar]
|
local dLen = vLoPar[#vLoPar]
|
||||||
local ptInt = ptP2 + vtLio * dLen
|
local ptInt = ptP2 + vtLo * dLen
|
||||||
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtLio)
|
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtLo)
|
||||||
EgtOutLog( 'LoFaceNorm=' .. tostring( vtFN), 3)
|
EgtOutLog( 'LoFaceNorm=' .. tostring( vtFN), 3)
|
||||||
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLio * vtFN)
|
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLo * vtFN)
|
||||||
local dLoLen = dLen + dAddLen
|
local dLoLen = dLen + dAddLen
|
||||||
EgtOutLog( 'LeadOut Dist=' .. EgtNumToString( dLoLen), 3)
|
EgtOutLog( 'LeadOut Dist=' .. EgtNumToString( dLoLen), 3)
|
||||||
dLoTang = dLoLen * vtLioL:getY()
|
dLoTang = dLoLen * vtLoL:getY()
|
||||||
dLoPerp = EgtIf( bRight, dLoLen, - dLoLen) * vtLioL:getX()
|
dLoPerp = EgtIf( bRight, dLoLen, - dLoLen) * vtLoL:getX()
|
||||||
-- verifico se miglioro calcolando con faccia successiva
|
-- verifico se miglioro calcolando con faccia successiva
|
||||||
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
|
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
|
||||||
local bLoOk2, _, vLoPar2 = EgtLineBoxInters( ptP2, vtLio, b3Mod)
|
local bLoOk2, _, vLoPar2 = EgtLineBoxInters( ptP2, vtLo, b3Mod)
|
||||||
if bLoOk2 and #vLoPar2 > 0 then
|
if bLoOk2 and #vLoPar2 > 0 then
|
||||||
local dLen2 = vLoPar2[#vLoPar2]
|
local dLen2 = vLoPar2[#vLoPar2]
|
||||||
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP2 + vtLio * dLen2, vtLio)
|
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP2 + vtLo * dLen2, vtLo)
|
||||||
EgtOutLog( 'LoFaceNorm2=' .. tostring( vtFN2), 3)
|
EgtOutLog( 'LoFaceNorm2=' .. tostring( vtFN2), 3)
|
||||||
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLio * vtFN2)
|
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLo * vtFN2)
|
||||||
local dLoLen2 = dLen2 + dAddLen2
|
local dLoLen2 = dLen2 + dAddLen2
|
||||||
EgtOutLog( 'LeadOut Dist2=' .. EgtNumToString( dLoLen2), 3)
|
EgtOutLog( 'LeadOut Dist2=' .. EgtNumToString( dLoLen2), 3)
|
||||||
local dLoTang2 = dLoLen2 * vtLioL:getY()
|
local dLoTang2 = dLoLen2 * vtLoL:getY()
|
||||||
local dLoPerp2 = EgtIf( bRight, dLoLen2, - dLoLen2) * vtLioL:getX()
|
local dLoPerp2 = EgtIf( bRight, dLoLen2, - dLoLen2) * vtLoL:getX()
|
||||||
if dLoLen2 < dLoLen then
|
if dLoLen2 < dLoLen then
|
||||||
dLoTang = dLoTang2
|
dLoTang = dLoTang2
|
||||||
dLoPerp = dLoPerp2
|
dLoPerp = dLoPerp2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return dLiTang, dLiPerp, dLoTang, dLoPerp, vtLio
|
return dLiTang, dLiPerp, dLoTang, dLoPerp
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
|||||||
+15
-30
@@ -2,7 +2,6 @@
|
|||||||
-- Libreria ricerca lavorazioni per Travi
|
-- Libreria ricerca lavorazioni per Travi
|
||||||
-- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste.
|
-- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste.
|
||||||
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
||||||
-- 2022/11/02 Modificata scelta utensile ottimizzata. Ora se c'è un utensile più grande disponibile si dà preferenza a quello.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local MachiningLib = {}
|
local MachiningLib = {}
|
||||||
@@ -264,8 +263,6 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
|||||||
-- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra
|
-- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra
|
||||||
MachineHeadUse = TWO_EQUAL_HEADS
|
MachineHeadUse = TWO_EQUAL_HEADS
|
||||||
end
|
end
|
||||||
-- variabile che definisce quando un utensile ha un diametro sostanzialmente più grande di un altro
|
|
||||||
local dBiggerToolTolerance = 1.25
|
|
||||||
for i = ForStart, ForEnd, ForStep do
|
for i = ForStart, ForEnd, ForStep do
|
||||||
local Machining = Machinings[i]
|
local Machining = Machinings[i]
|
||||||
local sMachiningType = Machining.Type
|
local sMachiningType = Machining.Type
|
||||||
@@ -287,24 +284,22 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
|||||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||||
-- verifico se posso usare lo stesso utensile della testa attiva
|
-- verifico se posso usare lo stesso utensile della testa attiva
|
||||||
elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then
|
elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then
|
||||||
-- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo
|
SetNextMachining( sToolName, nActiveHead, bFixed)
|
||||||
if ( not sH1Param or not sH1Param.TDiam or sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam) and ( not sH2Param or not sH2Param.TDiam or sH2Param.TDiam < 1.25 * ToolParams.TDiam) then
|
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
||||||
SetNextMachining( sToolName, nActiveHead, bFixed)
|
|
||||||
return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- segno le lavorazioni disponibili per entrambe le teste
|
|
||||||
if bH2 then
|
|
||||||
if not sH2Mach or sH2Mach == '' then
|
|
||||||
sH2Mach = Machining.Name
|
|
||||||
sH2Tool = sToolName
|
|
||||||
sH2Param = ToolParams
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if not sH1Mach or sH1Mach == '' then
|
-- segno le lavorazioni disponibili per entrambe le teste
|
||||||
sH1Mach = Machining.Name
|
if bH2 then
|
||||||
sH1Tool = sToolName
|
if not sH2Mach or sH2Mach == '' then
|
||||||
sH1Param = ToolParams
|
sH2Mach = Machining.Name
|
||||||
|
sH2Tool = sToolName
|
||||||
|
sH2Param = ToolParams
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if not sH1Mach or sH1Mach == '' then
|
||||||
|
sH1Mach = Machining.Name
|
||||||
|
sH1Tool = sToolName
|
||||||
|
sH1Param = ToolParams
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
|
elseif MachineHeadUse == TWO_UP_DOWN_HEADS then
|
||||||
@@ -320,16 +315,6 @@ local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if MachineHeadUse == TWO_EQUAL_HEADS then
|
if MachineHeadUse == TWO_EQUAL_HEADS then
|
||||||
-- se uno dei due utensili è molto più grande dell'altro scelgo quello senza fare altre analisi
|
|
||||||
if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then
|
|
||||||
if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then
|
|
||||||
SetNextMachining( sH1Tool, 1, bFixed)
|
|
||||||
return ReturnParams( MachiningType, sH1Mach, sType, sH1Param)
|
|
||||||
elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then
|
|
||||||
SetNextMachining( sH2Tool, 2, bFixed)
|
|
||||||
return ReturnParams( MachiningType, sH2Mach, sType, sH2Param)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- verifico se cambiare testa o cambiare utensile su quella corrente
|
-- verifico se cambiare testa o cambiare utensile su quella corrente
|
||||||
if nActiveHead == 1 then
|
if nActiveHead == 1 then
|
||||||
if sH2Mach ~= "" then
|
if sH2Mach ~= "" then
|
||||||
|
|||||||
+13
-50
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessCut.lua by Egaltech s.r.l. 2022/09/30
|
-- ProcessCut.lua by Egaltech s.r.l. 2022/07/28
|
||||||
-- Gestione calcolo singoli tagli di lama per Travi
|
-- Gestione calcolo singoli tagli di lama per Travi
|
||||||
-- 2021/05/18 I due tagli con testa da sotto di un cubetto sono fatti di seguito.
|
-- 2021/05/18 I due tagli con testa da sotto di un cubetto sono fatti di seguito.
|
||||||
-- 2021/06/06 Correzioni per tagli con testa da sotto.
|
-- 2021/06/06 Correzioni per tagli con testa da sotto.
|
||||||
@@ -14,9 +14,7 @@
|
|||||||
-- 2022/07/18 Se Q04=1, aggiunto LongCut anche dal lato per macchine tipo PF1250.
|
-- 2022/07/18 Se Q04=1, aggiunto LongCut anche dal lato per macchine tipo PF1250.
|
||||||
-- 2022/08/12 I tagli di lama inclinati in coda ora partono dal centro e non dall'esterno.
|
-- 2022/08/12 I tagli di lama inclinati in coda ora partono dal centro e non dall'esterno.
|
||||||
-- 2022/08/24 Disabilitato il dicing per i tagli meno spessi della lama.
|
-- 2022/08/24 Disabilitato il dicing per i tagli meno spessi della lama.
|
||||||
-- 2022/08/25 In caso di AdvTail con taglio lungo Y la profondità di lavorazione è opportunamente diminuita.
|
-- 2022/08/25 In caso di AdvTail con taglio lungo Y la profondità di lavorazione è opportunamente diminuita.
|
||||||
-- 2022/08/30 Modificata la condizione che determina l'utilizzo della testa da sotto. Ora controlla se la trave è più grande del doppio della massima larghezza del cubetto.
|
|
||||||
-- 2022/09/23 Corretta la condizione per cui è richiesto l'aggiornamento del grezzo.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessCut = {}
|
local ProcessCut = {}
|
||||||
@@ -250,21 +248,17 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL and
|
Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL and
|
||||||
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000))
|
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000))
|
||||||
-- verifico se da considerare taglio lungo dal lato, solo per macchine tipo PF1250, inclinato non più di 30deg
|
-- verifico se da considerare taglio lungo dal lato, solo per macchine tipo PF1250, inclinato non più di 30deg
|
||||||
local bLongCutFromSide = ( not bDownCut and ( BD.C_SIMM and BD.DOWN_HEAD and ( abs(vtN:getY()) > 0.865) and
|
local bLongCutFromSide = ( not bDownCut and ( BD.C_SIMM and BD.DOWN_HEAD and ( vtN:getY() > 0.865 or vtN:getY() < -0.865) and
|
||||||
Proc.Box:getDimZ() > b3Solid:getDimZ() - 10 * GEO.EPS_SMALL) and
|
Proc.Box:getDimZ() > b3Solid:getDimZ() - 10 * GEO.EPS_SMALL) and
|
||||||
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000))
|
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000))
|
||||||
-- se taglio lungo e Q04 = 1 allora lancio il processo dell'L10
|
-- se taglio lungo e Q04 = 1 allora lancio il processo dell'L10
|
||||||
local bNoDicing = EgtGetInfo( Proc.Id, 'Q04', 'i') == 1
|
local bNoDicing = EgtGetInfo( Proc.Id, 'Q04', 'i') == 1
|
||||||
if bNoDicing then
|
if bNoDicing then
|
||||||
if bLongCut then
|
if bLongCut then
|
||||||
local bOk, sErr = LongCut.Make( Proc, nPhase, nRawId, nPartId, true)
|
return LongCut.Make( Proc, nPhase, nRawId, nPartId, true)
|
||||||
return bOk, sErr, bNoDicing
|
|
||||||
elseif bLongCutFromSide then
|
elseif bLongCutFromSide then
|
||||||
local bOk, sErr = LongCut.Make( Proc, nPhase, nRawId, nPartId, false, 2)
|
return LongCut.Make( Proc, nPhase, nRawId, nPartId, false, 2)
|
||||||
return bOk, sErr, bNoDicing
|
|
||||||
end
|
end
|
||||||
-- se non passa dal LongCut rimetto a false perchè ha fatto un taglio standard
|
|
||||||
bNoDicing = false
|
|
||||||
end
|
end
|
||||||
-- se pezzo ancora attaccato alla trave, per non rovinare quello successivo
|
-- se pezzo ancora attaccato alla trave, per non rovinare quello successivo
|
||||||
local bFillAreaPiece
|
local bFillAreaPiece
|
||||||
@@ -353,37 +347,9 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
vtExtra = X_AX()
|
vtExtra = X_AX()
|
||||||
bAutoCalcSurf = false
|
bAutoCalcSurf = false
|
||||||
end
|
end
|
||||||
-- verifico elevazione max del materiale tagliato
|
|
||||||
local dMaxElev
|
|
||||||
if vtN:getX() > 0 then
|
|
||||||
if bForced then
|
|
||||||
dMaxElev = b3Raw:getMax():getX() - Proc.Box:getMin():getX()
|
|
||||||
else
|
|
||||||
dMaxElev = b3Solid:getMax():getX() - Proc.Box:getMin():getX()
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if bForced then
|
|
||||||
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
|
|
||||||
else
|
|
||||||
dMaxElev = Proc.Box:getMax():getX() - b3Solid:getMin():getX()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- per macchina TURN aggiusto massima dimensione cubetto
|
|
||||||
local dNewDiceDim
|
|
||||||
if BD.TURN then
|
|
||||||
local dDimRef = GEO.INFINITO
|
|
||||||
if abs( vtN:getZ()) < 0.003 then
|
|
||||||
dDimRef = b3Raw:getDimZ()
|
|
||||||
elseif abs( vtN:getY()) < 0.003 then
|
|
||||||
dDimRef = b3Raw:getDimY()
|
|
||||||
end
|
|
||||||
if dDimRef + BD.CUT_EXTRA < dMaxDepth then
|
|
||||||
dNewDiceDim = - ( dMaxDepth - BD.CUT_EXTRA)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se il taglio è più spesso della lama abilito il dicing, altrimenti no
|
-- se il taglio è più spesso della lama abilito il dicing, altrimenti no
|
||||||
if dMaxElev > dSawThick then
|
if Proc.Box:getDimX() >= dSawThick then
|
||||||
vCuts = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, dNewDiceDim)
|
vCuts = DC.GetDice( nAddGrpId, EgtIf( bForced, b3Raw, b3Solid), ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA)
|
||||||
-- se taglio sborda in coda e non è stato inserito nessun taglio a cubetti, lo rilancio con le dimensioni customizzate
|
-- se taglio sborda in coda e non è stato inserito nessun taglio a cubetti, lo rilancio con le dimensioni customizzate
|
||||||
if ( bFillTail or bCustDiceCut) and #vCuts == 0 then
|
if ( bFillTail or bCustDiceCut) and #vCuts == 0 then
|
||||||
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, Proc.Box:getDimY())
|
vCuts = DC.GetDice( nAddGrpId, b3Solid, ptC, vtN, bAutoCalcSurf, ptExtra, vtExtra, dMaxVertDepth - BD.CUT_EXTRA, Proc.Box:getDimY())
|
||||||
@@ -463,7 +429,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
local dVzLimDwnUp = dNzLimDwnUp
|
local dVzLimDwnUp = dNzLimDwnUp
|
||||||
if j ~= 1 then
|
if j ~= 1 then
|
||||||
vtNewOrthoO = -vtOrthoO
|
vtNewOrthoO = -vtOrthoO
|
||||||
if not BD.C_SIMM and not BD.TURN and abs( vtN:getY()) > 0.05 then dVzLimDwnUp = -0.708 end
|
if not BD.C_SIMM and abs( vtN:getY()) > 0.05 then dVzLimDwnUp = -0.707 end
|
||||||
end
|
end
|
||||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
@@ -487,7 +453,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local dVzLimDwnUp = dNzLimDwnUp
|
local dVzLimDwnUp = dNzLimDwnUp
|
||||||
if not BD.C_SIMM and not BD.TURN and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end
|
if not BD.C_SIMM and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end
|
||||||
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw)
|
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, sNotes, b3Raw)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
end
|
end
|
||||||
@@ -756,9 +722,9 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -20deg e sbandato oltre 1deg oppure sezione più larga di 2 cubetti o pezzo corto)
|
-- abilitazione lavorazione da sotto (testa da sotto e direzione normale sotto -20deg e sbandato oltre 1deg oppure sezione larga o pezzo corto)
|
||||||
local bDownHead = ( BD.DOWN_HEAD and vtN:getZ() < -0.341 and
|
local bDownHead = ( BD.DOWN_HEAD and vtN:getZ() < -0.341 and
|
||||||
( abs( vtN:getY()) > 0.017 or b3Raw:getDimY() > 2 * ( BD.MAX_DIM_DICE - BD.CUT_EXTRA_MIN) or b3Raw:getDimX() < BD.LEN_SHORT_PART))
|
( abs( vtN:getY()) > 0.017 or b3Raw:getDimY() > 2 * ( BD.MAX_DIM_HTCUT - BD.CUT_EXTRA_MIN) or b3Raw:getDimX() < BD.LEN_SHORT_PART))
|
||||||
local bDownTurn = ( BD.TURN and vtN:getZ() < -0.017)
|
local bDownTurn = ( BD.TURN and vtN:getZ() < -0.017)
|
||||||
local bTopHead = ( BD.DOWN_HEAD and ( vtN:getZ() > -0.342 or not bDownHead))
|
local bTopHead = ( BD.DOWN_HEAD and ( vtN:getZ() > -0.342 or not bDownHead))
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
@@ -770,11 +736,9 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
local bNoDicing = false
|
|
||||||
-- se taglio con testa da sopra
|
-- se taglio con testa da sopra
|
||||||
if not bDownHead and not bDownTurn then
|
if not bDownHead and not bDownTurn then
|
||||||
local bOk, sErr, bNoDicing2 = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes)
|
local bOk, sErr = MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom, bCustDiceCut, bForced, b3Raw, sNotes)
|
||||||
bNoDicing = bNoDicing2
|
|
||||||
if not bOk then return false, sErr end
|
if not bOk then return false, sErr end
|
||||||
-- altrimenti taglio con testa da sotto
|
-- altrimenti taglio con testa da sotto
|
||||||
else
|
else
|
||||||
@@ -782,8 +746,7 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom,
|
|||||||
if not bOk then return false, sErr end
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
-- Aggiornamento ingombro (se vero taglio o richiesto)
|
-- Aggiornamento ingombro (se vero taglio o richiesto)
|
||||||
-- Se lascio il cordolo (bNoDicing) non aggiorno il grezzo perchè lo scarto rimane attaccato
|
if ProcessCut.Identify( Proc) or bUpdateIng then
|
||||||
if ( ProcessCut.Identify( Proc) or bUpdateIng) and not bNoDicing then
|
|
||||||
UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
|
UpdateEncumbrance( Proc, vtN, dOvmHead, nRawId, b3Solid, b3Raw)
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2022/07/11
|
-- ProcessDoubleCut.lua by Egaltech s.r.l. 2022/07/11
|
||||||
-- Gestione calcolo doppi tagli di lama per Travi
|
-- Gestione calcolo doppi tagli di lama per Travi
|
||||||
-- 2022/08/29 Implementata la fresatura dal lato per tagli problematici per PF1250
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessDoubleCut = {}
|
local ProcessDoubleCut = {}
|
||||||
@@ -189,293 +188,6 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
local function VerifyPocket( Proc, dDiam, dDepth, dMaxTotLen, sMchFindMaster, bPocketDown)
|
|
||||||
-- tipo di svuotatura
|
|
||||||
local sMchFind = EgtIf( sMchFindMaster and #sMchFindMaster > 0, sMchFindMaster, 'Pocket')
|
|
||||||
-- ricerca della svuotatura
|
|
||||||
local sPocketing
|
|
||||||
if dDepth then
|
|
||||||
sPocketing = ML.FindPocketing( sMchFind, dDiam, dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
|
||||||
ML.FindPocketing( sMchFind, dDiam, 0.8 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
|
||||||
ML.FindPocketing( sMchFind, dDiam, 0.6 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
|
||||||
ML.FindPocketing( sMchFind, dDiam, 0.4 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
|
||||||
ML.FindPocketing( sMchFind, dDiam, 0, dMaxTotLen)
|
|
||||||
else
|
|
||||||
sPocketing = ML.FindPocketing( sMchFind, dDiam, 0, dMaxTotLen)
|
|
||||||
end
|
|
||||||
if not sPocketing then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
-- recupero i dati dell'utensile
|
|
||||||
local bUsePocketing = false
|
|
||||||
local dMaxDepth = 0
|
|
||||||
local dToolDiam = 0
|
|
||||||
if EgtMdbSetCurrMachining( sPocketing) then
|
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
|
||||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
|
||||||
end
|
|
||||||
bUsePocketing = true
|
|
||||||
end
|
|
||||||
return bUsePocketing, sPocketing, dMaxDepth, dToolDiam
|
|
||||||
end
|
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
local function SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
|
|
||||||
-- fondo tra loro le curve compatibili
|
|
||||||
EgtMergeCurvesInCurveCompo( nPathInt)
|
|
||||||
local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt)
|
|
||||||
local pLastPIni, pLastPEnd
|
|
||||||
-- faccio una copia della curva e la esplodo
|
|
||||||
if nStartIdEnt then
|
|
||||||
-- ciclo i lati della curva e controllo per ognuno se giace in uno dei piani limite del pezzo: se sì allora il lato è aperto
|
|
||||||
for i = 1, nNumEnt do
|
|
||||||
local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB)
|
|
||||||
local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB)
|
|
||||||
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
|
||||||
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
|
||||||
-- scrivo nelle proprietà della curva quali sono i lati aperti
|
|
||||||
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
|
||||||
if #sActInfo > 0 then
|
|
||||||
-- se ci sono già altri lati aperti
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
|
||||||
else
|
|
||||||
-- se è l'unico
|
|
||||||
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
local function MakeBySidePocket( Proc, nPhase, nRawId, nPartId, nAddGrpId, b3Solid)
|
|
||||||
local nFirstMachId
|
|
||||||
local sWarn
|
|
||||||
local sMchFind = 'OpenPocket'
|
|
||||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt
|
|
||||||
local bBadMach = false
|
|
||||||
-- ottengo le dimensioni del tunnel
|
|
||||||
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
|
||||||
-- posso utilizzare utensile con diametro doppio della dimensione minima
|
|
||||||
dDimMin = min( 2 * dDimMin, BD.MAXDIAM_POCK_CORNER)
|
|
||||||
local nPathInt
|
|
||||||
-- verifico se è presente la testa da sotto e se è necessario usarla
|
|
||||||
bMillDown = ( BD.DOWN_HEAD == true and abs( vtOrtho:getZ()) >= 0.707)
|
|
||||||
-- cerco l'utensile di svuotatura per la testa sopra
|
|
||||||
local bMakePocket, sPocketing, dMaxDepth, dDiamTool = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind)
|
|
||||||
local bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn
|
|
||||||
-- cerco anche l'utensile per la testa sotto, nel caso servisse
|
|
||||||
if bMillDown then
|
|
||||||
bMakePocketDn, sPocketingDn, dMaxDepthDn, dDiamToolDn = VerifyPocket( Proc, dDimMin, dDepth / 2, nil, sMchFind, true)
|
|
||||||
-- se è negativo inverto il versore e la faccia
|
|
||||||
if vtOrtho:getZ() < 0 then
|
|
||||||
vtOrtho = -vtOrtho
|
|
||||||
EgtInvertSurf( nSurfInt)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if bMakePocket then
|
|
||||||
-- gestione svuotatura da un solo lato o anche dal lato opposto (se non verticale)
|
|
||||||
-- estraggo il contorno dalla superfice per evitare i problemi con la svuotatura
|
|
||||||
-- e assegno l'estrusione
|
|
||||||
nPathInt = EgtExtractSurfTmLoops( nSurfInt, nAddGrpId)
|
|
||||||
EgtModifyCurveExtrusion( nPathInt, vtOrtho, GDB_RT.GLOB)
|
|
||||||
SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
|
|
||||||
-- variabili per parametri lavorazione
|
|
||||||
local dMachDepth
|
|
||||||
local dElev = 0
|
|
||||||
local bDoubleSide
|
|
||||||
local bOneShot
|
|
||||||
local bComplete = true
|
|
||||||
-- imposto altezza aggiuntiva di elevazione
|
|
||||||
local dCollSic = BL.CalcCollisionSafety( vtOrtho)
|
|
||||||
-- se possibile svuotare completamente da una sola parte
|
|
||||||
if dMaxDepth > ( dDepth + BD.CUT_EXTRA + dCollSic) then
|
|
||||||
dMachDepth = ( dDepth / 2) + BD.CUT_EXTRA
|
|
||||||
dElev = dDepth + BD.CUT_EXTRA
|
|
||||||
bOneShot = true
|
|
||||||
else
|
|
||||||
-- se direzione verso la verticale setto max affondamento possibile ed
|
|
||||||
-- emetto messaggio di warning perché non lavorabile interamente
|
|
||||||
if abs( vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
|
||||||
dMachDepth = dMaxDepth - ( dDepth / 2) - dCollSic
|
|
||||||
dElev = dMaxDepth
|
|
||||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
|
||||||
EgtOutLog( sWarn)
|
|
||||||
bComplete = false
|
|
||||||
-- altrimenti setto il flag per fare la svuotatura da due parti
|
|
||||||
else
|
|
||||||
-- se l'altezza utensile riesce a lavorare completamente da due parti
|
|
||||||
if dMaxDepth > ( dDepth / 2) + dCollSic + BD.CUT_EXTRA_MIN then
|
|
||||||
dMachDepth = BD.CUT_EXTRA_MIN
|
|
||||||
dElev = ( dDepth / 2) + BD.CUT_EXTRA_MIN
|
|
||||||
-- altrimenti non si riesce in due passate, limito la profondità e setto l'elevazione
|
|
||||||
else
|
|
||||||
dMachDepth = dMaxDepth - ( dDepth / 2) - dCollSic
|
|
||||||
dElev = dMaxDepth
|
|
||||||
-- se molto inclinato rispetto alla normale della faccia di riferimento, lavorazione non idonea per probabili collisioni
|
|
||||||
local vtRef = Y_AX()
|
|
||||||
if abs( vtOrtho:getX()) > abs( vtOrtho:getY()) and abs( vtOrtho:getX()) > abs( vtOrtho:getZ()) then
|
|
||||||
vtRef = X_AX()
|
|
||||||
elseif abs( vtOrtho:getZ()) > abs( vtOrtho:getX()) and abs( vtOrtho:getZ()) > abs( vtOrtho:getY()) then
|
|
||||||
vtRef = Z_AX()
|
|
||||||
end
|
|
||||||
if abs( vtOrtho * vtRef) < 0.5 then
|
|
||||||
bBadMach = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
bDoubleSide = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- inserisco la lavorazione di svuotatura
|
|
||||||
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
||||||
local nMchFId = EgtAddMachining( sName, sPocketing)
|
|
||||||
if not nMchFId then
|
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
|
||||||
EgtOutLog( sErr)
|
|
||||||
return -1, sErr
|
|
||||||
end
|
|
||||||
-- prendo l'id della prima lavorazione inserita
|
|
||||||
if not nFirstMachId then
|
|
||||||
nFirstMachId = nMchFId
|
|
||||||
end
|
|
||||||
-- aggiungo geometria
|
|
||||||
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
|
||||||
-- verifico se devo invertire direzione utensile (in caso di direzione verso la verticale)
|
|
||||||
local bInvertMach
|
|
||||||
if vtOrtho:getZ() < BD.NZ_MINA and abs(vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
|
||||||
bInvertMach = true
|
|
||||||
-- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti
|
|
||||||
elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL and not ( -(vtOrtho:getZ()) < BD.NZ_MINA) then
|
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
|
||||||
bInvertMach = true
|
|
||||||
end
|
|
||||||
-- imposto posizione braccio porta testa
|
|
||||||
local nSCC = MCH_SCC.NONE
|
|
||||||
if not BD.C_SIMM then
|
|
||||||
if AreSameOrOppositeVectorApprox( vtOrtho, Z_AX()) then
|
|
||||||
nSCC = MCH_SCC.ADIR_YM
|
|
||||||
elseif abs( vtOrtho:getX()) < 0.1 then
|
|
||||||
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
|
||||||
elseif vtOrtho:getY() < GEO.EPS_SMALL then
|
|
||||||
nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
|
||||||
else
|
|
||||||
nSCC = EgtIf( bInvertMach, MCH_SCC.ADIR_YM, MCH_SCC.ADIR_YP)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
|
||||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
|
||||||
-- inverto il percorso di lavorazione per lavorare sinistro
|
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
|
||||||
-- imposto affondamento
|
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
|
||||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
|
||||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
|
||||||
sNotes = sNotes .. 'VMRS=0;'
|
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
|
||||||
-- eseguo
|
|
||||||
if not ML.ApplyMachining( true, false) then
|
|
||||||
-- provo ad allargare leggermente la tasca
|
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, -0.1)
|
|
||||||
if not ML.ApplyMachining( true, false) then
|
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
|
||||||
EgtSetOperationMode( nMchFId, false)
|
|
||||||
return -1, sErr
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- se posso applicare la svuotatura sul lato opposto
|
|
||||||
if bDoubleSide then
|
|
||||||
-- se ho la lavorazione da sotto ricalcolo in base a questa lavorazione
|
|
||||||
if bMakePocketDn then
|
|
||||||
-- sPocketing = sPocketingDn
|
|
||||||
-- dMaxDepth = dMaxDepthDn
|
|
||||||
-- dDiamTool = dDiamToolDn
|
|
||||||
-- se l'altezza utensile riesce a lavorare completamente da due parti
|
|
||||||
if dMaxDepthDn > ( dDepth / 2) + dCollSic + BD.CUT_EXTRA_MIN then
|
|
||||||
dMachDepth = BD.CUT_EXTRA_MIN
|
|
||||||
dElev = ( dDepth / 2) + BD.CUT_EXTRA_MIN
|
|
||||||
-- altrimenti non si riesce in due passate, limito la profondità e setto l'elevazione
|
|
||||||
else
|
|
||||||
dMachDepth = dMaxDepthDn - ( dDepth / 2) - dCollSic
|
|
||||||
dElev = dMaxDepthDn
|
|
||||||
bComplete = false
|
|
||||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
|
||||||
EgtOutLog( sWarn)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- se anche lavorando dal lato opposto non riesco a svuotare completamente la fessura
|
|
||||||
-- setto i parametri affondamento ed emetto warning
|
|
||||||
if dMaxDepth < ( dDepth / 2) + BD.CUT_EXTRA + dCollSic then
|
|
||||||
dMachDepth = dMaxDepth - (dDepth / 2) - dCollSic
|
|
||||||
dElev = dMaxDepth
|
|
||||||
bComplete = false
|
|
||||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
|
||||||
EgtOutLog( sWarn)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- inserisco la lavorazione di svuotatura
|
|
||||||
local sName = 'PockOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
||||||
local nMchFId = EgtAddMachining( sName, EgtIf( bMakePocketDn, sPocketingDn, sPocketing))
|
|
||||||
if not nMchFId then
|
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. EgtIf( bMakePocketDn, sPocketingDn, sPocketing)
|
|
||||||
EgtOutLog( sErr)
|
|
||||||
return -1, sErr
|
|
||||||
end
|
|
||||||
-- prendo l'id della prima lavorazione inserita
|
|
||||||
if not nFirstMachId then
|
|
||||||
nFirstMachId = nMchFId
|
|
||||||
end
|
|
||||||
-- aggiungo geometria
|
|
||||||
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
|
||||||
-- imposto direzione utensile opposta
|
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
|
||||||
-- imposto posizione braccio porta testa
|
|
||||||
local nSCC = MCH_SCC.NONE
|
|
||||||
if not BD.C_SIMM then
|
|
||||||
if AreSameVectorApprox( vtOrtho, Z_AX()) then
|
|
||||||
nSCC = MCH_SCC.ADIR_YM
|
|
||||||
elseif abs( vtOrtho:getX()) < 0.1 then
|
|
||||||
nSCC = EgtIf( BL.IsPartFinalPhase( nPhase), MCH_SCC.ADIR_XM, MCH_SCC.ADIR_XP)
|
|
||||||
elseif vtOrtho:getY() < GEO.EPS_SMALL then
|
|
||||||
nSCC = MCH_SCC.ADIR_YP
|
|
||||||
else
|
|
||||||
nSCC = MCH_SCC.ADIR_YM
|
|
||||||
end
|
|
||||||
end
|
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
|
||||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
|
||||||
-- inverto il percorso di lavorazione per lavorare sinistro
|
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
|
||||||
-- imposo affondamento
|
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
|
||||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
|
||||||
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
|
||||||
sNotes = sNotes .. 'VMRS=0;'
|
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
|
||||||
-- eseguo
|
|
||||||
if not ML.ApplyMachining( true, false) then
|
|
||||||
-- provo ad allargare leggermente la tasca
|
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSR, -0.1)
|
|
||||||
if not ML.ApplyMachining( true, false) then
|
|
||||||
local _, sErr = EgtGetLastMachMgrError()
|
|
||||||
EgtSetOperationMode( nMchFId, false)
|
|
||||||
return -1, sErr
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return 1, sWarn, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId
|
|
||||||
end
|
|
||||||
return 0, sWarn, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId, bOrthoFaces
|
|
||||||
end
|
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Applicazione della lavorazione
|
-- Applicazione della lavorazione
|
||||||
function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||||
@@ -561,31 +273,6 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- eseguo
|
-- eseguo
|
||||||
local sCutType = EgtIf( bHead, 'HeadSide', 'TailSide')
|
local sCutType = EgtIf( bHead, 'HeadSide', 'TailSide')
|
||||||
local bDownHead = ( BD.DOWN_HEAD and vtNm:getZ() < BD.NZ_MINB)
|
local bDownHead = ( BD.DOWN_HEAD and vtNm:getZ() < BD.NZ_MINB)
|
||||||
-- per tutte le macchine tranne la Fast, controllo se ci sono tagli troppo inclinati e troppo profondi per la lama
|
|
||||||
-- in tal caso richiamo la lavorazione con fresa dal lato
|
|
||||||
if BD.C_SIMM and not bDownHead then
|
|
||||||
local sCutting = ML.FindCutting( sCutType, nil, bDownHead)
|
|
||||||
if not sCutting then
|
|
||||||
local sErr = 'Error : cutting not found in library'
|
|
||||||
EgtOutLog( sErr)
|
|
||||||
return false, sErr
|
|
||||||
end
|
|
||||||
local dMaxDepth = 0
|
|
||||||
if EgtMdbSetCurrMachining( sCutting) then
|
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local _, _, dDimV1 = BL.GetFaceHvRefDim( Proc.Id, 0, b3Raw)
|
|
||||||
local _, _, dDimV2 = BL.GetFaceHvRefDim( Proc.Id, 1, b3Raw)
|
|
||||||
local bFace1TooLongForBlade, bFace2TooLongForBlade = ( dDimV1 >= dMaxDepth), ( dDimV2 >= dMaxDepth)
|
|
||||||
local dFace1Ang, dFace2Ang = vtN[1]:getZ(), vtN[2]:getZ()
|
|
||||||
if bFace1TooLongForBlade and dFace1Ang < ( BD.CUT_VZ_MIN or -0.484) or bFace2TooLongForBlade and dFace2Ang < ( BD.CUT_VZ_MIN or -0.484) then
|
|
||||||
local bOk, sErr = MakeBySidePocket( Proc, nPhase, nRawId, nPartId, nAddGrpId, b3Solid)
|
|
||||||
return bOk, sErr
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local bOk, sErr = Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, false, bDownHead)
|
local bOk, sErr = Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, false, bDownHead)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
-- segnalazione ingombro di testa o coda
|
-- segnalazione ingombro di testa o coda
|
||||||
|
|||||||
@@ -13,7 +13,6 @@
|
|||||||
-- 2022/07/12 Aggiunto un valore minimo (10) per la distanza di sicurezza.
|
-- 2022/07/12 Aggiunto un valore minimo (10) per la distanza di sicurezza.
|
||||||
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
-- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati
|
||||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto e punta disabilitata.
|
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto e punta disabilitata.
|
||||||
-- 2022/10/25 Nella funzione Split aggiunto il controllo che le facce di ingresso e uscita siano differenti (potrebbe succedere per fori molto corti). Modifica importatore in futuro.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessDrill = {}
|
local ProcessDrill = {}
|
||||||
@@ -119,7 +118,7 @@ function ProcessDrill.Split( Proc, b3Raw)
|
|||||||
local dDiam = 2 * EgtArcRadius( AuxId)
|
local dDiam = 2 * EgtArcRadius( AuxId)
|
||||||
local dLen = abs( EgtCurveThickness( AuxId))
|
local dLen = abs( EgtCurveThickness( AuxId))
|
||||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||||
local bOpen = ( Proc.Fce ~= 0) and ( Proc.Fce ~= Proc.Fcs)
|
local bOpen = ( Proc.Fce ~= 0)
|
||||||
-- recupero flag abilitazione split (0=auto,1=no)
|
-- recupero flag abilitazione split (0=auto,1=no)
|
||||||
local bTrySplit = ( EgtGetInfo( Proc.Id, 'Q02', 'i') ~= 1)
|
local bTrySplit = ( EgtGetInfo( Proc.Id, 'Q02', 'i') ~= 1)
|
||||||
if not bTrySplit then
|
if not bTrySplit then
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/11/03
|
-- ProcessFreeContour.lua by Egaltech s.r.l. 2021/10/07
|
||||||
-- Gestione calcolo profilo libero per Travi
|
-- Gestione calcolo profilo libero per Travi
|
||||||
-- 2022/08/23 Aggiunta la funzione MakeByMark per la gestione del caso P13=10
|
-- 2022/08/23 Aggiunta la funzione MakeByMark per la gestione del caso P13=10
|
||||||
-- 2022/09/21 In MakeByMill aggiunto messaggio per elevazione non raggiunta.
|
|
||||||
-- 2022/11/03 In MakeByMill migliorata gestione lavorazione con fresa su testa da sotto.
|
|
||||||
-- 2022/11/09 Aggiunta la gestione della chiamata della FreeContour da parte della SimpleScarf.
|
|
||||||
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessFreeContour = {}
|
local ProcessFreeContour = {}
|
||||||
@@ -238,6 +234,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
local dDepth = abs( EgtCurveThickness( AuxId))
|
local dDepth = abs( EgtCurveThickness( AuxId))
|
||||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||||
local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
|
local b3Aux = EgtGetBBoxGlob( AuxId, GDB_BB.STANDARD)
|
||||||
|
local bToolInv = ( vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5)
|
||||||
local bDown = ( b3Aux:getMin():getZ() < b3Raw:getMin():getZ() + 5)
|
local bDown = ( b3Aux:getMin():getZ() < b3Raw:getMin():getZ() + 5)
|
||||||
-- verifico se in testa o coda
|
-- verifico se in testa o coda
|
||||||
local bHead = Proc.Head
|
local bHead = Proc.Head
|
||||||
@@ -246,14 +243,12 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local bTopHead = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.1)
|
local bTopHead = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.1)
|
||||||
local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
local bDownHead = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
||||||
local sMilling, _, _, bH2 = ML.FindMilling( 'FreeContour', nil, nil, nil, nil, bTopHead, bDownHead)
|
local sMilling = ML.FindMilling( 'FreeContour', nil, nil, nil, nil, bTopHead, bDownHead)
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error : FreeContour not found in library'
|
local sErr = 'Error : FreeContour not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
bDownHead = ( bDownHead and bH2)
|
|
||||||
local bToolInv = ( not bDownHead and vtExtr:getZ() < -0.1 and b3Aux:getDimZ() > b3Raw:getDimZ() - 5)
|
|
||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dToolDiam = 10
|
local dToolDiam = 10
|
||||||
local dMaxDepth = 0
|
local dMaxDepth = 0
|
||||||
@@ -309,21 +304,17 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
end
|
end
|
||||||
local bStripOnSide = false
|
local bStripOnSide = false
|
||||||
if bCross then
|
if bCross then
|
||||||
-- se chiamata da SimpleScarf il codolo è sempre attivo
|
if dDimStrip > 10 * GEO.EPS_SMALL and ( nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX())) then
|
||||||
if dDimStrip > 10 * GEO.EPS_SMALL and ( nStep > 1 or ( bDown and b3Aux:getDimX() > 0.5 * b3Raw:getDimX()) or Proc.Prc == 70) then
|
|
||||||
-- devo lasciare un codolo
|
-- devo lasciare un codolo
|
||||||
local dExtraCham = EgtIf( nChamfer > 0, 2, 0)
|
dDepth = dDepth - dDimStrip
|
||||||
dDepth = EgtIf( Proc.Prc == 70, dDepth - dDimStrip - dDepthCham - dExtraCham, dDepth - dDimStrip)
|
|
||||||
bStripOnSide = true
|
bStripOnSide = true
|
||||||
else
|
else
|
||||||
-- devo affondare un poco oltre
|
-- devo affondare un poco oltre
|
||||||
dDepth = dDepth + BD.CUT_EXTRA
|
dDepth = dDepth + BD.CUT_EXTRA
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local bIsDepthReduced = false
|
|
||||||
-- se parametro beamdata forza codolo in centro e lavorazione orizzontale e se larghezza trave è sufficientemente larga
|
-- se parametro beamdata forza codolo in centro e lavorazione orizzontale e se larghezza trave è sufficientemente larga
|
||||||
-- se chiamata da SimpleScarf il codolo è sempre attivo
|
if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and nStep > 1 and
|
||||||
if BD.DIM_TO_CENTER_STRIP and BD.DIM_TO_CENTER_STRIP > 10 * GEO.EPS_SMALL and ( nStep > 1 or Proc.Prc == 70) and
|
|
||||||
bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then
|
bCanDouble and b3Raw:getDimY() > BD.DIM_TO_CENTER_STRIP - 0.1 then
|
||||||
nDouble = 2
|
nDouble = 2
|
||||||
dDepth = min( ( b3Raw:getDimY() - dDimStrip) * 0.5, dMaxDepth)
|
dDepth = min( ( b3Raw:getDimY() - dDimStrip) * 0.5, dMaxDepth)
|
||||||
@@ -333,21 +324,11 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
if bCanDouble then
|
if bCanDouble then
|
||||||
nDouble = 2
|
nDouble = 2
|
||||||
dDepth = min( 0.5 * dDepth, dMaxDepth)
|
dDepth = min( 0.5 * dDepth, dMaxDepth)
|
||||||
if dDepth < 0.5 * dDepth - 10 * GEO.EPS_SMALL then
|
|
||||||
bIsDepthReduced = true
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
dDepth = dMaxDepth
|
dDepth = dMaxDepth
|
||||||
bIsDepthReduced = true
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local sWarn = ''
|
|
||||||
-- se ho ridotto l'altezza emetto warning
|
|
||||||
if bIsDepthReduced then
|
|
||||||
sWarn = 'Warning in process ' .. tostring( Proc.Id) .. ' (Free Contour) : elevation bigger than max tool depth'
|
|
||||||
EgtOutLog( sWarn)
|
|
||||||
end
|
|
||||||
-- se utensile orizzontale verso Y+, non in doppio e codolo da lasciare, devo invertire per lavorare sempre da Y-
|
-- se utensile orizzontale verso Y+, non in doppio e codolo da lasciare, devo invertire per lavorare sempre da Y-
|
||||||
if vtExtr:getY() > 0.707 and nDouble == 1 and bStripOnSide then
|
if vtExtr:getY() > 0.707 and nDouble == 1 and bStripOnSide then
|
||||||
bToolInv = true
|
bToolInv = true
|
||||||
@@ -358,7 +339,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
local dEndAddSpec = 0
|
local dEndAddSpec = 0
|
||||||
if Proc.Grp ~= 0 then dEndAddSpec = CalcSpecialAdd( AuxId, false, dToolDiam) end
|
if Proc.Grp ~= 0 then dEndAddSpec = CalcSpecialAdd( AuxId, false, dToolDiam) end
|
||||||
-- se devo inserire il chamfer
|
-- se devo inserire il chamfer
|
||||||
if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham and Proc.Prc ~= 70 then
|
if nChamfer > 0 and Proc.Grp ~= 0 and dOriDepth > dDepthCham then
|
||||||
local bDoubleCham = false
|
local bDoubleCham = false
|
||||||
local dExtra = 2
|
local dExtra = 2
|
||||||
-- eseguo
|
-- eseguo
|
||||||
@@ -382,7 +363,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
else
|
else
|
||||||
if not bDownHead and vtExtr:getZ() < 0 then
|
if vtExtr:getZ() < 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
@@ -397,7 +378,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
else
|
else
|
||||||
if not bDownHead and vtExtr:getZ() < 0 then
|
if vtExtr:getZ() < 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
@@ -571,9 +552,9 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- assegno lato di lavoro
|
-- assegno lato di lavoro
|
||||||
if Proc.Grp == 0 then
|
if Proc.Grp == 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.CENTER)
|
||||||
elseif ( Proc.Grp == 3 and not bToolInv) or ( Proc.Grp == 4 and bToolInv) or ( Proc.Grp == 1 and bToolInv) or ( Proc.Grp == 2 and bToolInv) then
|
elseif ( Proc.Grp == 3 and not bToolInv) or ( Proc.Grp == 4 and bToolInv) then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||||
elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) or ( Proc.Grp == 1 and not bToolInv) or ( Proc.Grp == 2 and not bToolInv) then
|
elseif ( Proc.Grp == 3 and bToolInv) or ( Proc.Grp == 4 and not bToolInv) then
|
||||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||||
end
|
end
|
||||||
-- posizione braccio porta testa
|
-- posizione braccio porta testa
|
||||||
@@ -642,7 +623,7 @@ local function MakeByMill( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
BL.UpdateTCING( nRawId, dOffs)
|
BL.UpdateTCING( nRawId, dOffs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true, sWarn
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
@@ -783,11 +764,6 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Applicazione della lavorazione
|
-- Applicazione della lavorazione
|
||||||
function ProcessFreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
function ProcessFreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||||
-- riassegno Q nel caso la funzione sia richiamata da un'altra make
|
|
||||||
if Proc.Prc == 70 then
|
|
||||||
Q_DEPTH_CHAMFER = 'Q01'
|
|
||||||
Q_DIM_STRIP = 'Q02'
|
|
||||||
end
|
|
||||||
-- recupero la tipologia
|
-- recupero la tipologia
|
||||||
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
|
local bPocket = ( EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1)
|
||||||
-- se svuotatura
|
-- se svuotatura
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
-- ProcessSplit.lua by Egaltech s.r.l. 2022/09/26
|
-- ProcessSplit.lua by Egaltech s.r.l. 2022/08/18
|
||||||
-- Gestione calcolo tagli di testa per Travi
|
-- Gestione calcolo tagli di testa per Travi
|
||||||
-- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio di tipo diceCut.
|
-- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio di tipo diceCut.
|
||||||
-- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita.
|
-- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita.
|
||||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
||||||
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
|
||||||
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessHeadCut = {}
|
local ProcessHeadCut = {}
|
||||||
@@ -207,13 +205,12 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
-- se taglio per sezioni alte e larghe
|
-- se taglio per sezioni alte e larghe
|
||||||
if bBigSectionCut then
|
if bBigSectionCut then
|
||||||
if dOvmHead > 0 then
|
if dOvmHead > 0 then
|
||||||
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
|
||||||
-- se finitura con lama
|
-- se finitura con lama
|
||||||
if nQ05 == 1 or nQ05 == 0 then
|
if not nOriId or EgtGetInfo( nOriId, 'Q05', 'i') == 1 or EgtGetInfo( nOriId, 'Q05', 'i') == 0 then
|
||||||
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT)
|
local bOk, sErr = Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, nil, false, true, nil, nil, dCurrOvmT)
|
||||||
if not bOk then return bOk, sErr end
|
if not bOk then return bOk, sErr end
|
||||||
-- se finitura con truciolatore
|
-- se finitura con truciolatore
|
||||||
elseif nQ05 == 2 then
|
elseif EgtGetInfo( nOriId, 'Q05', 'i') == 2 then
|
||||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||||
if not b3Solid then
|
if not b3Solid then
|
||||||
local sErr = 'Error : part box not found'
|
local sErr = 'Error : part box not found'
|
||||||
@@ -252,11 +249,9 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
|
|||||||
end
|
end
|
||||||
-- se necessari tagli in doppio, eseguo gli opposti
|
-- se necessari tagli in doppio, eseguo gli opposti
|
||||||
if bDoubleCut then
|
if bDoubleCut then
|
||||||
-- gli accorciamenti vanno invertiti per il taglio opposto
|
|
||||||
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
|
|
||||||
for i = nCuts, 1, -1 do
|
for i = nCuts, 1, -1 do
|
||||||
local dCutOffset = ( i - 1) * dOffsL
|
local dCutOffset = ( i - 1) * dOffsL
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, '', b3Raw, true)
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
|
||||||
if not bOk then return false, sErr end
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+328
-284
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/09/27
|
-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/07/05
|
||||||
-- 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.
|
||||||
@@ -49,13 +49,8 @@
|
|||||||
-- 2022/06/29 Migliorate lavorazioni con fresatura di lato per L30 se parametro Q03=2. Ora con 4 facce / 3 facce a L può entrare una fresa grande fino al doppio dell'altezza della tasca / doppio della dimensione minima.
|
-- 2022/06/29 Migliorate lavorazioni con fresatura di lato per L30 se parametro Q03=2. Ora con 4 facce / 3 facce a L può entrare una fresa grande fino al doppio dell'altezza della tasca / doppio della dimensione minima.
|
||||||
-- 2022/07/05 Modifiche per sega a catena di testa e relativa MaxElev.
|
-- 2022/07/05 Modifiche per sega a catena di testa e relativa MaxElev.
|
||||||
-- 2022/07/12 In MakeByChainOrSaw aggiunto check per feature L20 usata in modo improprio e, nel caso, si passa a una lavorazione tasca.
|
-- 2022/07/12 In MakeByChainOrSaw aggiunto check per feature L20 usata in modo improprio e, nel caso, si passa a una lavorazione tasca.
|
||||||
|
-- 2022/07/19 Profondamente semplificata la funzione SetOpenSide. Modificata la MakeMoreFaces per cercare sempre OpenPocket in determinate condizioni.
|
||||||
-- 2022/08/11 Aggiunta lavorazione tunnel splittata con sega a catena per tutte le macchine ad esclusione della Fast.
|
-- 2022/08/11 Aggiunta lavorazione tunnel splittata con sega a catena per tutte le macchine ad esclusione della Fast.
|
||||||
-- 2022/09/01 Spostate le funzioni GetTunnelDimension, CalcCollisionSafety, SetOpenSide in BeamLib.
|
|
||||||
-- 2022/09/15 Implementata gestione feature Planing L090, gestita come LapJoint
|
|
||||||
-- Implementata, in caso di fresatura di lato con altezza tasca molto bassa, la contornatura con unica passata
|
|
||||||
-- Migliorata gestione AntiSplint (Mill e Saw)
|
|
||||||
-- 2022/09/27 Aggiunta gestione SCC per svuotature con TURN (solo dopo applicazione lavorazione).
|
|
||||||
-- 2022/10/20 In MakeByChainOrSaw modificato check per trovare la faccia adiacente sul lato più lungo.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLapJoint = {}
|
local ProcessLapJoint = {}
|
||||||
@@ -106,7 +101,6 @@ function ProcessLapJoint.Identify( Proc)
|
|||||||
(( 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
|
||||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34) or
|
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 34) or
|
||||||
(( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90) or
|
|
||||||
( Proc.Grp == 4 and Proc.Prc == 37) or
|
( Proc.Grp == 4 and Proc.Prc == 37) or
|
||||||
( Proc.Grp == 4 and Proc.Prc == 39) or
|
( Proc.Grp == 4 and Proc.Prc == 39) or
|
||||||
( Proc.Grp == 4 and Proc.Prc == 120))
|
( Proc.Grp == 4 and Proc.Prc == 120))
|
||||||
@@ -164,9 +158,6 @@ local function AssignQIdent( Proc)
|
|||||||
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
|
Q_CONTOUR_SMALL_TOOL = 'Q01' -- i
|
||||||
Q_USE_MILL = 'Q02' -- i
|
Q_USE_MILL = 'Q02' -- i
|
||||||
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
Q_ANTISPLINT_TYPE = 'Q06' -- i
|
||||||
elseif ( Proc.Grp == 3 or Proc.Grp == 4) and Proc.Prc == 90 then
|
|
||||||
Q_ANTISPLINT_TYPE = 'Q03' -- i
|
|
||||||
Q_SIDE_ROUGH_TOOL = 'Q04' -- i
|
|
||||||
end
|
end
|
||||||
-- le altre features gestite non hanno parametri Q
|
-- le altre features gestite non hanno parametri Q
|
||||||
end
|
end
|
||||||
@@ -454,6 +445,62 @@ local function VerifyBHSideMill( Proc, bIsU, bIsL, bSinglePart, bPrevBhSideMill)
|
|||||||
return bUseBHSideMill, bHead, bHeadDir, sMilling, dToolThick, dToolDiam
|
return bUseBHSideMill, bHead, bHeadDir, sMilling, dToolThick, dToolDiam
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
local function GetTunnelDimension( Proc, nPartId)
|
||||||
|
-- sono necessarie almeno due facce
|
||||||
|
if Proc.Fct < 2 then return 0, 0, 0 end
|
||||||
|
-- recupero l'ingombro della trave
|
||||||
|
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||||
|
-- recupero centro e normale delle facce
|
||||||
|
local ptC = {}
|
||||||
|
local vtN = {}
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
ptC[i], vtN[i] = EgtSurfTmFacetCenter( 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
|
||||||
|
return 0, 0, 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- ottengo il boundingBox e prendo le dimensioni lungo la direzione (Z locale) che rappresenta la profondità della fessura
|
||||||
|
local frFc = Frame3d( ptC[1], vtOrtho) ;
|
||||||
|
local b3BoxLoc = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, frFc)
|
||||||
|
local dDepth = b3BoxLoc:getDimZ()
|
||||||
|
-- recupero gruppo per geometria addizionale
|
||||||
|
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||||
|
if not nAddGrpId then
|
||||||
|
EgtOutLog( 'Error : missing AddGroup')
|
||||||
|
return 0, 0, 0
|
||||||
|
end
|
||||||
|
-- centro del bounding box locale
|
||||||
|
local ptCen = b3BoxLoc:getCenter()
|
||||||
|
ptCen:toGlob( frFc)
|
||||||
|
-- creo superficie intermedia
|
||||||
|
local nSurfInt = EgtSurfTmPlaneInBBox( nAddGrpId, ptCen, vtOrtho, b3Solid, GDB_ID.ROOT)
|
||||||
|
if not nSurfInt then return 0, 0, 0 end
|
||||||
|
-- ritaglio la superficie con le facce della fessura
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
EgtCutSurfTmPlane( nSurfInt, ptC[i], -vtN[i], false, GDB_ID.ROOT)
|
||||||
|
end
|
||||||
|
local frSurfInt, dDimMax, dDimMin = EgtSurfTmFacetMinAreaRectangle( nSurfInt, 0, GDB_ID.ROOT)
|
||||||
|
-- cerco la faccia con larghezza pari a dimensione massima della fessura
|
||||||
|
local nLongIdFace = 0
|
||||||
|
for i = 1, Proc.Fct do
|
||||||
|
if abs( vtN[i] * frSurfInt:getVersX()) < 0.5 then
|
||||||
|
nLongIdFace = i - 1
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return dDimMin, dDimMax, dDepth, vtOrtho, nLongIdFace, nSurfInt
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function GetFaceAdj( Proc, nFacInd, dH, dV)
|
local function GetFaceAdj( Proc, nFacInd, dH, dV)
|
||||||
|
|
||||||
@@ -488,6 +535,23 @@ local function GetFaceAdj( Proc, nFacInd, dH, dV)
|
|||||||
return nFacAdj
|
return nFacAdj
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
local function CalcCollisionSafety( vtDir)
|
||||||
|
local dCollSic = 10 * BD.COLL_SIC
|
||||||
|
if abs( vtDir:getX()) > 0.999 or abs( vtDir:getY()) > 0.999 or abs( vtDir:getZ()) > 0.999 then
|
||||||
|
dCollSic = 0
|
||||||
|
elseif abs( vtDir:getX()) > 0.996 or abs( vtDir:getY()) > 0.996 or abs( vtDir:getZ()) > 0.996 then
|
||||||
|
dCollSic = 1 * BD.COLL_SIC
|
||||||
|
elseif abs( vtDir:getX()) > 0.89 or abs( vtDir:getY()) > 0.89 or abs( vtDir:getZ()) > 0.89 then
|
||||||
|
dCollSic = 2.5 * BD.COLL_SIC
|
||||||
|
elseif abs( vtDir:getX()) > 0.86 or abs( vtDir:getY()) > 0.86 or abs( vtDir:getZ()) > 0.86 then
|
||||||
|
dCollSic = 4 * BD.COLL_SIC
|
||||||
|
elseif abs( vtDir:getX()) > 0.707 or abs( vtDir:getY()) > 0.707 or abs( vtDir:getZ()) > 0.707 then
|
||||||
|
dCollSic = 5.5 * BD.COLL_SIC
|
||||||
|
end
|
||||||
|
return dCollSic
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
local function UpdateEncumbrance( Proc, nRawId, b3Raw, b3Solid)
|
||||||
-- verifico siano una o due facce
|
-- verifico siano una o due facce
|
||||||
@@ -695,7 +759,7 @@ function ProcessLapJoint.Classify( Proc, b3Raw)
|
|||||||
-- 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
|
||||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||||
EgtErase( nSurfInt)
|
EgtErase( nSurfInt)
|
||||||
-- verifico se può essere fatto con svuotatura
|
-- verifico se può essere fatto con svuotatura
|
||||||
if VerifyPocket( Proc, dDimMin) then
|
if VerifyPocket( Proc, dDimMin) then
|
||||||
@@ -1260,6 +1324,179 @@ local function CheckToInvert( AuxId, bPositive)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
local function SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId, nStartPoint)
|
||||||
|
-- fondo tra loro le curve compatibili
|
||||||
|
EgtMergeCurvesInCurveCompo( nPathInt)
|
||||||
|
local nStartIdEnt, nNumEnt = EgtCurveDomain( nPathInt)
|
||||||
|
local pLastPIni, pLastPEnd
|
||||||
|
-- faccio una copia della curva e la esplodo
|
||||||
|
if nStartIdEnt then
|
||||||
|
-- ciclo i lati della curva e controllo per ognuno se giace in uno dei piani limite del pezzo: se sì allora il lato è aperto
|
||||||
|
for i = 1, nNumEnt do
|
||||||
|
local pPini = EgtUP( nPathInt, (i-1), GDB_RT.GLOB)
|
||||||
|
local pPend = EgtUP( nPathInt, EgtIf( i == nNumEnt, 0, i), GDB_RT.GLOB)
|
||||||
|
if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||||
|
-- scrivo nelle proprietà della curva quali sono i lati aperti
|
||||||
|
local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||||
|
if #sActInfo > 0 then
|
||||||
|
-- se ci sono già altri lati aperti
|
||||||
|
EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||||
|
else
|
||||||
|
-- se è l'unico
|
||||||
|
EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||||
|
end
|
||||||
|
-- inizio - 20220719 codice vecchio mantenuto per backup
|
||||||
|
-- -- Se normale lungo la Z considero il box in X e Y
|
||||||
|
-- if abs(vtOrtho:getZ()) > 0.999 then
|
||||||
|
-- -- se corrisponde a X
|
||||||
|
-- if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
-- ( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||||
|
-- -- setto l'entità open
|
||||||
|
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||||
|
-- if #sActInfo > 0 then
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||||
|
-- else
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||||
|
-- end
|
||||||
|
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||||
|
-- pLastPIni = pPini
|
||||||
|
-- pLastPEnd = pPend
|
||||||
|
-- -- altrimenti se corrisponde a Y
|
||||||
|
-- elseif ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
-- ( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||||
|
-- -- setto l'entità open
|
||||||
|
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||||
|
-- if #sActInfo > 0 then
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||||
|
-- else
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||||
|
-- end
|
||||||
|
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||||
|
-- pLastPIni = pPini
|
||||||
|
-- pLastPEnd = pPend
|
||||||
|
-- end
|
||||||
|
-- -- altrimenti se normale lungo la Y considero il box in X e Z
|
||||||
|
-- elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getY()) > 0.999 then
|
||||||
|
-- -- se corrisponde a X
|
||||||
|
-- if ( abs( pPini:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
-- ( abs( pPini:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL and abs( pPend:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL) then
|
||||||
|
-- -- setto l'entità open
|
||||||
|
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||||
|
-- if #sActInfo > 0 then
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||||
|
-- else
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||||
|
-- end
|
||||||
|
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||||
|
-- pLastPIni = pPini
|
||||||
|
-- pLastPEnd = pPend
|
||||||
|
-- -- altrimenti se corrisponde a Z
|
||||||
|
-- elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
-- ( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||||
|
-- -- setto l'entità open
|
||||||
|
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||||
|
-- if #sActInfo > 0 then
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||||
|
-- else
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||||
|
-- end
|
||||||
|
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||||
|
-- pLastPIni = pPini
|
||||||
|
-- pLastPEnd = pPend
|
||||||
|
-- end
|
||||||
|
-- -- caso che non dovrebbe mai capitare ma gestito per completezza
|
||||||
|
-- -- altrimenti se normale lungo la X considero il box in Y e Z
|
||||||
|
-- elseif abs(vtOrtho:getZ()) < 0.001 and abs(vtOrtho:getX()) > 0.999 then
|
||||||
|
-- -- se corrisponde a Y
|
||||||
|
-- if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
-- ( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||||
|
-- -- setto l'entità open
|
||||||
|
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||||
|
-- if #sActInfo > 0 then
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||||
|
-- else
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||||
|
-- end
|
||||||
|
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||||
|
-- pLastPIni = pPini
|
||||||
|
-- pLastPEnd = pPend
|
||||||
|
-- -- altrimenti se corrisponde a Z
|
||||||
|
-- elseif ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
-- ( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||||
|
-- -- setto l'entità open
|
||||||
|
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||||
|
-- if #sActInfo > 0 then
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||||
|
-- else
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||||
|
-- end
|
||||||
|
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||||
|
-- pLastPIni = pPini
|
||||||
|
-- pLastPEnd = pPend
|
||||||
|
-- end
|
||||||
|
-- -- se asse Z orizzontale verifico se si avvicina piú a Y
|
||||||
|
-- elseif abs(vtOrtho:getZ()) < 0.001 then
|
||||||
|
-- if abs(vtOrtho:getY()) > 0.75 then
|
||||||
|
-- -- se corrisponde a Z
|
||||||
|
-- if ( abs( pPini:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMax():getZ()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
-- ( abs( pPini:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL and abs( pPend:getZ() - b3Solid:getMin():getZ()) < 10 * GEO.EPS_SMALL) then
|
||||||
|
-- -- setto l'entità open
|
||||||
|
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||||
|
-- if #sActInfo > 0 then
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||||
|
-- else
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||||
|
-- end
|
||||||
|
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||||
|
-- pLastPIni = pPini
|
||||||
|
-- pLastPEnd = pPend
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
-- -- se asse Y a 0 (fresa ne davanti ne dietro) verifico se si avvicina piú a Z+
|
||||||
|
-- elseif abs(vtOrtho:getY()) < 0.001 then
|
||||||
|
-- if abs(vtOrtho:getZ()) > 0.75 then
|
||||||
|
-- -- se corrisponde a Y
|
||||||
|
-- if ( abs( pPini:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMax():getY()) < 10 * GEO.EPS_SMALL) or
|
||||||
|
-- ( abs( pPini:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL and abs( pPend:getY() - b3Solid:getMin():getY()) < 10 * GEO.EPS_SMALL) then
|
||||||
|
-- -- setto l'entità open
|
||||||
|
-- local sActInfo = EgtGetInfo( nPathInt, 'OPEN', 's') or ''
|
||||||
|
-- if #sActInfo > 0 then
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', sActInfo .. ',' .. (i-1))
|
||||||
|
-- else
|
||||||
|
-- EgtSetInfo( nPathInt, 'OPEN', (i-1))
|
||||||
|
-- end
|
||||||
|
-- -- prendo i punti per eventuale modifica del punto di inizio percorso
|
||||||
|
-- pLastPIni = pPini
|
||||||
|
-- pLastPEnd = pPend
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
-- fine - 20220719 codice vecchio mantenuto per backup
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- se devo cambiare il punto di partenza
|
||||||
|
if nStartPoint then
|
||||||
|
if pLastPIni and pLastPEnd then
|
||||||
|
-- calcolo il punto medio con gli ultimi punti utilizzati
|
||||||
|
local ptPs = ( pLastPIni + pLastPEnd) / 2
|
||||||
|
EgtChangeClosedCurveStartPoint( nPathInt, ptPs, GDB_RT.GLOB)
|
||||||
|
-- se devo eliminare la parte open, nei casi in cui la funzione caller non faccia in automatico il check
|
||||||
|
if nStartPoint == 2 then
|
||||||
|
EgtRemoveCurveCompoCurve( nPathInt, true)
|
||||||
|
EgtRemoveCurveCompoCurve( nPathInt, false)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function MakeRoundCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw,
|
local function MakeRoundCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw,
|
||||||
nFacInd, nAddGrpId, dDiam, bMillDown, bDoubleSide)
|
nFacInd, nAddGrpId, dDiam, bMillDown, bDoubleSide)
|
||||||
@@ -1506,7 +1743,7 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
-- distanza di sicurezza per evitare collisioni
|
-- distanza di sicurezza per evitare collisioni
|
||||||
dCollSic = BL.CalcCollisionSafety( vtN1)
|
dCollSic = CalcCollisionSafety( vtN1)
|
||||||
-- elevazione massima della faccia
|
-- elevazione massima della faccia
|
||||||
dMaxElev = BL.GetFaceElevation( Proc.Id, nFacInd, nPartId)
|
dMaxElev = BL.GetFaceElevation( Proc.Id, nFacInd, nPartId)
|
||||||
-- ciclo tutta la tabella
|
-- ciclo tutta la tabella
|
||||||
@@ -1551,7 +1788,7 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|||||||
nFirstId = EgtCopyGlob( nPathInt, nAddGrpId)
|
nFirstId = EgtCopyGlob( nPathInt, nAddGrpId)
|
||||||
nNumId = 1
|
nNumId = 1
|
||||||
-- distanza di sicurezza per evitare collisioni
|
-- distanza di sicurezza per evitare collisioni
|
||||||
dCollSic = BL.CalcCollisionSafety( vtOrtho)
|
dCollSic = CalcCollisionSafety( vtOrtho)
|
||||||
-- calcolo elevazione dalla faccia trasversale aggiunta
|
-- calcolo elevazione dalla faccia trasversale aggiunta
|
||||||
local dSurfIntElev = BL.GetOtherFaceElevation( Proc.Id, nSurfInt, 0)
|
local dSurfIntElev = BL.GetOtherFaceElevation( Proc.Id, nSurfInt, 0)
|
||||||
if bDoubleSide then
|
if bDoubleSide then
|
||||||
@@ -1575,8 +1812,8 @@ local function MakeRoundCleanContour( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|||||||
end
|
end
|
||||||
-- normale alla faccia aggiunta
|
-- normale alla faccia aggiunta
|
||||||
vtN1 = Vector3d( vtOrtho)
|
vtN1 = Vector3d( vtOrtho)
|
||||||
-- imposto i lati aperti
|
-- imposto i lati aperti e con il parametro 2 li cancello per evitare di lavorarli
|
||||||
BL.SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se non trovato il percorso, esco
|
-- se non trovato il percorso, esco
|
||||||
@@ -2328,7 +2565,7 @@ local function MakeChamfer( Proc, bIs3Faces, nAddGrpId, vtOrtho, b3Solid, nSurfI
|
|||||||
if bIs3Faces then
|
if bIs3Faces then
|
||||||
-- nAuxId1, _ = EgtExtractSurfTmLoops( nSurfInt, nAddGrpId)
|
-- nAuxId1, _ = EgtExtractSurfTmLoops( nSurfInt, nAddGrpId)
|
||||||
-- EgtModifyCurveExtrusion( nAuxId1, vtOrtho, GDB_RT.GLOB)
|
-- EgtModifyCurveExtrusion( nAuxId1, vtOrtho, GDB_RT.GLOB)
|
||||||
-- BL.SetOpenSide( nAuxId1, vtOrtho, b3Solid, nAddGrpId, 1)
|
-- SetOpenSide( nAuxId1, vtOrtho, b3Solid, nAddGrpId, 1)
|
||||||
-- nNumIdAux = 2
|
-- nNumIdAux = 2
|
||||||
|
|
||||||
-- estraggo i percorsi
|
-- estraggo i percorsi
|
||||||
@@ -2444,7 +2681,7 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|||||||
end
|
end
|
||||||
if bOrthoFaces then
|
if bOrthoFaces then
|
||||||
-- ottengo le dimensioni del tunnel
|
-- ottengo le dimensioni del tunnel
|
||||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||||
end
|
end
|
||||||
-- 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]
|
||||||
@@ -2605,7 +2842,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|||||||
|
|
||||||
if bOrthoFaces then
|
if bOrthoFaces then
|
||||||
-- ottengo le dimensioni del tunnel
|
-- ottengo le dimensioni del tunnel
|
||||||
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||||
-- verifico la direzione
|
-- verifico la direzione
|
||||||
-- se devo inserire il chamfer
|
-- se devo inserire il chamfer
|
||||||
if nChamfer > 0 then
|
if nChamfer > 0 then
|
||||||
@@ -2627,7 +2864,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
|
|||||||
for i = 1, #vAdj do
|
for i = 1, #vAdj do
|
||||||
if vAdj[i] >= 0 then
|
if vAdj[i] >= 0 then
|
||||||
local vtAdjN = EgtSurfTmFacetNormVersor( Proc.Id, vAdj[i], GDB_ID.ROOT)
|
local vtAdjN = EgtSurfTmFacetNormVersor( Proc.Id, vAdj[i], GDB_ID.ROOT)
|
||||||
if not bIs3Faces or abs( rfFac:getVersZ():getY()) < 0.174 or abs( rfFac:getVersZ():getY()) > 0.984 or vtAdjN:getY() * rfFac:getVersZ():getY() > -0.1 then
|
if not bIs3Faces or abs( rfFac:getVersZ():getY()) < 0.174 or abs( rfFac:getVersZ():getY()) > 0.984 or vtAdjN:getY() * rfFac:getVersZ():getY() > 0.1 then
|
||||||
local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, nFacInd, vAdj[i], GDB_ID.ROOT)
|
local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, nFacInd, vAdj[i], GDB_ID.ROOT)
|
||||||
local dLen = dist( ptP1, ptP2)
|
local dLen = dist( ptP1, ptP2)
|
||||||
if dLen > dMaxLen then
|
if dLen > dMaxLen then
|
||||||
@@ -2992,11 +3229,10 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- eseguo il taglio
|
-- eseguo il taglio
|
||||||
local dVzLimDwnUp = EgtIf( BD.TURN, -2, nil)
|
local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, nil, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, dVzLimDwnUp, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
|
||||||
if bMadeASbyBld then
|
if bMadeASbyBld then
|
||||||
sWarn = nil
|
sWarn = nil
|
||||||
if not bReduceDepth and abs(dExtraOffs) > 0 then
|
if abs(dExtraOffs) > 0 then
|
||||||
sWarn = 'Warning : antisplint elevation is bigger than max tool depth'
|
sWarn = 'Warning : antisplint elevation is bigger than max tool depth'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -3004,7 +3240,7 @@ 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)
|
local function MakePocket( Proc, nPartId, ptPs, tvtN, nFaceRef, sMchFind, nUseRoughTool, sMasterPocket, dPrevFaceElev, tDimAndRef, dAng, bOpenOutRaw)
|
||||||
|
|
||||||
-- calcolo l'elevazione dal punto medio
|
-- calcolo l'elevazione dal punto medio
|
||||||
local dElev
|
local dElev
|
||||||
@@ -3098,10 +3334,8 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
|||||||
end
|
end
|
||||||
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
||||||
local sWarn
|
local sWarn
|
||||||
local dDepth = dElev
|
|
||||||
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then
|
||||||
dDepth = dMaxDepth - dElev
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMaxDepth - dElev)
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth)
|
|
||||||
dElev = dMaxDepth
|
dElev = dMaxDepth
|
||||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||||
EgtOutLog( sWarn)
|
EgtOutLog( sWarn)
|
||||||
@@ -3122,25 +3356,7 @@ local function MakePocket( Proc, nPartId, b3Solid, ptPs, tvtN, nFaceRef, sMchFin
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if BD.TURN then
|
return true, sWarn, sTuuidPk, dDiamTool
|
||||||
-- centro del pezzo
|
|
||||||
local ptCen = ORIG()
|
|
||||||
if b3Solid then ptCen = b3Solid:getCenter() end
|
|
||||||
-- punto inizio lavorazione
|
|
||||||
local ptStart = EgtGetMachiningStartPoint() or ORIG()
|
|
||||||
-- orientamento braccio
|
|
||||||
local nSCC = MCH_SCC.NONE
|
|
||||||
-- se faccia verso alto o basso
|
|
||||||
if abs( tvtN[2]:getZ()) > abs( tvtN[2]:getY()) then
|
|
||||||
nSCC = EgtIf( ptStart:getY() > ptCen:getY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
|
||||||
-- altrimenti faccia verso davanti o dietro
|
|
||||||
else
|
|
||||||
nSCC = EgtIf( ptStart:getZ() > ptCen:getZ(), MCH_SCC.ADIR_ZP, MCH_SCC.ADIR_ZM)
|
|
||||||
end
|
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
|
||||||
ML.ApplyMachining( true, false)
|
|
||||||
end
|
|
||||||
return true, sWarn, sTuuidPk, dDiamTool, dDepth
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
@@ -3165,7 +3381,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, ptPs, tvtN, nSideFace, sMchFind, nUseRoughTool, sPocketing, dPrevFaceElev, tDimAndRef, dAng)
|
||||||
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
|
||||||
@@ -3292,27 +3508,15 @@ local function MachineByMill( Proc, nPhase, nRawId, nPartId, b3Solid, tvtN, nBas
|
|||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dTDiam / 2)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dTDiam / 2)
|
||||||
else
|
else
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dTDiam / 2)
|
EgtSetMachiningParam( MCH_MP.STARTADDLEN, -dTDiam / 2)
|
||||||
-- forzo attacco lineare
|
|
||||||
if dElev > 0 then
|
if dElev > 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if bOpenEnd then
|
if bOpenEnd then
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dTDiam / 2)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dTDiam / 2)
|
||||||
else
|
else
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dTDiam / 2)
|
EgtSetMachiningParam( MCH_MP.ENDADDLEN, -dTDiam / 2)
|
||||||
-- forzo attacco lineare
|
|
||||||
if dElev > 0 then
|
if dElev > 0 then
|
||||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, dElev)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
EgtSetMachiningParam( MCH_MP.LOPERP, dElev)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -3356,7 +3560,7 @@ local function GetUShapeWidth( Proc, nFacInd)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFindMaster, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMchFindMaster, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders)
|
||||||
|
|
||||||
local nFirstMachId
|
local nFirstMachId
|
||||||
local bOrthoFaces
|
local bOrthoFaces
|
||||||
@@ -3364,8 +3568,6 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
local sMchFind = 'Pocket'
|
local sMchFind = 'Pocket'
|
||||||
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt
|
local dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt
|
||||||
local bBadMach = false
|
local bBadMach = false
|
||||||
-- minima altezza della tasca sotto alla quale fa una contornatura invece di una svuotatura
|
|
||||||
local dMinFaceElevForPocket = 20
|
|
||||||
if sMchFindMaster and #sMchFindMaster > 0 then
|
if sMchFindMaster and #sMchFindMaster > 0 then
|
||||||
sMchFind = sMchFindMaster
|
sMchFind = sMchFindMaster
|
||||||
end
|
end
|
||||||
@@ -3388,7 +3590,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
-- se è un tunnel verifico se è possibile usare la svuotatura
|
-- se è un tunnel verifico se è possibile usare la svuotatura
|
||||||
if bOrthoFaces then
|
if bOrthoFaces then
|
||||||
-- ottengo le dimensioni del tunnel
|
-- ottengo le dimensioni del tunnel
|
||||||
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||||
-- se due facce posso utilizzare utensile con diametro doppio della dimensione minima
|
-- se due facce posso utilizzare utensile con diametro doppio della dimensione minima
|
||||||
if Proc.Fct == 2 then
|
if Proc.Fct == 2 then
|
||||||
dDimMin = 2 * dDimMin
|
dDimMin = 2 * dDimMin
|
||||||
@@ -3421,31 +3623,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)
|
if bMakePocket then
|
||||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT)
|
|
||||||
local bMakeContour = false
|
|
||||||
local sMilling
|
|
||||||
if dFacElev < dMinFaceElevForPocket and ( bIsU or bIsL) and ( Proc.Fct == 2 or Proc.Fct == 3) and abs( vtN:getZ()) > 0.996 then
|
|
||||||
bMakeContour = true
|
|
||||||
-- recupero la lavorazione di contornatura
|
|
||||||
sMilling = ML.FindMilling( 'Prof', nil, nil, nil, nil, not bMillDown, bMillDown)
|
|
||||||
if not sMilling then
|
|
||||||
local sMyWarn = 'Warning : Prof not found in library'
|
|
||||||
EgtOutLog( sMyWarn)
|
|
||||||
return true, sMyWarn
|
|
||||||
end
|
|
||||||
-- recupero i dati dell'utensile
|
|
||||||
dDiamTool = 50
|
|
||||||
dMaxDepth = 0
|
|
||||||
if EgtMdbSetCurrMachining( sMilling) then
|
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
|
||||||
dDiamTool = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dMillDiam
|
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dToolMaxDepth
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if bMakePocket or bMakeContour then
|
|
||||||
-- gestione svuotatura da un solo lato o anche dal lato opposto (se non verticale)
|
-- gestione svuotatura da un solo lato o anche dal lato opposto (se non verticale)
|
||||||
-- estraggo il contorno dalla superfice per evitare i problemi con la svuotatura
|
-- estraggo il contorno dalla superfice per evitare i problemi con la svuotatura
|
||||||
-- e assegno l'estrusione
|
-- e assegno l'estrusione
|
||||||
@@ -3453,7 +3631,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
EgtModifyCurveExtrusion( nPathInt, vtOrtho, GDB_RT.GLOB)
|
EgtModifyCurveExtrusion( nPathInt, vtOrtho, GDB_RT.GLOB)
|
||||||
-- se ho 3 facce oppure se forzato, ciclo sulle entià del percorso per segnare quelle che sono aperte.
|
-- se ho 3 facce oppure se forzato, ciclo sulle entià del percorso per segnare quelle che sono aperte.
|
||||||
if bIs3Faces or bSetOpenBorders then
|
if bIs3Faces or bSetOpenBorders then
|
||||||
BL.SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
|
SetOpenSide( nPathInt, vtOrtho, b3Solid, nAddGrpId)
|
||||||
end
|
end
|
||||||
-- variabili per parametri lavorazione
|
-- variabili per parametri lavorazione
|
||||||
local dMachDepth
|
local dMachDepth
|
||||||
@@ -3462,7 +3640,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
local bOneShot
|
local bOneShot
|
||||||
local bComplete = true
|
local bComplete = true
|
||||||
-- imposto altezza aggiuntiva di elevazione
|
-- imposto altezza aggiuntiva di elevazione
|
||||||
local dCollSic = BL.CalcCollisionSafety( vtOrtho)
|
local dCollSic = CalcCollisionSafety( vtOrtho)
|
||||||
-- se possibile svuotare completamente da una sola parte
|
-- se possibile svuotare completamente da una sola parte
|
||||||
if dMaxDepth > ( dDepth + BD.CUT_EXTRA + dCollSic) then
|
if dMaxDepth > ( dDepth + BD.CUT_EXTRA + dCollSic) then
|
||||||
dMachDepth = ( dDepth / 2) + BD.CUT_EXTRA
|
dMachDepth = ( dDepth / 2) + BD.CUT_EXTRA
|
||||||
@@ -3471,7 +3649,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
else
|
else
|
||||||
-- se direzione verso la verticale setto max affondamento possibile ed
|
-- se direzione verso la verticale setto max affondamento possibile ed
|
||||||
-- emetto messaggio di warning perché non lavorabile interamente
|
-- emetto messaggio di warning perché non lavorabile interamente
|
||||||
if abs( vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD and not bMakeContour then
|
if abs( vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
||||||
dMachDepth = dMaxDepth - ( dDepth / 2) - dCollSic
|
dMachDepth = dMaxDepth - ( dDepth / 2) - dCollSic
|
||||||
dElev = dMaxDepth
|
dElev = dMaxDepth
|
||||||
sWarn = 'Warning : elevation bigger than max tool depth'
|
sWarn = 'Warning : elevation bigger than max tool depth'
|
||||||
@@ -3506,49 +3684,29 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
local sErr = 'Impossible apply perpendicular pocketing: ' .. sPocketing
|
local sErr = 'Impossible apply perpendicular pocketing: ' .. sPocketing
|
||||||
return -2, sErr
|
return -2, sErr
|
||||||
end
|
end
|
||||||
local sName
|
-- inserisco la lavorazione di svuotatura
|
||||||
local nMchFId
|
local sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
if bMakeContour then
|
local nMchFId = EgtAddMachining( sName, sPocketing)
|
||||||
-- inserisco la lavorazione di contornatura
|
if not nMchFId then
|
||||||
sName = 'Prof_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
||||||
nMchFId = EgtAddMachining( sName, sMilling)
|
EgtOutLog( sErr)
|
||||||
if not nMchFId then
|
return -1, sErr
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
|
||||||
EgtOutLog( sErr)
|
|
||||||
return -1, sErr
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- altrimenti inserisco la lavorazione di svuotatura
|
|
||||||
sName = 'Pock_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
||||||
nMchFId = EgtAddMachining( sName, sPocketing)
|
|
||||||
if not nMchFId then
|
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sPocketing
|
|
||||||
EgtOutLog( sErr)
|
|
||||||
return -1, sErr
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
-- prendo l'id della prima lavorazione inserita
|
-- prendo l'id della prima lavorazione inserita
|
||||||
if not nFirstMachId then
|
if not nFirstMachId then
|
||||||
nFirstMachId = nMchFId
|
nFirstMachId = nMchFId
|
||||||
end
|
end
|
||||||
if bMakeContour then
|
-- aggiungo geometria
|
||||||
-- aggiungo geometria per contornatura
|
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
||||||
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd}})
|
|
||||||
else
|
|
||||||
-- altrimenti aggiungo geometria per svuotatura
|
|
||||||
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
|
||||||
end
|
|
||||||
-- verifico se devo invertire direzione utensile (in caso di direzione verso la verticale)
|
-- verifico se devo invertire direzione utensile (in caso di direzione verso la verticale)
|
||||||
local bInvertMach
|
local bInvertMach
|
||||||
if not bMakeContour then
|
if vtOrtho:getZ() < BD.NZ_MINA and abs(vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
||||||
if vtOrtho:getZ() < BD.NZ_MINA and abs(vtOrtho:getZ()) >= 0.707 and not BD.DOWN_HEAD then
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
bInvertMach = true
|
||||||
bInvertMach = true
|
-- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti
|
||||||
-- altrimenti se da fare in una sola volta e direzionato verso Y+ lo inverto per lavorarlo davanti
|
elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL and not ( -(vtOrtho:getZ()) < BD.NZ_MINA) then
|
||||||
elseif not bDoubleSide and vtOrtho:getY() > GEO.EPS_SMALL and not ( -(vtOrtho:getZ()) < BD.NZ_MINA) then
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
bInvertMach = true
|
||||||
bInvertMach = true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
-- imposto posizione braccio porta testa
|
-- imposto posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = MCH_SCC.NONE
|
||||||
@@ -3569,50 +3727,11 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||||
end
|
end
|
||||||
-- inverto il percorso di lavorazione per lavorare sinistro
|
-- inverto il percorso di lavorazione per lavorare sinistro
|
||||||
if not bMakeContour then
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
|
||||||
end
|
|
||||||
-- imposto affondamento
|
-- imposto affondamento
|
||||||
if not bMakeContour then
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
|
||||||
end
|
|
||||||
-- se contornatura doppia anticipo la fine della lavorazione a metà trave
|
|
||||||
if bMakeContour and bDoubleSide then
|
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSL, dDepth / 2)
|
|
||||||
end
|
|
||||||
-- se contornatura cerco la direzione di lavoro migliore e setto attacco e allungamenti
|
|
||||||
if bMakeContour then
|
|
||||||
local nFaceUse = BL.GetNearestParalOpposite( vtOrtho)
|
|
||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
|
||||||
-- quantità di cui allargare la contornatura per andare in tangenza con lo spigolo, nel caso di altezza tasca minore di D/2 fresa
|
|
||||||
local dAddWorkWidth = EgtIf( dFacElev < dDiamTool / 2, -sqrt( dFacElev * dDiamTool - dFacElev * dFacElev), -dDiamTool / 2)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
|
||||||
if bIsU then
|
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
|
||||||
elseif bIsL then
|
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, 30)
|
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.TANGENT)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 30)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||||
local sNotes = ''
|
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||||
if not bMakeContour then
|
|
||||||
sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
|
||||||
end
|
|
||||||
sNotes = sNotes .. 'VMRS=0;'
|
sNotes = sNotes .. 'VMRS=0;'
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
@@ -3655,36 +3774,20 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
EgtOutLog( sWarn)
|
EgtOutLog( sWarn)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if bMakeContour then
|
-- inserisco la lavorazione di svuotatura
|
||||||
-- inserisco la lavorazione di contornatura
|
local sName = 'PockOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
sName = 'ProfOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local nMchFId = EgtAddMachining( sName, EgtIf( bMakePocketDn, sPocketingDn, sPocketing))
|
||||||
nMchFId = EgtAddMachining( sName, sMilling)
|
if not nMchFId then
|
||||||
if not nMchFId then
|
local sErr = 'Error adding machining ' .. sName .. '-' .. EgtIf( bMakePocketDn, sPocketingDn, sPocketing)
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
|
EgtOutLog( sErr)
|
||||||
EgtOutLog( sErr)
|
return -1, sErr
|
||||||
return -1, sErr
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- inserisco la lavorazione di svuotatura
|
|
||||||
sName = 'PockOppo_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
|
||||||
nMchFId = EgtAddMachining( sName, EgtIf( bMakePocketDn, sPocketingDn, sPocketing))
|
|
||||||
if not nMchFId then
|
|
||||||
local sErr = 'Error adding machining ' .. sName .. '-' .. EgtIf( bMakePocketDn, sPocketingDn, sPocketing)
|
|
||||||
EgtOutLog( sErr)
|
|
||||||
return -1, sErr
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
-- prendo l'id della prima lavorazione inserita
|
-- prendo l'id della prima lavorazione inserita
|
||||||
if not nFirstMachId then
|
if not nFirstMachId then
|
||||||
nFirstMachId = nMchFId
|
nFirstMachId = nMchFId
|
||||||
end
|
end
|
||||||
if bMakeContour then
|
-- aggiungo geometria
|
||||||
-- aggiungo geometria per contornatura
|
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
||||||
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd}})
|
|
||||||
else
|
|
||||||
-- altrimenti aggiungo geometria per svuotatura
|
|
||||||
EgtSetMachiningGeometry( {{ nPathInt, -1}})
|
|
||||||
end
|
|
||||||
-- imposto direzione utensile opposta
|
-- imposto direzione utensile opposta
|
||||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||||
-- imposto posizione braccio porta testa
|
-- imposto posizione braccio porta testa
|
||||||
@@ -3706,49 +3809,11 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
EgtSetMachiningParam( MCH_MP.SUBTYPE, MCH_POCK_SUB.SPIRALIN)
|
||||||
end
|
end
|
||||||
-- inverto il percorso di lavorazione per lavorare sinistro
|
-- inverto il percorso di lavorazione per lavorare sinistro
|
||||||
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
EgtSetMachiningParam( MCH_MP.INVERT, true)
|
||||||
-- imposto affondamento
|
-- imposo affondamento
|
||||||
if not bMakeContour then
|
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
||||||
EgtSetMachiningParam( MCH_MP.DEPTH, dMachDepth)
|
|
||||||
end
|
|
||||||
-- se contornatura doppia anticipo la fine della lavorazione a metà trave
|
|
||||||
if bMakeContour and bDoubleSide then
|
|
||||||
EgtSetMachiningParam( MCH_MP.OFFSL, dDepth / 2)
|
|
||||||
end
|
|
||||||
-- se contornatura cerco la direzione di lavoro migliore
|
|
||||||
if bMakeContour then
|
|
||||||
local nFaceUse = BL.GetNearestParalOpposite( vtOrtho)
|
|
||||||
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
|
|
||||||
-- quantità di cui allargare la contornatura per andare in tangenza con lo spigolo, nel caso di altezza tasca minore di D/2 fresa
|
|
||||||
local dAddWorkWidth = EgtIf( dFacElev < dDiamTool / 2, -sqrt( dFacElev * dDiamTool - dFacElev * dFacElev), -dDiamTool / 2)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LIELEV, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOELEV, 0)
|
|
||||||
if bIsU then
|
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAddWorkWidth)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.LINEAR)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, 30)
|
|
||||||
elseif bIsL then
|
|
||||||
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAddWorkWidth)
|
|
||||||
EgtSetMachiningParam( MCH_MP.ENDADDLEN, 30)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LEADINTYPE, MCH_MILL_LI.LINEAR)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LI.TANGENT)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOTANG, 30)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, 30)
|
|
||||||
EgtSetMachiningParam( MCH_MP.LOPERP, 0)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
-- imposto elevazione e dichiaro non si generano sfridi per VMill
|
||||||
sNotes = ''
|
local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
||||||
if not bMakeContour then
|
|
||||||
sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';'
|
|
||||||
end
|
|
||||||
sNotes = sNotes .. 'VMRS=0;'
|
sNotes = sNotes .. 'VMRS=0;'
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
@@ -3774,7 +3839,7 @@ local function MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCha
|
|||||||
end
|
end
|
||||||
if bPock3rd then
|
if bPock3rd then
|
||||||
-- recupero la distanza di sicurezza aggiuntiva
|
-- recupero la distanza di sicurezza aggiuntiva
|
||||||
local dFacCollSic = BL.CalcCollisionSafety( vtN)
|
local dFacCollSic = CalcCollisionSafety( vtN)
|
||||||
-- scelgo se lavorare da sotto
|
-- scelgo se lavorare da sotto
|
||||||
local bFacPocketDn = ( bMakePocketDn and vtN:getZ() < -0.174)
|
local bFacPocketDn = ( bMakePocketDn and vtN:getZ() < -0.174)
|
||||||
-- inserisco la lavorazione di svuotatura
|
-- inserisco la lavorazione di svuotatura
|
||||||
@@ -4168,7 +4233,7 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|||||||
end
|
end
|
||||||
-- prendo il primo versore
|
-- prendo il primo versore
|
||||||
_, vtN1 = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
_, vtN1 = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
dCollSic = BL.CalcCollisionSafety( vtN1) or 0
|
dCollSic = CalcCollisionSafety( vtN1) or 0
|
||||||
-- se direzione tende verso una delle alle 3 direzioni azzero l'altezza extra
|
-- se direzione tende verso una delle alle 3 direzioni azzero l'altezza extra
|
||||||
if abs( vtN1:getX()) > 0.7 or abs( vtN1:getY()) > 0.7 or abs( vtN1:getZ()) > 0.7 then dCollSic = 0 end
|
if abs( vtN1:getX()) > 0.7 or abs( vtN1:getY()) > 0.7 or abs( vtN1:getZ()) > 0.7 then dCollSic = 0 end
|
||||||
|
|
||||||
@@ -4225,7 +4290,7 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|||||||
-- alrimenti ho la faccia aggiunta
|
-- alrimenti ho la faccia aggiunta
|
||||||
else
|
else
|
||||||
|
|
||||||
dCollSic = BL.CalcCollisionSafety( vtOrtho)
|
dCollSic = CalcCollisionSafety( vtOrtho)
|
||||||
nFirstId = EgtCopyGlob( nPathInt, nAddGrpId)
|
nFirstId = EgtCopyGlob( nPathInt, nAddGrpId)
|
||||||
nNumId = 1
|
nNumId = 1
|
||||||
-- calcolo elevazione dalla faccia trasversale aggiunta
|
-- calcolo elevazione dalla faccia trasversale aggiunta
|
||||||
@@ -4249,7 +4314,8 @@ local function ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
vtN1 = Vector3d(vtOrtho)
|
vtN1 = Vector3d(vtOrtho)
|
||||||
local bOkPath = BL.SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
-- imposto i lati aperti e con il parametro 2 li cancello per evitare di lavorarli
|
||||||
|
local bOkPath = SetOpenSide( nFirstId, vtOrtho, b3Solid, nAddGrpId, 2)
|
||||||
-- se non ho un percorso chiuso estraggo i percorsi
|
-- se non ho un percorso chiuso estraggo i percorsi
|
||||||
if bOkPath then
|
if bOkPath then
|
||||||
-- creo percorsi antisplint dagli estremi dei percorsi di contorno trovati
|
-- creo percorsi antisplint dagli estremi dei percorsi di contorno trovati
|
||||||
@@ -4558,7 +4624,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- se lavorazione da sotto e lunga, va divisa in due metà
|
-- se lavorazione da sotto e lunga, va divisa in due metà
|
||||||
local bDouble = ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200) and not BD.TURN)
|
local bDouble = ( vtN:getZ() < -0.5 and dH > ( BD.MAX_LEN_BH_FROM_BOTTOM or 200))
|
||||||
-- inserisco la lavorazione di fresatura
|
-- inserisco la lavorazione di fresatura
|
||||||
local sName = 'BHMill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName = 'BHMill_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMchFId = EgtAddMachining( sName, sMilling)
|
local nMchFId = EgtAddMachining( sName, sMilling)
|
||||||
@@ -4588,7 +4654,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
sNotes = sNotes .. 'VMRS=0;'
|
sNotes = sNotes .. 'VMRS=0;'
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes)
|
||||||
-- attacchi e uscite
|
-- attacchi e uscite
|
||||||
if vtN:getZ() > -0.5 or BD.TURN then
|
if vtN:getZ() > -0.5 then
|
||||||
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
EgtSetMachiningParam( MCH_MP.LITANG, 0)
|
||||||
EgtSetMachiningParam( MCH_MP.LIPERP, dFacElev + BD.CUT_SIC)
|
EgtSetMachiningParam( MCH_MP.LIPERP, dFacElev + BD.CUT_SIC)
|
||||||
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, MCH_MILL_LO.AS_LI)
|
||||||
@@ -4609,20 +4675,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local nStepType = MCH_MILL_ST.ONEWAY
|
local nStepType = MCH_MILL_ST.ONEWAY
|
||||||
EgtSetMachiningParam( MCH_MP.STEPTYPE, nStepType)
|
EgtSetMachiningParam( MCH_MP.STEPTYPE, nStepType)
|
||||||
-- imposto posizione braccio porta testa
|
-- imposto posizione braccio porta testa
|
||||||
local nSCC = MCH_SCC.NONE
|
local nSCC = EgtIf( ( vtN:getY() > 0.5 or ( bHeadDir and vtN:getZ() > 0.5 ) or ( not bHeadDir and vtN:getZ() < -0.5)), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
||||||
if not BD.TURN then
|
|
||||||
nSCC = EgtIf( ( vtN:getY() > 0.5 or ( bHeadDir and vtN:getZ() > 0.5 ) or ( not bHeadDir and vtN:getZ() < -0.5)), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
|
|
||||||
else
|
|
||||||
if vtN:getY() > 0.707 then
|
|
||||||
nSCC = MCH_SCC.ADIR_YP
|
|
||||||
elseif vtN:getY() < -0.707 then
|
|
||||||
nSCC = MCH_SCC.ADIR_YM
|
|
||||||
elseif vtN:getZ() > 0.707 then
|
|
||||||
nSCC = MCH_SCC.ADIR_ZP
|
|
||||||
elseif vtN:getZ() < -0.707 then
|
|
||||||
nSCC = MCH_SCC.ADIR_ZM
|
|
||||||
end
|
|
||||||
end
|
|
||||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||||
-- eseguo
|
-- eseguo
|
||||||
if not ML.ApplyMachining( true, false) then
|
if not ML.ApplyMachining( true, false) then
|
||||||
@@ -4831,7 +4884,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
if not bOk then return false, sErr end
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
-- imposto altezza aggiuntiva di elevazione
|
-- imposto altezza aggiuntiva di elevazione
|
||||||
local dCollSic = BL.CalcCollisionSafety( vtN)
|
local dCollSic = CalcCollisionSafety( vtN)
|
||||||
-- abilitazione lavorazione da sotto
|
-- abilitazione lavorazione da sotto
|
||||||
local bMillUp = ( BD.DOWN_HEAD and vtN:getZ() > -0.259)
|
local bMillUp = ( BD.DOWN_HEAD and vtN:getZ() > -0.259)
|
||||||
local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342)
|
local bMillDown = ( BD.DOWN_HEAD and vtN:getZ() < 0.342)
|
||||||
@@ -5098,7 +5151,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
-- se devo inserire il chamfer
|
-- se devo inserire il chamfer
|
||||||
if ( ( Proc.Fct == 3 and bIsU) or (Proc.Fct == 2 and bIsL)) and nChamfer > 0 then
|
if ( ( Proc.Fct == 3 and bIsU) or (Proc.Fct == 2 and bIsL)) and nChamfer > 0 then
|
||||||
-- ottengo le dimensioni dello pseudotunnel
|
-- ottengo le dimensioni dello pseudotunnel
|
||||||
local _, _, _, vtOrtho, _, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
local _, _, _, vtOrtho, _, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||||
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
||||||
if nOk < 0 then return false, sErr end
|
if nOk < 0 then return false, sErr end
|
||||||
end
|
end
|
||||||
@@ -5112,16 +5165,13 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
-- 2021.07.16 Per poter eseguire antischeggia di lama su feature che non sono passanti da faccia a faccia
|
-- 2021.07.16 Per poter eseguire antischeggia di lama su feature che non sono passanti da faccia a faccia
|
||||||
-- ma che sono su un angolo (coinvolgono 2 facce contigue) è stato modificato il confronto in:
|
-- ma che sono su un angolo (coinvolgono 2 facce contigue) è stato modificato il confronto in:
|
||||||
-- esegue antischeggia di lama se forma U o L con feature passante in Y o Z, oppure se feature a furma U e con 3 facce oppore a forma a L e con 2 facce
|
-- esegue antischeggia di lama se forma U o L con feature passante in Y o Z, oppure se feature a furma U e con 3 facce oppore a forma a L e con 2 facce
|
||||||
-- non fa mai antischeggia di lama se la faccia è rivolta verso il basso, a meno che ci sia una testa sotto
|
|
||||||
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)
|
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) then
|
||||||
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
|
|
||||||
local bOk
|
local bOk
|
||||||
local bSawDown = ( bMillDown and not bMillUp)
|
local bSawDown = ( bMillDown and not bMillUp)
|
||||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown, true)
|
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bSawDown, true)
|
||||||
if not bOk then return false, sWarn end
|
if not bOk then return false, sWarn end
|
||||||
end
|
end
|
||||||
-- in base al flag interno e al numero di facce e se ha forma ad U
|
-- in base al flag interno e al numero di facce e se ha forma ad U
|
||||||
@@ -5131,7 +5181,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
-- o passare subito dalla lavorazione con lama/sega catena
|
-- o passare subito dalla lavorazione con lama/sega catena
|
||||||
if ( bTrySidePocketAtFirst and Proc.Fct == 3 and bIsU) or bForceSideMill then
|
if ( bTrySidePocketAtFirst and Proc.Fct == 3 and bIsU) or bForceSideMill then
|
||||||
-- lavoro con svuotature (singola o doppia contrapposta)
|
-- lavoro con svuotature (singola o doppia contrapposta)
|
||||||
local sMyMchFind = EgtIf( bForceSideMill, 'OpenPocket', 'Pocket')
|
-- 20220719 -> settate tutte come OpenPocket; prima era Pocket
|
||||||
|
local sMyMchFind = 'OpenPocket'
|
||||||
local dDiamTool = 100
|
local dDiamTool = 100
|
||||||
local nPathInt, nSurfInt, bOneShot, nFirstMachId
|
local nPathInt, nSurfInt, bOneShot, nFirstMachId
|
||||||
local bIs3Faces = true
|
local bIs3Faces = true
|
||||||
@@ -5150,7 +5201,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
tvtNx[2] = vtN
|
tvtNx[2] = vtN
|
||||||
local ptPs = ptC
|
local ptPs = ptC
|
||||||
dFacElev = BL.GetFaceElevation( Proc.Id, nFacInd)
|
dFacElev = BL.GetFaceElevation( Proc.Id, nFacInd)
|
||||||
dCollSic = BL.CalcCollisionSafety( tvtNx[2])
|
dCollSic = CalcCollisionSafety( tvtNx[2])
|
||||||
local dMachDepth = dFacElev + dCollSic
|
local dMachDepth = dFacElev + dCollSic
|
||||||
local frFacRec, dFacDim1, dFacDim2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
local frFacRec, dFacDim1, dFacDim2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||||
-- limito il diametro utensile massimo a 100 per queste lavorazioni
|
-- limito il diametro utensile massimo a 100 per queste lavorazioni
|
||||||
@@ -5191,7 +5242,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 = MakePocket( Proc, nPartId, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap)
|
||||||
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
|
||||||
@@ -5202,8 +5253,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
-- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then
|
||||||
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,
|
||||||
nFacInd, nAddGrpId, bMillDown, dDiamTool, nil,
|
nFacInd, nAddGrpId, bMillDown, dDiamTool, bDoubleSide,
|
||||||
nil, nil, nil, b3Solid, dDepth,
|
vtOrtho, nPathInt, nSurfInt, b3Solid, dDepth,
|
||||||
bOneShot, nFirstMachId)
|
bOneShot, nFirstMachId)
|
||||||
if sWarn2 then
|
if sWarn2 then
|
||||||
if not sWarn then sWarn = '' end
|
if not sWarn then sWarn = '' end
|
||||||
@@ -5232,7 +5283,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
bSetOpenBorders = true
|
bSetOpenBorders = true
|
||||||
end
|
end
|
||||||
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
|
nOk, sErr, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, dDiamTool, bDoubleSide, nPathInt, nSurfInt, bOneShot, bMillDown, nFirstMachId,
|
||||||
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders, bIsU, bIsL)
|
bOrthoFaces = MakeByPockets( Proc, nPhase, nRawId, nPartId, nChamfer, dDepthCham, nAddGrpId, sMyMchFind, bIs3Faces, b3Solid, bOrthoFacesMaster, bMillDown, bSetOpenBorders)
|
||||||
if nOk == -2 then
|
if nOk == -2 then
|
||||||
if not sMchFind then
|
if not sMchFind then
|
||||||
sMchFind = sMchFindBackUp
|
sMchFind = sMchFindBackUp
|
||||||
@@ -5252,11 +5303,10 @@ 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)
|
|
||||||
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,
|
nFacInd, nAddGrpId, bMillDown, dDiamTool, bDoubleSide,
|
||||||
nil, nil, nil, b3Solid, dFacElevOri,
|
vtOrtho, nPathInt, nSurfInt, b3Solid, dDepth,
|
||||||
bOneShot, nFirstMachId)
|
bOneShot, nFirstMachId)
|
||||||
if sWarn2 then
|
if sWarn2 then
|
||||||
if not sWarn then sWarn = '' end
|
if not sWarn then sWarn = '' end
|
||||||
@@ -5338,7 +5388,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
-- se devo inserire il chamfer
|
-- se devo inserire il chamfer
|
||||||
if ( ( Proc.Fct == 3 and bIsU) or (Proc.Fct == 2 and bIsL)) and nChamfer > 0 then
|
if ( ( Proc.Fct == 3 and bIsU) or (Proc.Fct == 2 and bIsL)) and nChamfer > 0 then
|
||||||
-- ottengo le dimensioni dello pseudotunnel
|
-- ottengo le dimensioni dello pseudotunnel
|
||||||
local _, _, _, vtOrtho, _, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
local _, _, _, vtOrtho, _, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||||
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
||||||
if nOk < 0 then return false, sErr end
|
if nOk < 0 then return false, sErr end
|
||||||
end
|
end
|
||||||
@@ -5349,16 +5399,13 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
-- 2021.07.16 Per poter eseguire antischeggia di lama su feature che non sono passanti da faccia a faccia
|
-- 2021.07.16 Per poter eseguire antischeggia di lama su feature che non sono passanti da faccia a faccia
|
||||||
-- ma che sono su un angolo (coinvolgono 2 facce contigue) è stato modificato il confronto in:
|
-- ma che sono su un angolo (coinvolgono 2 facce contigue) è stato modificato il confronto in:
|
||||||
-- esegue antischeggia di lama se forma U o L con feature passante in Y o Z, oppure se feature a furma U e con 3 facce oppore a forma a L e con 2 facce
|
-- esegue antischeggia di lama se forma U o L con feature passante in Y o Z, oppure se feature a furma U e con 3 facce oppore a forma a L e con 2 facce
|
||||||
-- non fa mai antischeggia di lama se la faccia è rivolta verso il basso, a meno che ci sia una testa sotto
|
|
||||||
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)
|
if nChamfer < 2 and nQAntisplintResult == 1 and (( bIsU or bIsL) and ( bPassThrou or bPassEdge)) then
|
||||||
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
|
|
||||||
local bOk
|
local bOk
|
||||||
local bSawDown = ( bMillDown and not bMillUp)
|
local bSawDown = ( bMillDown and not bMillUp)
|
||||||
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtNOri, nFacIndOri, sWarn, bSawDown)
|
bMadeASbyBld, bOk, sWarn = ManageAntiSplintBySaw( Proc, b3Raw, bIsU, vtN, nFacInd, sWarn, bSawDown)
|
||||||
if not bOk then return false, sWarn end
|
if not bOk then return false, sWarn end
|
||||||
end
|
end
|
||||||
if nChamfer < 2 and nQAntisplintResult == 2 then
|
if nChamfer < 2 and nQAntisplintResult == 2 then
|
||||||
@@ -5373,7 +5420,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa
|
|||||||
local tvtNx = {}
|
local tvtNx = {}
|
||||||
tvtNx[2] = vtN
|
tvtNx[2] = vtN
|
||||||
local bOk, sWarn2
|
local bOk, sWarn2
|
||||||
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, b3Solid, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dFacElev + dCollSic, nil, nil, bAllWithEndCap)
|
bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, ptC, tvtNx, nFacInd, sMchFind, nUseRoughTool, sPocketing, dFacElev + dCollSic, nil, nil, bAllWithEndCap)
|
||||||
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
|
||||||
@@ -5597,7 +5644,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- in base al tipo di feature attribuisco il significato dei parametri Q
|
-- in base al tipo di feature attribuisco il significato dei parametri Q
|
||||||
AssignQIdent( Proc)
|
AssignQIdent( Proc)
|
||||||
-- se non forzate frese, uso la lama
|
-- se non forzate frese, uso la lama
|
||||||
local bUseBlade = EgtIf( Proc.Prc == 90, false, EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1)
|
local bUseBlade = EgtGetInfo( Proc.Id, Q_USE_ROUGH_TOOL, 'i') ~= 1 and EgtGetInfo( Proc.Id, Q_USE_MILL, 'i') ~= 1
|
||||||
local nForceUseBladeOnNotContinueFace
|
local nForceUseBladeOnNotContinueFace
|
||||||
-- se ho attivo la lama e ho la feature 30, verifico i parametri Q propri della feature
|
-- se ho attivo la lama e ho la feature 30, verifico i parametri Q propri della feature
|
||||||
if bUseBlade then
|
if bUseBlade then
|
||||||
@@ -5724,9 +5771,6 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- se piccola, con fresa
|
-- se piccola, con fresa
|
||||||
if not bUseBlade and ( Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN)) then
|
if not bUseBlade and ( Proc.Box:getDimX() < MAX_MILL_LIN and ( Proc.Box:getDimZ() < MAX_MILL_LIN or Proc.Box:getDimY() < MAX_MILL_LIN)) then
|
||||||
return MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
return MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
||||||
-- se è una spianatura a una faccia richiamo la LongCut
|
|
||||||
elseif Proc.Prc == 90 then
|
|
||||||
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
|
|
||||||
-- altrimenti, con lama
|
-- altrimenti, con lama
|
||||||
else
|
else
|
||||||
return Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
return Cut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||||
@@ -5771,7 +5815,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
local nChamfer, dDepthCham, sErrCham = EvaluateQParam( Proc)
|
local nChamfer, dDepthCham, sErrCham = EvaluateQParam( Proc)
|
||||||
-- se smusso da fare
|
-- se smusso da fare
|
||||||
if nChamfer > 0 then
|
if nChamfer > 0 then
|
||||||
local _, _, _, vtOrtho, _, nSurfInt = BL.GetTunnelDimension( Proc, nPartId)
|
local _, _, _, vtOrtho, _, nSurfInt = GetTunnelDimension( Proc, nPartId)
|
||||||
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
local nOk, sErr = MakeChamfer( Proc, true, nAddGrpId, vtOrtho, b3Solid, nSurfInt, dDepthCham)
|
||||||
if nOk < 0 then return false, sErr end
|
if nOk < 0 then return false, sErr end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessLongCut.lua by Egaltech s.r.l. 2022/11/04
|
-- ProcessLongCut.lua by Egaltech s.r.l. 2022/03/07
|
||||||
-- Gestione calcolo taglio longitudinale per Travi
|
-- Gestione calcolo taglio longitudinale per Travi
|
||||||
-- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale.
|
-- 2021/02/03 Corretto FaceUse con fresa orizzontale su taglio orizzontale.
|
||||||
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
|
-- 2021/05/18 Possibile taglio con lama anche di fianco su macchina con testa da sotto.
|
||||||
@@ -11,8 +11,6 @@
|
|||||||
-- 2021/11/08 Se con lama e flag BD.USE_LONGCUT si lavora in direzione contraria allo standard.
|
-- 2021/11/08 Se con lama e flag BD.USE_LONGCUT si lavora in direzione contraria allo standard.
|
||||||
-- 2022/03/07 Razionalizzata gestione casi con fresa di fianco. Aggiunta gestione Long2Cut anche con testa sotto.
|
-- 2022/03/07 Razionalizzata gestione casi con fresa di fianco. Aggiunta gestione Long2Cut anche con testa sotto.
|
||||||
-- 2022/07/14 Aggiunta limitazione lavorazione a sinistra anche se il grezzo successivo non ha lavorazioni (finale barra) ma è abbastanza lungo da poter essere riutilizzato (BD.MinRaw).
|
-- 2022/07/14 Aggiunta limitazione lavorazione a sinistra anche se il grezzo successivo non ha lavorazioni (finale barra) ma è abbastanza lungo da poter essere riutilizzato (BD.MinRaw).
|
||||||
-- 2022/09/23 Modificato l'angolo per l'abilitazione della lama da sotto: ora interviene anche per facce verticali.
|
|
||||||
-- 2022/11/04 Aggiunto passaggio parametro bDownHead (Testa da Sotto) nelle chiamate a MakeSideFace.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessLongCut = {}
|
local ProcessLongCut = {}
|
||||||
@@ -438,8 +436,8 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= -0.5 then
|
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= -0.5 then
|
||||||
bCanUseUnderBlade = true
|
bCanUseUnderBlade = true
|
||||||
end
|
end
|
||||||
-- se faccia da sotto o di lato ma con versore Z sotto l'orizzontale abilito la lavorazione con lame mixate
|
-- se faccia da sotto o di lato ma con versore Z negativo abilito la lavorazione con lame mixate
|
||||||
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= 0.0175 then
|
if ( nSide == -1 or abs(nSide) == 2) and vtN:getZ() <= -0.0175 then
|
||||||
bCanUseUnderBlade = true
|
bCanUseUnderBlade = true
|
||||||
end
|
end
|
||||||
-- se faccia da sopra o di lato ma con versore Z negativo verifico che abbia un angolo compatibile (28deg) per non avere extracorsa
|
-- se faccia da sopra o di lato ma con versore Z negativo verifico che abbia un angolo compatibile (28deg) per non avere extracorsa
|
||||||
@@ -1026,12 +1024,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
for j = 1, Proc.Fct - 1 do
|
for j = 1, Proc.Fct - 1 do
|
||||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||||
if vtIni * vtN > 0 and nCountMilHead < 2 then
|
if vtIni * vtN > 0 and nCountMilHead < 2 then
|
||||||
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, nil, bDownHead)
|
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam)
|
||||||
nCountMilHead = nCountMilHead + 1
|
nCountMilHead = nCountMilHead + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if bForcedLim and nCountMilHead < 1 then
|
if bForcedLim and nCountMilHead < 1 then
|
||||||
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, nil, bDownHead)
|
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim)
|
||||||
nCountMilHead = nCountMilHead + 1
|
nCountMilHead = nCountMilHead + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1043,12 +1041,12 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
|
|||||||
for j = 1, Proc.Fct - 1 do
|
for j = 1, Proc.Fct - 1 do
|
||||||
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
local _, vtN = EgtSurfTmFacetCenter( Proc.Id, j, GDB_ID.ROOT)
|
||||||
if vtFin * vtN > 0 and nCountMilHead < 2 then
|
if vtFin * vtN > 0 and nCountMilHead < 2 then
|
||||||
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam, nil, nil, bDownHead)
|
MakeSideFace( Proc.Id, j, nSide, sMilling, dToolDiam)
|
||||||
nCountMilHead = nCountMilHead + 1
|
nCountMilHead = nCountMilHead + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if bForcedLim and nCountMilHead < 2 then
|
if bForcedLim and nCountMilHead < 2 then
|
||||||
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim, nil, bDownHead)
|
MakeSideFace( Proc.Id, 0, nSide, sMilling, dToolDiam, bForcedLim)
|
||||||
nCountMilHead = nCountMilHead + 1
|
nCountMilHead = nCountMilHead + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
-- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda).
|
-- 2021/12/01 Se frontale aggiungo taglio con Grp e Proc di vero taglio (per aggiornare ingombro di testa /coda).
|
||||||
-- 2022/07/26 Aggiunta gestione del parametro P04=1 per la pulizia degli angoli con mortasatrice (sega a catena) specifica
|
-- 2022/07/26 Aggiunta gestione del parametro P04=1 per la pulizia degli angoli con mortasatrice (sega a catena) specifica
|
||||||
-- 2022/07/29 Nella pulitura angoli aggiunto il check dimensioni tasca vs utensile. Corretta direzione utensile per mortasa frontale.
|
-- 2022/07/29 Nella pulitura angoli aggiunto il check dimensioni tasca vs utensile. Corretta direzione utensile per mortasa frontale.
|
||||||
-- 2022/09/27 Migliorata la scelta utensile. Se c'è almeno una lavorazione 'mortise' si cerca di usare quelle, riducendo l'elevazione se necessario.
|
|
||||||
-- Se non c'è nemmeno una lavorazione 'mortise' si passa alle pocket.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessMortise = {}
|
local ProcessMortise = {}
|
||||||
@@ -231,35 +229,6 @@ local function CleanCorners( Proc, dMorH, vtN, bDoubleDir, AuxId)
|
|||||||
return true, sWarn
|
return true, sWarn
|
||||||
end
|
end
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
local function VerifyMortiseOrPocket( Proc, dDiam, dDepth, dMaxTotLen, sType, bPocketDown)
|
|
||||||
-- ricerca della svuotatura
|
|
||||||
local sPocketing
|
|
||||||
if dDepth then
|
|
||||||
sPocketing = ML.FindPocketing( sType, dDiam, dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
|
||||||
ML.FindPocketing( sType, dDiam, 0.8 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
|
||||||
ML.FindPocketing( sType, dDiam, 0.6 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
|
||||||
ML.FindPocketing( sType, dDiam, 0.4 * dDepth, dMaxTotLen, not bPocketDown, bPocketDown) or
|
|
||||||
ML.FindPocketing( sType, dDiam, 0, dMaxTotLen)
|
|
||||||
else
|
|
||||||
sPocketing = ML.FindPocketing( sType, dDiam, 0, dMaxTotLen)
|
|
||||||
end
|
|
||||||
if not sPocketing then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
-- recupero i dati dell'utensile
|
|
||||||
local dMaxDepth = 0
|
|
||||||
local dToolDiam = 0
|
|
||||||
if EgtMdbSetCurrMachining( sPocketing) then
|
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
|
||||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return sPocketing, dMaxDepth, dToolDiam
|
|
||||||
end
|
|
||||||
|
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Applicazione della lavorazione
|
-- Applicazione della lavorazione
|
||||||
function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
||||||
@@ -340,10 +309,8 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
-- se il percorso ausiliario è esterno al grezzo, lo riavvicino
|
-- se il percorso ausiliario è esterno al grezzo, lo riavvicino
|
||||||
if abs( dMove) > GEO.EPS_SMALL then
|
if abs( dMove) > GEO.EPS_SMALL then
|
||||||
AuxId = EgtCopyGlob( AuxId, BL.GetAddGroup( nPartId))
|
AuxId = EgtCopyGlob( AuxId, BL.GetAddGroup( nPartId))
|
||||||
local vtMove = Vector3d(0,0,dMove)
|
EgtMove( AuxId, Vector3d(0,0,-dMove))
|
||||||
vtMove:toGlob(frMor)
|
EgtMove( nFlat, Vector3d(0,0,-dMove))
|
||||||
EgtMove( AuxId, vtMove, GDB_RT.GLOB)
|
|
||||||
EgtMove( nFlat, vtMove, GDB_RT.GLOB)
|
|
||||||
frMor, dL, dW = EgtSurfTmFacetMinAreaRectangle( nFlat, 0, GDB_ID.ROOT)
|
frMor, dL, dW = EgtSurfTmFacetMinAreaRectangle( nFlat, 0, GDB_ID.ROOT)
|
||||||
ptC = frMor:getOrigin()
|
ptC = frMor:getOrigin()
|
||||||
vtN = frMor:getVersZ()
|
vtN = frMor:getVersZ()
|
||||||
@@ -420,16 +387,16 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
end
|
end
|
||||||
local sPocketing
|
local sPocketing
|
||||||
if Proc.Prc ~= 53 then
|
if Proc.Prc ~= 53 then
|
||||||
sPocketing = VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, bPockDown)
|
sPocketing = ML.FindPocketing( sPockType..sMchExt, dW, nil, nil, not bPockDown, bPockDown)
|
||||||
if not sPocketing and bPockUp then
|
if not sPocketing and bPockUp then
|
||||||
sPocketing = VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt)
|
sPocketing = ML.FindPocketing( sPockType, dW)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not sPocketing then
|
if not sPocketing then
|
||||||
sPockType = 'Pocket'
|
sPockType = 'Pocket'
|
||||||
sPocketing = VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt, bPockDown)
|
sPocketing = ML.FindPocketing( sPockType..sMchExt, dW, nil, nil, not bPockDown, bPockDown)
|
||||||
if not sPocketing and bPockUp then
|
if not sPocketing and bPockUp then
|
||||||
sPocketing = VerifyMortiseOrPocket( Proc, dW, dMorH, nil, sPockType..sMchExt)
|
sPocketing = ML.FindPocketing( sPockType, dW)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not sPocketing then
|
if not sPocketing then
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessProfCamb.lua by Egaltech s.r.l. 2022/11/03
|
-- ProcessProfCamb.lua by Egaltech s.r.l. 2022/05/28
|
||||||
-- Gestione calcolo profilo caudato per Travi
|
-- Gestione calcolo profilo caudato per Travi
|
||||||
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
|
-- 2021/05/03 Aggiunta gestione smusso da sopra e sotto per macchina con testa da sotto.
|
||||||
-- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra.
|
-- 2021/06/28 Per macchine con testa sotto, smussi di lato con questa testa se non c'è lav.ne da sopra.
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
-- 2022/02/02 Aggiunta funzione OnlyChamfer.
|
-- 2022/02/02 Aggiunta funzione OnlyChamfer.
|
||||||
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
-- 2022/05/24 Aggiunta fresatura da sotto su macchine con testa da sotto.
|
||||||
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
-- 2022/05/28 Aggiunto calcolo svuotatura da modulo di libreria.
|
||||||
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessProfCamb = {}
|
local ProcessProfCamb = {}
|
||||||
@@ -316,14 +315,12 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
|
|||||||
-- leggo anticipatamente i parametri utensile fresa per dare un valore opportuno all'elevazione della lama
|
-- leggo anticipatamente i parametri utensile fresa per dare un valore opportuno all'elevazione della lama
|
||||||
-- recupero la lavorazione di fresatura
|
-- recupero la lavorazione di fresatura
|
||||||
local sMillType = 'Prof'
|
local sMillType = 'Prof'
|
||||||
local bH2
|
sMilling, _, _, bMillDown = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bMillDown)
|
||||||
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bMillDown)
|
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' milling not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
bMillDown = ( bMillDown and bH2)
|
|
||||||
-- Recupero i dati dell'utensile
|
-- Recupero i dati dell'utensile
|
||||||
if EgtMdbSetCurrMachining( sMilling) then
|
if EgtMdbSetCurrMachining( sMilling) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- ProcessScarfJoint.lua by Egaltech s.r.l. 2022/09/30
|
-- ProcessScarfJoint.lua by Egaltech s.r.l. 2022/07/12
|
||||||
-- Gestione calcolo giunto Gerber per Travi
|
-- Gestione calcolo giunto Gerber per Travi
|
||||||
-- 2021/06/28 Aggiunto extra-taglio alle lamate orizzontali.
|
-- 2021/06/28 Aggiunto extra-taglio alle lamate orizzontali.
|
||||||
-- 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)
|
||||||
@@ -173,11 +173,7 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
|
|||||||
if vtO then
|
if vtO then
|
||||||
vtOrthoO = Vector3d( vtO)
|
vtOrthoO = Vector3d( vtO)
|
||||||
else
|
else
|
||||||
if vtN[vFaceOrd[4]]:getZ() < 0.1 then
|
vtOrthoO = Y_AX()
|
||||||
vtOrthoO = Z_AX()
|
|
||||||
else
|
|
||||||
vtOrthoO = Y_AX()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -314,12 +310,10 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
|||||||
end
|
end
|
||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dSawDiam = 400
|
local dSawDiam = 400
|
||||||
local dMaxDepth = 0
|
|
||||||
if EgtMdbSetCurrMachining( sCutting) then
|
if EgtMdbSetCurrMachining( sCutting) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -352,6 +346,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
|||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
|
|
||||||
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
-- se esistono faccia interna ed intermedia, verifico se richiedono taglio a cubetti
|
||||||
nGoodFace1 = EgtSurfTmFacetCount( nFace1)
|
nGoodFace1 = EgtSurfTmFacetCount( nFace1)
|
||||||
nGoodFace4 = EgtSurfTmFacetCount( nFace4)
|
nGoodFace4 = EgtSurfTmFacetCount( nFace4)
|
||||||
@@ -361,27 +356,21 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
|||||||
nGoodFace1 = EgtSurfTmFacetCount( nFace1)
|
nGoodFace1 = EgtSurfTmFacetCount( nFace1)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- per macchina TURN aggiusto massima dimensione cubetto
|
local bOkd, sErrD, vCuts = ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw)
|
||||||
local dNewDiceDim
|
|
||||||
if BD.TURN and nGoodFace4 and nGoodFace4 > 0 then
|
|
||||||
local dDimRef = EgtIf( abs( vtN[vFaceOrd[4]]:getZ()) < 0.1, b3Raw:getDimZ(), b3Raw:getDimY())
|
|
||||||
if dDimRef + BD.CUT_EXTRA < dMaxDepth then
|
|
||||||
dNewDiceDim = - ( dMaxDepth - BD.CUT_EXTRA)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local bOkd, sErrD, vCuts = ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw, dNewDiceDim)
|
|
||||||
if not bOkd then return bOkd, sErrD end
|
if not bOkd then return bOkd, sErrD end
|
||||||
|
|
||||||
if #vCuts == 0 then
|
if #vCuts == 0 then
|
||||||
-- se ho la faccia intermedia, per prima cosa verifico se ho intersezione con la faccia tappo
|
-- se ho la faccia intermedia, per prima cosa verifico se ho intersezione con la faccia tappo
|
||||||
if nGoodFace4 ~= 0 then
|
if nGoodFace4 ~= 0 then
|
||||||
|
-- taglio sulla faccia interna
|
||||||
|
if vFaceOrd[1] ~= 0 then
|
||||||
|
-- inserisco la lavorazione
|
||||||
|
local vtOrthoO = Vector3d( vtRef)
|
||||||
|
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
|
if not bOkd then return bOkd, sErrD end
|
||||||
|
end
|
||||||
-- se non ho intersezione con la faccia tappo posso fare il taglio sul fianco
|
-- se non ho intersezione con la faccia tappo posso fare il taglio sul fianco
|
||||||
if not nGoodFace1 or nGoodFace1 == 0 then
|
if not nGoodFace1 or nGoodFace1 == 0 then
|
||||||
-- inserisco la lavorazione
|
|
||||||
local vtRef2 = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, Z_AX(), EgtIf( bHead, Y_AX(), -Y_AX()))
|
|
||||||
bOkd, sErrD = Fbs.MakeOne( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
|
||||||
if not bOkd then return bOkd, sErrD end
|
|
||||||
-- lavoro la faccia opposta (definita dal parametro P11)
|
-- lavoro la faccia opposta (definita dal parametro P11)
|
||||||
if vFaceOrd[3] ~= 0 then
|
if vFaceOrd[3] ~= 0 then
|
||||||
-- inserisco la lavorazione
|
-- inserisco la lavorazione
|
||||||
@@ -389,20 +378,16 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmTa
|
|||||||
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
if not bOkd then return bOkd, sErrD end
|
if not bOkd then return bOkd, sErrD end
|
||||||
end
|
end
|
||||||
-- altrimenti se ho intersezione forzo il DiceCut ad essere eseguito con distanze più piccole
|
-- inserisco la lavorazione
|
||||||
else
|
local vtRef2 = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, Z_AX(), EgtIf( bHead, Y_AX(), -Y_AX()))
|
||||||
|
bOkd, sErrD = Fbs.MakeOne( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
||||||
|
if not bOkd then return bOkd, sErrD end
|
||||||
|
else -- altrimenti se ho intersezione forzo il DiceCut ad essere eseguito con distanze più piccole
|
||||||
-- definisco la nuova dimensione massima del dice cut
|
-- definisco la nuova dimensione massima del dice cut
|
||||||
local dNewDiceDim = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, b3Raw:getDimZ(), b3Raw:getDimY())
|
local dNewDiceDim = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, b3Raw:getDimZ(), b3Raw:getDimY())
|
||||||
bOkd, sErrD = ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw, dNewDiceDim)
|
bOkd, sErrD = ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Solid, ptC, vtN, Proc, vtRef, bHead, sCutting, dSawDiam, b3Raw, dNewDiceDim)
|
||||||
if not bOkd then return bOkd, sErrD end
|
if not bOkd then return bOkd, sErrD end
|
||||||
end
|
end
|
||||||
-- taglio sulla faccia interna
|
|
||||||
if vFaceOrd[1] ~= 0 then
|
|
||||||
-- inserisco la lavorazione
|
|
||||||
local vtOrthoO = Vector3d( vtRef)
|
|
||||||
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
|
|
||||||
if not bOkd then return bOkd, sErrD end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
-- taglio sulla faccia interna
|
-- taglio sulla faccia interna
|
||||||
if vFaceOrd[1] ~= 0 then
|
if vFaceOrd[1] ~= 0 then
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
-- Gestione calcolo giunto Gerber per Travi
|
-- Gestione calcolo giunto Gerber per Travi
|
||||||
-- 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)
|
||||||
-- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut.
|
-- 2022/08/09 Ora se la feature ha meno di due facce viene richiamata la normale Cut.
|
||||||
-- 2022/11/09 Aggiunta gestione parametro Q04 per forzare utilizzo fresa di lato e lavorare come FreeContour.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessSimpleScarf = {}
|
local ProcessSimpleScarf = {}
|
||||||
@@ -13,7 +12,6 @@ local BL = require( 'BeamLib')
|
|||||||
local Fbs = require( 'FacesBySaw')
|
local Fbs = require( 'FacesBySaw')
|
||||||
local DC = require( 'DiceCut')
|
local DC = require( 'DiceCut')
|
||||||
local Cut = require( 'ProcessCut')
|
local Cut = require( 'ProcessCut')
|
||||||
local FreeContour = require( 'ProcessFreeContour')
|
|
||||||
|
|
||||||
EgtOutLog( ' ProcessSimpleScarf started', 1)
|
EgtOutLog( ' ProcessSimpleScarf started', 1)
|
||||||
|
|
||||||
@@ -30,13 +28,11 @@ end
|
|||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
-- Classificazione della feature
|
-- Classificazione della feature
|
||||||
function ProcessSimpleScarf.Classify( Proc)
|
function ProcessSimpleScarf.Classify( Proc)
|
||||||
-- se forzato utilizzo fresa non ruoto la trave
|
|
||||||
local bForceSideMill = ( EgtGetInfo( Proc.Id, 'Q04', 'd') or 0) > 0
|
|
||||||
-- verifico le normali delle facce
|
-- verifico le normali delle facce
|
||||||
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
|
local nFacetCnt = EgtSurfTmFacetCount( Proc.Id)
|
||||||
for i = 1, nFacetCnt do
|
for i = 1, nFacetCnt do
|
||||||
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
|
local vtN = EgtSurfTmFacetNormVersor( Proc.Id, i-1, GDB_ID.ROOT)
|
||||||
if vtN:getZ() < - 0.5 and Proc.Box:getDimX() / abs( vtN:getZ()) > BD.MAX_DIM_DICE and not bForceSideMill then
|
if vtN:getZ() < - 0.5 and Proc.Box:getDimX() / abs( vtN:getZ()) > BD.MAX_DIM_DICE then
|
||||||
return true, true
|
return true, true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -192,14 +188,6 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, dOvmT
|
|||||||
-- inserimento smussi
|
-- inserimento smussi
|
||||||
local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
local bOkc, sErrC = MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||||
if not bOkc then return bOkc, sErrC end
|
if not bOkc then return bOkc, sErrC end
|
||||||
-- se forzato utilizzo fresa richiamo la freecontour
|
|
||||||
local bForceSideMill = EgtGetInfo( Proc.Id, 'Q04', 'd') == 1 or
|
|
||||||
( EgtGetInfo( Proc.Id, 'Q04', 'd') == 2 and abs( vtN[vFaceOrd[3]]:getY()) < 0.1) or
|
|
||||||
( EgtGetInfo( Proc.Id, 'Q04', 'd') == 3 and abs( vtN[vFaceOrd[3]]:getY()) < 0.1 and vtN[vFaceOrd[3]]:getZ() < 0.1)
|
|
||||||
if bForceSideMill then
|
|
||||||
bOk, sErr = FreeContour.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|
||||||
return bOk, sErr
|
|
||||||
end
|
|
||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sCutting = ML.FindCutting( 'HeadSide')
|
local sCutting = ML.FindCutting( 'HeadSide')
|
||||||
if not sCutting then
|
if not sCutting then
|
||||||
|
|||||||
+13
-40
@@ -3,9 +3,6 @@
|
|||||||
-- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio con sega a catena seguito da rifinitura con lama (aggiunta funzione MakeSplitByChainSaw); gestione eventuale creazione nuova fase dall'interno della Make.
|
-- 2022/05/31 Aggiunta gestione sezioni alte e larghe con taglio con sega a catena seguito da rifinitura con lama (aggiunta funzione MakeSplitByChainSaw); gestione eventuale creazione nuova fase dall'interno della Make.
|
||||||
-- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita.
|
-- 2022/06/10 Per sezioni alte e larghe aggiunta gestione finitura in base a sovramateriale e a parametro Q05 dell' eventuale lavorazione sostituita.
|
||||||
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
-- 2022/08/18 Aggiunta gestione macchine con testa da sotto con lama da sotto disabilitata.
|
||||||
-- 2022/09/08 Migliorato verso di lavorazione in caso di DoubleCut
|
|
||||||
-- 2022/11/02 Corretti accorciamenti per DoubleCut
|
|
||||||
-- 2022/11/10 Corrette finiture lama per BigSection con trave alta
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessSplit = {}
|
local ProcessSplit = {}
|
||||||
@@ -257,13 +254,11 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
-- recupero i dati dell'utensile
|
-- recupero i dati dell'utensile
|
||||||
local dSawDiam = 400
|
local dSawDiam = 400
|
||||||
local dMaxDepth = 50
|
local dMaxDepth = 50
|
||||||
local dSawThick = 2
|
|
||||||
if EgtMdbSetCurrMachining( sCutting) then
|
if EgtMdbSetCurrMachining( sCutting) then
|
||||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||||
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
dSawDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam
|
||||||
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
dMaxDepth = EgtTdbGetCurrToolMaxDepth() or dMaxDepth
|
||||||
dSawThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
local dMaxVertDepth = dMaxDepth - ( BD.DECR_VERT_CUT or 0)
|
||||||
@@ -272,22 +267,20 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
-- recupero i dati della eventuale seconda lama
|
-- recupero i dati della eventuale seconda lama
|
||||||
local dSawDiam2 = 0
|
local dSawDiam2 = 0
|
||||||
local dMaxDepth2 = 0
|
local dMaxDepth2 = 0
|
||||||
local dSawThick2 = 0
|
|
||||||
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
|
if sCutting2 and EgtMdbSetCurrMachining( sCutting2) then
|
||||||
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
local sTuuid2 = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
|
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid2) or '') then
|
||||||
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
|
dSawDiam2 = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dSawDiam2
|
||||||
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
|
dMaxDepth2 = EgtTdbGetCurrToolMaxDepth() or dMaxDepth2
|
||||||
dSawThick2 = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dSawThick2
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- caratteristiche taglio
|
-- caratteristiche taglio
|
||||||
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
local dDimYRef = EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM + 10 * GEO.EPS_SMALL, dMaxDepth, abs( BD.MAX_DIM_HTCUT_HBEAM))
|
||||||
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
local bBigSectionCut = ( b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL) and
|
||||||
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
( b3Raw:getDimZ() > EgtIf( BD.TURN, 2 * dMaxVertDepth, dMaxVertDepth + dMaxDepth2) - 2 * BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||||
local bHorizCut = ( ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA))
|
local bHorizCut = ( not bBigSectionCut and ( b3Raw:getDimY() > b3Raw:getDimZ() + 10 * GEO.EPS_SMALL or BD.TURN) and ( b3Raw:getDimZ() < dMaxVertDepth - BD.CUT_EXTRA))
|
||||||
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
local bDoubleHorizCut = ( ( BD.DOWN_HEAD or BD.TURN) and not bBigSectionCut and not bHorizCut and b3Raw:getDimY() > 2 * dDimYRef - BD.CUT_EXTRA_MIN + 10 * GEO.EPS_SMALL)
|
||||||
local bDoubleCut = ( not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
local bDoubleCut = ( not bBigSectionCut and not bHorizCut and not bDoubleHorizCut and b3Raw:getDimY() > dDimYRef - BD.CUT_EXTRA + 10 * GEO.EPS_SMALL)
|
||||||
-- dati geometrici del taglio
|
-- dati geometrici del taglio
|
||||||
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
local ptC, vtN = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||||
-- flag di lavorazione faccia
|
-- flag di lavorazione faccia
|
||||||
@@ -387,29 +380,12 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
sNotes = 'Precut;'
|
sNotes = 'Precut;'
|
||||||
sNotesFinal = 'Cut;'
|
sNotesFinal = 'Cut;'
|
||||||
end
|
end
|
||||||
local nQ05 = EgtGetInfo( nOriId or GDB_ID.NULL, 'Q05', 'i') or 0
|
|
||||||
-- se finitura con lama
|
-- se finitura con lama
|
||||||
if nQ05 == 1 or nQ05 == 0 or not bSplit then
|
if not nOriId or EgtGetInfo( nOriId, 'Q05', 'i') == 1 or EgtGetInfo( nOriId, 'Q05', 'i') == 0 or not bSplit then
|
||||||
local dSawThickCheck = dSawThick
|
local bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dLenEndRaw, nil, false, true, b3Raw, sNotes, dCurrOvmT)
|
||||||
if dSawThick2 > 0 and bDoubleHorizCut then
|
if not bOk then return bOk, sErr, nNewPhase end
|
||||||
dSawThickCheck = min( dSawThick, dSawThick2)
|
|
||||||
end
|
|
||||||
local dMaxElev = 0
|
|
||||||
if vtN:getX() > 0 then
|
|
||||||
dMaxElev = b3Raw:getMax():getX() - Proc.Box:getMin():getX()
|
|
||||||
else
|
|
||||||
dMaxElev = Proc.Box:getMax():getX() - b3Raw:getMin():getX()
|
|
||||||
end
|
|
||||||
-- controllo se è necessario un taglio con dicing o si deve proseguire ai casi standard
|
|
||||||
if bSplit or dMaxElev > dSawThickCheck then
|
|
||||||
local bOk, sErr = Cut.Make( Proc, nNewPhase, nRawId, nPartId, dLenEndRaw, nil, false, true, b3Raw, sNotes, dCurrOvmT)
|
|
||||||
if sNotesFinal then
|
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
|
||||||
end
|
|
||||||
return bOk, sErr, nNewPhase
|
|
||||||
end
|
|
||||||
-- se finitura con truciolatore
|
-- se finitura con truciolatore
|
||||||
elseif nQ05 == 2 then
|
elseif EgtGetInfo( nOriId, 'Q05', 'i') == 2 then
|
||||||
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
|
||||||
if not b3Solid then
|
if not b3Solid then
|
||||||
local sErr = 'Error : part box not found'
|
local sErr = 'Error : part box not found'
|
||||||
@@ -423,15 +399,14 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
|
local bOk, sErr = Pocket.Make( Proc, Proc.Id, 0, sPocketing, nPartId, b3Solid)
|
||||||
if sNotesFinal then
|
if not bOk then return bOk, sErr, nNewPhase end
|
||||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
end
|
||||||
end
|
if sNotesFinal then
|
||||||
return bOk, sErr, nNewPhase
|
EgtSetMachiningParam( MCH_MP.USERNOTES, sNotesFinal)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
-- se tagli standard
|
-- se tagli standard
|
||||||
if not bDoubleHorizCut then
|
elseif not bDoubleHorizCut then
|
||||||
-- calcolo extra taglio ed accorciamento
|
-- calcolo extra taglio ed accorciamento
|
||||||
local dCutExtra = 0
|
local dCutExtra = 0
|
||||||
local dAccStart = 0
|
local dAccStart = 0
|
||||||
@@ -450,12 +425,10 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId, nOrd, sDownOrSideOrSt
|
|||||||
end
|
end
|
||||||
-- se necessari tagli in doppio, eseguo gli opposti
|
-- se necessari tagli in doppio, eseguo gli opposti
|
||||||
if bDoubleCut then
|
if bDoubleCut then
|
||||||
-- gli accorciamenti vanno invertiti per il taglio opposto
|
|
||||||
local dAccStartDoubleCut, dAccEndDoubleCut = dAccEnd, dAccStart
|
|
||||||
for i = nCuts, 1, -1 do
|
for i = nCuts, 1, -1 do
|
||||||
local dCutOffset = ( i - 1) * dOffsL
|
local dCutOffset = ( i - 1) * dOffsL
|
||||||
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
|
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
|
||||||
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStartDoubleCut, dAccEndDoubleCut, sNotes, b3Raw, true)
|
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
|
||||||
if not bOk then return false, sErr end
|
if not bOk then return false, sErr end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
-- ProcessStepJoint.lua by Egaltech s.r.l. 2022/11/03
|
-- ProcessStepJoint.lua by Egaltech s.r.l. 2022/01/26
|
||||||
-- Gestione calcolo giunto a gradino per Travi
|
-- Gestione calcolo giunto a gradino per Travi
|
||||||
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessStepJoint = {}
|
local ProcessStepJoint = {}
|
||||||
@@ -84,14 +83,13 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sMillType = 'Mark'
|
local sMillType = 'Mark'
|
||||||
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
||||||
local sMilling, bH2
|
local sMilling
|
||||||
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
sMilling, _, _, bDownHead = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error : milling not found in library'
|
local sErr = 'Error : milling not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
bDownHead = ( bDownHead and bH2)
|
|
||||||
-- Inserisco la lavorazione del lato standard
|
-- Inserisco la lavorazione del lato standard
|
||||||
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
local nMch1Id = EgtAddMachining( sName1, sMilling)
|
local nMch1Id = EgtAddMachining( sName1, sMilling)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2022/11/03
|
-- ProcessStepJointNotch.lua by Egaltech s.r.l. 2022/01/25
|
||||||
-- Gestione calcolo tacca a gradino per Travi
|
-- Gestione calcolo tacca a gradino per Travi
|
||||||
-- 2022/11/03 Correzione per riconoscimento testa da sotto su fresatura.
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessStepJointNotch = {}
|
local ProcessStepJointNotch = {}
|
||||||
@@ -524,14 +523,13 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- recupero la lavorazione
|
-- recupero la lavorazione
|
||||||
local sMillType = 'Mark'
|
local sMillType = 'Mark'
|
||||||
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
local bDownHead = ( BD.DOWN_HEAD and abs( vtExtr:getZ()) < 0.1)
|
||||||
local sMilling, bH2
|
local sMilling
|
||||||
sMilling, _, _, bH2 = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
sMilling, _, _, bDownHead = ML.FindMilling( sMillType, nil, nil, nil, nil, true, bDownHead)
|
||||||
if not sMilling then
|
if not sMilling then
|
||||||
local sErr = 'Error : milling not found in library'
|
local sErr = 'Error : milling not found in library'
|
||||||
EgtOutLog( sErr)
|
EgtOutLog( sErr)
|
||||||
return false, sErr
|
return false, sErr
|
||||||
end
|
end
|
||||||
bDownHead = ( bDownHead and bH2)
|
|
||||||
if bExeNormal then
|
if bExeNormal then
|
||||||
-- Inserisco la lavorazione del lato standard
|
-- Inserisco la lavorazione del lato standard
|
||||||
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
-- ProcessTenon.lua by Egaltech s.r.l. 2022/11/03
|
-- ProcessTenon.lua by Egaltech s.r.l. 2022/05/28
|
||||||
-- 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.
|
||||||
-- 2022/05/18 Migliorata gestione attacco.
|
-- 2022/05/18 Migliorata gestione attacco.
|
||||||
-- 2022/05/28 Spostato calcolo svuotatura in modulo di libreria.
|
-- 2022/05/28 Spostato calcolo svuotatura in modulo di libreria.
|
||||||
-- 2022/09/20 Migliorato il calcolo delle passate laterali; ora considera la reale distanza tra contorno del tenone e estremi della faccia
|
|
||||||
-- 2022/11/03 Corretto uso di bH2 (da sotto solo se anche bMillDown vero).
|
|
||||||
|
|
||||||
-- Tabella per definizione modulo
|
-- Tabella per definizione modulo
|
||||||
local ProcessTenon = {}
|
local ProcessTenon = {}
|
||||||
@@ -122,32 +120,11 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
local vtN = vtExtr
|
local vtN = vtExtr
|
||||||
local ptC = ptBC + vtN * dTenH
|
local ptC = ptBC + vtN * dTenH
|
||||||
EgtOutLog( 'ptC=' .. tostring( ptC) ..' vtN=' .. tostring( vtN), 3)
|
EgtOutLog( 'ptC=' .. tostring( ptC) ..' vtN=' .. tostring( vtN), 3)
|
||||||
-- determino larghezza svuotatura per calcolare il numero di passate laterali
|
-- determino larghezza massima di svuotatura
|
||||||
-- ricavo i contorni della faccia principale
|
local b3Aux = EgtGetBBoxRef( AuxId, GDB_BB.STANDARD, frTen)
|
||||||
local nLoopId, nLoopCnt = EgtExtractSurfTmFacetLoops( Proc.Id, 0, EgtGetParent( Proc.Id))
|
local dPockX = max( b3Ten:getMax():getX() - b3Aux:getMax():getX(), b3Aux:getMin():getX() - b3Ten:getMin():getX())
|
||||||
local dPockL = 0
|
local dPockY = max( b3Ten:getMax():getY() - b3Aux:getMax():getY(), b3Aux:getMin():getY() - b3Ten:getMin():getY())
|
||||||
-- ricavo la massima distanza tra gli estremi della faccia e la curva del tenone
|
local dPockL = sqrt( dPockX * dPockX + dPockY * dPockY)
|
||||||
if nLoopId then
|
|
||||||
local dUmin, dUmax = EgtCurveDomain( nLoopId)
|
|
||||||
for dU = dUmin, dUmax do
|
|
||||||
local ptP = EgtUP( nLoopId, dU, GDB_ID.ROOT)
|
|
||||||
local ptNear = EgtNP( AuxId, ptP, GDB_ID.ROOT)
|
|
||||||
local dDist = dist( ptP, ptNear)
|
|
||||||
if dDist > dPockL then
|
|
||||||
dPockL = dDist
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- cancello i contorni dopo averli analizzati
|
|
||||||
for i = 1, nLoopCnt do
|
|
||||||
EgtErase( nLoopId + i - 1)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- se il metodo sopra non funziona uso il metodo semplice (distanza tra gli angoli retti della curva tenone e faccia principale)
|
|
||||||
local b3Aux = EgtGetBBoxRef( AuxId, GDB_BB.STANDARD, frTen)
|
|
||||||
local dPockX = max( b3Ten:getMax():getX() - b3Aux:getMax():getX(), b3Aux:getMin():getX() - b3Ten:getMin():getX())
|
|
||||||
local dPockY = max( b3Ten:getMax():getY() - b3Aux:getMax():getY(), b3Aux:getMin():getY() - b3Ten:getMin():getY())
|
|
||||||
dPockL = sqrt( dPockX * dPockX + dPockY * dPockY)
|
|
||||||
end
|
|
||||||
-- abilitazione lavorazione da sotto
|
-- abilitazione lavorazione da sotto
|
||||||
local bMillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
|
local bMillUp = ( BD.DOWN_HEAD and vtExtr:getZ() > -0.259)
|
||||||
local bMillDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
local bMillDown = ( BD.DOWN_HEAD and vtExtr:getZ() < 0.1)
|
||||||
@@ -226,7 +203,7 @@ function ProcessTenon.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
|||||||
-- porto inizio curva il più possibile sul bordo in alto o in basso
|
-- porto inizio curva il più possibile sul bordo in alto o in basso
|
||||||
local dMaxDist = OVERLAP_COEFF * dMillDiam * MAX_PASS
|
local dMaxDist = OVERLAP_COEFF * dMillDiam * MAX_PASS
|
||||||
local bMyShortPart = ( bShortPart and abs( vtN:getX()) < 0.999 and abs( vtN:getY()) < 0.259)
|
local bMyShortPart = ( bShortPart and abs( vtN:getX()) < 0.999 and abs( vtN:getY()) < 0.259)
|
||||||
BL.PutStartNearestToEdge( AuxId, b3Solid, dMaxDist, ( bH2 and bMillDown) ~= bMyShortPart)
|
BL.PutStartNearestToEdge( AuxId, b3Solid, dMaxDist, bH2 ~= bMyShortPart)
|
||||||
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
-- se elevazione superiore a massimo affondamento della fresa, riduco opportunamente
|
||||||
local sWarn
|
local sWarn
|
||||||
local dDepth = 0
|
local dDepth = 0
|
||||||
|
|||||||
+3
-16
@@ -1,7 +1,5 @@
|
|||||||
-- BeamNestProcess.lua by Egaltech s.r.l. 2021/06/14
|
-- BeamNestProcess.lua by Egaltech s.r.l. 2021/06/14
|
||||||
-- Gestione nesting automatico travi
|
-- Gestione nesting automatico travi
|
||||||
-- 2022/10/05 Piccole modifiche per far funzionare correttamente i compilati
|
|
||||||
-- 2022/10/06 Corretto bug che moltiplicava i pezzi se erano presenti più grezzi della stessa sezione
|
|
||||||
|
|
||||||
-- Intestazioni
|
-- Intestazioni
|
||||||
require( 'EgtBase')
|
require( 'EgtBase')
|
||||||
@@ -170,20 +168,12 @@ end
|
|||||||
-- Pezzi
|
-- Pezzi
|
||||||
local Parts = {}
|
local Parts = {}
|
||||||
|
|
||||||
-- cerco il grezzo con la lunghezza maggiore, epurata dello start gap
|
|
||||||
local maxRawLenToFillNoStartGap = 0
|
|
||||||
for RawIndex = 1, #Raws do
|
|
||||||
maxRawLenToFillNoStartGap = max( maxRawLenToFillNoStartGap, Raws[RawIndex].LenToFill - Raws[RawIndex].StartGap)
|
|
||||||
end
|
|
||||||
-- ciclo su pezzi per aggiungerli al nesting
|
-- ciclo su pezzi per aggiungerli al nesting
|
||||||
for nPartId, nCount in pairs( PART) do
|
for nPartId, nCount in pairs( PART) do
|
||||||
-- recupero lunghezza pezzo
|
-- recupero lunghezza pezzo
|
||||||
local Len = EgtGetInfo( nPartId, "L", 'd')
|
local Len = EgtGetInfo( nPartId, "L", 'd')
|
||||||
local DispLen = EgtIf( Len <= 1000, 2000, 0) --EgtIf( Len <= 2000, max( 2000, 6000 - Len), 0)
|
local DispLen = EgtIf( Len <= 1000, 2000, 0) --EgtIf( Len <= 2000, max( 2000, 6000 - Len), 0)
|
||||||
-- aggiungo il pezzo solo se ci sta nel grezzo più lungo a disposizione
|
table.insert( Parts, {Id = nPartId, Len = Len, DispLen = DispLen, Cnt = nCount})
|
||||||
if Len < maxRawLenToFillNoStartGap then
|
|
||||||
table.insert( Parts, {Id = nPartId, Len = Len, DispLen = DispLen, Cnt = nCount})
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- lunghezza totale pezzi
|
-- lunghezza totale pezzi
|
||||||
@@ -217,10 +207,7 @@ for ShortIndex = 1, #ShortList do
|
|||||||
ShortCount = ShortCount + ShortList[ShortIndex].Cnt
|
ShortCount = ShortCount + ShortList[ShortIndex].Cnt
|
||||||
end
|
end
|
||||||
local ShortForRaw = floor( ShortCount / MediumRawQty)
|
local ShortForRaw = floor( ShortCount / MediumRawQty)
|
||||||
local ExtraShortForRaw = 0
|
local ExtraShortForRaw = fmod( ShortCount, MediumRawQty)
|
||||||
if MediumRawQty > 0 then
|
|
||||||
ExtraShortForRaw = fmod( ShortCount, MediumRawQty)
|
|
||||||
end
|
|
||||||
-- creo lista pezzi corti singoli
|
-- creo lista pezzi corti singoli
|
||||||
local SingleShortList = {}
|
local SingleShortList = {}
|
||||||
for ShortIndex = 1, #ShortList do
|
for ShortIndex = 1, #ShortList do
|
||||||
@@ -338,7 +325,7 @@ while nMachGroup do
|
|||||||
if EgtGetInfo( nMachGroup, "AUTONEST",'i') == 1 then
|
if EgtGetInfo( nMachGroup, "AUTONEST",'i') == 1 then
|
||||||
EgtRemoveInfo( nMachGroup, "AUTONEST")
|
EgtRemoveInfo( nMachGroup, "AUTONEST")
|
||||||
EgtSetInfo( nMachGroup, "UPDATEUI", 1)
|
EgtSetInfo( nMachGroup, "UPDATEUI", 1)
|
||||||
local bOk, sErr = pcall( dofile, BEAM.BASEDIR .. "\\BatchProcessNew.lua")
|
local bOk, sErr = pcall( dofile, EgtGetSourceDir() .. "BatchProcessNew.lua")
|
||||||
if not bOk then
|
if not bOk then
|
||||||
EgtOutLog( 'Error in BatchProcessNew.lua call (' .. ( sErr or '') ..')')
|
EgtOutLog( 'Error in BatchProcessNew.lua call (' .. ( sErr or '') ..')')
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user