From 1286cfd77f96fbde4835cc5ac4531ad7d47eb58a Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 27 Jun 2022 10:36:49 +0200 Subject: [PATCH 01/12] DataBeam: -bugfix: nella feature L30 con Q03=2 e parete di fondo funziona correttamente la pulitura contorno (Q01=1) --- LuaLibs/ProcessLapJoint.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 332f902..4f1aee6 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -5147,6 +5147,31 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) end bTryWithBlades = false + -- se ho antischeggia con fresa le inserisco + -- if nChamfer < 2 and nQAntisplintResult == 2 and ( bIsU or bIsL) then + if nChamfer < 2 and nQAntisplintResult == 2 then + local bOk, sWarn2 = ManageAntiSplintByMill( Proc, nPhase, nRawId, nPartId, b3Raw, + nFacInd, nAddGrpId, bMillDown, dDiamTool, bDoubleSide, + vtOrtho, nPathInt, nSurfInt, b3Solid, dDepth, + bOneShot, nFirstMachId) + if sWarn2 then + if not sWarn then sWarn = '' end + sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) + end + end + -- se abilitato dal parametro Q inserisco pulitura spigoli o contorno con fresa più piccola + local nContourSmallTool = EgtGetInfo( Proc.Id, Q_CONTOUR_SMALL_TOOL, 'i') or 0 + if nContourSmallTool > 0 then + local bOk, sWarn2 = MakeRoundCleanCornerOrContour( Proc, nPhase, nRawId, nPartId, b3Raw, + nFacInd, nAddGrpId, dDiamTool, nContourSmallTool, bMillDown, + bDoubleSide, vtOrtho, nPathInt, nSurfInt, b3Solid, + dDepth, bOneShotm) + if not bOk then return false, sWarn2 end + if sWarn2 then + if not sWarn then sWarn = '' end + sWarn = EgtIf( #sWarn > 0, sWarn .. '\n' .. sWarn2, sWarn2) + end + end -- in tutti gli altri casi lancio la MakeByPockets (lavorazione singola o doppia contrapposta, fondo della tasca una faccia fittizia perpendicolare al lato lungo) else -- se 2 facce setto i parametri corretti per la MakeByPockets From 80d37ef897d4b74caf97575a9f4c55d469472717 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Mon, 27 Jun 2022 17:48:11 +0200 Subject: [PATCH 02/12] DataBeam: -bugfix: piccola correzione a LapJoint --- LuaLibs/ProcessLapJoint.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 4f1aee6..f4ba2c6 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -5138,7 +5138,8 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa dFacElev = BL.GetFaceElevation( Proc.Id, nFacInd) dCollSic = CalcCollisionSafety( tvtNx[2]) local dMachDepth = dFacElev + dCollSic - local _, _, dDimMin = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) + _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) + local dDimMin = min( dH, dV) local _, sPocketing = VerifyPocket( Proc, dDimMin, dFacElev, nil, sMyMchFind) bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap) if not bOk then return false, sWarn2 end From a5cf7e0783849b3e1185710e469c8bd49b8e5d45 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 29 Jun 2022 17:45:55 +0200 Subject: [PATCH 03/12] DataBeam: --- LuaLibs/ProcessLapJoint.lua | 50 +++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index f4ba2c6..a35dbc2 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -46,6 +46,7 @@ -- 2022/06/15 Correzione calcolo normale alla faccia per sega catena di fianco. -- 2022/06/16 Implemento lavorazioni con fresatura di lato per L30 (al momento solo passanti) se parametro Q03=2. Modificate funzioni Make, MakeMoreFaces, Classify. -- 2022/06/21 Implemento di lavorazioni non passanti con fresatura di lato per L30 se parametro Q03=2. Modificate funzioni MakeMoreFaces, Classify. +-- 2022/06/29 Migliorate lavorazioni con fresatura di lato per L30 se parametro Q03=2. Ora con 4 facce / 3 facce a L può entrare una fresa grande fino al doppio dell'altezza della tasca / doppio della dimensione minima. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -4345,6 +4346,9 @@ end --------------------------------------------------------------------- local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePart, bPrevBhSideMill, bAllWithEndCap) + if not BD.MAXDIAM_POCK_CORNER then + BD.MAXDIAM_POCK_CORNER = 30 + end local sWarn -- recupero l'ingombro del grezzo di appartenenza local b3Raw = EgtGetRawPartBBox( nRawId) @@ -4835,11 +4839,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa elseif Proc.Fct == 4 then -- se non angoli fittizi, per rifinire gli angoli premio utensile diam 25 o da BD if not bAllWithEndCap then - dDiam = min( dDiam, BD.MAXDIAM_POCK_CORNER or 30) + dDiam = min( dDiam, BD.MAXDIAM_POCK_CORNER) end elseif Proc.Fct == 3 and bIsL then -- per rifinire gli angoli premio utensile diam 25 o da BD - dDiam = min( 2 * dDiam, BD.MAXDIAM_POCK_CORNER or 30) + dDiam = min( ( 2 * dDiam) - 1, BD.MAXDIAM_POCK_CORNER) else dDiam = 2 * dDiam end @@ -5138,9 +5142,45 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa dFacElev = BL.GetFaceElevation( Proc.Id, nFacInd) dCollSic = CalcCollisionSafety( tvtNx[2]) local dMachDepth = dFacElev + dCollSic - _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) - local dDimMin = min( dH, dV) - local _, sPocketing = VerifyPocket( Proc, dDimMin, dFacElev, nil, sMyMchFind) + local frFacRec, dFacDim1, dFacDim2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) + -- limito il diametro utensile massimo a 100 per queste lavorazioni + dToolTargetDiam = min( BD.MAXDIAM_POCK_CORNER, 100) + -- se è 4 facce devo capire quale è il lato libero e settare dH e dV di conseguenza + if Proc.Fct == 4 then + local vAdj = {} + local vtN2 + for i = 1, Proc.Fct do + -- recupero le adiacenze del loop esterno + local vFacAdj = EgtSurfTmFacetAdjacencies( Proc.Id, i - 1)[1] + -- le conto + local nCount = 0 + for j = 1, #vFacAdj do + if vFacAdj[j] >= 0 then + nCount = nCount + 1 + end + end + vAdj[i] = nCount + if vAdj[i] == Proc.Fct - 1 and i ~= nFacInd + 1 then + dV = BL.GetFaceElevation( Proc.Id, i - 1) + vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT) + end + end + local vtRes = vtN2 ^ vtN + if AreSameOrOppositeVectorApprox( frFacRec:getVersX(), vtRes) then + dH = dFacDim1 + else + dH = dFacDim2 + end + -- se la tasca ha dimensioni adeguate cerco di usare una fresa con raggio fino a metà altezza + dToolMaxDiam = EgtIf( dH >= dToolTargetDiam and dV > 0.5 * dToolTargetDiam, dToolTargetDiam, min( dH, dV, dToolTargetDiam)) + -- per le L a 3 facce, avendo due lati aperti per l'attacco, si considera un diametro utensile pari al doppio della dimensione minima; il "- 1" è un accorgimento per impedire bug derivanti da dimensione della tasca uguale a D\2 utensile + elseif Proc.Fct == 3 and bIsL then + dToolMaxDiam = min ( ( min( dFacDim1, dFacDim2) * 2) - 1, dToolTargetDiam) + -- in tutti gli altri casi l'utensile dovrà essere grande al massimo come il lato più piccolo + else + dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam) + end + local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind) bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap) if not bOk then return false, sWarn2 end if sWarn2 then From 59051cbf06c5cd5c49fac57cecd6dab15b7e0877 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 29 Jun 2022 17:46:05 +0200 Subject: [PATCH 04/12] Revert "DataBeam:" This reverts commit a5cf7e0783849b3e1185710e469c8bd49b8e5d45. --- LuaLibs/ProcessLapJoint.lua | 50 ++++--------------------------------- 1 file changed, 5 insertions(+), 45 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index a35dbc2..f4ba2c6 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -46,7 +46,6 @@ -- 2022/06/15 Correzione calcolo normale alla faccia per sega catena di fianco. -- 2022/06/16 Implemento lavorazioni con fresatura di lato per L30 (al momento solo passanti) se parametro Q03=2. Modificate funzioni Make, MakeMoreFaces, Classify. -- 2022/06/21 Implemento di lavorazioni non passanti con fresatura di lato per L30 se parametro Q03=2. Modificate funzioni MakeMoreFaces, Classify. --- 2022/06/29 Migliorate lavorazioni con fresatura di lato per L30 se parametro Q03=2. Ora con 4 facce / 3 facce a L può entrare una fresa grande fino al doppio dell'altezza della tasca / doppio della dimensione minima. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -4346,9 +4345,6 @@ end --------------------------------------------------------------------- local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePart, bPrevBhSideMill, bAllWithEndCap) - if not BD.MAXDIAM_POCK_CORNER then - BD.MAXDIAM_POCK_CORNER = 30 - end local sWarn -- recupero l'ingombro del grezzo di appartenenza local b3Raw = EgtGetRawPartBBox( nRawId) @@ -4839,11 +4835,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa elseif Proc.Fct == 4 then -- se non angoli fittizi, per rifinire gli angoli premio utensile diam 25 o da BD if not bAllWithEndCap then - dDiam = min( dDiam, BD.MAXDIAM_POCK_CORNER) + dDiam = min( dDiam, BD.MAXDIAM_POCK_CORNER or 30) end elseif Proc.Fct == 3 and bIsL then -- per rifinire gli angoli premio utensile diam 25 o da BD - dDiam = min( ( 2 * dDiam) - 1, BD.MAXDIAM_POCK_CORNER) + dDiam = min( 2 * dDiam, BD.MAXDIAM_POCK_CORNER or 30) else dDiam = 2 * dDiam end @@ -5142,45 +5138,9 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa dFacElev = BL.GetFaceElevation( Proc.Id, nFacInd) dCollSic = CalcCollisionSafety( tvtNx[2]) local dMachDepth = dFacElev + dCollSic - local frFacRec, dFacDim1, dFacDim2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) - -- limito il diametro utensile massimo a 100 per queste lavorazioni - dToolTargetDiam = min( BD.MAXDIAM_POCK_CORNER, 100) - -- se è 4 facce devo capire quale è il lato libero e settare dH e dV di conseguenza - if Proc.Fct == 4 then - local vAdj = {} - local vtN2 - for i = 1, Proc.Fct do - -- recupero le adiacenze del loop esterno - local vFacAdj = EgtSurfTmFacetAdjacencies( Proc.Id, i - 1)[1] - -- le conto - local nCount = 0 - for j = 1, #vFacAdj do - if vFacAdj[j] >= 0 then - nCount = nCount + 1 - end - end - vAdj[i] = nCount - if vAdj[i] == Proc.Fct - 1 and i ~= nFacInd + 1 then - dV = BL.GetFaceElevation( Proc.Id, i - 1) - vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT) - end - end - local vtRes = vtN2 ^ vtN - if AreSameOrOppositeVectorApprox( frFacRec:getVersX(), vtRes) then - dH = dFacDim1 - else - dH = dFacDim2 - end - -- se la tasca ha dimensioni adeguate cerco di usare una fresa con raggio fino a metà altezza - dToolMaxDiam = EgtIf( dH >= dToolTargetDiam and dV > 0.5 * dToolTargetDiam, dToolTargetDiam, min( dH, dV, dToolTargetDiam)) - -- per le L a 3 facce, avendo due lati aperti per l'attacco, si considera un diametro utensile pari al doppio della dimensione minima; il "- 1" è un accorgimento per impedire bug derivanti da dimensione della tasca uguale a D\2 utensile - elseif Proc.Fct == 3 and bIsL then - dToolMaxDiam = min ( ( min( dFacDim1, dFacDim2) * 2) - 1, dToolTargetDiam) - -- in tutti gli altri casi l'utensile dovrà essere grande al massimo come il lato più piccolo - else - dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam) - end - local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind) + _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) + local dDimMin = min( dH, dV) + local _, sPocketing = VerifyPocket( Proc, dDimMin, dFacElev, nil, sMyMchFind) bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap) if not bOk then return false, sWarn2 end if sWarn2 then From ec5583366e86b82e0a4ece839f553263bcb5b293 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 29 Jun 2022 17:49:45 +0200 Subject: [PATCH 05/12] Revert "Revert "DataBeam:"" This reverts commit 59051cbf06c5cd5c49fac57cecd6dab15b7e0877. --- LuaLibs/ProcessLapJoint.lua | 50 +++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index f4ba2c6..a35dbc2 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -46,6 +46,7 @@ -- 2022/06/15 Correzione calcolo normale alla faccia per sega catena di fianco. -- 2022/06/16 Implemento lavorazioni con fresatura di lato per L30 (al momento solo passanti) se parametro Q03=2. Modificate funzioni Make, MakeMoreFaces, Classify. -- 2022/06/21 Implemento di lavorazioni non passanti con fresatura di lato per L30 se parametro Q03=2. Modificate funzioni MakeMoreFaces, Classify. +-- 2022/06/29 Migliorate lavorazioni con fresatura di lato per L30 se parametro Q03=2. Ora con 4 facce / 3 facce a L può entrare una fresa grande fino al doppio dell'altezza della tasca / doppio della dimensione minima. -- Tabella per definizione modulo local ProcessLapJoint = {} @@ -4345,6 +4346,9 @@ end --------------------------------------------------------------------- local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePart, bPrevBhSideMill, bAllWithEndCap) + if not BD.MAXDIAM_POCK_CORNER then + BD.MAXDIAM_POCK_CORNER = 30 + end local sWarn -- recupero l'ingombro del grezzo di appartenenza local b3Raw = EgtGetRawPartBBox( nRawId) @@ -4835,11 +4839,11 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa elseif Proc.Fct == 4 then -- se non angoli fittizi, per rifinire gli angoli premio utensile diam 25 o da BD if not bAllWithEndCap then - dDiam = min( dDiam, BD.MAXDIAM_POCK_CORNER or 30) + dDiam = min( dDiam, BD.MAXDIAM_POCK_CORNER) end elseif Proc.Fct == 3 and bIsL then -- per rifinire gli angoli premio utensile diam 25 o da BD - dDiam = min( 2 * dDiam, BD.MAXDIAM_POCK_CORNER or 30) + dDiam = min( ( 2 * dDiam) - 1, BD.MAXDIAM_POCK_CORNER) else dDiam = 2 * dDiam end @@ -5138,9 +5142,45 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa dFacElev = BL.GetFaceElevation( Proc.Id, nFacInd) dCollSic = CalcCollisionSafety( tvtNx[2]) local dMachDepth = dFacElev + dCollSic - _, dH, dV = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) - local dDimMin = min( dH, dV) - local _, sPocketing = VerifyPocket( Proc, dDimMin, dFacElev, nil, sMyMchFind) + local frFacRec, dFacDim1, dFacDim2 = EgtSurfTmFacetMinAreaRectangle( Proc.Id, nFacInd, GDB_ID.ROOT) + -- limito il diametro utensile massimo a 100 per queste lavorazioni + dToolTargetDiam = min( BD.MAXDIAM_POCK_CORNER, 100) + -- se è 4 facce devo capire quale è il lato libero e settare dH e dV di conseguenza + if Proc.Fct == 4 then + local vAdj = {} + local vtN2 + for i = 1, Proc.Fct do + -- recupero le adiacenze del loop esterno + local vFacAdj = EgtSurfTmFacetAdjacencies( Proc.Id, i - 1)[1] + -- le conto + local nCount = 0 + for j = 1, #vFacAdj do + if vFacAdj[j] >= 0 then + nCount = nCount + 1 + end + end + vAdj[i] = nCount + if vAdj[i] == Proc.Fct - 1 and i ~= nFacInd + 1 then + dV = BL.GetFaceElevation( Proc.Id, i - 1) + vtN2 = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT) + end + end + local vtRes = vtN2 ^ vtN + if AreSameOrOppositeVectorApprox( frFacRec:getVersX(), vtRes) then + dH = dFacDim1 + else + dH = dFacDim2 + end + -- se la tasca ha dimensioni adeguate cerco di usare una fresa con raggio fino a metà altezza + dToolMaxDiam = EgtIf( dH >= dToolTargetDiam and dV > 0.5 * dToolTargetDiam, dToolTargetDiam, min( dH, dV, dToolTargetDiam)) + -- per le L a 3 facce, avendo due lati aperti per l'attacco, si considera un diametro utensile pari al doppio della dimensione minima; il "- 1" è un accorgimento per impedire bug derivanti da dimensione della tasca uguale a D\2 utensile + elseif Proc.Fct == 3 and bIsL then + dToolMaxDiam = min ( ( min( dFacDim1, dFacDim2) * 2) - 1, dToolTargetDiam) + -- in tutti gli altri casi l'utensile dovrà essere grande al massimo come il lato più piccolo + else + dToolMaxDiam = min ( dFacDim1, dFacDim2, dToolTargetDiam) + end + local _, sPocketing = VerifyPocket( Proc, dToolMaxDiam, dFacElev, nil, sMyMchFind) bOk, sWarn2, sTuuidPk, dDiamTool = MakePocket( Proc, nPartId, ptPs, tvtNx, nFacInd, sMyMchFind, nUseRoughTool, sPocketing, dMachDepth, nil, nil, bAllWithEndCap) if not bOk then return false, sWarn2 end if sWarn2 then From 661c398fb84c6ac668e3470552ba8a70c7137246 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 29 Jun 2022 18:19:00 +0200 Subject: [PATCH 06/12] DataBeam: - correzione ordine funzioni in BeamExec --- LuaLibs/BeamExec.lua | 372 +++++++++++++++++++++---------------------- 1 file changed, 186 insertions(+), 186 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index f514d09..85a8ac7 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -129,6 +129,192 @@ EgtMdbSave() ------------------------------------------------------------------------------------------------------------- -- *** Inserimento delle travi nel grezzo *** +------------------------------------------------------------------------------------------------------------- +local function IsHeadFeature( Proc, b3Raw, dCurrOvmH) + -- feature sempre di testa o coda per il gruppo + if Proc.Grp == 1 or Proc.Grp == 2 then + return ( Proc.Box:getCenter():getX() > b3Raw:getCenter():getX() - 0.5 * dCurrOvmH) + end + -- feature sempre di testa o coda nonostante il gruppo + if ( Proc.Grp == 3 or Proc.Grp == 4) and + ( Proc.Prc == 38 or Proc.Prc == 51 or Proc.Prc == 56 or Proc.Prc == 100 or Proc.Prc == 101 or Proc.Prc == 102 or Proc.Prc == 103 or Proc.Prc == 106) then + return ( Proc.Box:getCenter():getX() > b3Raw:getCenter():getX() - 0.5 * dCurrOvmH) + end + -- gestioni speciali + if LapJoint.Identify( Proc) then + return LapJoint.IsHeadFeature( Proc, b3Raw, dCurrOvmH) + end + if Drill.Identify( Proc) then + return Drill.IsHeadFeature( Proc, b3Raw, dCurrOvmH) + end + if RoundArch.Identify( Proc) then + return RoundArch.IsHeadFeature( Proc, b3Raw, dCurrOvmH) + end + if Dovetail.Identify( Proc) then + return Dovetail.IsHeadFeature( Proc, b3Raw, dCurrOvmH) + end + if FreeContour.Identify( Proc) then + return FreeContour.IsHeadFeature( Proc, b3Raw, dCurrOvmH) + end + -- non è di testa + return false +end + +------------------------------------------------------------------------------------------------------------- +local function IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT) + -- lunghezza di riferimento per spostare le feature di coda appena prima + local dAdvTailLen = BD.LEN_VERY_SHORT_PART or BD.LEN_SHORT_PART + -- feature sempre di testa o coda per il gruppo (se non troppo lunga) + if Proc.Grp == 1 or Proc.Grp == 2 then + -- se abilitato avanzamento lavorazione feature di coda e pezzo corto (quindi a caduta) e feature in coda + if BD.ADVANCE_TAIL_CUT and b3Raw:getDimX() < dAdvTailLen and Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH then + -- se taglio, lo avanzo + if Proc.Prc == 10 then + return false, true + end + end + -- standard + return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH and Proc.Box:getDimX() < BD.MAX_LEN_HTFEA) + end + -- feature sempre di testa o coda nonostante il gruppo + if ( Proc.Grp == 3 or Proc.Grp == 4) and + ( Proc.Prc == 38 or Proc.Prc == 51 or Proc.Prc == 56 or Proc.Prc == 100 or Proc.Prc == 101 or Proc.Prc == 102 or Proc.Prc == 103 or Proc.Prc == 106) then + -- se abilitato avanzamento lavorazione feature di coda e pezzo corto (quindi a caduta) e feature in coda + if BD.ADVANCE_TAIL_CUT and b3Raw:getDimX() < dAdvTailLen and Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH then + -- se profilo front solo con smusso, lo avanzo + if Proc.Prc == 100 and ProfFront.OnlyChamfer( Proc) then + return false, true + end + -- se profilo concavo solo con smusso, lo avanzo + if Proc.Prc == 101 and ProfConcave.OnlyChamfer( Proc) then + return false, true + end + -- se profilo convesso solo con smusso, lo avanzo + if Proc.Prc == 102 and ProfConvex.OnlyChamfer( Proc) then + return false, true + end + -- se profilo caudato solo con smusso, lo avanzo + if Proc.Prc == 103 and ProfCamb.OnlyChamfer( Proc) then + return false, true + end + -- se profilo head solo con smusso, lo avanzo + if Proc.Prc == 106 and ProfHead.OnlyChamfer( Proc) then + return false, true + end + end + -- standard + return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH) + end + -- gestioni speciali + if LapJoint.Identify( Proc) then + return LapJoint.IsTailFeature( Proc, b3Raw) + end + if Drill.Identify( Proc) then + return Drill.IsTailFeature( Proc, b3Raw, dCurrOvmT) + end + if DtMortise.Identify( Proc) then + return DtMortise.IsTailFeature( Proc, b3Raw) + end + if RoundArch.Identify( Proc) then + return RoundArch.IsTailFeature( Proc, b3Raw) + end + if Dovetail.Identify( Proc) then + return Dovetail.IsTailFeature( Proc, b3Raw) + end + if FreeContour.Identify( Proc) then + return FreeContour.IsTailFeature( Proc, b3Raw) + end + -- non è di coda + return false +end + +------------------------------------------------------------------------------------------------------------- +local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT) + -- recupero le feature + local vProc = {} + local LayerId = {} + LayerId[1] = BL.GetAddGroup( PartId) + LayerId[2] = EgtGetFirstNameInGroup( PartId or GDB_ID.NULL, 'Processings') + for nInd = 1, 2 do + local ProcId = EgtGetFirstInGroup( LayerId[nInd] or GDB_ID.NULL) + while ProcId do + local nEntType = EgtGetType( ProcId) + if nEntType == GDB_TY.SRF_MESH or nEntType == GDB_TY.EXT_TEXT or + nEntType == GDB_TY.CRV_LINE or nEntType == GDB_TY.CRV_ARC or nEntType == GDB_TY.CRV_BEZ or nEntType == GDB_TY.CRV_COMPO then + local nGrp = EgtGetInfo( ProcId, 'GRP', 'i') + local nPrc = EgtGetInfo( ProcId, 'PRC', 'i') + local nDo = EgtGetInfo( ProcId, 'DO', 'i') or 1 + local nCutId = EgtGetInfo( EgtGetParent( EgtGetParent( ProcId)), 'CUTID', 'i') or 0 + local nTaskId = EgtGetInfo( ProcId, 'TASKID', 'i') or 0 + if nGrp and nPrc and nDo == 1 then + local Proc = {} + Proc.Id = ProcId + Proc.Grp = nGrp + Proc.Prc = nPrc + Proc.Flg = 1 + Proc.Fct = EgtSurfTmFacetCount( ProcId) or 0 + Proc.Diam = 0 + Proc.Fcs = 0 + Proc.Fce = 0 + Proc.CutId = nCutId + Proc.TaskId = nTaskId + Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD) + if Proc.Box and not Proc.Box:isEmpty() then + Proc.Head = IsHeadFeature( Proc, b3Raw, dCurrOvmH) + Proc.Tail, Proc.AdvTail = IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT) + table.insert( vProc, Proc) + -- se foro + if Drill.Identify( Proc) then + -- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento) + Proc.Diam, Proc.Fcs, Proc.Fce = Drill.GetData( Proc, b3Raw) + -- verifico se necessaria seconda lavorazione da parte opposta per foro più lungo della punta + if Drill.Split( Proc, b3Raw) then + -- aggiorno flags prima parte foro (dati tabelle sempre per riferimento) + Proc.Flg = 2 + Proc.Head = Drill.IsHeadFeature( Proc, b3Raw, dCurrOvmH) + Proc.Tail = Drill.IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT) + -- definisco dati seconda parte + local Proc2 = {} + Proc2.Id = ProcId + Proc2.Grp = nGrp + Proc2.Prc = nPrc + Proc2.Flg = -2 + Proc2.Box = BBox3d( Proc.Box) + Proc2.Fct = Proc.Fct + Proc2.Diam = Proc.Diam + Proc2.Head = Drill.IsHeadFeature( Proc2, b3Raw, dCurrOvmH) + Proc2.Tail = Drill.IsTailFeature( Proc2, b3Raw, dCurrOvmH) + Proc2.Fcs = Proc.Fce + Proc2.Fce = Proc.Fcs + Proc2.CutId = Proc.CutId + Proc2.TaskId = Proc.TaskId + table.insert( vProc, Proc2) + end + -- se BlockHaus HalfLap + elseif Proc.Prc == 37 then + local nFacInd = BL.GetFaceWithMostAdj( Proc.Id, PartId) + if nFacInd then + local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) + if vtN then + Proc.vtN = Vector3d( vtN) + end + end + end + else + Proc.Head = false + Proc.Tail = false + Proc.Flg = 0 + table.insert( vProc, Proc) + EgtOutLog( ' Feature ' .. tostring( Proc.Id) .. ' is empty (no geometry)') + end + end + end + ProcId = EgtGetNext( ProcId) + end + end + return vProc +end + ------------------------------------------------------------------------------------------------------------- local function AnalyzeHeadFeatures( b3Solid, vProc, dRawW, dRawH) local nReplacedFeatureId = nil @@ -376,105 +562,6 @@ local function Verify90DegRotation( nRawId) ( dRawH < BD.MAX_WIDTH2 + 10 * GEO.EPS_SMALL and dRawW < BD.MAX_HEIGHT2 + 10 * GEO.EPS_SMALL) end -------------------------------------------------------------------------------------------------------------- -local function IsHeadFeature( Proc, b3Raw, dCurrOvmH) - -- feature sempre di testa o coda per il gruppo - if Proc.Grp == 1 or Proc.Grp == 2 then - return ( Proc.Box:getCenter():getX() > b3Raw:getCenter():getX() - 0.5 * dCurrOvmH) - end - -- feature sempre di testa o coda nonostante il gruppo - if ( Proc.Grp == 3 or Proc.Grp == 4) and - ( Proc.Prc == 38 or Proc.Prc == 51 or Proc.Prc == 56 or Proc.Prc == 100 or Proc.Prc == 101 or Proc.Prc == 102 or Proc.Prc == 103 or Proc.Prc == 106) then - return ( Proc.Box:getCenter():getX() > b3Raw:getCenter():getX() - 0.5 * dCurrOvmH) - end - -- gestioni speciali - if LapJoint.Identify( Proc) then - return LapJoint.IsHeadFeature( Proc, b3Raw, dCurrOvmH) - end - if Drill.Identify( Proc) then - return Drill.IsHeadFeature( Proc, b3Raw, dCurrOvmH) - end - if RoundArch.Identify( Proc) then - return RoundArch.IsHeadFeature( Proc, b3Raw, dCurrOvmH) - end - if Dovetail.Identify( Proc) then - return Dovetail.IsHeadFeature( Proc, b3Raw, dCurrOvmH) - end - if FreeContour.Identify( Proc) then - return FreeContour.IsHeadFeature( Proc, b3Raw, dCurrOvmH) - end - -- non è di testa - return false -end - -------------------------------------------------------------------------------------------------------------- -local function IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT) - -- lunghezza di riferimento per spostare le feature di coda appena prima - local dAdvTailLen = BD.LEN_VERY_SHORT_PART or BD.LEN_SHORT_PART - -- feature sempre di testa o coda per il gruppo (se non troppo lunga) - if Proc.Grp == 1 or Proc.Grp == 2 then - -- se abilitato avanzamento lavorazione feature di coda e pezzo corto (quindi a caduta) e feature in coda - if BD.ADVANCE_TAIL_CUT and b3Raw:getDimX() < dAdvTailLen and Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH then - -- se taglio, lo avanzo - if Proc.Prc == 10 then - return false, true - end - end - -- standard - return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH and Proc.Box:getDimX() < BD.MAX_LEN_HTFEA) - end - -- feature sempre di testa o coda nonostante il gruppo - if ( Proc.Grp == 3 or Proc.Grp == 4) and - ( Proc.Prc == 38 or Proc.Prc == 51 or Proc.Prc == 56 or Proc.Prc == 100 or Proc.Prc == 101 or Proc.Prc == 102 or Proc.Prc == 103 or Proc.Prc == 106) then - -- se abilitato avanzamento lavorazione feature di coda e pezzo corto (quindi a caduta) e feature in coda - if BD.ADVANCE_TAIL_CUT and b3Raw:getDimX() < dAdvTailLen and Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH then - -- se profilo front solo con smusso, lo avanzo - if Proc.Prc == 100 and ProfFront.OnlyChamfer( Proc) then - return false, true - end - -- se profilo concavo solo con smusso, lo avanzo - if Proc.Prc == 101 and ProfConcave.OnlyChamfer( Proc) then - return false, true - end - -- se profilo convesso solo con smusso, lo avanzo - if Proc.Prc == 102 and ProfConvex.OnlyChamfer( Proc) then - return false, true - end - -- se profilo caudato solo con smusso, lo avanzo - if Proc.Prc == 103 and ProfCamb.OnlyChamfer( Proc) then - return false, true - end - -- se profilo head solo con smusso, lo avanzo - if Proc.Prc == 106 and ProfHead.OnlyChamfer( Proc) then - return false, true - end - end - -- standard - return ( Proc.Box:getCenter():getX() < b3Raw:getCenter():getX() - 0.5 * dCurrOvmH) - end - -- gestioni speciali - if LapJoint.Identify( Proc) then - return LapJoint.IsTailFeature( Proc, b3Raw) - end - if Drill.Identify( Proc) then - return Drill.IsTailFeature( Proc, b3Raw, dCurrOvmT) - end - if DtMortise.Identify( Proc) then - return DtMortise.IsTailFeature( Proc, b3Raw) - end - if RoundArch.Identify( Proc) then - return RoundArch.IsTailFeature( Proc, b3Raw) - end - if Dovetail.Identify( Proc) then - return Dovetail.IsTailFeature( Proc, b3Raw) - end - if FreeContour.Identify( Proc) then - return FreeContour.IsTailFeature( Proc, b3Raw) - end - -- non è di coda - return false -end - ------------------------------------------------------------------------------------------------------------- local function PrintFeatures( vProc, b3Raw) EgtOutLog( ' RawBox=' .. tostring( b3Raw)) @@ -494,93 +581,6 @@ local function PrintFeatures( vProc, b3Raw) end end -------------------------------------------------------------------------------------------------------------- -local function CollectFeatures( PartId, b3Raw, dCurrOvmH, dCurrOvmT) - -- recupero le feature - local vProc = {} - local LayerId = {} - LayerId[1] = BL.GetAddGroup( PartId) - LayerId[2] = EgtGetFirstNameInGroup( PartId or GDB_ID.NULL, 'Processings') - for nInd = 1, 2 do - local ProcId = EgtGetFirstInGroup( LayerId[nInd] or GDB_ID.NULL) - while ProcId do - local nEntType = EgtGetType( ProcId) - if nEntType == GDB_TY.SRF_MESH or nEntType == GDB_TY.EXT_TEXT or - nEntType == GDB_TY.CRV_LINE or nEntType == GDB_TY.CRV_ARC or nEntType == GDB_TY.CRV_BEZ or nEntType == GDB_TY.CRV_COMPO then - local nGrp = EgtGetInfo( ProcId, 'GRP', 'i') - local nPrc = EgtGetInfo( ProcId, 'PRC', 'i') - local nDo = EgtGetInfo( ProcId, 'DO', 'i') or 1 - local nCutId = EgtGetInfo( EgtGetParent( EgtGetParent( ProcId)), 'CUTID', 'i') or 0 - local nTaskId = EgtGetInfo( ProcId, 'TASKID', 'i') or 0 - if nGrp and nPrc and nDo == 1 then - local Proc = {} - Proc.Id = ProcId - Proc.Grp = nGrp - Proc.Prc = nPrc - Proc.Flg = 1 - Proc.Fct = EgtSurfTmFacetCount( ProcId) or 0 - Proc.Diam = 0 - Proc.Fcs = 0 - Proc.Fce = 0 - Proc.CutId = nCutId - Proc.TaskId = nTaskId - Proc.Box = EgtGetBBoxGlob( ProcId, GDB_BB.STANDARD) - if Proc.Box and not Proc.Box:isEmpty() then - Proc.Head = IsHeadFeature( Proc, b3Raw, dCurrOvmH) - Proc.Tail, Proc.AdvTail = IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT) - table.insert( vProc, Proc) - -- se foro - if Drill.Identify( Proc) then - -- assegno diametro e facce di ingresso e uscita (dati tabelle sempre per riferimento) - Proc.Diam, Proc.Fcs, Proc.Fce = Drill.GetData( Proc, b3Raw) - -- verifico se necessaria seconda lavorazione da parte opposta per foro più lungo della punta - if Drill.Split( Proc, b3Raw) then - -- aggiorno flags prima parte foro (dati tabelle sempre per riferimento) - Proc.Flg = 2 - Proc.Head = Drill.IsHeadFeature( Proc, b3Raw, dCurrOvmH) - Proc.Tail = Drill.IsTailFeature( Proc, b3Raw, dCurrOvmH, dCurrOvmT) - -- definisco dati seconda parte - local Proc2 = {} - Proc2.Id = ProcId - Proc2.Grp = nGrp - Proc2.Prc = nPrc - Proc2.Flg = -2 - Proc2.Box = BBox3d( Proc.Box) - Proc2.Fct = Proc.Fct - Proc2.Diam = Proc.Diam - Proc2.Head = Drill.IsHeadFeature( Proc2, b3Raw, dCurrOvmH) - Proc2.Tail = Drill.IsTailFeature( Proc2, b3Raw, dCurrOvmH) - Proc2.Fcs = Proc.Fce - Proc2.Fce = Proc.Fcs - Proc2.CutId = Proc.CutId - Proc2.TaskId = Proc.TaskId - table.insert( vProc, Proc2) - end - -- se BlockHaus HalfLap - elseif Proc.Prc == 37 then - local nFacInd = BL.GetFaceWithMostAdj( Proc.Id, PartId) - if nFacInd then - local vtN = EgtSurfTmFacetNormVersor( Proc.Id, nFacInd, GDB_ID.ROOT) - if vtN then - Proc.vtN = Vector3d( vtN) - end - end - end - else - Proc.Head = false - Proc.Tail = false - Proc.Flg = 0 - table.insert( vProc, Proc) - EgtOutLog( ' Feature ' .. tostring( Proc.Id) .. ' is empty (no geometry)') - end - end - end - ProcId = EgtGetNext( ProcId) - end - end - return vProc -end - ------------------------------------------------------------------------------------------------------------- local function OrderFeatures( vProc, b3Raw) From c722186118775484a52fdb03fd7121c1c18de00f Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 29 Jun 2022 18:23:55 +0200 Subject: [PATCH 07/12] DataBeam: - correzione commenti --- LuaLibs/BeamExec.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 85a8ac7..e3f2bf4 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -127,9 +127,6 @@ EgtOutLog( ' BeamExec started', 1) EgtMdbSetGeneralParam( MCH_GP.MAXDEPTHSAFE, BD.COLL_SIC) EgtMdbSave() -------------------------------------------------------------------------------------------------------------- --- *** Inserimento delle travi nel grezzo *** -------------------------------------------------------------------------------------------------------------- local function IsHeadFeature( Proc, b3Raw, dCurrOvmH) -- feature sempre di testa o coda per il gruppo if Proc.Grp == 1 or Proc.Grp == 2 then @@ -363,6 +360,8 @@ local function AnalyzeTailFeatures( b3Solid, vProc, dRawW, dRawH) return bTailFinishingNeeded, nReplacedFeatureId end +------------------------------------------------------------------------------------------------------------- +-- *** Inserimento delle travi nel grezzo *** ------------------------------------------------------------------------------------------------------------- function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, vBeam, bMachGroupOk) From e882e70c0c1f877b7ca546c28a821e28792b2390 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Wed, 29 Jun 2022 18:25:02 +0200 Subject: [PATCH 08/12] DataBeam: - correzione commenti --- LuaLibs/BeamExec.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index e3f2bf4..facd6ad 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -127,6 +127,7 @@ EgtOutLog( ' BeamExec started', 1) EgtMdbSetGeneralParam( MCH_GP.MAXDEPTHSAFE, BD.COLL_SIC) EgtMdbSave() +------------------------------------------------------------------------------------------------------------- local function IsHeadFeature( Proc, b3Raw, dCurrOvmH) -- feature sempre di testa o coda per il gruppo if Proc.Grp == 1 or Proc.Grp == 2 then From 34bbe792228521c445b5498893e761b99f8e82aa Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 4 Jul 2022 07:24:40 +0200 Subject: [PATCH 09/12] DataBeam : - modifiche a GetNzLimDownUp per macchina FAST. --- LuaLibs/BeamLib.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index f557fc8..8fc9b25 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -690,27 +690,36 @@ function BeamLib.GetNzLimDownUp( b3Raw, vtN, vtOrtho) return -0.484 else if vtOrtho and vtOrtho:getZ() > 0.5 then + -- N_HorAng < 15° or N_HorAng > 55° if vtN and ( abs( vtN:getY()) < 0.259 or abs( vtN:getY()) > 0.819) then return -0.708 + -- N_HorAng > 50° elseif vtN and abs( vtN:getY()) > 0.766 then return -0.383 else return EgtIf( b3Raw:getDimZ() < BD.MIN_DIM_HBEAM, -0.609, -0.383) end else + -- N_HorAng > 60° if vtN and ( abs( vtN:getY()) > 0.866) then return -0.708 else if b3Raw:getDimZ() < 120 then return -0.708 elseif b3Raw:getDimZ() < 200 then + -- N_HorAng < 15° or N_HorAng > 55° if vtN and ( abs( vtN:getY()) < 0.259 or abs( vtN:getY()) > 0.819) then return -0.5 else return -0.383 end elseif b3Raw:getDimZ() < BD.MIN_DIM_HBEAM then - return -0.240 + -- N_HorAng < 10° + if vtN and ( abs( vtN:getY()) < 0.174) then + return -0.5 + else + return -0.240 + end else return -0.174 end From 1350cd03af364cfea2e563efd48ea0bfa2f47f30 Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 4 Jul 2022 16:52:47 +0200 Subject: [PATCH 10/12] DataBeam : - in ProcessLapJoint modifiche per lavorazioni con Sega a Catena (soprattutto elevazione da MaxElev). --- LuaLibs/ProcessLapJoint.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 332f902..bebdb86 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -1,4 +1,4 @@ --- ProcessLapJoint.lua by Egaltech s.r.l. 2022/06/25 +-- ProcessLapJoint.lua by Egaltech s.r.l. 2022/07/03 -- Gestione calcolo mezzo-legno per Travi -- 2019/10/08 Agg. gestione OpenPocket. -- 2021/01/24 Con sega a catena ora sempre impostato asse A. @@ -2793,12 +2793,13 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, dDimMin, dDimMax, dDepth, vtOrtho, nLundIdFace, bOrthoFacesMaster, nBottomFace, nChamfer, nAddGrpId, b3Solid, dDepthCham, nSurfInt, bIs3Faces) - local bOrthoFaces local sWarn -- ingombro del grezzo local b3Raw = EgtGetRawPartBBox( nRawId) -- ottengo la distanza tra la fine del pezzo e il pezzo successivo local dDistToNextPiece = EgtGetInfo( nRawId, 'BDST', 'd') or 5.4 + -- verifico e fessura con 3 facce o tunnel + local bOrthoFaces if bIs3Faces then -- recupero la faccia con il maggior numero di adiacenze e l'elevazione relativa local nFacInd1, dFacElev1, nFacInd2, dFacElev2 = BL.GetFaceWithMostAdj( Proc.Id, nPartId, bIs3Faces) @@ -2817,6 +2818,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, -- eventuale massima elevazione imposta dall'utente local dMaxElev = EgtGetInfo( Proc.Id, Q_MAX_ELEVATION, 'd') if dMaxElev and dMaxElev < 1 then dMaxElev = nil end + dElev = dMaxElev or dElev if bOrthoFaces then -- ottengo le dimensioni del tunnel @@ -2913,7 +2915,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, dSawMaxDepth = BD.MAX_DIM_HTCUT_HBEAM end -- Se entrambi gli estremi sono aperti e possibile, lavoro con la lama - if bOpenStart and bOpenEnd and bForceUseBlade and ( dMaxElev or dElev) < dSawMaxDepth + 10 * GEO.EPS_SMALL then + if bOpenStart and bOpenEnd and bForceUseBlade and dElev < dSawMaxDepth + 10 * GEO.EPS_SMALL then -- recupero altri dati dell'utensile local dSawDiam = 400 local dSawThick = 4 @@ -2977,10 +2979,10 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, return false, sErr end local bGoFromHead = true - -- se la lunghezza utensile non riesce ad arrivare sul fondo assegno la possibilità di lavorare di testa o di fianco + -- se la lunghezza utensile non riesce ad arrivare sul fondo assegno la possibilità di lavorare di fianco (se possibile) if dElev > dMaxDepth + 10 * GEO.EPS_SMALL then - -- lavora di testa se è un tunnel, lavora di fianco se non è un tunnel - bGoFromHead = not bOrthoFaces + -- continuo di testa se fessura con tre facce o non è tunnel + bGoFromHead = ( bIs3Faces or not bOrthoFaces) end -- se continuo a lavorare di testa if bGoFromHead then @@ -3118,10 +3120,8 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, end -- considero estremi inizio/fine chiusi -- recupero massima elevazione da utente - if dMaxElev and dMaxElev > 10 then - local sNotes = 'MaxElev=' .. EgtNumToString( dMaxElev, 1) .. ';' - EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) - end + local sNotes = 'MaxElev=' .. EgtNumToString( dElev, 1) .. ';' + EgtSetMachiningParam( MCH_MP.USERNOTES, sNotes) -- eseguo if not ML.ApplyMachining( true, false) then if EgtGetOutstrokeInfo() then From 89aacd06ea5b5feafa5656028facaf074fa41f87 Mon Sep 17 00:00:00 2001 From: DarioS Date: Mon, 4 Jul 2022 20:39:03 +0200 Subject: [PATCH 11/12] DataBeam : - in LapJoint aumentata tolleranza per calcolo passate lama e sega a catena. --- LuaLibs/ProcessLapJoint.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index bebdb86..736edb5 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -2753,7 +2753,7 @@ local function MakeByMillAsSaw( Proc, nPhase, nRawId, nPartId, nFacInd, end end -- Eseguo i tagli - local nStep = ceil( ( dV - 10 * GEO.EPS_SMALL) / dSawThick) + local nStep = ceil( ( dV - 100 * GEO.EPS_SMALL) / dSawThick) local dStep = 0 if nStep > 1 then dStep = ( dV - dSawThick) / ( nStep - 1) @@ -2934,7 +2934,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, -- Calcolo uso faccia local nFaceUse = BL.GetNearestOrthoOpposite( rfFac:getVersZ()) -- Eseguo i tagli - local nStep = ceil( ( dV - 10 * GEO.EPS_SMALL) / dSawThick) + local nStep = ceil( ( dV - 100 * GEO.EPS_SMALL) / dSawThick) local dStep = 0 if nStep > 1 then dStep = ( dV - dSawThick) / ( nStep - 1) @@ -2991,7 +2991,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, -- Calcolo uso faccia local nFaceUse = BL.GetNearestParalOpposite( rfFac:getVersZ(), vtN) -- Verifico se necessarie più passate - local nStep = ceil( ( dV - 10 * GEO.EPS_SMALL) / dSawThick) + local nStep = ceil( ( dV - 100 * GEO.EPS_SMALL) / dSawThick) local dStep = 0 if nStep > 1 then dStep = ( dV - dSawThick) / ( nStep - 1) @@ -3082,7 +3082,7 @@ local function MakeByChainOrSaw( Proc, nPhase, nRawId, nPartId, nFacInd, if vtRef:getY() > 0.5 or vtRef:getZ() < -0.1 then vtRef = -vtRef end local nFaceUse = BL.GetNearestParalOpposite( vtRef, vtNL) -- Verifico se necessarie più passate - local nStep = ceil( ( dDimMin - 10 * GEO.EPS_SMALL) / dSawThick2) + local nStep = ceil( ( dDimMin - 100 * GEO.EPS_SMALL) / dSawThick2) local dStep = 0 if nStep > 1 then dStep = ( dDimMin - dSawThick2) / ( nStep - 1) @@ -4446,7 +4446,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa local bMakeChainSaw, sSawing, dMaxMat, dSawCornerRad, dSawThick = VerifyChainSaw( Proc, dDimMin, dDimMax) if bMakeChainSaw then -- Verifico se necessarie più passate - local nStep = ceil( ( dDimMin - 10 * GEO.EPS_SMALL) / dSawThick) + local nStep = ceil( ( dDimMin - 100 * GEO.EPS_SMALL) / dSawThick) local dStep = 0 if nStep > 1 then dStep = ( dDimMin - dSawThick) / ( nStep - 1) From 415aecfa7d27a36223fdfd1909e2e01be07bf311 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 5 Jul 2022 09:28:36 +0200 Subject: [PATCH 12/12] DataBeam: corretto commento --- LuaLibs/ProcessLapJoint.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LuaLibs/ProcessLapJoint.lua b/LuaLibs/ProcessLapJoint.lua index 96b45cc..b15586c 100644 --- a/LuaLibs/ProcessLapJoint.lua +++ b/LuaLibs/ProcessLapJoint.lua @@ -5171,7 +5171,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, dOvmHead, bSinglePa else dH = dFacDim2 end - -- se la tasca ha dimensioni adeguate cerco di usare una fresa con raggio fino a metà altezza + -- se la tasca ha dimensioni adeguate cerco di usare una fresa con raggio fino a metà altezza dToolMaxDiam = EgtIf( dH >= dToolTargetDiam and dV > 0.5 * dToolTargetDiam, dToolTargetDiam, min( dH, dV, dToolTargetDiam)) -- per le L a 3 facce, avendo due lati aperti per l'attacco, si considera un diametro utensile pari al doppio della dimensione minima; il "- 1" è un accorgimento per impedire bug derivanti da dimensione della tasca uguale a D\2 utensile elseif Proc.Fct == 3 and bIsL then