DataBeam :

- aggiunta gestione rotazioni di 90gradi (abilitata da BD.ROT90 e compatibilmente con sezione)
- migliorato ordinamento fori
- migliorata classificazione Contorni Liberi.
This commit is contained in:
Dario Sassi
2020-05-19 15:40:07 +00:00
parent c7411fe35d
commit 1c7db5d845
6 changed files with 188 additions and 64 deletions
+136 -35
View File
@@ -1,14 +1,16 @@
-- BeamExec.lua by Egaltech s.r.l. 2020/04/23
-- BeamExec.lua by Egaltech s.r.l. 2020/05/19
-- Libreria esecuzione lavorazioni per Travi
-- 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/25 Aggiunta gestione StepJoint e StepJointNotch
-- 2020/01/21 Aggiunta gestione ScarfJoint
-- 2020/02/10 Aggiunta gestione FrenchRidgeLap
-- 2020/02/11 Aggiunta gestione BlockHausFront
-- 2019/09/25 Aggiunta gestione StepJoint e StepJointNotch.
-- 2020/01/21 Aggiunta gestione ScarfJoint.
-- 2020/02/10 Aggiunta gestione FrenchRidgeLap.
-- 2020/02/11 Aggiunta gestione BlockHausFront.
-- 2020/04/02 Fori di testa dal basso non danno errore e fanno ribaltare la trave.
-- 2020/04/07 Aggiunta gestione TyroleanDovetail
-- 2020/04/14 Aggiunta gestione Dovetail
-- 2020/04/07 Aggiunta gestione TyroleanDovetail.
-- 2020/04/14 Aggiunta gestione Dovetail.
-- 2020/05/16 Migliorie ordinamento fori.
-- 2020/05/16 Gestione rotazione di 90deg.
-- Tabella per definizione modulo
local BeamExec = {}
@@ -110,7 +112,7 @@ EgtMdbSave()
-------------------------------------------------------------------------------------------------------------
function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam)
-- Determinazione minimo grezzo scaricabile
-- Determinazione minimo grezzo scaricabile
BeamExec.CalcMinUnloadableRaw( dRawW, dRawH)
-- Creazione nuovo gruppo di lavoro
@@ -230,6 +232,17 @@ end
-------------------------------------------------------------------------------------------------------------
-- *** Inserimento delle lavorazioni nelle travi ***
-------------------------------------------------------------------------------------------------------------
local function Verify90DegRotation( nRawId)
if not nRawId then return false end
-- dimensioni sezione trave in posizione normale (rotazione 0°)
local dRawW = EgtGetRawPartBBox( nRawId):getDimY()
local dRawH = EgtGetRawPartBBox( nRawId):getDimZ()
-- verifica dell'altezza rispetto alla massima larghezza
return ( dRawH < BD.MAX_WIDTH + 10 * GEO.EPS_SMALL and dRawW < BD.MAX_HEIGHT + 10 * GEO.EPS_SMALL) or
( dRawH < BD.MAX_WIDTH2 + 10 * GEO.EPS_SMALL and dRawW < BD.MAX_HEIGHT2 + 10 * GEO.EPS_SMALL)
end
-------------------------------------------------------------------------------------------------------------
local function IsHeadFeature( Proc, b3Raw, dCurrOvmH)
-- feature sempre di testa o coda per il gruppo
@@ -373,6 +386,8 @@ end
-------------------------------------------------------------------------------------------------------------
local function OrderFeatures( vProc, b3Raw)
local dSmallDrillRange = EgtIf( b3Raw:getDimX() < BD.LEN_SHORT_PART, 150, 250)
-- 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)
local function CompareFeatures( B1, B2)
@@ -384,6 +399,10 @@ local function OrderFeatures( vProc, b3Raw)
if Hcut.Identify( B2) then
return false
end
-- se uno di testa e non l'altro, privilegio quello di testa
if B1.Head ~= B2.Head then
return B1.Head
end
-- se primo è feature di coda e l'altro è separazione o non è feature di coda
if B1.Tail and ( Split.Identify( B2) or not B2.Tail) then
return false
@@ -415,14 +434,14 @@ local function OrderFeatures( vProc, b3Raw)
end
-- se primo è foro e l'altro no, lo penalizzo
if B1.Prc == 40 and B2.Prc ~= 40 then
return B1.Box:getCenter():getX() > B2.Box:getMax():getX() + 100
return B1.Box:getCenter():getX() - 100 > B2.Box:getMax():getX()
end
-- se secondo è foro e l'altro no, lo penalizzo
if B2.Prc == 40 and B1.Prc ~= 40 then
-- se primo è altro e secondo è foro, lo premio
if B1.Prc ~= 40 and B2.Prc == 40 then
return B1.Box:getMax():getX() + 100 > B2.Box:getCenter():getX()
end
-- se sono fori e hanno posizione praticamente uguale ordino secondo diametro e faccia di inizio (Fcs)
if B1.Prc == 40 and B2.Prc == 40 and abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < 600 then
-- se entrambi fori con posizione praticamente uguale ordino secondo diametro e faccia di inizio (Fcs)
if B1.Prc == 40 and B2.Prc == 40 and abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) < dSmallDrillRange then
if abs( B1.Diam - B2.Diam) < 1.0 then
if B1.Fcs == B2.Fcs then
return B1.Box:getCenter():getX() > B2.Box:getCenter():getX()
@@ -438,10 +457,6 @@ local function OrderFeatures( vProc, b3Raw)
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
return ( B1.Prc == 50 and B2.Prc == 52)
end
-- se uno di testa e non l'altro, privilegio questo
if B1.Head ~= B2.Head then
return B1.Head
end
-- confronto standard
if abs( B1.Box:getCenter():getX() - B2.Box:getCenter():getX()) > 0.4 * ( B1.Box:getDimX() + B2.Box:getDimX()) then
return B1.Box:getCenter():getX() > B2.Box:getCenter():getX()
@@ -458,7 +473,7 @@ local function OrderFeatures( vProc, b3Raw)
table.sort( vProc, CompareFeatures)
-- riunisco fori con lo stesso diametro e non troppo lontani
local dDrillRange = EgtIf( BD.GO_FAST == 2, 6000, 600)
local dDrillRange = EgtIf( BD.GO_FAST == 2, 6000, EgtIf( b3Raw:getDimX() < BD.LEN_SHORT_PART, 200, 600))
for i = 1, #vProc do
local ProcI = vProc[i]
if ProcI.Prc == 40 then
@@ -468,11 +483,10 @@ local function OrderFeatures( vProc, b3Raw)
abs( ProcJ.Diam - ProcI.Diam) < 1.0 and abs( ProcJ.Box:getCenter():getX() - ProcI.Box:getCenter():getX()) < dDrillRange then
if j > i + 1 then
local ProcK = vProc[i+1]
if ProcK.Prc ~= 40 or abs( ProcK.Diam - ProcJ.Diam) > 1.0 or ProcJ.Box:getCenter():getX() < ProcK.Box:getCenter():getX() then
if ProcK.Prc ~= 40 or abs( ProcK.Diam - ProcJ.Diam) > 1.0 then
table.insert( vProc, i + 1, table.remove( vProc, j))
end
end
break
end
end
end
@@ -501,6 +515,7 @@ end
local function ClassifyFeatures( vProc, b3Raw, Stats)
local bAllOk = true
local bSomeDown = false
local bSomeSide = false
local bSplitRot = false
local nHeading
local nSplitting
@@ -508,7 +523,8 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
local Proc = vProc[i]
local bOk = true
local bDown = false
local bDownOnHeadOk = false
local bSide = false
local bDownSideOnHeadOk = false
-- se intestatura
if Hcut.Identify( Proc) then
nHeading = i
@@ -539,8 +555,8 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
bOk, bDown = LapJoint.Classify( Proc, b3Raw)
-- se foratura
elseif Drill.Identify( Proc) then
bOk, bDown = Drill.Classify( Proc, b3Raw)
bDownOnHeadOk = true
bOk, bDown, bSide = Drill.Classify( Proc, b3Raw)
bDownSideOnHeadOk = true
-- se tenone
elseif Tenon.Identify( Proc) then
bOk, bDown = Tenon.Classify( Proc, b3Raw)
@@ -588,15 +604,15 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
bOk, bDown = Dovetail.Classify( Proc, b3Raw)
-- se contorno libero
elseif FreeContour.Identify( Proc) then
bOk, bDown = FreeContour.Classify( Proc, b3Raw)
bOk, bDown, bSide = FreeContour.Classify( Proc, b3Raw)
-- se decorazione
elseif Decor.Identify( Proc) then
bOk, bDown = Decor.Classify( Proc)
end
-- assegno risultato
if bOk then
-- non ammessa feature di testa da lavorare ribaltata
if Proc.Head and bDown and not bDownOnHeadOk then
-- non ammessa feature di testa da lavorare ribaltata o ruotata
if Proc.Head and ( bDown or bSide) and not bDownSideOnHeadOk then
Proc.Flg = 0
Proc.Down = true
bAllOk = false
@@ -606,10 +622,17 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
Proc.Down = true
bSomeDown = true
bSplitRot = true
-- gestione feature di coda da lavorare ruotata
elseif Proc.Tail and bSide then
Proc.Side = true
bSomeSide = true
bSplitRot = true
-- caso normale
else
Proc.Down = bDown
Proc.Side = bSide
if bDown then bSomeDown = true end
if bSide then bSomeSide = true end
end
else
Proc.Flg = 0
@@ -620,12 +643,17 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
-- se necessario ribaltamento, assegno intestatura alla fase ribaltata
if bSomeDown and nHeading then
vProc[nHeading].Down = true
-- se altrimenti necessaria rotazione (senza ribaltamento), assegno intestatura alla fase ribaltata (creata ad hoc)
elseif bSomeSide and nHeading then
vProc[nHeading].Down = true
bSomeDown = true
end
-- se necessaria rotazione del ribaltato, assegno separazione alla fase ribaltata
if bSplitRot then
-- se necessaria separazione del ribaltato o ruotato, la assegno sempre alla fase ribaltata
if bSplitRot and nSplitting then
vProc[nSplitting].Down = true
bSomeDown = true
end
return bAllOk, bSomeDown, bSplitRot
return bAllOk, bSomeDown, bSomeSide, bSplitRot
end
-------------------------------------------------------------------------------------------------------------
@@ -633,9 +661,9 @@ local function PrintFeatures( vProc, b3Raw)
EgtOutLog( ' RawBox=' .. tostring( b3Raw))
for i = 1, #vProc do
local Proc = vProc[i]
local sOut = string.format( ' Proc=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Down=%s Head=%s Tail=%s Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s',
local sOut = string.format( ' Proc=%3d Grp=%1d Prc=%3d TC=%2d/%d Flg=%2d Down=%s Side=%s Head=%s Tail=%s Fcse=%1d,%1d Diam=%.2f Fct=%2d Box=%s',
Proc.Id, Proc.Grp, Proc.Prc, Proc.TaskId, Proc.CutId,
Proc.Flg, EgtIf( Proc.Down, 'T', 'F'), EgtIf( Proc.Head, 'T', 'F'), EgtIf( Proc.Tail, 'T', 'F'),
Proc.Flg, EgtIf( Proc.Down, 'T', 'F'), EgtIf( Proc.Side, 'T', 'F'), EgtIf( Proc.Head, 'T', 'F'), EgtIf( Proc.Tail, 'T', 'F'),
Proc.Fcs, Proc.Fce, Proc.Diam, Proc.Fct, tostring( Proc.Box))
EgtOutLog( sOut)
end
@@ -801,6 +829,9 @@ end
-------------------------------------------------------------------------------------------------------------
function BeamExec.ProcessFeatures()
-- verifica se possibile rotazione di 90 gradi
BD.ROT90 = BD.ROT90 and Verify90DegRotation( EgtGetFirstRawPart())
-- ciclo sui pezzi
local nTotErr = 0
local Stats = {}
local nOrd = 1
@@ -828,7 +859,7 @@ function BeamExec.ProcessFeatures()
-- le ordino lungo X
OrderFeatures( vProc, b3Raw)
-- le classifico
local bAllOk, bSomeDown, bSplitRot = ClassifyFeatures( vProc, b3Raw, Stats)
local bAllOk, bSomeDown, bSomeSide, bSplitRot = ClassifyFeatures( vProc, b3Raw, Stats)
if not bAllOk then
nTotErr = nTotErr + 1
end
@@ -836,8 +867,8 @@ function BeamExec.ProcessFeatures()
if EgtGetDebugLevel() >= 1 then
PrintFeatures( vProc, b3Raw)
end
-- se richiesto ribaltamento
if bSomeDown then
-- se richiesto ribaltamento (oppure rotazione)
if bSomeDown or bSomeSide then
-- ribalto le travi della fase corrente
local nRId = nRawId
while nRId do
@@ -880,6 +911,76 @@ function BeamExec.ProcessFeatures()
if not bSplitRot then
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, 0)
-- altrimenti
else
---- se l'ultima fase è senza lavorazioni, la elimino
--local nLastOpeType = EgtGetOperationType( EgtGetLastOperation() or GDB_ID.NULL)
--if nLastOpeType == MCH_OY.DISP then
-- EgtRemoveLastPhase()
--end
-- aggiungo nuova fase con le travi in posizione standard
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET)
-- se grezzo successivo senza pezzi e finale, va tolto
local nNextRawId = EgtGetNextRawPart( nRawId)
if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then
EgtRemoveRawPartFromCurrPhase( nNextRawId)
end
end
nPhase = EgtGetCurrPhase()
nDispId = EgtGetPhaseDisposition( nPhase)
local nType = 'MID'
if bSplitRot then nType = EgtIf( bSomeSide, 'MID2', 'END2') end
EgtSetInfo( nDispId, 'TYPE', nType)
EgtSetInfo( nDispId, 'ORD', nOrd)
end
-- se richiesta rotazione
if bSomeSide then
-- vettore movimento grezzi per rotazione di 90deg
local dDeltaYZ = EgtGetRawPartBBox( nRawId):getDimY() - EgtGetRawPartBBox( nRawId):getDimZ()
local vtMove = Vector3d( 0, dDeltaYZ / 2, dDeltaYZ / 2)
-- ruoto le travi della fase corrente
local nRId = nRawId
while nRId do
EgtMoveRawPart( nRId, vtMove)
EgtRotateRawPart( nRId, X_AX(), 90)
nRId = EgtGetNextRawPart( nRId)
end
EgtSetInfo( nDispId, 'ROT', -1)
-- inserisco le lavorazioni da lavorare ruotate
for i = 1, #vProc do
-- creo la lavorazione
local Proc = vProc[i]
if Proc.Flg ~= 0 and Proc.Side then
local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3Raw)
if not bOk then
nTotErr = nTotErr + 1
table.insert( Stats, {Err=1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
elseif sMsg and #sMsg > 0 then
table.insert( Stats, {Err=-1, Msg=sMsg, Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
else
table.insert( Stats, {Err=0, Msg='', Rot=-2, CutId=Proc.CutId, TaskId=Proc.TaskId})
end
-- se era taglio di separazione, aggiungo nuova fase
if bNewPhase then
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET)
EgtMoveRawPart( nRawId, vtMove)
EgtRotateRawPart( nRawId, X_AX(), 90)
-- se grezzo successivo senza pezzi e finale, va tolto
local nNextRawId = EgtGetNextRawPart( nRawId)
if nNextRawId and EgtGetPartInRawPartCount( nNextRawId) == 0 and EgtGetRawPartBBox( nNextRawId):getDimX() < BD.MinRaw then
EgtRemoveRawPartFromCurrPhase( nNextRawId)
end
nPhase = EgtGetCurrPhase()
nDispId = EgtGetPhaseDisposition( nPhase)
EgtSetInfo( nDispId, 'TYPE', 'MID2')
EgtSetInfo( nDispId, 'ORD', nOrd)
EgtSetInfo( nDispId, 'ROT', -1)
end
end
end
-- se separazione non ancora effettuata, aggiungo nuova fase con le travi in posizione standard
if not bSplitRot then
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, 0)
-- altrimenti
else
BL.AddPhaseWithRawParts( nRawId, BD.OriTR, BD.RAW_OFFSET)
-- se grezzo successivo senza pezzi e finale, va tolto
@@ -897,7 +998,7 @@ function BeamExec.ProcessFeatures()
for i = 1, #vProc do
-- creo la lavorazione
local Proc = vProc[i]
if Proc.Flg ~= 0 and not Proc.Down then
if Proc.Flg ~= 0 and not ( Proc.Down or Proc.Side) then
local bOk, sMsg, bNewPhase = AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3Raw)
if not bOk then
nTotErr = nTotErr + 1
+2 -2
View File
@@ -1,4 +1,4 @@
-- MachiningLib.lua by Egaltech s.r.l. 2020/03/18
-- MachiningLib.lua by Egaltech s.r.l. 2020/05/16
-- Libreria ricerca lavorazioni per Travi
-- Tabella per definizione modulo
@@ -46,7 +46,7 @@ function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr)
local dTMaxDepth = EgtTdbGetCurrToolMaxDepth()
if ( not sTuuidMstr or sTuuidMstr == sTuuid) and
( not dDepth or dTMaxDepth > dDepth - GEO.EPS_SMALL) then
return Milling.Name
return Milling.Name, dTMaxDepth
end
end
end
+23 -13
View File
@@ -1,4 +1,4 @@
-- ProcessDrill.lua by Egaltech s.r.l. 2020/03/31
-- ProcessDrill.lua by Egaltech s.r.l. 2020/05/15
-- Gestione calcolo forature per Travi
-- Tabella per definizione modulo
@@ -84,15 +84,19 @@ function ProcessDrill.Split( Proc, b3Raw)
local dLen = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local bOpen = ( Proc.Fce ~= 0)
-- recupero flag abilitazione split (0=auto,1=no)
local bCanSplit = ( EgtGetInfo( Proc.Id, 'Q02', 'i') ~= 1)
if not bCanSplit then
return false
end
-- recupero la lavorazione
local sDrilling, _, dMaxMat = ML.FindDrilling( dDiam)
if not sDrilling then
dMaxMat = 0
end
if not sDrilling then dMaxMat = 0 end
-- restituisco se va fatto in doppio (solo fori orizzontali)
local DRILL_EXTRA = 5
return ( bOpen and dLen + DRILL_EXTRA > dMaxMat + 10 * GEO.EPS_SMALL and abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and
( abs( vtExtr:getY()) * b3Raw:getDimZ() > abs( vtExtr:getZ()) * b3Raw:getDimY() or Proc.Fce == 5 or Proc.Fce == 6))
local bHoriz = ( abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and
( abs( vtExtr:getY()) * b3Raw:getDimZ() > abs( vtExtr:getZ()) * b3Raw:getDimY() or Proc.Fce == 5 or Proc.Fce == 6))
return ( bOpen and dLen + DRILL_EXTRA > dMaxMat + 10 * GEO.EPS_SMALL and ( bHoriz or BD.ROT90))
end
---------------------------------------------------------------------
@@ -109,19 +113,25 @@ function ProcessDrill.Classify( Proc, b3Raw)
local dLen = abs( EgtCurveThickness( AuxId))
local vtExtr = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
local ptCen = EgtCP( AuxId, GDB_RT.GLOB)
if Proc.Flg == -2 then
vtExtr = - vtExtr
ptCen = ptCen + vtExtr * dLen
-- se lavorato in doppio, devo considerare il lato più sfavorevole
if Proc.Flg == 2 or Proc.Flg == -2 then
if vtExtr:getZ() > 0 then
vtExtr = - vtExtr
ptCen = ptCen + vtExtr * dLen
end
end
-- verifico se troppo inclinato e quindi non lavorabile
if not ( Proc.Fcs == 5 or Proc.Fcs == 6 or Proc.Fce == 5 or Proc.Fce == 6) and abs( vtExtr:getX()) > BD.DRILL_VX_MAX then
return false, false
return false, false, false
end
local bOpen = ( Proc.Fce ~= 0)
local bFaceDown = ( ptCen:getZ() < b3Raw:getMin():getZ() + dDiam / 2 and not Proc.Head and not Proc.Tail)
-- verifico se il foro è fattibile solo da sotto
local bDown = (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1))
return true, bDown
-- verifico se il foro è sotto e quindi va spostato o sopra o sul fianco
if (( vtExtr:getZ() < BD.DRILL_VZ_MIN or bFaceDown) and ( not bOpen or Proc.Flg ~= 1)) then
return true, not BD.ROT90, BD.ROT90
else
return true, false, false
end
end
---------------------------------------------------------------------
+25 -11
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2020/04/24
-- ProcessFreeContour.lua by Egaltech s.r.l. 2020/05/16
-- Gestione calcolo profilo libero per Travi
-- Tabella per definizione modulo
@@ -39,8 +39,8 @@ function ProcessFreeContour.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
local vtN = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
return ( vtN:getX() >= 0.5)
end
-- deve occupare la maggior parte dell'area
if Proc.Box:getDimY() > 0.75 * b3Raw:getDimY() or Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() then
-- deve occupare una buona parte dell'area
if Proc.Box:getDimY() * Proc.Box:getDimZ() > 0.45 * b3Raw:getDimY() * b3Raw:getDimZ() then
return true
end
-- non è di testa
@@ -67,8 +67,8 @@ function ProcessFreeContour.IsTailFeature( Proc, b3Raw)
local vtN = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
return ( vtN:getX() <= - 0.5)
end
-- deve occupare la maggior parte dell'area
if Proc.Box:getDimY() > 0.75 * b3Raw:getDimY() and Proc.Box:getDimZ() > 0.75 * b3Raw:getDimZ() then
-- deve occupare una buona parte dell'area
if Proc.Box:getDimY() * Proc.Box:getDimZ() > 0.45 * b3Raw:getDimY() * b3Raw:getDimZ() then
return true
end
-- non è di coda
@@ -85,14 +85,28 @@ function ProcessFreeContour.Classify( Proc, b3Raw)
if not AuxId then return false end
AuxId = AuxId + Proc.Id
local vtN = EgtCurveExtrusion( AuxId, GDB_RT.GLOB)
-- verifico se va lavorata da sotto
local bDown = false
if not bPocket then
bDown = ( vtN:getZ() < - 0.5) and Proc.Box:getDimZ() < 0.9 * b3Raw:getDimZ()
-- se tasca
if bPocket then
local bDown = ( vtN:getZ() < - 0.5)
return true, bDown, false
-- se altrimenti profilo orizzontale
elseif abs( vtN:getZ()) < 0.5 then
return true, false, false
-- se altrimenti profilo verticale che non interessa tutta la sezione
elseif Proc.Box:getDimZ() < 0.9 * b3Raw:getDimZ() then
local bDown = ( vtN:getZ() < - 0.5)
return true, bDown, false
-- altrimenti è profilo verticale che interessa tutta la sezione
else
bDown = ( vtN:getZ() < - 0.5)
-- recupero la massima capacità di lavoro dell'utensile da utilizzare
local sMilling, dMaxDepth = ML.FindMilling( 'FreeContour')
if not sMilling then dMaxDepth = 0 end
if Proc.Box:getDimZ() > dMaxDepth and BD.ROT90 then
return true, false, true
else
return true, false, false
end
end
return true, bDown
end
---------------------------------------------------------------------
+2 -2
View File
@@ -3223,7 +3223,7 @@ local function MakeLongMoreFaces( Proc, nPhase, nRawId, nPartId)
local b3Raw = EgtGetRawPartBBox( nRawId)
-- la divido in parti lungo X
local vAddId = {}
local nPart = ceil( Proc.Box:getDimX() / BD.LONGCUT_MAXLEN)
local nPart = max( ceil( Proc.Box:getDimX() / BD.LONGCUT_MAXLEN), 2)
local dPartLen = Proc.Box:getDimX() / nPart
local Xmin = Proc.Box:getMin():getX()
for i = 1, nPart do
@@ -3264,7 +3264,7 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- in base al tipo di feature attribuisco il significato dei parametri Q
AssignQValues( Proc)
-- se lunghezza richiede spezzatura
if Proc.Box:getDimX() > BD.LONGCUT_MAXLEN then
if Proc.Box:getDimX() > BD.LONGCUT_ENDLEN then
-- una faccia
if Proc.Fct == 1 then
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
-1
View File
@@ -97,7 +97,6 @@ function ProcessMortise.Make( Proc, nPhase, nRawId, nPartId)
end
end
end
end
-- recupero i dati della faccia di fondo
local frMor, dL, dW = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_ID.ROOT)