DataBeam :
- aggiunta gestione spostamento opzionale fori su tenoni (BeamData.OFFSET_DRILL_TENON).
This commit is contained in:
@@ -827,6 +827,41 @@ local function AddFeatureMachining( Proc, nPhase, nRawId, nPartId, dCurrOvmH, b3
|
||||
return bOk, sErr, bNewPhase
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
local function MoveDrillsOnTenon( vProc)
|
||||
-- se non richiesto spostamento fori su tenone, esco
|
||||
if abs( BD.OFFSET_DRILL_TENON) < 0.1 then return end
|
||||
-- ciclo sulle feature
|
||||
for i = 1, #vProc do
|
||||
if Tenon.Identify( vProc[i]) then
|
||||
for j = 1, #vProc do
|
||||
if Drill.Identify( vProc[j]) then
|
||||
-- se esiste intersezione tra tenone e foro
|
||||
if vProc[i].Box:getMin():getX() < vProc[j].Box:getMax():getX() + 100 * GEO.EPS_SMALL and
|
||||
vProc[j].Box:getMin():getX() < vProc[i].Box:getMax():getX() + 100 * GEO.EPS_SMALL then
|
||||
-- verifico se foro già spostato
|
||||
if not EgtExistsInfo( vProc[j].Id, 'MOV') then
|
||||
-- recupero curva ausiliaria del foro
|
||||
local AuxDriId = EgtGetInfo( vProc[j].Id, 'AUXID', 'i')
|
||||
AuxDriId = EgtIf( AuxDriId, AuxDriId + vProc[j].Id, nil)
|
||||
-- recupero versore normale del tenone
|
||||
local AuxTenId = EgtGetInfo( vProc[i].Id, 'AUXID', 'i')
|
||||
AuxTenId = EgtIf( AuxTenId, AuxTenId + vProc[i].Id, GDB_ID.NULL)
|
||||
local vtExtr = EgtCurveExtrusion( AuxTenId, GDB_RT.GLOB)
|
||||
-- se tutto ok, eseguo spostamento
|
||||
if AuxDriId and vtExtr then
|
||||
local vtMove = -vtExtr * BD.OFFSET_DRILL_TENON
|
||||
EgtMove( AuxDriId, vtMove, GDB_RT.GLOB)
|
||||
EgtSetInfo( vProc[j].Id, 'MOV', vtMove)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
function BeamExec.ProcessFeatures()
|
||||
-- verifica se possibile rotazione di 90 gradi
|
||||
@@ -867,6 +902,8 @@ function BeamExec.ProcessFeatures()
|
||||
if EgtGetDebugLevel() >= 1 then
|
||||
PrintFeatures( vProc, b3Raw)
|
||||
end
|
||||
-- eventuale spostamento fori sui tenoni
|
||||
MoveDrillsOnTenon( vProc)
|
||||
-- se richiesto ribaltamento (oppure rotazione)
|
||||
if bSomeDown or bSomeSide then
|
||||
-- ribalto le travi della fase corrente
|
||||
|
||||
Reference in New Issue
Block a user