DataWall :

- in FreeContour correzioni e modifiche per pulitura spigoli tipo 2 e 3
- aggiunto sort per utensili anche a pulitura spigoli.
This commit is contained in:
DarioS
2022-04-04 07:38:27 +02:00
parent ce99018cc2
commit fdb69f9f69
2 changed files with 13 additions and 11 deletions
+11 -9
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/03/16
-- ProcessFreeContour.lua by Egaltech s.r.l. 2022/04/03
-- Gestione calcolo profilo libero per Pareti
-- 2021/11/15 Penna e chiodature sono sempre riportate sulla faccia sopra anche se nel progetto sono sotto.
-- 2021/12/10 In taglio con lama aggiunta gestione SCC per testa Gearbox.
@@ -7,6 +7,7 @@
-- 2022/02/21 Corretti allungamenti/accorciamenti tagli inclinati con fresa. Migliorata gestione tagli trasversali per macchine travi.
-- 2022/03/14 Corretto riconoscimento lato esterno per percorsi aperti.
-- 2022/03/16 Ulteriore modifica per riconoscimento lato esterno (aggiunto uso vExtr a GetFacesExternalSide).
-- 2022/04/03 Correzioni e modifiche per pulitura spigoli tipo 2 e 3.
-- Tabella per definizione modulo
local WPF = {}
@@ -23,6 +24,7 @@ local WM = require( 'WMachiningLib')
if WD.CHECK_MIN_Z_SAW == nil then WD.CHECK_MIN_Z_SAW = true end
if not WD.MIN_Z_SAW then WD.MIN_Z_SAW = 0 end
if not WD.MAX_CLEAN_CRN60 then WD.MAX_CLEAN_CRN60 = 150 end
if not WD.MAX_CLEAN_CRN30 then WD.MAX_CLEAN_CRN30 = 68 end
local WHISK_OFFS = 0.1
local WHISK_SAFE = 5
local MIN_LEN_CUT = 250
@@ -633,7 +635,7 @@ local function MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick, bC
if i < #vGeom then
-- ricavo i punti e l'angolo interno
_, _, _, dAng = EgtSurfTmFacetsContact( vGeom[i][1], vGeom[i][2], vGeom[i+1][2], GDB_ID.ROOT)
elseif i == #vGeom and nConeCut == 3 and bClosed then
elseif bClosed then
-- ricavo i punti e l'angolo interno
_, _, _, dAng = EgtSurfTmFacetsContact( vGeom[i][1], vGeom[i][2], vGeom[1][2], GDB_ID.ROOT)
else
@@ -677,17 +679,17 @@ local function MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick, bC
end
end
-- calcolo la lunghezza della linea da inserire in base all'angolo e alla lunghezza utensile
local dLenAdd = abs(( dMillLength * sin(33)) - ( dMillDiam / 2))
local dLenAdd = abs(( dMillLength * sin( 33)) - ( dMillDiam / 2))
-- per ogni entità compongo la nuova lista per creare percorso
for i = 1, nIdCount do
-- aggiungo linea precedente
table.insert( nPath, ( nId1st + i - 1))
-- se non è la linea finale e l'angolo tra le due facce è ammesso
if i < nIdCount and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL) and nPathData[i][2] < 0 and
nPathData[i][2] > -(180-dAngleSmall + 10 * GEO.EPS_SMALL) then
if ( i < nIdCount or bClosed) and dThick <= ( WD.MAX_CLEAN_CRN30 + 20 * GEO.EPS_SMALL) and
nPathData[i][2] < 0 and nPathData[i][2] > -( 180 - dAngleSmall + 10 * GEO.EPS_SMALL) then
-- aggiungo una retta sulla bisettrice
local _, vtN2 = EgtSurfTmFacetCenter( vGeom[i][1], vGeom[i][2], GDB_ID.ROOT)
local _, vtN3 = EgtSurfTmFacetCenter( vGeom[i][1], vGeom[i+1][2], GDB_ID.ROOT)
local _, vtN3 = EgtSurfTmFacetCenter( vGeom[i][1], vGeom[EgtIf( i == nIdCount, 1, i+1)][2], GDB_ID.ROOT)
local ptP1 = EgtEP( ( nId1st + i - 1), GDB_ID.ROOT)
-- sommo i tre versori per avere una direzione media
local vtExtrExit = vtN2 + vtN3
@@ -710,10 +712,10 @@ local function MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick, bC
-- aggiungo linea precedente
table.insert( nPath, ( nId1st + i - 1))
-- se non è la linea finale e l'angolo tra le due facce è ammesso
if ( i < nIdCount and nPathData[i][2] < 0) or ( i == nIdCount and bClosed and nPathData[i][2] < 0) then
if ( i < nIdCount or bClosed) and nPathData[i][2] < 0 then
-- aggiungo una retta sulla bisettrice
local _, vtN2 = EgtSurfTmFacetCenter( vGeom[i][1], vGeom[i][2], GDB_ID.ROOT)
local _, vtN3 = EgtSurfTmFacetCenter( vGeom[i][1], vGeom[ EgtIf( i == nIdCount and bClosed, 1, i+1)][2], GDB_ID.ROOT)
local _, vtN3 = EgtSurfTmFacetCenter( vGeom[i][1], vGeom[EgtIf( i == nIdCount, 1, i+1)][2], GDB_ID.ROOT)
local ptP1 = EgtEP( ( nId1st + i - 1), GDB_ID.ROOT)
-- sommo i tre versori per avere una direzione media
local vtExtrExit = vtN2 + vtN3
@@ -1490,7 +1492,7 @@ local function AddMillings( sMilling, vFace, Proc, nRawId, b3Raw, nConeCut, nAdd
-- altrimenti se devo fare rientranza per inserimento utensile cono 30°
elseif nConeCut == 2 then
-- eseguo la costruzione del percorso
local nPathId, sErr = MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick)
local nPathId, sErr = MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick, bClosed and bAllType4)
if nPathId == 0 then return 0, sErr end
EgtSetMachiningGeometry({{ nPathId, -1}})
EgtSetMachiningParam( MCH_MP.STARTADDLEN, dSal)