DataBeam :
- aggiunta gestione smussi su tagli coincidenti con testa e coda della trave - correzione nei tagli su pezzi grandi (lato di accesso e dicecut) - correzione in LapJoint per riconoscimento caso 3facce con lavorazione speciale.
This commit is contained in:
+28
-2
@@ -1,4 +1,4 @@
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2020/04/14
|
||||
-- BeamLib.lua by Egaltech s.r.l. 2020/06/16
|
||||
-- Libreria globale per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -60,6 +60,19 @@ function BeamLib.AddPartStartFace( PartId, b3Solid)
|
||||
EgtSetName( nStmId, 'StartCut')
|
||||
EgtSetInfo( nStmId, 'GRP', 1)
|
||||
EgtSetInfo( nStmId, 'PRC', 340)
|
||||
-- verifico se sostituisce un taglio di testa già presente
|
||||
local nProcId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( PartId, 'Processings') or GDB_ID.NULL)
|
||||
while nProcId do
|
||||
local nGrp = EgtGetInfo( nProcId, 'GRP', 'i') or 0
|
||||
local nProc = EgtGetInfo( nProcId, 'PRC', 'i') or 0
|
||||
if ( nGrp == 1 or nGrp == 2) and nProc == 10 then
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nProcId, 0, GDB_ID.ROOT)
|
||||
if ptC and vtN and AreSameVectorApprox( vtN, X_AX()) and abs( ptC:getX() - b3Solid:getMax():getX()) < 10 * GEO.EPS_SMALL then
|
||||
EgtSetInfo( nStmId, 'ORI', nProcId)
|
||||
end
|
||||
end
|
||||
nProcId = EgtGetNext( nProcId)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -83,6 +96,19 @@ function BeamLib.AddPartEndFace( PartId, b3Solid)
|
||||
EgtSetName( nStmId, 'EndCut')
|
||||
EgtSetInfo( nStmId, 'GRP', 2)
|
||||
EgtSetInfo( nStmId, 'PRC', 350)
|
||||
-- verifico se sostituisce un taglio di coda già presente
|
||||
local nProcId = EgtGetFirstInGroup( EgtGetFirstNameInGroup( PartId, 'Processings') or GDB_ID.NULL)
|
||||
while nProcId do
|
||||
local nGrp = EgtGetInfo( nProcId, 'GRP', 'i') or 0
|
||||
local nProc = EgtGetInfo( nProcId, 'PRC', 'i') or 0
|
||||
if ( nGrp == 1 or nGrp == 2) and nProc == 10 then
|
||||
local ptC, vtN = EgtSurfTmFacetCenter( nProcId, 0, GDB_ID.ROOT)
|
||||
if ptC and vtN and AreSameVectorApprox( vtN, -X_AX()) and abs( ptC:getX() - b3Solid:getMin():getX()) < 10 * GEO.EPS_SMALL then
|
||||
EgtSetInfo( nStmId, 'ORI', nProcId)
|
||||
end
|
||||
end
|
||||
nProcId = EgtGetNext( nProcId)
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -363,7 +389,7 @@ function BeamLib.GetFaceWithMostAdj( nSurfId, nPartId, bCompare3Fc, dCosSideAng)
|
||||
-- recupero il numero di facce
|
||||
local nFacCnt = EgtSurfTmFacetCount( nSurfId)
|
||||
if not dCosSideAng then
|
||||
dCosSideAng = -0.05
|
||||
dCosSideAng = -0.09
|
||||
end
|
||||
-- recupero le normali delle facce
|
||||
local vvtN = {}
|
||||
|
||||
+3
-2
@@ -369,8 +369,9 @@ end
|
||||
-- bGetOrtoPlanes*: se voglio calcolare i piani ortogonali al piano passato (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)
|
||||
-- dOrthoMaxDim : massima profondità taglio se faccia singola perpendicolare facce laterali trave
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPlanes, ptCBond, vtNBond)
|
||||
function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPlanes, ptCBond, vtNBond, dOrthoMaxDim)
|
||||
|
||||
local dTolerance = 0 -- distanza di sicurezza per i tagli ortogonali
|
||||
local OffsetP = BD.MAX_DIM_DICE -- distanza tra i piani paralleli
|
||||
@@ -395,7 +396,7 @@ function DiceCut.GetDice( nParent, BBoxRawPart, ptCPlanes, vtNPlanes, bGetOrtoPl
|
||||
|
||||
-- se normali senza componenti in Y con faccia quasi verticale e trave non alta, uso per offset i limiti dei tagli di testa e coda
|
||||
if abs( vtNPlanes:getY()) < 0.1 and vtNPlanes:getZ() < 0.7071 and ( not vtNBond or abs( vtNBond:getY()) < 0.1) and BBoxRawPart:getDimZ() < BD.MIN_DIM_HBEAM then
|
||||
OffsetO = BD.MAX_DIM_HTCUT
|
||||
OffsetO = dOrthoMaxDim or BD.MAX_DIM_HTCUT
|
||||
end
|
||||
|
||||
-- aggiungo piccolo extra agli offset
|
||||
|
||||
+45
-13
@@ -34,6 +34,23 @@ function ProcessCut.Classify( Proc, b3Raw)
|
||||
return true, false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- verifica curva per smusso (-1=errore curva, 0=estrusione non va bene, 1=ok)
|
||||
local function VerifyCurveForChamfer( AuxId)
|
||||
if not AuxId then
|
||||
return -2
|
||||
end
|
||||
if ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
|
||||
return -1
|
||||
end
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
-- va bene solo se direzione estrusione orizzontale
|
||||
if abs( vtExtr:getZ()) > 0.1 then
|
||||
return 0
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- lavorazione smussi
|
||||
local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
@@ -42,24 +59,39 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if dDepth < 0.1 then return true end
|
||||
-- ingombro del grezzo
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- recupero e verifico l'entità curva associata
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||
-- recupero e verifico le entità curva associate (max 2)
|
||||
local sVal = EgtGetInfo( Proc.Id, 'AUXID')
|
||||
local vsAuxId = EgtSplitString( sVal)
|
||||
local AuxId, Aux2Id
|
||||
if vsAuxId and #vsAuxId >=1 then
|
||||
AuxId = tonumber( vsAuxId[1])
|
||||
end
|
||||
if vsAuxId and #vsAuxId >=2 then
|
||||
Aux2Id = tonumber( vsAuxId[2])
|
||||
end
|
||||
if AuxId then AuxId = AuxId + Proc.Id end
|
||||
if not AuxId then return true end
|
||||
if ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
|
||||
if Aux2Id then Aux2Id = Aux2Id + Proc.Id end
|
||||
local nRes = VerifyCurveForChamfer( AuxId)
|
||||
if nRes == 0 and Aux2Id then
|
||||
AuxId = Aux2Id
|
||||
nRes = VerifyCurveForChamfer( AuxId)
|
||||
end
|
||||
if nRes == -2 then
|
||||
return true
|
||||
end
|
||||
if nRes == -1 then
|
||||
local sErr = 'Error : missing profile geometry'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero i dati della curva e del profilo
|
||||
local dWidth = abs( EgtCurveThickness( AuxId))
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
-- eseguo lo smusso solo se direzione orizzontale (non propago la segnalazione a TS3)
|
||||
if abs( vtExtr:getZ()) > 0.1 then
|
||||
if nRes == 0 then
|
||||
local sWarn = 'Warning : skipped not horizontal chamfer'
|
||||
EgtOutLog( sWarn)
|
||||
return true
|
||||
end
|
||||
-- recupero i dati della curva e del profilo
|
||||
local dWidth = abs( EgtCurveThickness( AuxId))
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
-- eseguo lo smusso solo se feature larga come la trave
|
||||
if dWidth < b3Raw:getDimY() - 1 then
|
||||
local sWarn = 'Warning : skipped chamfer (feature smaller than beam)'
|
||||
@@ -118,7 +150,7 @@ local function MakeChamfer( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true
|
||||
return true, nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -175,12 +207,12 @@ function ProcessCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bFromBottom)
|
||||
end
|
||||
-- determino la direzione di taglio preferenziale
|
||||
local _, dCutH, dCutV = BL.GetFaceHvRefDim( Proc.Id, 0)
|
||||
local bHorizCut = (( dCutV < dMaxDepth - 10 * GEO.EPS_SMALL and dCutH > dMaxDepth - 10 * GEO.EPS_SMALL) and not bDownCut)
|
||||
local bHorizCut = (( dCutV < dMaxDepth - BD.CUT_EXTRA and dCutH > dMaxDepth - BD.CUT_EXTRA) and not bDownCut)
|
||||
-- verifico se necessari tagli supplementari
|
||||
EgtOutLog( string.format( 'MaxDepth=%.1f CutH=%.1f CutV=%.1f', dMaxDepth, dCutH, dCutV), 3)
|
||||
local vCuts = {}
|
||||
if dCutH > dMaxDepth - 3 * BD.COLL_SIC or dCutV > dMaxDepth - 3 * BD.COLL_SIC then
|
||||
vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC, vtN, true)
|
||||
if dCutH > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC or dCutV > dMaxDepth - BD.CUT_EXTRA - 3 * BD.COLL_SIC then
|
||||
vCuts = DC.GetDice( EgtGetParent( Proc.Id), b3Solid, ptC, vtN, true, nil, nil, dMaxDepth - BD.CUT_EXTRA)
|
||||
end
|
||||
--DC.PrintOrderCut( vCuts)
|
||||
if #vCuts > 0 then
|
||||
|
||||
+126
-1
@@ -1,4 +1,4 @@
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2020/05/25
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2020/06/16
|
||||
-- Gestione calcolo tagli di testa per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -20,11 +20,136 @@ function ProcessHeadCut.Identify( Proc)
|
||||
return ( Proc.Grp == 1 and Proc.Prc == 340)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- verifica curva per smusso (-1=errore curva, 0=estrusione non va bene, 1=ok)
|
||||
local function VerifyCurveForChamfer( AuxId)
|
||||
if not AuxId then
|
||||
return -2
|
||||
end
|
||||
if ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
|
||||
return -1
|
||||
end
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
-- va bene solo se direzione estrusione orizzontale
|
||||
if abs( vtExtr:getZ()) > 0.1 then
|
||||
return 0
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- lavorazione smussi
|
||||
local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- verifico che lo smusso sia richiesto
|
||||
local dDepth = EgtGetInfo( nOriId, 'Q06', 'd') or 0
|
||||
if dDepth < 0.1 then return true end
|
||||
-- ingombro del grezzo
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- recupero e verifico le entità curva associate (max 2)
|
||||
local sVal = EgtGetInfo( nOriId, 'AUXID')
|
||||
local vsAuxId = EgtSplitString( sVal)
|
||||
local AuxId, Aux2Id
|
||||
if vsAuxId and #vsAuxId >=1 then
|
||||
AuxId = tonumber( vsAuxId[1])
|
||||
end
|
||||
if vsAuxId and #vsAuxId >=2 then
|
||||
Aux2Id = tonumber( vsAuxId[2])
|
||||
end
|
||||
if AuxId then AuxId = AuxId + nOriId end
|
||||
if Aux2Id then Aux2Id = Aux2Id + nOriId end
|
||||
local nRes = VerifyCurveForChamfer( AuxId)
|
||||
if nRes == 0 and Aux2Id then
|
||||
AuxId = Aux2Id
|
||||
nRes = VerifyCurveForChamfer( AuxId)
|
||||
end
|
||||
if nRes == -2 then
|
||||
return true
|
||||
end
|
||||
if nRes == -1 then
|
||||
local sErr = 'Error : missing profile geometry'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
if nRes == 0 then
|
||||
local sWarn = 'Warning : skipped not horizontal chamfer'
|
||||
EgtOutLog( sWarn)
|
||||
return true
|
||||
end
|
||||
-- recupero i dati della curva e del profilo
|
||||
local dWidth = abs( EgtCurveThickness( AuxId))
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
-- eseguo lo smusso solo se feature larga come la trave
|
||||
if dWidth < b3Raw:getDimY() - 1 then
|
||||
local sWarn = 'Warning : skipped chamfer (feature smaller than beam)'
|
||||
EgtOutLog( sWarn)
|
||||
return true, sWarn
|
||||
end
|
||||
local dExtra = 2
|
||||
-- recupero la lavorazione
|
||||
local sMilling = ML.FindMilling( 'Mark')
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato standard
|
||||
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch1Id = EgtAddMachining( sName1, sMilling)
|
||||
if not nMch1Id then
|
||||
local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
-- assegno lato di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtAddMachining( sName2, sMilling)
|
||||
if not nMch2Id then
|
||||
local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- inverto direzione utensile
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
-- assegno lato di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true, nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut)
|
||||
-- ingombro del grezzo
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- inserimento smussi
|
||||
local nOriId = EgtGetInfo( Proc.Id, 'ORI', 'i')
|
||||
if nOriId then
|
||||
local bOkc, sErrC = MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOkc then return bOkc, sErrC end
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sCutting = ML.FindCutting( 'HeadSide')
|
||||
if not sCutting then
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/06/06
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/06/16
|
||||
-- Gestione calcolo mezzo-legno per Travi
|
||||
-- 2019/10/08 Agg. gestione OpenPocket.
|
||||
|
||||
@@ -2891,25 +2891,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSinglePart)
|
||||
-- altrimenti lavoro con svuotatura
|
||||
else
|
||||
local bSpecial3faces = false
|
||||
-- verifico se sono nel caso in cui la faccia esclusa ha elevazione più alta
|
||||
if not bIsU and bIsL and Proc.Fct <= 3 and nFacInd ~= 0 and nFacInd2 ~= 0 then
|
||||
-- verifico se l'elevazione della faccia esclusa è maggiore dell'elevazione delle altre due facce
|
||||
local nFaceMaxElev = 0
|
||||
if Proc.Fct == 3 then
|
||||
for i = 1, Proc.Fct do
|
||||
if (i-1) ~= nFacInd and (i-1) ~= nFacInd2 then
|
||||
nFaceMaxElev = (i-1)
|
||||
end
|
||||
end
|
||||
end
|
||||
local rfFac0 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFaceMaxElev, GDB_ID.ROOT)
|
||||
-- ottengo il box con la normale della faccia 0
|
||||
local bBoxF0 = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfFac0)
|
||||
local dElevF0 = bBoxF0:getDimZ()
|
||||
-- se effettivamente l'elevazione della faccia esclusa è maggiore delle altre elevazioni segno il flag per le 3 facce speciali
|
||||
if dElevF0 > dFacElev and dElevF0 > dFacElev2 then
|
||||
bSpecial3faces = true
|
||||
end
|
||||
-- verifico se lavorando la faccia principale rimane esclusa molta sezione trasversale complessiva della feature (da box)
|
||||
local rfFac, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT)
|
||||
local bBoxF = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfFac)
|
||||
if dH * dV < 0.9 * ( bBoxF:getDimX() * bBoxF:getDimY()) then
|
||||
bSpecial3faces = true
|
||||
end
|
||||
-- se riconosciuta gestione 3 facce
|
||||
-- e limitata per ora alla feature 20
|
||||
|
||||
+126
-1
@@ -1,4 +1,4 @@
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2020/02/29
|
||||
-- ProcessSplit.lua by Egaltech s.r.l. 2020/06/16
|
||||
-- Gestione calcolo tagli di separazione per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -20,11 +20,136 @@ function ProcessSplit.Identify( Proc)
|
||||
return ( Proc.Grp == 2 and Proc.Prc == 350)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- verifica curva per smusso (-1=errore curva, 0=estrusione non va bene, 1=ok)
|
||||
local function VerifyCurveForChamfer( AuxId)
|
||||
if not AuxId then
|
||||
return -2
|
||||
end
|
||||
if ( EgtGetType( AuxId) & GDB_FY.GEO_CURVE) == 0 then
|
||||
return -1
|
||||
end
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
-- va bene solo se direzione estrusione orizzontale
|
||||
if abs( vtExtr:getZ()) > 0.1 then
|
||||
return 0
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- lavorazione smussi
|
||||
local function MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- verifico che lo smusso sia richiesto
|
||||
local dDepth = EgtGetInfo( nOriId, 'Q06', 'd') or 0
|
||||
if dDepth < 0.1 then return true end
|
||||
-- ingombro del grezzo
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- recupero e verifico le entità curva associate (max 2)
|
||||
local sVal = EgtGetInfo( nOriId, 'AUXID')
|
||||
local vsAuxId = EgtSplitString( sVal)
|
||||
local AuxId, Aux2Id
|
||||
if vsAuxId and #vsAuxId >=1 then
|
||||
AuxId = tonumber( vsAuxId[1])
|
||||
end
|
||||
if vsAuxId and #vsAuxId >=2 then
|
||||
Aux2Id = tonumber( vsAuxId[2])
|
||||
end
|
||||
if AuxId then AuxId = AuxId + nOriId end
|
||||
if Aux2Id then Aux2Id = Aux2Id + nOriId end
|
||||
local nRes = VerifyCurveForChamfer( AuxId)
|
||||
if nRes == 0 and Aux2Id then
|
||||
AuxId = Aux2Id
|
||||
nRes = VerifyCurveForChamfer( AuxId)
|
||||
end
|
||||
if nRes == -2 then
|
||||
return true
|
||||
end
|
||||
if nRes == -1 then
|
||||
local sErr = 'Error : missing profile geometry'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
if nRes == 0 then
|
||||
local sWarn = 'Warning : skipped not horizontal chamfer'
|
||||
EgtOutLog( sWarn)
|
||||
return true
|
||||
end
|
||||
-- recupero i dati della curva e del profilo
|
||||
local dWidth = abs( EgtCurveThickness( AuxId))
|
||||
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
|
||||
-- eseguo lo smusso solo se feature larga come la trave
|
||||
if dWidth < b3Raw:getDimY() - 1 then
|
||||
local sWarn = 'Warning : skipped chamfer (feature smaller than beam)'
|
||||
EgtOutLog( sWarn)
|
||||
return true, sWarn
|
||||
end
|
||||
local dExtra = 2
|
||||
-- recupero la lavorazione
|
||||
local sMilling = ML.FindMilling( 'Mark')
|
||||
if not sMilling then
|
||||
local sErr = 'Error : milling not found in library'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato standard
|
||||
local sName1 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch1Id = EgtAddMachining( sName1, sMilling)
|
||||
if not nMch1Id then
|
||||
local sErr = 'Error adding machining ' .. sName1 .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
-- assegno lato di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.RIGHT)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
-- Inserisco la lavorazione del lato opposto
|
||||
local sName2 = 'SJN_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMch2Id = EgtAddMachining( sName2, sMilling)
|
||||
if not nMch2Id then
|
||||
local sErr = 'Error adding machining ' .. sName2 .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- inverto direzione utensile
|
||||
EgtSetMachiningParam( MCH_MP.TOOLINVERT, true)
|
||||
-- assegno affondamento e offset radiale
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dDepth + dExtra)
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dExtra)
|
||||
-- assegno lato di lavoro
|
||||
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchId, false)
|
||||
return false, sErr
|
||||
end
|
||||
return true, nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- ingombro del grezzo
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- inserimento smussi
|
||||
local nOriId = EgtGetInfo( Proc.Id, 'ORI', 'i')
|
||||
if nOriId then
|
||||
local bOkc, sErrC = MakeChamfer( nOriId, Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
if not bOkc then return bOkc, sErrC end
|
||||
end
|
||||
-- recupero la lavorazione
|
||||
local sCutting = ML.FindCutting( EgtIf( bSplit, 'SplitSide', 'TailSide'))
|
||||
if not sCutting then
|
||||
|
||||
Reference in New Issue
Block a user