DataBeam :
- aggiornamenti e correzioni varie.
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
-- ClearProcess.lua by Egaltech s.r.l. 2019/01/10
|
||||
-- ClearProcess.lua by Egaltech s.r.l. 2020/03/30
|
||||
-- Se la trave non è parte di un gruppo di lavoro, cancello geometrie aggiunte
|
||||
|
||||
-- Intestazioni
|
||||
@@ -44,7 +44,7 @@ end
|
||||
local LayId = EgtGetFirstLayer( PartId)
|
||||
while LayId do
|
||||
local NextLayId = EgtGetNextLayer( LayId)
|
||||
if EgtGetInfo( LayId, '!MGO') then
|
||||
if EgtGetInfo( LayId, GDB_SI.MGRPONLY) then
|
||||
EgtErase( LayId)
|
||||
end
|
||||
LayId = NextLayId
|
||||
|
||||
@@ -519,7 +519,7 @@ local function ClassifyFeatures( vProc, b3Raw, Stats)
|
||||
-- se mezzo-legno di testa
|
||||
elseif RidgeLap.Identify( Proc) then
|
||||
bOk, bDown = RidgeLap.Classify( Proc)
|
||||
-- se mezzo-legno, fessura, fessura frontale, notch, tasca, tacca
|
||||
-- se mezzo-legno, fessura, fessura frontale, notch, tasca, tacca, taglio a triangolo
|
||||
elseif LapJoint.Identify( Proc) then
|
||||
bOk, bDown = LapJoint.Classify( Proc)
|
||||
-- se foratura
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessBlockHausFront.lua by Egaltech s.r.l. 2020/02/11
|
||||
-- ProcessBlockHausFront.lua by Egaltech s.r.l. 2020/03/30
|
||||
-- Gestione calcolo giunzione block house in testa
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -32,7 +32,7 @@ function ProcessBlockHausFront.Classify( Proc)
|
||||
-- se versore z è preponderante sulle altre componenti del vettore ed è verso il basso,
|
||||
-- do errore perchè non è ancora gestita la rotazione di 90°
|
||||
-- considerazioni: al momento non è possibile sapere se ci sono due rastremature o una quindi se è rivolta verso il basso
|
||||
-- viene dato errore, altrimenti si porebbe imporre la rotazione di 180 (ovviamente con una sola rastrematura rivolta verso il basso)
|
||||
-- viene dato errore, altrimenti si potrebbe imporre la rotazione di 180 (ovviamente con una sola rastrematura rivolta verso il basso)
|
||||
if abs(vtN:getZ()) > abs(vtN:getX()) and abs(vtN:getZ()) > abs(vtN:getY()) and vtN:getZ() < -0.5 then
|
||||
return false
|
||||
end
|
||||
@@ -117,7 +117,7 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
dToolThick = EgtTdbGetCurrToolParam(MCH_TP.THICK) or dToolThick
|
||||
end
|
||||
end
|
||||
-- recupero la geometria opzionale
|
||||
-- recupero la geometria ausiliaria
|
||||
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
|
||||
if AuxId then AuxId = AuxId + Proc.Id end
|
||||
-- recupero gruppo per geometria addizionale
|
||||
@@ -128,7 +128,7 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
return false, sErr
|
||||
end
|
||||
-- cerco se nelle note del layer c'è già la nota che indica che l'aux è già stato lavorato
|
||||
local bAuxMachined = EgtGetInfo( nAddGrpId, 'AuxId', 'b')
|
||||
local bAuxMachined = EgtGetInfo( nAddGrpId, 'AuxId.'..tostring(AuxId or 0), 'b')
|
||||
-- taglio sulla faccia esterna
|
||||
if AuxId and not bAuxMachined then
|
||||
-- in generale va fatto
|
||||
@@ -149,7 +149,7 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
|
||||
if bOk then
|
||||
bAuxMachined = true
|
||||
EgtSetInfo( nAddGrpId, 'AuxId', true)
|
||||
EgtSetInfo( nAddGrpId, 'AuxId.'..tostring(AuxId or 0), true)
|
||||
else
|
||||
return bOk, sErr
|
||||
end
|
||||
@@ -240,7 +240,7 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
|
||||
-- se taglio applicato setto la nota al gruppo Mach per non doverla lavorare una seconda volta
|
||||
if bOk then
|
||||
bAuxMachined = true
|
||||
EgtSetInfo( nAddGrpId, 'AuxId', true)
|
||||
EgtSetInfo( nAddGrpId, 'AuxId.'..tostring(AuxId or 0), true)
|
||||
else
|
||||
return bOk, sErr
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2020/03/06
|
||||
-- ProcessDrill.lua by Egaltech s.r.l. 2020/03/31
|
||||
-- Gestione calcolo forature per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -90,7 +90,8 @@ function ProcessDrill.Split( Proc, b3Raw)
|
||||
dMaxMat = 0
|
||||
end
|
||||
-- restituisco se va fatto in doppio (solo fori orizzontali)
|
||||
return ( bOpen and dLen > dMaxMat + 10 * GEO.EPS_SMALL and abs( vtExtr:getZ()) < abs( BD.DRILL_VZ_MIN) and
|
||||
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))
|
||||
end
|
||||
|
||||
|
||||
+138
-75
@@ -1,4 +1,4 @@
|
||||
-- ProcessMortise.lua by Egaltech s.r.l. 2020/03/19
|
||||
-- ProcessDtMortise.lua by Egaltech s.r.l. 2020/03/31
|
||||
-- Gestione calcolo mortase a coda di rondice per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -16,6 +16,7 @@ local ML = require( 'MachiningLib')
|
||||
|
||||
-- settaggi interni ( poi andrà utilizzato parametro ACTIVE_AS proveniente da parametri utente di TechnoEssetre)
|
||||
local bMakeAntiSplitPath = true
|
||||
local bMakeAsByArc = true
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Riconoscimento della feature
|
||||
@@ -47,6 +48,57 @@ function ProcessDtMortise.Classify( Proc)
|
||||
return true, bDown
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function ExtractTopPath( nProcId, vtOrtho, nAddGrpId, rfFac0, dZedTop)
|
||||
|
||||
-- estraggo percorso di contorno
|
||||
local nAuxTop, nNumTop = EgtExtractSurfTmLoops( nProcId, nAddGrpId)
|
||||
if nNumTop ~= 1 then
|
||||
-- elimino i percorsi creati
|
||||
for i = 1, nNumTop do
|
||||
EgtErase( nAuxTop + i - 1)
|
||||
end
|
||||
return nil, 0
|
||||
else
|
||||
-- fondo tra loro le curve compatibili
|
||||
EgtMergeCurvesInCurveCompo( nAuxTop)
|
||||
-- esplodo il percorso in modo da avere entità separate per poterle controllare
|
||||
local nStartId, nCount = EgtExplodeCurveCompo( nAuxTop)
|
||||
if nStartId then
|
||||
-- tabella con identificativi delle curve
|
||||
tEnt = EgtTableFill( nStartId, nCount)
|
||||
-- elimino le curve che non stanno al bordo superiore
|
||||
for i = nCount, 1, -1 do
|
||||
local ptP1 = EgtSP( tEnt[i], GDB_RT.GLOB)
|
||||
local ptP2 = EgtEP( tEnt[i], GDB_RT.GLOB)
|
||||
ptP1:toLoc( rfFac0)
|
||||
ptP2:toLoc( rfFac0)
|
||||
-- se ha variazioni in Z o non è alla giusta Z, cancello l'entità
|
||||
if ( abs( ptP1:getZ() - ptP2:getZ()) > 10 * GEO.EPS_SMALL) or
|
||||
( abs( ptP1:getZ() - dZedTop) > 10 * GEO.EPS_SMALL) then
|
||||
EgtErase( tEnt[i])
|
||||
table.remove( tEnt, i)
|
||||
end
|
||||
end
|
||||
-- ricreo il percorso
|
||||
local ptStart = EgtSP( tEnt[1])
|
||||
local nFirstId, nCnt = EgtCurveCompoByReorder( nAddGrpId, tEnt, ptStart, true)
|
||||
if not nFirstId then return nil, 0 end
|
||||
-- deve rimanere un solo percorso
|
||||
if nCnt > 1 then
|
||||
for nId = nFirstId, nFirstId + nCnt - 1 do
|
||||
EgtErase( nFirstId)
|
||||
end
|
||||
return nil, 0
|
||||
end
|
||||
-- modifico estrusione percorso
|
||||
EgtModifyCurveExtrusion( nFirstId, vtOrtho, GDB_RT.GLOB)
|
||||
return nFirstId, 1
|
||||
end
|
||||
end
|
||||
return nil, 0
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- Applicazione della lavorazione
|
||||
function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId)
|
||||
@@ -74,96 +126,107 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- recupero il diametro dell'utensile
|
||||
-- recupero il diametro dell'utensile e l'angolo di spoglia
|
||||
local dToolDiam = 100
|
||||
local dMaxMat = 30
|
||||
local dSideAngle = 0
|
||||
if EgtMdbSetCurrMachining( sMilling) then
|
||||
local sTuuid = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID)
|
||||
if EgtTdbSetCurrTool( EgtTdbGetToolFromUUID( sTuuid) or '') then
|
||||
dToolDiam = EgtTdbGetCurrToolParam( MCH_TP.DIAM) or dToolDiam
|
||||
dMaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) or dMaxMat
|
||||
dSideAngle = EgtTdbGetCurrToolParam( MCH_TP.SIDEANG) or dSideAngle
|
||||
end
|
||||
end
|
||||
-- se parametro interno abilitato e il percorso non è chiuso, aggiungo percorso e lavorazione antischeggia
|
||||
if bMakeAntiSplitPath and not EgtCurveIsClosed( AuxId) then
|
||||
-- recupero punto iniziale e finale del percorso
|
||||
local pStartP = EgtSP( AuxId, GDB_RT.GLOB)
|
||||
local pEndP = EgtEP( AuxId, GDB_RT.GLOB)
|
||||
if pStartP and pEndP then
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
|
||||
local pMid = ( pStartP + pEndP) / 2
|
||||
local dDistMid = dist( pStartP, pMid)
|
||||
local pMidArc
|
||||
local bGoodArc
|
||||
local nDiv = 2
|
||||
local nId1
|
||||
-- ciclo fino ad individuare arco compativile con l'utensile
|
||||
while not bGoodArc do
|
||||
-- linea dal punto medio alla fine
|
||||
nId1 = EgtLine( nAddGrpId, pMid, pEndP, GDB_RT.GLOB)
|
||||
-- se è stata creata setto il piano e l'accorcio
|
||||
if nId1 then
|
||||
-- EgtModifyCurveExtrusion( nId1, vtExtr, GDB_RT.GLOB)
|
||||
-- accorcio la seconda linea al valore impostato, partendo dal divisore 2
|
||||
EgtTrimExtendCurveByLen( nId1, -( dDistMid * ( 1 - ( 1 / nDiv))), pEndP, GDB_RT.GLOB)
|
||||
-- ruoto di -90 gradi
|
||||
EgtRotate( nId1, pMid, vtExtr, -90, GDB_RT.GLOB)
|
||||
-- prendo il punto finale dell'entità ruotata
|
||||
pMidArc = EgtEP( nId1, GDB_RT.GLOB)
|
||||
-- cancello linea
|
||||
EgtErase(nId1)
|
||||
-- creo arco per 3 punti
|
||||
nId1 = EgtArc3P( nAddGrpId, pStartP, pMidArc, pEndP, GDB_RT.GLOB)
|
||||
if nId1 then
|
||||
EgtModifyCurveExtrusion( nId1, vtExtr, GDB_RT.GLOB)
|
||||
-- recupero il raggio e lo comparo con il raggio utensile,
|
||||
-- se è maggiore del raggio utensile esco dal cliclo
|
||||
local dRad = EgtArcRadius( nId1)
|
||||
if dRad > 0 and dRad > dToolDiam then
|
||||
bGoodArc = true
|
||||
else
|
||||
-- cancello l'arco e incremento il componente del divisore
|
||||
EgtErase(nId1)
|
||||
nDiv = nDiv + 1
|
||||
end
|
||||
else
|
||||
bGoodArc = true
|
||||
end
|
||||
-- recupero il riferimento della faccia di fondo
|
||||
local rfFac0 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, 0, GDB_ID.ROOT)
|
||||
-- ottengo il box con la normale della faccia 0
|
||||
local bBoxF0 = EgtGetBBoxRef( Proc.Id, GDB_BB.STANDARD, rfFac0)
|
||||
-- recupero l'altezza della mortasa
|
||||
local dAltMort = bBoxF0:getDimZ()
|
||||
-- recupero gruppo per geometria addizionale
|
||||
local nAddGrpId = BL.GetAddGroup( nPartId)
|
||||
if not nAddGrpId then
|
||||
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' missing AddGroup'
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- estraggo il percorso top mortise
|
||||
local nAuxId1 = ExtractTopPath( Proc.Id, vtExtr, nAddGrpId, rfFac0, dAltMort)
|
||||
-- se esiste il percorso
|
||||
if nAuxId1 then
|
||||
-- creo percorso sulla parte alta della mortasa
|
||||
local dToolRadDelta = dAltMort * tan( dSideAngle)
|
||||
local dTopDiam = dToolDiam + 2 * dToolRadDelta
|
||||
-- recupero punto iniziale e finale del percorso
|
||||
local ptStart = EgtSP( nAuxId1, GDB_RT.GLOB)
|
||||
local ptEnd = EgtEP( nAuxId1, GDB_RT.GLOB)
|
||||
if ptStart and ptEnd then
|
||||
local nId1
|
||||
-- se richiesti due segmenti di linea
|
||||
if not bMakeAsByArc then
|
||||
-- determino il punto comune dei due segmenti
|
||||
local vtDelta = ( ptEnd - ptStart) / 4
|
||||
vtDelta:rotate( vtExtr, -90)
|
||||
local ptMid = ( ptStart + ptEnd) / 2 + vtDelta
|
||||
-- creo la spezzata formata dai due segmenti
|
||||
nId1 = EgtCurveCompoFromPoints( nAddGrpId, { ptStart, ptMid, ptEnd}, GDB_RT.GLOB)
|
||||
-- altrimenti richiesto arco
|
||||
else
|
||||
bGoodArc = true
|
||||
-- direzione del segmento
|
||||
local vtDir = ptEnd - ptStart ;
|
||||
local dLen = vtDir:len()
|
||||
vtDir:normalize()
|
||||
-- direzioni tangenti iniziale e finale
|
||||
local vtStart = EgtSV( nAuxId1, GDB_RT.GLOB)
|
||||
local vtEnd = EgtEV( nAuxId1, GDB_RT.GLOB)
|
||||
-- angoli
|
||||
local dAngStart = acos( vtStart * vtDir)
|
||||
local dAngEnd = acos( vtEnd * vtDir)
|
||||
local dMaxAng = min( 30, dAngStart, dAngEnd)
|
||||
if dLen < dTopDiam then
|
||||
dMaxAng = min( dMaxAng, asin( dLen / dTopDiam))
|
||||
end
|
||||
local vtTg = vtDir ; vtTg:rotate( vtExtr, -dMaxAng)
|
||||
-- creo l'arco
|
||||
nId1 = EgtArc2PV( nAddGrpId, ptStart, ptEnd, vtTg, GDB_RT.GLOB)
|
||||
end
|
||||
end
|
||||
if not nId1 then
|
||||
if not nId1 then
|
||||
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
EgtModifyCurveExtrusion( nId1, vtExtr, GDB_RT.GLOB)
|
||||
-- inserisco la lavorazione di contornatura anti splint
|
||||
local sNameF = 'DtMtAS_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sNameF, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nId1, -1}})
|
||||
-- setto affondamento pari all'altezza della mortsasa
|
||||
EgtSetMachiningParam( MCH_MP.DEPTH, dAltMort)
|
||||
-- setto offset radiale con aggiunto un ulteriore allargamento di 1mm
|
||||
EgtSetMachiningParam( MCH_MP.OFFSR, dToolRadDelta - 1)
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
local sUserNotes = 'MaxElev='.. EgtNumToString( dAltMort, 1) .. '; VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return false, sErr
|
||||
end
|
||||
else
|
||||
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- inserisco la lavorazione di contornatura anti splint
|
||||
local sNameF = 'DtMtAS_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
|
||||
local nMchFId = EgtAddMachining( sNameF, sMilling)
|
||||
if not nMchFId then
|
||||
local sErr = 'Error adding machining ' .. sNameF .. '-' .. sMilling
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ nId1, -1}})
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
local sUserNotes = 'MaxElev='.. EgtNumToString( dMaxMat - 0.1, 1) .. 'VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
local _, sErr = EgtGetLastMachMgrError()
|
||||
EgtSetOperationMode( nMchFId, false)
|
||||
return false, sErr
|
||||
end
|
||||
else
|
||||
local sErr = 'Wrong geometry : Error on DtMortise ' .. tostring( Proc.Id)
|
||||
EgtOutLog( sErr)
|
||||
@@ -209,7 +272,7 @@ function ProcessDtMortise.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ AuxId, -1}})
|
||||
-- dichiaro non si generano sfridi per VMill
|
||||
local sUserNotes = 'MaxElev='.. EgtNumToString( dMaxMat - 0.1, 1) .. 'VMRS=0;'
|
||||
local sUserNotes = 'MaxElev='.. EgtNumToString( dMaxMat - 0.1, 1) .. '; VMRS=0;'
|
||||
EgtSetMachiningParam( MCH_MP.USERNOTES, sUserNotes)
|
||||
-- eseguo
|
||||
if not EgtApplyMachining( true, false) then
|
||||
|
||||
+762
-234
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user