DataBeam :
- correzioni e migliorie.
This commit is contained in:
+43
-16
@@ -1,4 +1,4 @@
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/07/01
|
||||
-- ProcessLapJoint.lua by Egaltech s.r.l. 2019/07/08
|
||||
-- Gestione calcolo mezzo-legno per Travi
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
@@ -9,6 +9,8 @@ require( 'EgtBase')
|
||||
local BL = require( 'BeamLib')
|
||||
local Cut = require( 'ProcessCut')
|
||||
local DoubleCut = require( 'ProcessDoubleCut')
|
||||
local LongCut = require( 'ProcessLongCut')
|
||||
local Long2Cut = require( 'ProcessLongDoubleCut')
|
||||
local Fbs = require( 'FacesBySaw')
|
||||
|
||||
EgtOutLog( ' ProcessLapJoint started', 1)
|
||||
@@ -35,6 +37,10 @@ function ProcessLapJoint.IsHeadFeature( Proc, b3Raw, dCurrOvmH)
|
||||
if Proc.Box:getMax():getX() < b3Raw:getMax():getX() - dCurrOvmH - BD.MAX_DIST_HTFEA then
|
||||
return false
|
||||
end
|
||||
-- la sua lunghezza non deve superare la metà della lunghezza della trave
|
||||
if Proc.Box:getDimX() > 0.5 * b3Raw:getDimX() then
|
||||
return false
|
||||
end
|
||||
-- se una o due facce ora è sicuramente di testa
|
||||
if Proc.Fct <= 2 then
|
||||
return true
|
||||
@@ -62,6 +68,10 @@ function ProcessLapJoint.IsTailFeature( Proc, b3Raw)
|
||||
if Proc.Box:getMin():getX() > b3Raw:getMin():getX() + BD.MAX_DIST_HTFEA then
|
||||
return false
|
||||
end
|
||||
-- la sua lunghezza non deve superare la metà della lunghezza della trave
|
||||
if Proc.Box:getDimX() > 0.5 * b3Raw:getDimX() then
|
||||
return false
|
||||
end
|
||||
-- se una o due facce ora è sicuramente di coda
|
||||
if Proc.Fct <= 2 then
|
||||
return true
|
||||
@@ -100,7 +110,10 @@ function ProcessLapJoint.Classify( Proc)
|
||||
ptC[1], vtN[1] = EgtSurfTmFacetCenter( Proc.Id, 0, GDB_ID.ROOT)
|
||||
ptC[2], vtN[2] = EgtSurfTmFacetCenter( Proc.Id, 1, GDB_ID.ROOT)
|
||||
-- verifico se è lavorabile solo dal basso
|
||||
local bDown = ( vtN[1]:getZ() < BD.NZ_MINB and vtN[2]:getZ() < BD.NZ_MINB)
|
||||
local bSmall = ( Proc.Box:getDimX() < BD.MAX_LEN_RIDGELAP_FROM_BOTTOM)
|
||||
local bDown = ( vtN[1]:getZ() < BD.NZ_MINB and vtN[2]:getZ() < BD.NZ_MINB) or
|
||||
( vtN[1]:getZ() < BD.NZ_MINA and ( abs( vtN[2]:getZ()) > 0.1 or not bSmall)) or
|
||||
( vtN[2]:getZ() < BD.NZ_MINA and ( abs( vtN[1]:getZ()) > 0.1 or not bSmall))
|
||||
return true, bDown
|
||||
-- se più di 2 facce
|
||||
else
|
||||
@@ -232,7 +245,9 @@ local function MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
|
||||
-- aggiungo geometria
|
||||
EgtSetMachiningGeometry( {{ Proc.Id, nFacInd}})
|
||||
-- imposto uso faccia e lato correzione
|
||||
if vtN[nOthInd]:getX() > 0 then
|
||||
if vtN[nOthInd]:getZ() < -0.1 then
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_TOP)
|
||||
elseif vtN[nOthInd]:getX() > 0 then
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_LEFT)
|
||||
else
|
||||
EgtSetMachiningParam( MCH_MP.FACEUSE, MCH_MILL_FU.ORTHO_RIGHT)
|
||||
@@ -533,26 +548,38 @@ function ProcessLapJoint.Make( Proc, nPhase, nRawId, nPartId)
|
||||
-- limiti di fresatura semplice
|
||||
local MAX_MILL_XZ = 80
|
||||
local MAX_MILL_VOL = ( 80 * 240 * 20) / 2
|
||||
-- recupero l'ingombro del grezzo di appartenenza
|
||||
local b3Raw = EgtGetRawPartBBox( nRawId)
|
||||
-- una faccia
|
||||
if Proc.Fct == 1 then
|
||||
-- se piccola, con fresa
|
||||
if ( Proc.Box:getDimX() < MAX_MILL_XZ and Proc.Box:getDimZ() < MAX_MILL_XZ) or Proc.Box:getDimX() * Proc.Box:getDimY() * Proc.Box:getDimZ() < MAX_MILL_VOL then
|
||||
return MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
||||
-- altrimenti, con lama
|
||||
-- se lunghezza richiede spezzatura
|
||||
if Proc.Box:getDimX() > min( BD.LONGCUT_MAXLEN, 0.5 * b3Raw:getDimX()) then
|
||||
return LongCut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
else
|
||||
return Cut.Make( Proc, nPhase, nRawId, nPartId, 0)
|
||||
-- se piccola, con fresa
|
||||
if ( Proc.Box:getDimX() < MAX_MILL_XZ and Proc.Box:getDimZ() < MAX_MILL_XZ) or Proc.Box:getDimX() * Proc.Box:getDimY() * Proc.Box:getDimZ() < MAX_MILL_VOL then
|
||||
return MakeOneFaceByMill( Proc, nPhase, nRawId, nPartId)
|
||||
-- altrimenti, con lama
|
||||
else
|
||||
return Cut.Make( Proc, nPhase, nRawId, nPartId, 0)
|
||||
end
|
||||
end
|
||||
-- due facce
|
||||
elseif Proc.Fct == 2 then
|
||||
-- determino l'angolo tra le facce
|
||||
local _, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
|
||||
-- se ortogonali e piccole, con fresa
|
||||
if abs( dAng + 90) < 1 and
|
||||
(( Proc.Box:getDimX() < MAX_MILL_XZ and Proc.Box:getDimZ() < MAX_MILL_XZ) or Proc.Box:getDimX() * Proc.Box:getDimY() * Proc.Box:getDimZ() < MAX_MILL_VOL) then
|
||||
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
|
||||
-- altrimenti, con lama
|
||||
-- se lunghezza richiede spezzatura
|
||||
if Proc.Box:getDimX() > min( BD.LONGCUT_MAXLEN, 0.5 * b3Raw:getDimX()) then
|
||||
return Long2Cut.Make( Proc, nPhase, nRawId, nPartId)
|
||||
else
|
||||
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, 'HeadSide')
|
||||
-- determino l'angolo tra le facce
|
||||
local _, _, _, dAng = EgtSurfTmFacetsContact( Proc.Id, 0, 1, GDB_ID.ROOT)
|
||||
-- se ortogonali e piccole, con fresa
|
||||
if abs( dAng + 90) < 1 and
|
||||
(( Proc.Box:getDimX() < MAX_MILL_XZ and Proc.Box:getDimZ() < MAX_MILL_XZ) or Proc.Box:getDimX() * Proc.Box:getDimY() * Proc.Box:getDimZ() < MAX_MILL_VOL) then
|
||||
return MakeTwoFacesByMill( Proc, nPhase, nRawId, nPartId)
|
||||
-- altrimenti, con lama
|
||||
else
|
||||
return Fbs.MakeTwo( Proc, nPhase, nRawId, nPartId, 'HeadSide')
|
||||
end
|
||||
end
|
||||
-- tre o più facce
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user