DataBeam :

- spostate MakeOneFaceBySaw (ora MakeOne), CalcLeadInOutPerpGeom e CalcLeadInOutTangGeom da BeamLib a FacesBySaw
- modifiche a SCC per macchine tipo PF in MakeOne.
This commit is contained in:
DarioS
2021-11-28 15:41:10 +01:00
parent ec14595f60
commit adf19c5105
18 changed files with 446 additions and 433 deletions
+1 -363
View File
@@ -1,20 +1,12 @@
-- BeamLib.lua by Egaltech s.r.l. 2021/11/19
-- BeamLib.lua by Egaltech s.r.l. 2021/11/26
-- 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.
-- 2021/01/06 Cambiato limite per attacco Tg con lama e CalcLeadInOutGeom rinominata in CalcLeadInOutPerpGeom.
-- 2021/02/03 In taglio lama si accettano anche due lati con deviazione minore di 20deg.
-- 2021/02/09 In taglio lama con PF si preferisce testa in Y- quindi SCC di conseguenza.
-- 2021/02/26 In taglio lama consento attacco anche da sotto (grazie a migliorie in MachKernel).
-- 2021/03/22 Attacchi e uscite di tagli longitudinali da sotto con lama solo ortogonali.
-- 2021/04/27 Migliorati controlli per attacchi e uscite Tg con lama.
-- 2021/06/27 Aggiunta funzione GetOtherFaceElevation.
-- 2021/07/01 In GetNearestOrthoOpposite premio direzioni destra/sinistra.
-- 2021/07/08 Modifiche in MakeOneFaceBySaw per gestione taglio con due segmenti.
-- 2021/07/15 Aggiunta GetFaceElevationFromPointDir.
-- 2021/08/03 In MakeOneFaceBySaw mgliorata gestione tagli con normale verso il basso e da sopra.
-- 2021/09/12 Aggiustamenti in GetNearestParalOpposite e GetNearestOrthoOpposite.
-- Tabella per definizione modulo
@@ -666,360 +658,6 @@ function BeamLib.GetFaceHvRefDim( nSurfId, nFacet)
return frHV, b3HV:getDimX(), b3HV:getDimY()
end
---------------------------------------------------------------------
function BeamLib.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dRad, vtRef, dCutExtra, b3Box)
-- Mi assicuro che i vettori ingresso/uscita giacciano nel piano
vtV1 = vtV1 - vtV1 * vtN * vtN ; vtV1:normalize()
vtV2 = vtV2 - vtV2 * vtN * vtN ; vtV2:normalize()
-- Versore tangente al taglio
local vtTg = ptP2 - ptP1 ;
vtTg = vtTg - vtTg * vtN * vtN ; vtTg:normalize()
-- Sistema di riferimento intrinseco al taglio
local vtX = vtTg ^ vtN
local frFace = Frame3d( ptP1, vtX, vtTg, vtN)
EgtOutLog( 'Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3)
-- Versori di attacco e uscita
local dCos1 = vtV1 * vtRef
local dCos2 = vtV2 * vtRef
local vtLi, vtLo
if abs( dCos1 - dCos2) < 0.001 then
if abs( vtV1:getZ()) < abs( vtV2:getZ()) then
vtLi = vtV1
vtLo = vtV1
else
vtLi = vtV2
vtLo = vtV2
end
elseif dCos1 > dCos2 then
vtLi = vtV1
vtLo = vtV1
else
vtLi = vtV2
vtLo = vtV2
end
local bRight = ( vtX * vtLi > 0)
-- Versori di attacco e uscita nel riferimento intrinseco al taglio
local vtLiL = Vector3d( vtLi) ; vtLiL:toLoc( frFace)
local vtLoL = Vector3d( vtLo) ; vtLoL:toLoc( frFace)
-- Spostamento punti per effetto dell'extra o della deficienza di taglio
ptP1 = ptP1 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra))
ptP2 = ptP2 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra))
-- Non va considerata l'uscita dalla faccia sotto, pertanto va abbassata
-- 2021/02/26 Abilito anche uscita sotto
local b3MyBox = BBox3d( b3Box) ; --b3MyBox:Add( b3MyBox:getMin() - 1000 * Z_AX())
-- Attacco
local dLiTang = 10000
local dLiPerp = 10000
local bLiOk, _, vLiPar = EgtLineBoxInters( ptP1, vtLi, b3MyBox)
if bLiOk and #vLiPar > 0 then
-- con la prima faccia di uscita
local dLen = vLiPar[#vLiPar]
local ptInt = ptP1 + vtLi * dLen
local vtFN = BeamLib.GetBoxFaceNorm( b3MyBox, ptInt, vtLi)
EgtOutLog( 'LiFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLi * vtFN)
local dLiLen = dLen + dAddLen
EgtOutLog( 'LeadIn Dist=' .. EgtNumToString( dLiLen), 3)
dLiTang = - dLiLen * vtLiL:getY()
dLiPerp = EgtIf( bRight, dLiLen, - dLiLen) * vtLiL:getX()
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLiOk2, _, vLiPar2 = EgtLineBoxInters( ptP1, vtLi, b3Mod)
if bLiOk2 and #vLiPar2 > 0 then
local dLen2 = vLiPar2[#vLiPar2]
local vtFN2 = BeamLib.GetBoxFaceNorm( b3Mod, ptP1 + vtLi * dLen2, vtLi)
EgtOutLog( 'LiFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLi * vtFN2)
local dLiLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadIn Dist2=' .. EgtNumToString( dLiLen2), 3)
local dLiTang2 = - dLiLen2 * vtLiL:getY()
local dLiPerp2 = EgtIf( bRight, dLiLen2, - dLiLen2) * vtLiL:getX()
if dLiLen2 < dLiLen then
dLiTang = dLiTang2
dLiPerp = dLiPerp2
end
end
end
-- Lunghezza di uscita
local dLoTang = 10000
local dLoPerp = 10000
local bLoOk, _, vLoPar = EgtLineBoxInters( ptP2, vtLo, b3MyBox)
if bLoOk and #vLoPar > 0 then
-- con la prima faccia di uscita
local dLen = vLoPar[#vLoPar]
local ptInt = ptP2 + vtLo * dLen
local vtFN = BeamLib.GetBoxFaceNorm( b3MyBox, ptInt, vtLo)
EgtOutLog( 'LoFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLo * vtFN)
local dLoLen = dLen + dAddLen
EgtOutLog( 'LeadOut Dist=' .. EgtNumToString( dLoLen), 3)
dLoTang = dLoLen * vtLoL:getY()
dLoPerp = EgtIf( bRight, dLoLen, - dLoLen) * vtLoL:getX()
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLoOk2, _, vLoPar2 = EgtLineBoxInters( ptP2, vtLo, b3Mod)
if bLoOk2 and #vLoPar2 > 0 then
local dLen2 = vLoPar2[#vLoPar2]
local vtFN2 = BeamLib.GetBoxFaceNorm( b3Mod, ptP2 + vtLo * dLen2, vtLo)
EgtOutLog( 'LoFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLo * vtFN2)
local dLoLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadOut Dist2=' .. EgtNumToString( dLoLen2), 3)
local dLoTang2 = dLoLen2 * vtLoL:getY()
local dLoPerp2 = EgtIf( bRight, dLoLen2, - dLoLen2) * vtLoL:getX()
if dLoLen2 < dLoLen then
dLoTang = dLoTang2
dLoPerp = dLoPerp2
end
end
end
return dLiTang, dLiPerp, dLoTang, dLoPerp
end
---------------------------------------------------------------------
function BeamLib.CalcLeadInOutTangGeom( ptP1, ptP2, vtN, dRad, vtRef, dCutExtra, b3Box)
-- Versore tangente al taglio
local vtTg = ptP2 - ptP1 ;
vtTg = vtTg - vtTg * vtN * vtN ; vtTg:normalize()
-- Sistema di riferimento intrinseco al taglio
local vtX = vtTg ^ vtN
local frFace = Frame3d( ptP1, vtX, vtTg, vtN)
if ( vtX * vtRef < 0) then
vtX = - vtX
end
EgtOutLog( 'Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3)
-- Spostamento punti per effetto dell'extra o della deficienza di taglio
ptP1 = ptP1 - vtX * dCutExtra
ptP2 = ptP2 - vtX * dCutExtra
-- Non va considerata l'uscita dalla faccia sotto, pertanto va abbassata
-- 2021/02/26 Abilito anche uscita sotto
local b3MyBox = BBox3d( b3Box) ; --b3MyBox:Add( b3MyBox:getMin() - 1000 * Z_AX())
-- Attacco
local dLiTang = 10000
local dLiPerp = 0
local bLiOk, _, vLiPar = EgtLineBoxInters( ptP1, vtTg, b3MyBox)
if bLiOk and #vLiPar > 0 then
local dLen = vLiPar[1]
local ptInt = ptP1 + vtTg * dLen
local vtFN = BeamLib.GetBoxFaceNorm( b3MyBox, ptInt, -vtTg)
EgtOutLog( 'LiFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - ( vtX * vtFN)) / ( vtTg * vtFN)
local dLiLen = dLen + dAddLen
EgtOutLog( 'LeadIn Dist=' .. EgtNumToString( dLiLen), 3)
dLiTang = - dLiLen
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLiOk2, _, vLiPar2 = EgtLineBoxInters( ptP1, vtTg, b3Mod)
if bLiOk2 and #vLiPar2 > 0 then
local dLen2 = vLiPar2[1]
local vtFN2 = BeamLib.GetBoxFaceNorm( b3Mod, ptP1 + vtTg * dLen2, -vtTg)
EgtOutLog( 'LiFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - ( vtX * vtFN2)) / ( vtTg * vtFN2)
local dLiLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadIn Dist2=' .. EgtNumToString( dLiLen2), 3)
if -dLiLen2 < -dLiLen then
dLiTang = - dLiLen2
end
end
end
-- Lunghezza di uscita
local dLoTang = 10000
local dLoPerp = 0
local bLoOk, _, vLoPar = EgtLineBoxInters( ptP2, vtTg, b3MyBox)
if bLoOk and #vLoPar > 0 then
local dLen = vLoPar[#vLoPar]
local ptInt = ptP2 + vtTg * dLen
local vtFN = BeamLib.GetBoxFaceNorm( b3MyBox, ptInt, vtTg)
EgtOutLog( 'LoFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - ( vtX * vtFN)) / ( vtTg * vtFN)
local dLoLen = dLen + dAddLen
EgtOutLog( 'LeadOut Dist=' .. EgtNumToString( dLoLen), 3)
dLoTang = dLoLen
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLoOk2, _, vLoPar2 = EgtLineBoxInters( ptP2, vtTg, b3Mod)
if bLoOk2 and #vLoPar2 > 0 then
local dLen2 = vLoPar2[#vLoPar2]
local vtFN2 = BeamLib.GetBoxFaceNorm( b3Mod, ptP2 + vtTg * dLen2, vtTg)
EgtOutLog( 'LoFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - ( vtX * vtFN2)) / ( vtTg * vtFN2)
local dLoLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadOut Dist2=' .. EgtNumToString( dLoLen2), 3)
if dLoLen2 < dLoLen then
dLoTang = dLoLen2
end
end
end
return dLiTang, dLiPerp, dLoTang, dLoPerp
end
---------------------------------------------------------------------
function BeamLib.MakeOneFaceBySaw( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
-- risolvo parametro ambiguo
local nOrthoOpposite
local vtOrthO
if isVector3d( Par5) then
nOrthoOpposite = BeamLib.GetNearestOrthoOpposite( Par5, vtN)
vtOrthO = Vector3d( Par5)
else
nOrthoOpposite = Par5
vtOrthO = BeamLib.GetVersRef( Par5)
end
-- linea o bilinea di lavorazione (qui uso nOrthoOpposite per ripetere esattamente il calcolo del Mach)
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, BeamLib.GetVersRef( nOrthoOpposite), GDB_ID.ROOT)
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
EgtOutLog( sWarn, 1)
return true, ''
end
vtV1 = - vtV1
local bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
if bInvert then
ptP1, ptP2 = ptP2, ptP1
vtV1, vtV2 = vtV2, vtV1
end
local vtTg = ptP2 - ptP1 ; vtTg:normalize()
local dAllStart = 0
local dAllEnd = 0
-- se bilinea, scarto la parte più allineata con la direzione ortogonale (se deviazione angolare oltre 20 deg o lunghezza minore di dSawDiam/2 * cos( 20/2)) ma maggiore di un minimo
if ( ( ptPm - ptP1) - ( ptPm - ptP1) * vtTg * vtTg):len() > 100 * GEO.EPS_SMALL then
local vtTg1 = ptPm - ptP1 ; vtTg1:normalize()
local vtTg2 = ptP2 - ptPm ; vtTg2:normalize()
local dDist1 = dist( ptP1, ptPm)
local dDist2 = dist( ptP2, ptPm)
local dCosMax = 0.951 -- cos( 18°)
local dLenMin = 30
local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin)
--if vtTg1 * vtTg2 < dCosMax or ( dDist1 < dLenMax and dDist1 > dLenMin) or ( dDist2 < dLenMax and dDist2 > dLenMin) then
if vtTg1 * vtTg2 < dCosMax then
local dOrtho1 = abs( vtTg1 * vtOrthO)
local dOrtho2 = abs( vtTg2 * vtOrthO)
if dOrtho1 < dOrtho2 or ( abs( dOrtho1 - dOrtho2) < 0.1 and dDist1 > 4 * dDist2) then
if dDist1 > dLenMin or dDist1 > 0.5 * dDist2 then
ptP2 = Point3d( ptPm)
dAllEnd = - dDist2 - 10 * GEO.EPS_SMALL
end
else
if dDist2 > dLenMin or dDist2 > 0.5 * dDist1 then
ptP1 = Point3d( ptPm)
dAllStart = - dDist1 - 10 * GEO.EPS_SMALL
end
end
vtTg = ptP2 - ptP1 ; vtTg:normalize()
end
end
-- verifico se lavorazione con lama sotto e testa sopra
local bFromTop = ( nOrthoOpposite == MCH_MILL_FU.ORTHO_DOWN)
if not dVzLimDwnUp then dVzLimDwnUp = BeamLib.GetNzLimDownUp( b3Raw, bFromTop) end
local bDownUp = ( vtN:getZ() < dVzLimDwnUp)
local nFaceUse = nOrthoOpposite
if bDownUp then nFaceUse = BeamLib.GetOrtupOpposite( nOrthoOpposite) end
local bWsRight = ( bInvert ~= bDownUp)
local nWorkSide = EgtIf( bWsRight, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
-- Versore di riferimento
local vtRef = Vector3d( vtTg)
vtRef:rotate( vtN, EgtIf( bInvert, -90, 90))
-- Versore esterno
local vtOut = vtRef - vtRef * vtTg * vtTg ; vtOut:normalize()
-- Versore ausiliario (direzione braccio)
local vtAux = Vector3d( vtN:getX(), vtN:getY(), 0) ; vtAux:normalize()
vtAux:rotate( Z_AX(), EgtIf( bWsRight, 90, -90))
if vtAux:isSmall() then
vtAux = Vector3d( vtOut:getX(), vtOut:getY(), 0) ; vtAux:normalize()
else
if abs( vtAux * vtOut) < GEO.EPS_SMALL then
if abs( vtTg:getZ()) > 0.5 then
if vtAux * vtRef < 0 then
vtAux = - vtAux
end
elseif vtAux * vtTg > 0 then
vtAux = - vtAux
end
elseif vtAux * vtOut < 0 then
vtAux = - vtAux
end
end
-- parametri di attacco/uscita
local b3Box = BBox3d( b3Raw)
b3Box:expand( dCutSic)
local ptP1act = ptP1 + vtN * dCutOffset
local ptP2act = ptP2 + vtN * dCutOffset
-- attacco perpendicolare
local dLiTang, dLiPerp, dLoTang, dLoPerp = BeamLib.CalcLeadInOutPerpGeom( ptP1act, ptP2act, vtV1, vtV2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
-- attacco tangente
local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = BeamLib.CalcLeadInOutTangGeom( ptP1act, ptP2act, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
local dLenLi2 = abs( dLi2Tang)
local dLenLo2 = abs( dLo2Tang)
-- scelgo l'attacco più conveniente (se non taglio praticamente longitudinale)
local Ktp = 1.1
if BD.KIOTP then Ktp = BD.KIOTP end
if abs( vtTg:getX()) < 0.9848 and
( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5)) or
( abs( vtTg:getZ()) < 0.51 and b3Box:getDimZ() > 400 and BD.C_SIMM and BD.MAX_HEIGHT > 450) or
( Ktp * dLenLi2 < dLenLi and Ktp * dLenLo2 < dLenLo) or Ktp * ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) then
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
end
-- posizione braccio
EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
local nSCC = MCH_SCC.NONE
if not BD.C_SIMM or vtRef:getZ() < 0.866 or abs( vtTg:getZ()) > 0.02 then
if abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
else
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end
end
-- per macchine PF se possibile preferisco tenere la testa più davanti
if BD.C_SIMM and abs( vtTg:getZ()) < 0.01 and abs( vtTg:getX()) < 0.5 then
if nSCC == MCH_SCC.ADIR_YP then
nSCC = MCH_SCC.ADIR_YM
end
end
-- inserisco la lavorazione di taglio
local sName = 'Cut_' .. ( EgtGetName( nSurfId) or tostring( nSurfId)) .. '_' .. tostring( nFacet + 1)
local nMchFId = EgtAddMachining( sName, sCutting)
if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
EgtOutLog( sErr)
return false, sErr
end
sName = EgtGetOperationName( nMchFId)
-- aggiungo geometria
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
-- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto inversione e lato correzione
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide)
-- affondamento aggiuntivo
EgtSetMachiningParam( MCH_MP.OFFSR, -dCutExtra)
-- offset longitudinale
EgtSetMachiningParam( MCH_MP.OFFSL, EgtIf( bDownUp, -dCutOffset, dCutOffset))
-- imposto attacco/uscita
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
-- imposto allungamenti iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd)
-- eventuali note
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
return true, sName, nMchFId
end
-------------------------------------------------------------------------------------------------------------
function BeamLib.UpdateHCING( nRawId, dHCI, dDist)
local dOldHCI = EgtGetInfo( nRawId, 'HCING', 'd') or 0
+368 -5
View File
@@ -1,6 +1,15 @@
-- FacesBySaw.lua by Egaltech s.r.l. 2021/08/31
-- Gestione taglio con lama di feature con una, due o tre facce
-- FacesBySaw.lua by Egaltech s.r.l. 2021/11/26
-- Gestione taglio con lama di feature con una o due facce
-- 2021/01/06 Cambiato limite per attacco Tg con lama e CalcLeadInOutGeom rinominata in CalcLeadInOutPerpGeom.
-- 2021/02/03 In taglio lama si accettano anche due lati con deviazione minore di 20deg.
-- 2021/02/09 In taglio lama con PF si preferisce testa in Y- quindi SCC di conseguenza.
-- 2021/02/26 In taglio lama consento attacco anche da sotto (grazie a migliorie in MachKernel).
-- 2021/03/22 Attacchi e uscite di tagli longitudinali da sotto con lama solo ortogonali.
-- 2021/04/27 Migliorati controlli per attacchi e uscite Tg con lama.
-- 2021/07/08 Modifiche in MakeOneFaceBySaw per gestione taglio con due segmenti.
-- 2021/08/03 In MakeOneFaceBySaw mgliorata gestione tagli con normale verso il basso e da sopra.
-- 2021/08/31 DS Aggiunta gestione nessun limite direzione da sotto per testa da sotto.
-- 2021/11/26 DS Spostate qui MakeOneFaceBySaw (ora MakeOne), CalcLeadInOutPerpGeom e CalcLeadInOutTangGeom.
-- Tabella per definizione modulo
local FacesBySaw = {}
@@ -16,6 +25,173 @@ EgtOutLog( ' FacesBySaw started', 1)
local BD = require( 'BeamData')
local ML = require( 'MachiningLib')
---------------------------------------------------------------------
function FacesBySaw.MakeOne( nSurfId, nFacet, sCutting, dSawDiam, Par5, dVzLimDwnUp, dCutExtra, dCutSic, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
-- dati della faccia
local ptC, vtN = EgtSurfTmFacetCenter( nSurfId, nFacet, GDB_ID.ROOT)
-- risolvo parametro ambiguo
local nOrthoOpposite
local vtOrthO
if isVector3d( Par5) then
nOrthoOpposite = BL.GetNearestOrthoOpposite( Par5, vtN)
vtOrthO = Vector3d( Par5)
else
nOrthoOpposite = Par5
vtOrthO = BL.GetVersRef( Par5)
end
-- linea o bilinea di lavorazione (qui uso nOrthoOpposite per ripetere esattamente il calcolo del Mach)
local ptP1, ptPm, ptP2, vtV1, vtV2, dLen, dWidth = EgtSurfTmFacetOppositeSide( nSurfId, nFacet, BL.GetVersRef( nOrthoOpposite), GDB_ID.ROOT)
if not dLen or dLen < 1.1 or not dWidth or dWidth < 1.1 then
local sWarn = 'Face ' .. string.format( '%d,%d', nSurfId, nFacet) .. ' skipped : too small'
EgtOutLog( sWarn, 1)
return true, ''
end
vtV1 = - vtV1
local bInvert = ( ptP2:getZ() < ptP1:getZ() - 100 * GEO.EPS_SMALL)
if bInvert then
ptP1, ptP2 = ptP2, ptP1
vtV1, vtV2 = vtV2, vtV1
end
local vtTg = ptP2 - ptP1 ; vtTg:normalize()
local dAllStart = 0
local dAllEnd = 0
-- se bilinea, scarto la parte più allineata con la direzione ortogonale (se deviazione angolare oltre 20 deg o lunghezza minore di dSawDiam/2 * cos( 20/2)) ma maggiore di un minimo
if ( ( ptPm - ptP1) - ( ptPm - ptP1) * vtTg * vtTg):len() > 100 * GEO.EPS_SMALL then
local vtTg1 = ptPm - ptP1 ; vtTg1:normalize()
local vtTg2 = ptP2 - ptPm ; vtTg2:normalize()
local dDist1 = dist( ptP1, ptPm)
local dDist2 = dist( ptP2, ptPm)
local dCosMax = 0.951 -- cos( 18°)
local dLenMin = 30
local dLenMax = max( 0.5 * dSawDiam * 0.17365 + 1, 2 * dLenMin)
--if vtTg1 * vtTg2 < dCosMax or ( dDist1 < dLenMax and dDist1 > dLenMin) or ( dDist2 < dLenMax and dDist2 > dLenMin) then
if vtTg1 * vtTg2 < dCosMax then
local dOrtho1 = abs( vtTg1 * vtOrthO)
local dOrtho2 = abs( vtTg2 * vtOrthO)
if dOrtho1 < dOrtho2 or ( abs( dOrtho1 - dOrtho2) < 0.1 and dDist1 > 4 * dDist2) then
if dDist1 > dLenMin or dDist1 > 0.5 * dDist2 then
ptP2 = Point3d( ptPm)
dAllEnd = - dDist2 - 10 * GEO.EPS_SMALL
end
else
if dDist2 > dLenMin or dDist2 > 0.5 * dDist1 then
ptP1 = Point3d( ptPm)
dAllStart = - dDist1 - 10 * GEO.EPS_SMALL
end
end
vtTg = ptP2 - ptP1 ; vtTg:normalize()
end
end
-- verifico se lavorazione con lama sotto e testa sopra
local bFromTop = ( nOrthoOpposite == MCH_MILL_FU.ORTHO_DOWN)
if not dVzLimDwnUp then dVzLimDwnUp = BL.GetNzLimDownUp( b3Raw, bFromTop) end
local bDownUp = ( vtN:getZ() < dVzLimDwnUp)
local nFaceUse = nOrthoOpposite
if bDownUp then nFaceUse = BL.GetOrtupOpposite( nOrthoOpposite) end
local bWsRight = ( bInvert ~= bDownUp)
local nWorkSide = EgtIf( bWsRight, MCH_MILL_WS.RIGHT, MCH_MILL_WS.LEFT)
-- Versore di riferimento
local vtRef = Vector3d( vtTg)
vtRef:rotate( vtN, EgtIf( bInvert, -90, 90))
-- Versore esterno
local vtOut = vtRef - vtRef * vtTg * vtTg ; vtOut:normalize()
-- Versore ausiliario (direzione braccio)
local vtAux = Vector3d( vtN:getX(), vtN:getY(), 0) ; vtAux:normalize()
vtAux:rotate( Z_AX(), EgtIf( bWsRight, 90, -90))
if vtAux:isSmall() then
vtAux = Vector3d( vtOut:getX(), vtOut:getY(), 0) ; vtAux:normalize()
else
if abs( vtAux * vtOut) < GEO.EPS_SMALL then
if abs( vtTg:getZ()) > 0.5 then
if vtAux * vtRef < 0 then
vtAux = - vtAux
end
elseif vtAux * vtTg > 0 then
vtAux = - vtAux
end
elseif vtAux * vtOut < 0 then
vtAux = - vtAux
end
end
-- parametri di attacco/uscita
local b3Box = BBox3d( b3Raw)
b3Box:expand( dCutSic)
local ptP1act = ptP1 + vtN * dCutOffset
local ptP2act = ptP2 + vtN * dCutOffset
-- attacco perpendicolare
local dLiTang, dLiPerp, dLoTang, dLoPerp = FacesBySaw.CalcLeadInOutPerpGeom( ptP1act, ptP2act, vtV1, vtV2, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
local dLenLi = sqrt( dLiTang * dLiTang + dLiPerp * dLiPerp)
local dLenLo = sqrt( dLoTang * dLoTang + dLoPerp * dLoPerp)
-- attacco tangente
local dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp = FacesBySaw.CalcLeadInOutTangGeom( ptP1act, ptP2act, vtN, dSawDiam/2, vtRef, dCutExtra, b3Box)
local dLenLi2 = abs( dLi2Tang)
local dLenLo2 = abs( dLo2Tang)
-- scelgo l'attacco più conveniente (se non taglio praticamente longitudinale)
local Ktp = 1.1
if BD.KIOTP then Ktp = BD.KIOTP end
if ( not bDownUp or abs( vtTg:getY()) > 0.5) and abs( vtTg:getX()) < 0.9848 and
( ( abs( vtTg:getZ()) < 0.17 and ( vtV1:getZ() < -0.5 or vtV2:getZ() < -0.5)) or
( abs( vtTg:getZ()) < 0.51 and b3Box:getDimZ() > 300 and BD.C_SIMM and BD.MAX_HEIGHT > 450) or
( Ktp * dLenLi2 < dLenLi and Ktp * dLenLo2 < dLenLo) or Ktp * ( dLenLi2 + dLenLo2) < ( dLenLi + dLenLo)) then
dLiTang, dLiPerp, dLoTang, dLoPerp = dLi2Tang, dLi2Perp, dLo2Tang, dLo2Perp
end
-- posizione braccio
EgtOutLog( 'vtN=' .. tostring( vtN) .. ' vtRef=' .. tostring( vtRef) .. ' vtOut=' .. tostring( vtOut) .. ' vtAux=' .. tostring( vtAux), 3)
local nSCC = MCH_SCC.NONE
--if not BD.C_SIMM or vtRef:getZ() < 0.866 or abs( vtTg:getZ()) > 0.02 then
if abs( vtAux:getX()) > abs( vtAux:getY()) - GEO.EPS_SMALL then
nSCC = EgtIf( ( vtAux:getX() > -GEO.EPS_SMALL), MCH_SCC.ADIR_XP, MCH_SCC.ADIR_XM)
else
nSCC = EgtIf( ( vtAux:getY() > -GEO.EPS_SMALL), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_YM)
end
--end
-- per macchine PF se possibile preferisco tenere la testa più davanti
--if BD.C_SIMM and abs( vtTg:getZ()) < 0.01 and abs( vtTg:getX()) < 0.5 then
-- if nSCC == MCH_SCC.ADIR_YP then
-- nSCC = MCH_SCC.ADIR_YM
-- end
--end
-- inserisco la lavorazione di taglio
local sName = 'Cut_' .. ( EgtGetName( nSurfId) or tostring( nSurfId)) .. '_' .. tostring( nFacet + 1)
local nMchFId = EgtAddMachining( sName, sCutting)
if not nMchFId then
local sErr = 'Error adding machining ' .. sName .. '-' .. sCutting
EgtOutLog( sErr)
return false, sErr
end
sName = EgtGetOperationName( nMchFId)
-- aggiungo geometria
EgtSetMachiningGeometry( {{ nSurfId, nFacet}})
-- imposto uso faccia
EgtSetMachiningParam( MCH_MP.FACEUSE, nFaceUse)
-- imposto posizione braccio porta testa
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
-- imposto inversione e lato correzione
EgtSetMachiningParam( MCH_MP.INVERT, bInvert)
EgtSetMachiningParam( MCH_MP.WORKSIDE, nWorkSide)
-- affondamento aggiuntivo
EgtSetMachiningParam( MCH_MP.OFFSR, -dCutExtra)
-- offset longitudinale
EgtSetMachiningParam( MCH_MP.OFFSL, EgtIf( bDownUp, -dCutOffset, dCutOffset))
-- imposto attacco/uscita
EgtSetMachiningParam( MCH_MP.LITANG, dLiTang)
EgtSetMachiningParam( MCH_MP.LIPERP, dLiPerp)
EgtSetMachiningParam( MCH_MP.LOTANG, dLoTang)
EgtSetMachiningParam( MCH_MP.LOPERP, dLoPerp)
-- imposto allungamenti iniziale e finale
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dAllStart - dAccStart)
EgtSetMachiningParam( MCH_MP.ENDADDLEN, dAllEnd - dAccEnd)
-- eventuali note
if sNotes and #sNotes > 0 then EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) end
-- eseguo
if not EgtApplyMachining( true, false) then
local _, sErr = EgtGetLastMachMgrError()
EgtSetOperationMode( nMchFId, false)
return false, sErr
end
return true, sName, nMchFId
end
---------------------------------------------------------------------
function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType, bUpdateIng, bDownHead)
-- bUpdateIng : parametro opzionale con default true
@@ -137,7 +313,7 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
if not BD.C_SIMM and BD.MAX_HEIGHT_ROT_B_ABOVE and b3Raw:getDimZ() > BD.MAX_HEIGHT_ROT_B_ABOVE and vtOrthO:getZ() > 0.866 and j == #vCuts[i] then
dAccEnd = - ( dSawDiam / 2 + BD.CUT_SIC)
end
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, dAccEnd, nil, b3Raw)
local bOk, sErr = FacesBySaw.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, dAccEnd, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -151,10 +327,10 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
nUpInd, nOtInd = nOtInd, nUpInd
end
-- lavoro la prima faccia
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, nOtInd-1, sCutting, dSawDiam, vtRef[nOtInd], dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = FacesBySaw.MakeOne( Proc.Id, nOtInd-1, sCutting, dSawDiam, vtRef[nOtInd], dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
-- lavoro seconda faccia
bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, nUpInd-1, sCutting, dSawDiam, vtRef[nUpInd], dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOk, sErr = FacesBySaw.MakeOne( Proc.Id, nUpInd-1, sCutting, dSawDiam, vtRef[nUpInd], dNzLimDwnUp, dCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -180,4 +356,191 @@ function FacesBySaw.MakeTwo( Proc, nPhase, nRawId, nPartId, dOvmHead, sCutType,
return true
end
---------------------------------------------------------------------
function FacesBySaw.CalcLeadInOutPerpGeom( ptP1, ptP2, vtV1, vtV2, vtN, dRad, vtRef, dCutExtra, b3Box)
-- Mi assicuro che i vettori ingresso/uscita giacciano nel piano
vtV1 = vtV1 - vtV1 * vtN * vtN ; vtV1:normalize()
vtV2 = vtV2 - vtV2 * vtN * vtN ; vtV2:normalize()
-- Versore tangente al taglio
local vtTg = ptP2 - ptP1 ;
vtTg = vtTg - vtTg * vtN * vtN ; vtTg:normalize()
-- Sistema di riferimento intrinseco al taglio
local vtX = vtTg ^ vtN
local frFace = Frame3d( ptP1, vtX, vtTg, vtN)
EgtOutLog( 'Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3)
-- Versori di attacco e uscita
local dCos1 = vtV1 * vtRef
local dCos2 = vtV2 * vtRef
local vtLi, vtLo
if abs( dCos1 - dCos2) < 0.001 then
if abs( vtV1:getZ()) < abs( vtV2:getZ()) then
vtLi = vtV1
vtLo = vtV1
else
vtLi = vtV2
vtLo = vtV2
end
elseif dCos1 > dCos2 then
vtLi = vtV1
vtLo = vtV1
else
vtLi = vtV2
vtLo = vtV2
end
local bRight = ( vtX * vtLi > 0)
-- Versori di attacco e uscita nel riferimento intrinseco al taglio
local vtLiL = Vector3d( vtLi) ; vtLiL:toLoc( frFace)
local vtLoL = Vector3d( vtLo) ; vtLoL:toLoc( frFace)
-- Spostamento punti per effetto dell'extra o della deficienza di taglio
ptP1 = ptP1 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra))
ptP2 = ptP2 + vtX * ( EgtIf( bRight, - dCutExtra, dCutExtra))
-- Non va considerata l'uscita dalla faccia sotto, pertanto va abbassata
-- 2021/02/26 Abilito anche uscita sotto
local b3MyBox = BBox3d( b3Box) ; --b3MyBox:Add( b3MyBox:getMin() - 1000 * Z_AX())
-- Attacco
local dLiTang = 10000
local dLiPerp = 10000
local bLiOk, _, vLiPar = EgtLineBoxInters( ptP1, vtLi, b3MyBox)
if bLiOk and #vLiPar > 0 then
-- con la prima faccia di uscita
local dLen = vLiPar[#vLiPar]
local ptInt = ptP1 + vtLi * dLen
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtLi)
EgtOutLog( 'LiFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLi * vtFN)
local dLiLen = dLen + dAddLen
EgtOutLog( 'LeadIn Dist=' .. EgtNumToString( dLiLen), 3)
dLiTang = - dLiLen * vtLiL:getY()
dLiPerp = EgtIf( bRight, dLiLen, - dLiLen) * vtLiL:getX()
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLiOk2, _, vLiPar2 = EgtLineBoxInters( ptP1, vtLi, b3Mod)
if bLiOk2 and #vLiPar2 > 0 then
local dLen2 = vLiPar2[#vLiPar2]
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP1 + vtLi * dLen2, vtLi)
EgtOutLog( 'LiFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLi * vtFN2)
local dLiLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadIn Dist2=' .. EgtNumToString( dLiLen2), 3)
local dLiTang2 = - dLiLen2 * vtLiL:getY()
local dLiPerp2 = EgtIf( bRight, dLiLen2, - dLiLen2) * vtLiL:getX()
if dLiLen2 < dLiLen then
dLiTang = dLiTang2
dLiPerp = dLiPerp2
end
end
end
-- Lunghezza di uscita
local dLoTang = 10000
local dLoPerp = 10000
local bLoOk, _, vLoPar = EgtLineBoxInters( ptP2, vtLo, b3MyBox)
if bLoOk and #vLoPar > 0 then
-- con la prima faccia di uscita
local dLen = vLoPar[#vLoPar]
local ptInt = ptP2 + vtLo * dLen
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtLo)
EgtOutLog( 'LoFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - abs( vtX * vtFN)) / ( vtLo * vtFN)
local dLoLen = dLen + dAddLen
EgtOutLog( 'LeadOut Dist=' .. EgtNumToString( dLoLen), 3)
dLoTang = dLoLen * vtLoL:getY()
dLoPerp = EgtIf( bRight, dLoLen, - dLoLen) * vtLoL:getX()
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLoOk2, _, vLoPar2 = EgtLineBoxInters( ptP2, vtLo, b3Mod)
if bLoOk2 and #vLoPar2 > 0 then
local dLen2 = vLoPar2[#vLoPar2]
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP2 + vtLo * dLen2, vtLo)
EgtOutLog( 'LoFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - abs( vtX * vtFN2)) / ( vtLo * vtFN2)
local dLoLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadOut Dist2=' .. EgtNumToString( dLoLen2), 3)
local dLoTang2 = dLoLen2 * vtLoL:getY()
local dLoPerp2 = EgtIf( bRight, dLoLen2, - dLoLen2) * vtLoL:getX()
if dLoLen2 < dLoLen then
dLoTang = dLoTang2
dLoPerp = dLoPerp2
end
end
end
return dLiTang, dLiPerp, dLoTang, dLoPerp
end
---------------------------------------------------------------------
function FacesBySaw.CalcLeadInOutTangGeom( ptP1, ptP2, vtN, dRad, vtRef, dCutExtra, b3Box)
-- Versore tangente al taglio
local vtTg = ptP2 - ptP1 ;
vtTg = vtTg - vtTg * vtN * vtN ; vtTg:normalize()
-- Sistema di riferimento intrinseco al taglio
local vtX = vtTg ^ vtN
local frFace = Frame3d( ptP1, vtX, vtTg, vtN)
if ( vtX * vtRef < 0) then
vtX = - vtX
end
EgtOutLog( 'Vref=' .. tostring( vtRef) .. ' V1=' .. tostring( vtV1) .. ' V2=' .. tostring( vtV2), 3)
-- Spostamento punti per effetto dell'extra o della deficienza di taglio
ptP1 = ptP1 - vtX * dCutExtra
ptP2 = ptP2 - vtX * dCutExtra
-- Non va considerata l'uscita dalla faccia sotto, pertanto va abbassata
-- 2021/02/26 Abilito anche uscita sotto
local b3MyBox = BBox3d( b3Box) ; --b3MyBox:Add( b3MyBox:getMin() - 1000 * Z_AX())
-- Attacco
local dLiTang = 10000
local dLiPerp = 0
local bLiOk, _, vLiPar = EgtLineBoxInters( ptP1, vtTg, b3MyBox)
if bLiOk and #vLiPar > 0 then
local dLen = vLiPar[1]
local ptInt = ptP1 + vtTg * dLen
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, -vtTg)
EgtOutLog( 'LiFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - ( vtX * vtFN)) / ( vtTg * vtFN)
local dLiLen = dLen + dAddLen
EgtOutLog( 'LeadIn Dist=' .. EgtNumToString( dLiLen), 3)
dLiTang = - dLiLen
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLiOk2, _, vLiPar2 = EgtLineBoxInters( ptP1, vtTg, b3Mod)
if bLiOk2 and #vLiPar2 > 0 then
local dLen2 = vLiPar2[1]
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP1 + vtTg * dLen2, -vtTg)
EgtOutLog( 'LiFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - ( vtX * vtFN2)) / ( vtTg * vtFN2)
local dLiLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadIn Dist2=' .. EgtNumToString( dLiLen2), 3)
if -dLiLen2 < -dLiLen then
dLiTang = - dLiLen2
end
end
end
-- Lunghezza di uscita
local dLoTang = 10000
local dLoPerp = 0
local bLoOk, _, vLoPar = EgtLineBoxInters( ptP2, vtTg, b3MyBox)
if bLoOk and #vLoPar > 0 then
local dLen = vLoPar[#vLoPar]
local ptInt = ptP2 + vtTg * dLen
local vtFN = BL.GetBoxFaceNorm( b3MyBox, ptInt, vtTg)
EgtOutLog( 'LoFaceNorm=' .. tostring( vtFN), 3)
local dAddLen = dRad * ( sqrt( 1 - ( vtN * vtFN) * ( vtN * vtFN)) - ( vtX * vtFN)) / ( vtTg * vtFN)
local dLoLen = dLen + dAddLen
EgtOutLog( 'LeadOut Dist=' .. EgtNumToString( dLoLen), 3)
dLoTang = dLoLen
-- verifico se miglioro calcolando con faccia successiva
local b3Mod = BBox3d( b3MyBox) ; b3Mod:Add( ptInt + 1000 * vtFN)
local bLoOk2, _, vLoPar2 = EgtLineBoxInters( ptP2, vtTg, b3Mod)
if bLoOk2 and #vLoPar2 > 0 then
local dLen2 = vLoPar2[#vLoPar2]
local vtFN2 = BL.GetBoxFaceNorm( b3Mod, ptP2 + vtTg * dLen2, vtTg)
EgtOutLog( 'LoFaceNorm2=' .. tostring( vtFN2), 3)
local dAddLen2 = dRad * ( sqrt( 1 - ( vtN * vtFN2) * ( vtN * vtFN2)) - ( vtX * vtFN2)) / ( vtTg * vtFN2)
local dLoLen2 = dLen2 + dAddLen2
EgtOutLog( 'LeadOut Dist2=' .. EgtNumToString( dLoLen2), 3)
if dLoLen2 < dLoLen then
dLoTang = dLoLen2
end
end
end
return dLiTang, dLiPerp, dLoTang, dLoPerp
end
return FacesBySaw
+4 -3
View File
@@ -7,6 +7,7 @@ local ProcessBlockHausFront = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut')
@@ -215,7 +216,7 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
else
dExtraTrim = dMiddleExtraTrim
end
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -(dTrim+dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -(dTrim+dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -254,7 +255,7 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if vFaceOrd[2] ~= 0 then
-- inserisco la lavorazione
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
if #sNameOrErr > 0 then bIntCut = true end
end
@@ -270,7 +271,7 @@ function ProcessBlockHausFront.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end
-- inserisco la lavorazione
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end
+10 -9
View File
@@ -1,4 +1,4 @@
-- ProcessCut.lua by Egaltech s.r.l. 2021/11/14
-- ProcessCut.lua by Egaltech s.r.l. 2021/11/27
-- Gestione calcolo singoli tagli di lama per Travi
-- 2021/05/18 I due tagli con testa da sotto di un cubetto sono fatti di seguito.
-- 2021/06/06 Correzioni per tagli con testa da sotto.
@@ -12,6 +12,7 @@ local ProcessCut = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
local LongCut = require( 'ProcessLongCut')
@@ -237,8 +238,8 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
if bFromBottom == nil then
bFromBottom = ( vtN:getZ() > 0.25 and ( b3Solid:getDimX() < BD.LEN_SHORT_PART and vtN:getX() < 0))
end
-- verifico se da considerare taglio lungo ( non da sotto, inclinato meno di 21.56deg, largo come la trave e abbastanza lungo)
local bLongCut = ( not bDownCut and vtN:getZ() > 0.93 and
-- verifico se da considerare taglio lungo ( non da sotto, inclinato non più di 30deg, largo come la trave e abbastanza lungo)
local bLongCut = ( not bDownCut and vtN:getZ() > 0.865 and
Proc.Box:getDimY() > b3Solid:getDimY() - 10 * GEO.EPS_SMALL and
( Proc.Box:getDimX() > 0.75 * b3Solid:getDimX() or Proc.Box:getDimX() > 600.000))
-- se taglio lungo e Q04 = 1 allora lancio il processo dell'L10
@@ -415,7 +416,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
vtNewOrthoO = -vtOrthoO
if not BD.C_SIMM and abs( vtN:getY()) > 0.05 then dVzLimDwnUp = -0.707 end
end
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtNewOrthoO, dVzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -440,7 +441,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
end
local dVzLimDwnUp = dNzLimDwnUp
if not BD.C_SIMM and vtN:getZ() > 0.707 then dVzLimDwnUp = -0.708 end
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, dVzLimDwnUp, dExtraCut, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -473,7 +474,7 @@ local function MakeFromTop( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead, b
vtOrthoO = EgtIf( vtN:getY() > 0.02, Y_AX(), -Y_AX())
end
-- taglio
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, dNzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, dNzLimDwnUp, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -617,14 +618,14 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- taglio perpendicolare (limite Vz Down Up messo a -2 per non farlo mai intervenire)
if vCuts[i][j] then
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO_1, -2, dExtraCut_1, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
end
-- taglio parallelo (limite Vz Down Up messo a -2 per non farlo mai intervenire)
if vCuts[i+1][j] then
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i+1][j], 0, sCutting, dSawDiam, vtOrthoO_2, -2, dExtraCut_2, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -663,7 +664,7 @@ local function MakeFromDown( sCutting, Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end
-- taglio (limite Vz Down Up messo a -2 per non farlo mai intervenire)
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, -2, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, vtOrthoO, -2, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
+2 -2
View File
@@ -7,9 +7,9 @@ local ProcessDoubleCut = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut')
local Fbs = require( 'FacesBySaw')
EgtOutLog( ' ProcessDoubleCut started', 1)
@@ -298,7 +298,7 @@ function ProcessDoubleCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if ( i % 2) ~= 1 then vtOrthOpp, vtNorm = vtNorm, vtOrthOpp end
-- lavoro la faccia
for j = 1, #vCuts[i] do
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthOpp, EgtIf( bDownHead, -2, nil), 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthOpp, EgtIf( bDownHead, -2, nil), 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
+7 -6
View File
@@ -7,6 +7,7 @@ local ProcessDovetail = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut')
@@ -530,7 +531,7 @@ local function MakeCutsByDice( Proc, b3Raw, vCuts, bHead, vtRef, dFinalExtraTrim
else
dExtraTrim = dMiddleExtraTrim
end
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -( dTrim + dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -( dTrim + dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -702,7 +703,7 @@ local function MakeByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3So
-- calcolo secondo testa o coda
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
-- inserisco la lavorazione
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
-- taglio sulla seconda faccia intermedia
@@ -710,7 +711,7 @@ local function MakeByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3So
-- calcolo secondo testa o coda
local vtRef2 = EgtIf( bHead, X_AX(), -X_AX())
-- inserisco la lavorazione
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
-- se altrimenti non ha fatto una parte dei tagli a cubetti
@@ -720,7 +721,7 @@ local function MakeByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3So
-- inserisco la lavorazione
local nDirVect = BL.GetNearestOrthoOpposite( vtRef)
local bOk, sNameOrErr
bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nDirVect, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nDirVect, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
if #sNameOrErr > 0 then bIntCut = true end
end
@@ -736,7 +737,7 @@ local function MakeByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b3So
end
end
-- inserisco la lavorazione
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end
@@ -996,7 +997,7 @@ local function MachSideFaces( Proc, nPartId, b3Raw, nFacetCnt, bForceUseRough,
end
-- inserisco la lavorazione
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, ( i - 1), sCutting, dSawDiam, nOrthoOpposite, nil, -( dTrim + dExtraZed), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, ( i - 1), sCutting, dSawDiam, nOrthoOpposite, nil, -( dTrim + dExtraZed), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
bPrevByBlade = true
end
+6 -5
View File
@@ -7,6 +7,7 @@ local ProcessFrenchRidgeLap = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
EgtOutLog( ' ProcessFrenchRidgeLap started', 1)
@@ -176,7 +177,7 @@ function ProcessFrenchRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
else
dExtraTrim = dMiddleExtraTrim
end
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -(dTrim+dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -(dTrim+dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -197,7 +198,7 @@ function ProcessFrenchRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se va fatto, inserisco la lavorazione
if bCut then
local vtOrthoO = Vector3d( vtRef)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
end
end
@@ -217,7 +218,7 @@ function ProcessFrenchRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se va fatto, inserisco la lavorazione
if bCut then
local vtOrthoO = Vector3d( vtRef)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
end
end
@@ -226,7 +227,7 @@ function ProcessFrenchRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if vFaceOrd[2] ~= 0 then
-- inserisco la lavorazione
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
if #sNameOrErr > 0 then bIntCut = true end
end
@@ -242,7 +243,7 @@ function ProcessFrenchRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end
-- inserisco la lavorazione
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end
+5 -4
View File
@@ -7,6 +7,7 @@ local ProcessHeadCut = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
EgtOutLog( ' ProcessHeadCut started', 1)
@@ -206,14 +207,14 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
if bDoubleCut then
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_BACK, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
if not bOk then return false, sErr end
end
end
-- eseguo i tagli necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, '', b3Raw)
if not bOk then return false, sErr end
end
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
@@ -256,13 +257,13 @@ function ProcessHeadCut.Make( Proc, nPhase, nRawId, nPartId, dOvmHead, bNeedHCut
-- eseguo i tagli da sotto necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, nil, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, nil, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
if not bOk then return false, sErr end
end
-- eseguo i tagli da sopra necessari
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, '', b3Raw)
if not bOk then return false, sErr end
end
end
+4 -4
View File
@@ -39,11 +39,11 @@ local ProcessLapJoint = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local Cut = require( 'ProcessCut')
local DoubleCut = require( 'ProcessDoubleCut')
local LongCut = require( 'ProcessLongCut')
local Long2Cut = require( 'ProcessLongDoubleCut')
local Fbs = require( 'FacesBySaw')
EgtOutLog( ' ProcessLapJoint started', 1)
@@ -2752,7 +2752,7 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
for i = 1, nStep do
local dOffs = ( i - 1) * dStep
if vtN:getZ() < BD.NZ_MINA then dOffs = dOffs + dSawThick end
local bOk, sErr, nMchId = BL.MakeOneFaceBySaw( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, -0.01, 0, BD.CUT_SIC, dOffs, dStartDist, dEndDist, nil, b3Raw)
local bOk, sErr, nMchId = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, -0.01, 0, BD.CUT_SIC, dOffs, dStartDist, dEndDist, nil, b3Raw)
if not bOk then return bOk, sErr end
-- setto l'elevazione
local sNotes = 'MaxElev=' .. EgtNumToString( 0, 1) .. ';'
@@ -2932,7 +2932,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd,
end
for i = 1, nStep do
local dOffs = ( i - 1) * dStep
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, -0.01, 0, BD.CUT_SIC, dOffs, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, nFacAdj, sCutting, dSawDiam, nFaceUse, -0.01, 0, BD.CUT_SIC, dOffs, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
-- in base all'elevazione calcolo l'impronta della lama
@@ -3222,7 +3222,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
end
end
-- eseguo il taglio
local bMadeASbyBld, sWarn, nIdMach = BL.MakeOneFaceBySaw( Proc.Id, nFacet, sCutting, dSawDiam, vtN, nil, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, nil, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if bMadeASbyBld then
sWarn = nil
if abs(dExtraOffs) > 0 then
+3 -2
View File
@@ -16,6 +16,7 @@ local ProcessLongCut = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
EgtOutLog( ' ProcessLongCut started', 1)
@@ -161,7 +162,7 @@ local function MakeAntiSplintBySaw( Proc, nFacet, vtN, b3Raw, nFacInd, bReduceDe
end
end
-- eseguo il taglio
local bMadeASbyBld, sWarn, nIdMach = BL.MakeOneFaceBySaw( Proc.Id, nFacet, sCutting, dSawDiam, vtN, nil, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bMadeASbyBld, sWarn, nIdMach = Fbs.MakeOne( Proc.Id, nFacet, sCutting, dSawDiam, vtN, nil, ( -0.5 + dExtraOffs), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if bMadeASbyBld then
sWarn = nil
if abs(dExtraOffs) > 0 then
@@ -778,7 +779,7 @@ function ProcessLongCut.Make( Proc, nPhase, nRawId, nPartId, bCustUseBlade, nCus
vtRef:rotate( vtN, EgtIf( bInvert, -90, 90))
local ptP1act = ptP1
local ptP2act = ptP2
_, dLioPerp, _, _ = BL.CalcLeadInOutPerpGeom( ptP1act, ptP2act, vtV1, vtV2, vtN, dToolDiam/2, vtRef, dCutExtra, b3Box)
_, dLioPerp, _, _ = Fbs.CalcLeadInOutPerpGeom( ptP1act, ptP2act, vtV1, vtV2, vtN, dToolDiam/2, vtRef, dCutExtra, b3Box)
]]--
end
-- inserisco le parti di lavorazione
+2 -1
View File
@@ -11,6 +11,7 @@ local ProcessProfCamb = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local Cut = require( 'ProcessCut')
EgtOutLog( ' ProcessProfCamb started', 1)
@@ -332,7 +333,7 @@ function ProcessProfCamb.Make( Proc, nPhase, nRawId, nPartId, dCurrOvmH)
end
local vtOrthoO = Vector3d( vtN)
local dVzLimDwnUp = EgtIf( bMillDown, -2, nil)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, nLastFacet, sCutting, dToolDiam, vtOrthoO, dVzLimDwnUp, -((dMillDiam/2)+1), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, nLastFacet, sCutting, dToolDiam, vtOrthoO, dVzLimDwnUp, -((dMillDiam/2)+1), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
end
end
-- se devo inserire il chamfer
+4 -3
View File
@@ -7,6 +7,7 @@ local ProcessRidgeLap = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local Cut = require( 'ProcessCut')
local DC = require( 'DiceCut')
@@ -170,7 +171,7 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- lavoro la faccia
for j = 1, #vCuts[i] do
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -181,14 +182,14 @@ function ProcessRidgeLap.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if vFaceOrd[2] ~= 0 then
-- inserisco la lavorazione
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtN[vFaceOrd[3]])
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
-- taglio sulla faccia intermedia
if vFaceOrd[3] ~= 0 then
-- inserisco la lavorazione
local nOrthoOpposite = BL.GetNearestOrthoOpposite( EgtIf( bHead, X_AX(), -X_AX()))
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, nOrthoOpposite, dVzLimDwnUp, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end
+10 -9
View File
@@ -8,6 +8,7 @@ local ProcessScarfJoint = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
EgtOutLog( ' ProcessScarfJoint started', 1)
@@ -172,7 +173,7 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
local dExtraCut = EgtIf( i % 2 == 1, 0, BD.CUT_EXTRA)
-- lavoro la faccia
for j = 1, #vCuts[i] do
bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, dExtraCut, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, dExtraCut, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end
@@ -180,14 +181,14 @@ local function ApplyDiceCut( vFaceOrd, nGoodFace1, nGoodFace4, nAddGrpId, b3Soli
if vFaceOrd[1] ~= 0 then
-- inserisco la lavorazione
local vtOrthoO = Vector3d( vtRef)
bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
-- lavoro la faccia opposta (definita dal parametro P11)
if vFaceOrd[3] ~= 0 then
-- inserisco la lavorazione
local vtOrthoO = Vector3d( vtRef)
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end
@@ -351,7 +352,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if vFaceOrd[1] ~= 0 then
-- inserisco la lavorazione
local vtOrthoO = Vector3d( vtRef)
bOkd, sErrD = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOkd then return bOkd, sErrD end
end
-- se non ho intersezione con la faccia tappo posso fare il taglio sul fianco
@@ -360,12 +361,12 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if vFaceOrd[3] ~= 0 then
-- inserisco la lavorazione
local vtOrthoO = Vector3d( vtRef)
bOkd, sErrD = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOkd then return bOkd, sErrD end
end
-- inserisco la lavorazione
local vtRef2 = EgtIf( abs(vtRef:getZ()) < GEO.EPS_SMALL, Z_AX(), EgtIf( bHead, Y_AX(), -Y_AX()))
bOkd, sErrD = BL.MakeOneFaceBySaw( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOkd, sErrD = Fbs.MakeOne( nFace4, nGoodFace4 - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOkd then return bOkd, sErrD end
else -- altrimenti se ho intersezione forzo il DiceCut ad essere eseguito con distanze più piccole
-- definisco la nuova dimensione massima del dice cut
@@ -378,14 +379,14 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if vFaceOrd[1] ~= 0 then
-- inserisco la lavorazione
local vtOrthoO = Vector3d( vtRef)
bOkd, sErrD = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOkd then return bOkd, sErrD end
end
-- lavoro la faccia opposta (definita dal parametro P11)
if vFaceOrd[3] ~= 0 then
-- inserisco la lavorazione
local vtOrthoO = Vector3d( vtRef)
bOkd, sErrD = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
bOkd, sErrD = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOkd then return bOkd, sErrD end
end
end
@@ -412,7 +413,7 @@ function ProcessScarfJoint.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
else
vtOrthoO = Vector3d( vtRef)
end
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[5] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[5] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
end
end
+5 -4
View File
@@ -7,6 +7,7 @@ local ProcessSimpleScarf = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
EgtOutLog( ' ProcessSimpleScarf started', 1)
@@ -213,7 +214,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- se va fatto, inserisco la lavorazione
if bCut then
local vtOrthoO = Vector3d( vtRef)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[1] - 1, sCutting, dSawDiam, vtOrthoO, nil, BD.CUT_EXTRA, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
end
end
@@ -265,7 +266,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
-- lavoro la faccia
for j = 1, #vCuts[i] do
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -277,7 +278,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
if vFaceOrd[2] ~= 0 then
-- inserisco la lavorazione
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
if #sNameOrErr > 0 then bIntCut = true end
end
@@ -293,7 +294,7 @@ function ProcessSimpleScarf.Make( Proc, nPhase, nRawId, nPartId, dOvmHead)
end
end
-- inserisco la lavorazione
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, 0, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end
+5 -4
View File
@@ -7,6 +7,7 @@ local ProcessSplit = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
EgtOutLog( ' ProcessSplit started', 1)
@@ -217,7 +218,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId)
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_FRONT, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
if not bOk then return false, sErr end
end
end
@@ -230,7 +231,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId)
else
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
end
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, nOrthoOpposite, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, dAccEnd, sNotes, b3Raw)
if not bOk then return false, sErr end
end
-- altrimenti necessari tagli da sopra e sotto con testa opportuna
@@ -274,7 +275,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId)
for i = nCuts, 1, -1 do
local dCutOffset = ( i - 1) * dOffsL
local sNotes = EgtIf( bSplit, 'Presplit;', 'Precut;')
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, nil, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting2, dSawDiam2, MCH_MILL_FU.ORTHO_TOP, nil, dCutExtra2, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
if not bOk then return false, sErr end
end
-- eseguo i tagli necessari
@@ -286,7 +287,7 @@ function ProcessSplit.Make( Proc, nPhase, nRawId, nPartId)
else
sNotes = EgtIf( i == 1, 'Cut;', 'Precut;')
end
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, 0, sCutting, dSawDiam, MCH_MILL_FU.ORTHO_DOWN, nil, dCutExtra, BD.CUT_SIC, dCutOffset, dAccStart, 0, sNotes, b3Raw)
if not bOk then return false, sErr end
end
end
+3 -3
View File
@@ -7,9 +7,9 @@ local ProcessStepJoint = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut')
local Fbs = require( 'FacesBySaw')
EgtOutLog( ' ProcessStepJoint started', 1)
@@ -266,7 +266,7 @@ local function MakeTwoFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- lavoro la faccia
for j = 1, #vCuts[i] do
local dLocCutExtra = EgtIf( j == #vCuts[i], dCutExtra - dExtraUp, dCutExtra)
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, nil, dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, nil, dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -421,7 +421,7 @@ local function MakeThreeFaces( Proc, nPhase, nRawId, nPartId, dOvmHead)
-- lavoro la faccia
for j = 1, #vCuts[i] do
local dLocCutExtra = EgtIf( j == #vCuts[i], dCutExtra - dExtraUp, dCutExtra)
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, nil, dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthO, nil, dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
+2 -2
View File
@@ -7,9 +7,9 @@ local ProcessStepJointNotch = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut')
local Fbs = require( 'FacesBySaw')
EgtOutLog( ' ProcessStepJointNotch started', 1)
@@ -120,7 +120,7 @@ local function MachineByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Solid,
-- lavoro la faccia
for j = 1, #vCuts[i] do
local dLocCutExtra = EgtIf( j == #vCuts[i], dCutExtra - dExtraUp, dCutExtra)
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, EgtIf( bDownHead, -2, nil), dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, nOrthoOpposite, EgtIf( bDownHead, -2, nil), dLocCutExtra, BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
+5 -4
View File
@@ -7,6 +7,7 @@ local ProcessTyroleanDovetail = {}
-- Include
require( 'EgtBase')
local BL = require( 'BeamLib')
local Fbs = require( 'FacesBySaw')
local DC = require( 'DiceCut')
local Cut = require( 'ProcessCut')
@@ -300,7 +301,7 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw,
else
dExtraTrim = dMiddleExtraTrim
end
local bOk, sErr = BL.MakeOneFaceBySaw( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -(dTrim+dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( vCuts[i][j], 0, sCutting, dSawDiam, vtOrthoO, nil, -(dTrim+dExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then
return bOk, sErr
end
@@ -339,7 +340,7 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw,
if vFaceOrd[2] ~= 0 then
-- inserisco la lavorazione
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, vFaceOrd[2] - 1, sCutting, dSawDiam, nOrthoOpposite, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
if #sNameOrErr > 0 then bIntCut = true end
end
@@ -355,7 +356,7 @@ local function MakeMachByBlade( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw,
end
end
-- inserisco la lavorazione
local bOk, sErr = BL.MakeOneFaceBySaw( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sErr = Fbs.MakeOne( Proc.Id, vFaceOrd[3] - 1, sCutting, dSawDiam, vtRef2, nil, -(dTrim + dFinalExtraTrim), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sErr end
end
end
@@ -566,7 +567,7 @@ local function MakeMachByMill( Proc, nPhase, nRawId, nPartId, dOvmHead, b3Raw, b
end
-- inserisco la lavorazione
local nOrthoOpposite = BL.GetNearestOrthoOpposite( vtRef)
local bOk, sNameOrErr = BL.MakeOneFaceBySaw( Proc.Id, (i-1), sCutting, dSawDiam, nOrthoOpposite, nil, -(dTrim + 1), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
local bOk, sNameOrErr = Fbs.MakeOne( Proc.Id, (i-1), sCutting, dSawDiam, nOrthoOpposite, nil, -(dTrim + 1), BD.CUT_SIC, 0, 0, 0, nil, b3Raw)
if not bOk then return bOk, sNameOrErr end
end
end