DataBeam :

- correzione a GetFaceElevation
- modifiche a lavorazione LapJoint per passare i parametri Q quando si fa LongDoubleCut
- modifiche a LongDoubleCut per poter ricevere parametri Q invece di leggerli più alcune migliorie
- aggiunto antischggia in testa a profilo arcuato ma poi disabilitato.
This commit is contained in:
Dario Sassi
2020-11-18 16:14:23 +00:00
parent 4c79eb18c2
commit 7c6961985c
4 changed files with 140 additions and 27 deletions
+21 -2
View File
@@ -1,8 +1,9 @@
-- BeamLib.lua by Egaltech s.r.l. 2020/11/09
-- BeamLib.lua by Egaltech s.r.l. 2020/11/18
-- Libreria globale per Travi
-- 2020/07/28 Corretto calcolo attacchi e uscite di lame per non uscire dalla faccia sotto.
-- 2020/08/18 Aggiunto a GetNearestParalOpposite e GetNearestOrthoOpposite parametro opzionale vtNorm.
-- 2020/11/03 Aggiunta funzione IsEndOrEnd2Phase.
-- 2020/11/18 Correzioni a GetParallelOpposite e a GetFaceElevation.
-- Tabella per definizione modulo
local BeamLib = {}
@@ -336,6 +337,24 @@ function BeamLib.GetOrtupOpposite( nOrthoOpposite)
return nil
end
---------------------------------------------------------------------
function BeamLib.GetParallelOpposite( nOrthoOpposite)
if nOrthoOpposite == MCH_MILL_FU.ORTHO_LEFT then
return MCH_MILL_FU.PARAL_LEFT
elseif nOrthoOpposite == MCH_MILL_FU.ORTHO_RIGHT then
return MCH_MILL_FU.PARAL_RIGHT
elseif nOrthoOpposite == MCH_MILL_FU.ORTHO_FRONT then
return MCH_MILL_FU.PARAL_FRONT
elseif nOrthoOpposite == MCH_MILL_FU.ORTHO_BACK then
return MCH_MILL_FU.PARAL_BACK
elseif nOrthoOpposite == MCH_MILL_FU.ORTHO_DOWN then
return MCH_MILL_FU.PARAL_DOWN
elseif nOrthoOpposite == MCH_MILL_FU.ORTHO_TOP then
return MCH_MILL_FU.PARAL_TOP
end
return nil
end
---------------------------------------------------------------------
function BeamLib.GetVersRef( nOrthoOpposite)
if nOrthoOpposite == MCH_MILL_FU.ORTHO_LEFT then
@@ -392,7 +411,7 @@ function BeamLib.GetFaceElevation( nSurfId, nFac, nPartId)
if not ptC or not vtN then return 0 end
local frOCS = Frame3d( ptC, vtN) ;
local b3Box = EgtGetBBoxRef( nSurfId, GDB_BB.STANDARD, frOCS)
local dElev = b3Box:getDimZ()
local dElev = b3Box:getMax():getZ()
if nPartId then
if EgtSurfTmFacetCount( nSurfId) > 1 then
local _, dCenElev = BeamLib.GetPointDirDepth( nPartId, ptC, vtN)
+5 -2
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/11/13
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/11/16
-- Gestione calcolo mezzo-legno per Travi
-- 2019/10/08 Agg. gestione OpenPocket.
@@ -3745,7 +3745,10 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
local b3Fac1 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 0, GDB_BB.STANDARD)
local b3Fac2 = EgtSurfTmGetFacetBBoxGlob( Proc.Id, 1, GDB_BB.STANDARD)
if abs( b3Fac1:getDimX() - b3Fac2:getDimX()) < 50 then
return Long2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- leggo i parametri Q per utilizzare la fresa di fianco e/o lama
local nUseSideTool = EgtGetInfo( Proc.Id, sMakeBySideRoughTool, 'i') or 0
local bUseBlade = EgtGetInfo( Proc.Id, sAntisplintMode, 'i') == 1
return Long2Cut.Make( Proc, nPhase, nRawId, nPartId, bUseBlade, nUseSideTool)
elseif b3Fac1:getDimX() < 1 then
-- la faccia 0 deve essere quella lunga
EgtSurfTmSwapFacets( Proc.Id, 0, 1)
+54 -12
View File
@@ -1,4 +1,4 @@
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2020/11/08
-- ProcessLongDoubleCut.lua by Egaltech s.r.l. 2020/11/16
-- Gestione calcolo doppio taglio longitudinale per Travi
-- Tabella per definizione modulo
@@ -203,7 +203,7 @@ end
---------------------------------------------------------------------
-- Applicazione della lavorazione
function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId, bForcedBladeMaster, nUseSideToolMaster)
local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( nPartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD)
-- carico i dati delle face già inserite nelle opportune tabelle
@@ -268,8 +268,20 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- fino al punto più vicino della faccia laterale (prima l'arretramento era sempre del raggio utensile).
-- Questo viene fatto se Q03=1 o fresa da sotto
----------------------------------------------------------------------------------------------------------------------------------------
local bUseBlade = EgtGetInfo( Proc.Id, 'Q01', 'i') == 1
local nUseMillOnSide = EgtGetInfo( Proc.Id, 'Q03', 'i') or 0
local bUseBlade
local nUseMillOnSide
-- se presenti utilizzo i parametri dell'eventuale lua "padre"
if bForcedBladeMaster ~= nil then
bUseBlade = bForcedBladeMaster
else
bUseBlade = EgtGetInfo( Proc.Id, 'Q01', 'i') == 1
end
if nUseSideToolMaster ~= nil then
nUseMillOnSide = nUseSideToolMaster
else
nUseMillOnSide = EgtGetInfo( Proc.Id, 'Q03', 'i') or 0
end
-- se entrambe i Q sono attivi, disabilito lama
if nUseMillOnSide > 0 then bUseBlade = false end
@@ -404,8 +416,13 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- ciclo sulle passate
local dOffset
local dLioPerp
if j == 1 then -- il primo taglio lo faccio completo
dOffset = 0
if j == 1 then -- il primo taglio lo faccio completo se angolo interno maggiore di 90
-- se angolo interno inferiore di 90° calcolo l'arretramento della lama + un piccolo delta di 0.3
if dAng < - ( 90 + 10 * GEO.EPS_SMALL) then
dOffset = 0.3 + ((dToolThick* vtN[vOrd[1]]) * vtN[vOrd[2]] * vtN[vOrd[2]]):len()
else
dOffset = 0
end
dLioPerp = vWidth[vOrd[j]] + BD.CUT_SIC
else -- il secondo ridotto della distanza minima e della componente spessore della lama
dOffset = BD.DIM_STRIP_SMALL + ((dToolThick* vtN[vOrd[1]]) - (dToolThick* vtN[vOrd[1]]) * vtN[vOrd[2]] * vtN[vOrd[2]]):len()
@@ -464,6 +481,12 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
-- se angolo compreso è inferiore ai 90 gradi do errore
if dAng < - ( 90 + 10 * GEO.EPS_SMALL) then
local sErr = 'Error : Impossible use a mill with angle less than 90'
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
local dToolDiam = 0
local dMaxDepth = 0
@@ -620,6 +643,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- imposto posizione braccio porta testa per non ingombrare agli estremi
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto uso faccia
EgtOutLog( 'FaceUse='..tostring( vFaceUse[vOrd[i]]))
--EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, BL.GetParallelOpposite( vFaceUse[vOrd[i]]), vFaceUse[vOrd[i]]))
EgtSetMachiningParam( MCH_MP.FACEUSE, EgtIf( bSide, MCH_MILL_FU.PARAL_DOWN, vFaceUse[vOrd[i]]))
-- imposto lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
@@ -691,6 +716,12 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
EgtOutLog( sErr)
return false, sErr
end
-- se angolo compreso è inferiore ai 90 gradi do errore
if dAng < - ( 90 + 10 * GEO.EPS_SMALL) then
local sErr = 'Error : Impossible use a mill with angle less than 90'
EgtOutLog( sErr)
return false, sErr
end
-- recupero i dati dell'utensile
local dToolDiam = 0
local dMaxDepth = 0
@@ -782,8 +813,15 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- ciclo sulle parti
local nM = 0
for j = 1, nC do
local nFin = 2
-- se concavo e facce ortogonali controllo se con la lavorazione della prima faccia il diametro copre la seconda (e non la eseguo)
if not bConvex and bOrtho then
if dToolDiam > vWidth[vOrd[2]] then
nFin = 1
end
end
-- su entrambe le facce
for i = 1, 2 do
for i = 1, nFin do
-- Limitazioni della lavorazione
local nPos = EgtIf( i == 1, j, nC - j + 1)
local dSal = EgtIf( nPos == 1, - EgtIf( i == 1, dStartDist, dEndDist), - EgtIf( i == 1, dStartAccDist, dEndAccDist) - ( nPos - 2) * dC)
@@ -817,8 +855,10 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
else
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
end
-- se concavo
else
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
local vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse2)
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
end
@@ -831,7 +871,8 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
end
else
-- lascio lo stesso le lavorazioni anche se viene intercettato l'errore
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.PARAL_DOWN)
local vFaceUse2 = BL.GetNearestParalOpposite( vtN[EgtIf(vOrd[i] == 1, 2, 1)])
EgtSetMachiningParam( MCH_MP.FACEUSE, vFaceUse2)
if vtN[vOrd[i]]:getZ() < 0 then
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dEal)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dSal)
@@ -844,17 +885,18 @@ function ProcessLong2Cut.Make( Proc, nPhase, nRawId, nPartId)
-- imposto lato di lavoro e inversione
EgtSetMachiningParam( MCH_MP.WORKSIDE, MCH_MILL_WS.LEFT)
EgtSetMachiningParam( MCH_MP.INVERT, true)
local dNz = vtN[vOrd[i]]:getZ()
-- nel caso concavo, devo impostare la lunghezza di attacco ortogonale
if not bConvex then
local dNz = vtN[vOrd[i]]:getZ()
local dLioPerp = vWidth[vOrd[i]] * sqrt( 1 - dNz * dNz) / abs( dNz) + BD.COLL_SIC
-- local dLioPerp = vWidth[vOrd[i]] * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, sqrt( 1 - dNz * dNz) / abs( dNz)) + BD.COLL_SIC
local dLioPerp = vWidth[ EgtIf( vOrd[i] == 1, 2,1)] + BD.COLL_SIC
EgtSetMachiningParam( MCH_MP.LIPERP, dLioPerp)
EgtSetMachiningParam( MCH_MP.LOPERP, dLioPerp)
end
-- verifico massimo affondamento (tengo conto dell'inclinazione utensile e della pinza con estremità conica)
-- 08/09/2020 tolti i 3mm ( per la ghiera smussata) perchè nella verifica collisione vine creato un cilindro non smussato che rileva la collisione
-- local dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * abs( vtN[vOrd[i]]:getY() / vtN[vOrd[i]]:getZ()) - 3)
local dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * abs( vtN[vOrd[i]]:getY() / vtN[vOrd[i]]:getZ()))
local dCollSic = max( BD.COLL_SIC, ( dThDiam - dToolDiam) / 2 * EgtIf( abs(dNz) < GEO.EPS_SMALL, 1, abs( vtN[vOrd[i]]:getY() / dNz)))
if vWidth[vOrd[i]] + dAgg > dMaxDepth - dCollSic then
sWarn = 'Warning in LongDoubleCut : depth (' .. EgtNumToString( vWidth[vOrd[i]] + dAgg, 1) .. ') bigger than max tool depth (' .. EgtNumToString( dMaxDepth - dCollSic, 1) .. ')'
end
+60 -11
View File
@@ -1,4 +1,4 @@
-- ProcessProfCamb.lua by Egaltech s.r.l. 2020/10/30
-- ProcessProfCamb.lua by Egaltech s.r.l. 2020/11/17
-- Gestione calcolo profilo caudato per Travi
-- Tabella per definizione modulo
@@ -22,6 +22,9 @@ local sDepthChamferMill = 'Q03' -- d
local sOverMaterialForFinish = 'Q04' -- d
local sPreemptiveChamfer = 'Q05' -- i
-- abilitazioni extra
dMakeAntiSplintOnHead = 0 -- valore impronta antischeggia, per disattivare settare = nil o = 0
---------------------------------------------------------------------
-- Riconoscimento della feature
function ProcessProfCamb.Identify( Proc)
@@ -94,15 +97,15 @@ local function GetSawCutData( AuxId, vtNF)
end
---------------------------------------------------------------------
local function ModifySideAndInvert( Proc, bHead, dToolDiam)
local function ModifySideAndInvert( Proc, bHead, bForceInvert, nCutLengthMach)
-- confronto il punto iniziale e finale della lavorazione con il box della feature
-- e se è vicino alla parte esterna della trave inverto la lavorazione
ptSP = EgtGetMachiningStartPoint()
ptEp = EgtGetMachiningEndPoint()
local nMachMode = EgtGetMachiningParam( MCH_MP.STEPTYPE)
if nMachMode == 1 and ptSP and ptEp then
if abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX()) then
if bForceInvert or ( nMachMode == 1 and ptSP and ptEp) then
if bForceInvert or ( abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptSP:getX()) <
abs( EgtIf( bHead, Proc.Box:getMax():getX(), Proc.Box:getMin():getX()) - ptEp:getX())) then
-- ottengo il lato lavoro e lo inverto
local nSideWork = EgtGetMachiningParam( MCH_MP.WORKSIDE)
if nSideWork > 0 then
@@ -111,6 +114,12 @@ local function ModifySideAndInvert( Proc, bHead, dToolDiam)
-- ottengo l'inversione e setto il contrario
local bInvertMode = EgtGetMachiningParam( MCH_MP.INVERT)
EgtSetMachiningParam( MCH_MP.INVERT, not bInvertMode)
-- se devo tagliare il percorso setto anche i parametri per l'antischeggia
if nCutLengthMach then
EgtSetMachiningParam( MCH_MP.OFFSR, 0.5)
EgtSetMachiningParam( MCH_MP.LEADOUTTYPE, 0)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, nCutLengthMach)
end
-- riapplico la lavorazione
EgtApplyMachining( true, false)
end
@@ -335,7 +344,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione
ModifySideAndInvert( Proc, bHead, dMillDiam)
ModifySideAndInvert( Proc, bHead)
end
-- se lavorazione da due parti, aggiungo la seconda
if bDoubleCham then
@@ -372,7 +381,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione
ModifySideAndInvert( Proc, bHead, dMillDiam)
ModifySideAndInvert( Proc, bHead)
end
end
end
@@ -382,7 +391,12 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
local bDouble = ( nSide ~= 0 and dProfDepth + BD.CUT_EXTRA > dToolMaxDepth)
local dDepth = min( dToolMaxDepth, dProfDepth / 2 + BD.MILL_OVERLAP)
-- inserisco la lavorazione
local sName = 'Prof_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local sName
if dMakeAntiSplintOnHead and abs(dMakeAntiSplintOnHead) > 0 then
sName = 'Prof_As_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
else
sName = 'Prof_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
end
local nMchId = EgtAddMachining( sName, sMilling)
if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
@@ -446,7 +460,22 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione
ModifySideAndInvert( Proc, bHead, dMillDiam)
ModifySideAndInvert( Proc, bHead)
end
-- se devo fare l'antischeggia in testa
if dMakeAntiSplintOnHead and abs(dMakeAntiSplintOnHead) > 0 then
local sNewName = 'Prof_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
-- copio lavorazione per ingresso antischeggia (la copia è la lavorazione finale)
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
-- rendo corrente la precedente, la inverto e modifico il parametri di uscita
EgtSetCurrMachining( nMchId)
local dCrvLen = EgtCurveLength( AuxId)
if dCrvLen > abs(dMakeAntiSplintOnHead) then
ModifySideAndInvert( Proc, bHead, true, ( abs(dMakeAntiSplintOnHead) - dCrvLen))
end
-- rendo corrente la copia (cioè la lavorazione completa)
EgtSetCurrMachining( nMch2Id)
nMchId = nMch2Id
end
-- se abilitata, aggiungo lavorazione di finitura
if bFinish then
@@ -472,7 +501,12 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
-- se lavorazione da due parti, aggiungo la seconda
if bDouble then
-- inserisco la lavorazione
local sName = 'ProfB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
local sName
if dMakeAntiSplintOnHead and abs(dMakeAntiSplintOnHead) > 0 then
sName = 'ProfB_As_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
else
sName = 'ProfB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
end
local nMchId = EgtAddMachining( sName, sMilling)
if not nMchId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sMilling
@@ -504,7 +538,22 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
else
-- applico controllo del punto entrata lavorazione e se non è distante dall'esterno
-- della feature inverto il punto di inizio della lavorazione
ModifySideAndInvert( Proc, bHead, dMillDiam)
ModifySideAndInvert( Proc, bHead)
end
-- se devo fare l'antischeggia in testa
if dMakeAntiSplintOnHead and abs(dMakeAntiSplintOnHead) > 0 then
local sNewName = 'ProfB_' .. ( EgtGetName( Proc.Id) or tostring( Proc.Id))
-- copio lavorazione per ingresso antischeggia (la copia è la lavorazione finale)
local nMch2Id = EgtCopyMachining( sNewName, EgtGetName( nMchId))
-- rendo corrente la precedente, la inverto e modifico il parametri di uscita
EgtSetCurrMachining( nMchId)
local dCrvLen = EgtCurveLength( AuxId)
if dCrvLen > abs(dMakeAntiSplintOnHead) then
ModifySideAndInvert( Proc, bHead, true, ( abs(dMakeAntiSplintOnHead) - dCrvLen))
end
-- rendo corrente la copia (cioè la lavorazione completa)
EgtSetCurrMachining( nMch2Id)
nMchId = nMch2Id
end
-- se abilitata, aggiungo lavorazione di finitura
if bFinish then