DataBeam :

- nuovo metodo per calcolo percorso di riferimento per antischeggia per mortase a coda di rondine
- migliorie varie a LapJoint.
This commit is contained in:
Dario Sassi
2020-04-14 07:38:58 +00:00
parent 02c399eaa0
commit f1b0324106
4 changed files with 68 additions and 87 deletions
+24 -33
View File
@@ -1,4 +1,4 @@
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/04/06
-- ProcessLapJoint.lua by Egaltech s.r.l. 2020/04/07
-- Gestione calcolo mezzo-legno per Travi
-- 2019/10/08 Agg. gestione OpenPocket.
@@ -910,23 +910,12 @@ local function ChooseCorner( Proc, nFacInd)
local tFacAdj = {}
for i = 1, #vAdj do
if vAdj[i] >= 0 then
for j = 1, #vAdj do
if vAdj[j] >= 0 and j ~= i then
local bInsert = true
for k = 1, #tFacAdj do
local nFace1 = tFacAdj[k][1]
local nFace2 = tFacAdj[k][2]
if ( nFace1 == vAdj[i] and nFace2 == vAdj[j]) or
( nFace1 == vAdj[j] and nFace2 == vAdj[i]) then
bInsert = false
end
end
if bInsert then
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, vAdj[i], vAdj[j], GDB_ID.ROOT)
if ptP1 and ptP2 then
local dLen = dist( ptP1, ptP2)
table.insert( tFacAdj, { vAdj[i], vAdj[j], dLen, ptP1, ptP2, dAng})
end
for j = i+1, #vAdj do
if vAdj[j] >= 0 then
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, vAdj[i], vAdj[j], GDB_ID.ROOT)
if ptP1 and ptP2 and dAng < 0 then
local dLen = dist( ptP1, ptP2)
table.insert( tFacAdj, { vAdj[i], vAdj[j], dLen, ptP1, ptP2, dAng})
end
end
end
@@ -959,6 +948,10 @@ local function MakeContourCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd,
-- ottengo gli angoli dove applicare il percorso con fresa più piccola
local dMaxLen, nIdLine, tFacAdj = ChooseCorner( Proc, nFacInd)
-- se non trovato nessun angolo interno valido esco
if #tFacAdj == 0 then
return true, sMyWarn
end
-- prendo il primo versore
local _, vtN1 = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
-- se direzione tende verso una delle alle 3 direzioni azzero l'altezza extra
@@ -975,10 +968,9 @@ local function MakeContourCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd,
for i = 1, #tFacAdj do
sMyWarn = ''
-- le 2 facce di contatto devono essere perpendicolari o non sottossquadra rispetto alla faccia di fondo
-- e ra le due facce deve esserci un angolo interno
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( Proc.Id, nFacInd, tFacAdj[i][1], GDB_ID.ROOT)
local _, ptP1x, ptP2x, dAngx = EgtSurfTmFacetsContact( Proc.Id, nFacInd, tFacAdj[i][2], GDB_ID.ROOT)
if ( dAng < 0 and 180 + dAng >= 90 - 10 * GEO.EPS_SMALL) and ( dAngx < 0 and 180 + dAngx >= 90 - 10 * GEO.EPS_SMALL) and ( tFacAdj[i][6] < 0) then
if ( dAng < 0 and 180 + dAng >= 90 - 10 * GEO.EPS_SMALL) and ( dAngx < 0 and 180 + dAngx >= 90 - 10 * GEO.EPS_SMALL) then
-- prendo la lunghezza di adiacenza delle due linee
local dLen1 = dist( ptP1, ptP2)
local dLen2 = dist( ptP1x, ptP2x)
@@ -1121,10 +1113,11 @@ local function MakeContourCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd,
end
return true, sMyWarn
end
---------------------------------------------------------------------
local function MakeCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiam)
local sMyWarn
local sMyWarn = ''
local pAuxId = {}
local nAuxId
local AuxId
@@ -1135,16 +1128,14 @@ local function MakeCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, n
-- ottengo l'angolo di riferimento dove applicare il percorso di pulitura
local dMaxLen, nIdLine, tFacAdj = ChooseCorner( Proc, nFacInd)
-- se non trovato nessun angolo valido esco
if #tFacAdj == 0 then
return true, sMyWarn
end
-- prendo il primo versore
local _, vtN1 = EgtSurfTmFacetCenter( Proc.Id, nFacInd, GDB_ID.ROOT)
local _, vtN2 = EgtSurfTmFacetCenter( Proc.Id, tFacAdj[nIdLine][1], GDB_ID.ROOT)
local _, vtN3 = EgtSurfTmFacetCenter( Proc.Id, tFacAdj[nIdLine][2], GDB_ID.ROOT)
if not tFacAdj then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' geometry not found for clean corner'
EgtOutLog( sErr)
return false, sErr
end
-- trovo il punto sulla superfice di riferimento
local _, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( Proc.Id, nFacInd, tFacAdj[nIdLine][1], GDB_ID.ROOT)
local nIdIniPoint
@@ -1294,15 +1285,15 @@ local function MakeCleanCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, n
return true, sMyWarn
end
---------------------------------------------------------------------
local function MakeDrillOnCorner( Proc, nPhase, nRawId, nPartId, b3Raw, nFacInd, nAddGrpId, dDiam, bSpecialMach)
local sMyWarn
local sMyWarn = ''
-- ottengo l'angolo dove applicare il foro
local dMaxLen, nIdLine, tFacAdj = ChooseCorner( Proc, nFacInd)
if not tFacAdj then
local sErr = 'Error on process ' .. tostring( Proc.Id) .. ' geometry not found for drilling'
EgtOutLog( sErr)
return false, sErr
-- se non trovato nessun angolo interno valido esco
if #tFacAdj == 0 then
return true, sMyWarn
end
-- trovo il punto sulla superfice di riferimento
local _, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( Proc.Id, nFacInd, tFacAdj[nIdLine][1], GDB_ID.ROOT)
@@ -3074,7 +3065,7 @@ local function MakeMoreFaces( Proc, nPhase, nRawId, nPartId, bSingle_part)
-- se processo 20 vedo se ho truciolatore abilitato
if Proc.Prc == 20 then
-- se forzato uso truciolatore altrimenti prosegue con fresa più piccola
if EgtGetInfo( Proc.Id, sUseRoughTool, 'i') == 1 then
if EgtGetInfo( Proc.Id, sUseRoughTool, 'i') ~= 0 then
sMchFind = 'OpenPocket'
nUseRoughTool = 1
end