Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 09ce7d2d01 | |||
| 84eb8ec1b9 | |||
| a2fc9b4ade | |||
| bb5b13d122 | |||
| ee04bed533 | |||
| 5452ceda9f | |||
| a875f9758b | |||
| c091137ffc | |||
| 9d0206984b | |||
| 84339a5843 | |||
| 780b0addc1 | |||
| 6c1d2e5cc5 | |||
| 1c623206df | |||
| 4034898f6e | |||
| aa7099539e | |||
| 510724a627 | |||
| 23a831cf50 | |||
| b2fe513d2d |
+2
-1
@@ -1,5 +1,5 @@
|
||||
|
||||
REM Compilazione degli script Wall Egaltech 2023.02.27
|
||||
REM Compilazione degli script Wall Egaltech 2023.09.26
|
||||
REM Per togliere info di debug aggiungere flag -s prima del nome del file di input
|
||||
|
||||
REM Compilazione 32 e 64 bit
|
||||
@@ -11,6 +11,7 @@ REM Compilazione 32 e 64 bit
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDoubleCut.lua LuaLibs\WProcessDoubleCut.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDrill.lua LuaLibs\WProcessDrill.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessDtMortise.lua LuaLibs\WProcessDtMortise.lua
|
||||
REM \EgtProg\Dll32\luac54 -o bin\LuaLibs\WFeatureTopology.lua LuaLibs\WFeatureTopology.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessFreeContour.lua LuaLibs\WProcessFreeContour.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessLapJoint.lua LuaLibs\WProcessLapJoint.lua
|
||||
\EgtProg\Dll32\luac54 -o bin\LuaLibs\WProcessMark.lua LuaLibs\WProcessMark.lua
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2023/09/12
|
||||
-- ProcessFreeContour.lua by Egaltech s.r.l. 2023/09/26
|
||||
-- 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.
|
||||
@@ -22,6 +22,8 @@
|
||||
-- 2023/06/06 Aggiunta gestione lavorazione per lamatura speciale affondata con Tool_ID specifico.
|
||||
-- 2023/07/26 In MakeByCut migliorata la scelta della fresa secondaria nel caso non sia disponibile una fresa di lunghezza sufficiente.
|
||||
-- 2023/09/12 Modifiche a GetTunnelDimension (asse deve essere com Z globale) e MakeLocalSurf per gestire finestre con lati inclinati.
|
||||
-- 2023/09/21 In MakeByMill modificato SCC per correggere caso con lama su testa fresa.
|
||||
-- 2023/09/26 In Is3EdgesApprox aggiunta cancellazione dei loop temporanei.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPF = {}
|
||||
@@ -1091,7 +1093,8 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
local nFacCnt = EgtSurfTmFacetCount( nNewProc)
|
||||
local nFacInd, dDepth, nSurfInt
|
||||
local bMakeLocSurf
|
||||
if nFacCnt <= 4 then
|
||||
-- RIMUOVERE
|
||||
if false and nFacCnt <= 4 then
|
||||
-- recupero profondità e faccia di fondo
|
||||
_, _, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc, Proc.PartId, nAddGrpId, bClosed)
|
||||
if nSurfInt then
|
||||
@@ -1105,6 +1108,7 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
else
|
||||
return true
|
||||
end
|
||||
-- FINE PARTE DA RIMUOVERE
|
||||
else
|
||||
bMakeLocSurf = true
|
||||
end
|
||||
@@ -1122,27 +1126,27 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
while i <= #vFace do
|
||||
-- se tutta la faccia o la sua fine senza taglio, inserisco una fresatura
|
||||
if ( vFace[i].Type & 2) ~= 0 or vFace[i].Type == 4 then
|
||||
-- variabili costruzione geometria (nface1, nFace2, tFacAdj)
|
||||
-- variabili costruzione geometria (nFace1, nFace2, tFacAdj)
|
||||
local nFace1 = vFace[i].Fac
|
||||
-- aggiungo geometria
|
||||
local j = EgtIf( i < #vFace, i + 1, EgtIf( bClosed, 1, nil))
|
||||
if not j then return true end
|
||||
local nFace2 = vFace[j].Fac
|
||||
-- ricavo i tre punti per eventuale superficie locale
|
||||
local ptLoc1, ptLoc2, ptLoc3
|
||||
-- punto precedente (punto precedente della faccia [i])
|
||||
ptLoc3 = vFace[i].PPrev
|
||||
-- aggiungo geometria
|
||||
i = i + 1
|
||||
local j = EgtIf( i <= #vFace, i, EgtIf( bClosed, 1, nil))
|
||||
if not j then
|
||||
return true
|
||||
end
|
||||
local nFace2 = vFace[j].Fac
|
||||
-- punto in comune tra le due facce (punto precedente della faccia [j])
|
||||
ptLoc1 = vFace[j].PPrev
|
||||
-- punto precedente (punto precedente della faccia [i])
|
||||
if vFace[i].PPrev then
|
||||
ptLoc3 = vFace[i].PPrev
|
||||
else
|
||||
ptLoc3 = Point3d( vFace[i].Cen:getX(), vFace[i].Cen:getY(), ptLoc1:getZ())
|
||||
end
|
||||
-- punto successivo ( precedente della faccia successiva)
|
||||
j = j + 1
|
||||
local k = EgtIf( j <= #vFace, j, EgtIf( bClosed, 1, nil))
|
||||
local k = EgtIf( j < #vFace, j + 1, EgtIf( bClosed, 1, nil))
|
||||
-- se è un percorso aperto prendo il punto medio della seconda faccia come punto locale 2
|
||||
if not k then
|
||||
ptLoc2 = Point3d( vFace[j-1].Cen:getX(), vFace[j-1].Cen:getY(), ptLoc1:getZ())
|
||||
ptLoc2 = Point3d( vFace[j].Cen:getX(), vFace[j].Cen:getY(), ptLoc1:getZ())
|
||||
else
|
||||
ptLoc2 = vFace[k].PPrev
|
||||
end
|
||||
@@ -1180,9 +1184,9 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
else
|
||||
i = i + 1
|
||||
end
|
||||
-- passo alla successiva
|
||||
i = i + 1
|
||||
end
|
||||
-- cancello la copia della superfice
|
||||
if nNewProc then
|
||||
@@ -1207,26 +1211,28 @@ end
|
||||
---------------------------------------------------------------------
|
||||
-- Funzione per determinare se la faccia ha lati molto corti (trascurabili) ed è quindi approssimabile ad una 3 facce
|
||||
local function Is3EdgesApprox( Proc, nFacet, nAddGrpId)
|
||||
local bResult = false
|
||||
local nContourId = EgtExtractSurfTmFacetLoops( Proc.Id, nFacet, nAddGrpId)
|
||||
nAddGrpId = nAddGrpId or WL.GetAddGroup( Proc.PartId)
|
||||
-- recupero il contorno della faccia
|
||||
local nContourId, nContourCnt = EgtExtractSurfTmFacetLoops( Proc.Id, nFacet, nAddGrpId)
|
||||
if not nContourId then return false end
|
||||
EgtMergeCurvesInCurveCompo( nContourId)
|
||||
-- recupero il numero effettivo di lati
|
||||
-- recupero il numero di lati del contorno
|
||||
local _, nEntityCount = EgtCurveDomain( nContourId)
|
||||
if not nEntityCount then return false end
|
||||
-- se sono già tre, ho finito
|
||||
if nEntityCount == 3 then return true end
|
||||
-- rimuovo i lati molto corti dal conteggio totale
|
||||
local nEdges = nEntityCount
|
||||
if nContourId then
|
||||
if nEntityCount and nEntityCount == 3 then
|
||||
bResult = true
|
||||
-- rimuovo i lati molto corti dal conteggio totale
|
||||
elseif nEntityCount then
|
||||
for i = 1, nEntityCount do
|
||||
local dLength = EgtCurveCompoLength( nContourId, i - 1)
|
||||
if dLength < 15 then nEdges = nEdges - 1 end
|
||||
end
|
||||
end
|
||||
if nEdges == 3 then bResult = true end
|
||||
for i = 1, nEntityCount do
|
||||
local dLength = EgtCurveCompoLength( nContourId, i - 1)
|
||||
if dLength < 15 then nEdges = nEdges - 1 end
|
||||
end
|
||||
if bResult == true then
|
||||
EgtOutLog( 'FreeContour : Face with ' .. tointeger( nEntityCount) .. ' edges skipped (approx 3 edges)')
|
||||
-- verifico il numero significativo di lati
|
||||
local bResult = ( nEdges == 3)
|
||||
-- cancello tutti i contorni appena creati
|
||||
EgtErase( EgtTableFill( nContourId, nContourCnt))
|
||||
if bResult then
|
||||
EgtOutLog( 'FreeContour : Face with ' .. tostring( nEntityCount) .. ' edges skipped (approx 3 edges)')
|
||||
end
|
||||
return bResult
|
||||
end
|
||||
@@ -2188,7 +2194,7 @@ local function MakeByMill( Proc, nRawId, b3Raw)
|
||||
-- posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.ADIR_ZP
|
||||
if AreSameOrOppositeVectorApprox( vtExtr, Z_AX()) then
|
||||
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
|
||||
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- eseguo
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-- WProcessLapJoint.lua by Egaltech s.r.l. 2023/09/19
|
||||
-- WProcessLapJoint.lua by Egaltech s.r.l. 2023/09/21
|
||||
-- Gestione calcolo mezzo-legno per Pareti
|
||||
-- 2021/08/27 DS Se tre o più facce con flag PCKT=1 forzo svuotatura con fresa (per Variant).
|
||||
-- 2021/08/29 DS Se svuotatura di fianco setto flag per farla dopo i tagli.
|
||||
@@ -27,6 +27,8 @@
|
||||
-- 2023/08/01 Migliorato controllo testa sotto al grezzo in SieGroove.
|
||||
-- 2023/08/07 Controllo testa sotto al grezzo in SideGroove escluso se richiesto il move after.
|
||||
-- 2023/09/19 Controllo lavorabilità con una sola faccia ora ha limiti come FreeContour.
|
||||
-- 2023/09/21 Modifica controllo lavorabilità con tre facce tipo tunnel ma non ortogonali tra loro.
|
||||
-- 2023/09/21 In MakeByMill modificato SCC per correggere caso con lama su testa fresa.
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WPL = {}
|
||||
@@ -192,8 +194,8 @@ function WPL.Classify( Proc, b3Raw)
|
||||
else
|
||||
return false
|
||||
end
|
||||
-- se altrimenti tunnel
|
||||
elseif nFacInd == -1 then
|
||||
-- se altrimenti tunnel o assimilabile
|
||||
elseif nFacInd == -1 or nFacInd == -2 then
|
||||
-- dati delle prime tre facce
|
||||
local vtN = {}
|
||||
vtN[1] = EgtSurfTmFacetNormVersor( Proc.Id, 0, GDB_ID.ROOT)
|
||||
@@ -808,7 +810,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
-- se devo creare superfice locale
|
||||
if bMakeLocSurf then
|
||||
-- creo superfice locale o esco
|
||||
local nSurfToAdd = MakeLocalSurf( tFacAdj[1][7], tFacAdj[1][8], tFacAdj[1][9], nAddGrpId)
|
||||
local nSurfToAdd = MakeLocalSurf( tFacAdj[7], tFacAdj[8], tFacAdj[9], nAddGrpId)
|
||||
if nSurfToAdd then
|
||||
local nFacCntPre = EgtSurfTmFacetCount( nNewProc)
|
||||
-- creo copia del percorso principale e gli aggiungo la nuova faccia
|
||||
@@ -829,11 +831,11 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
end
|
||||
-- prendo il primo versore
|
||||
local _, vtN1 = EgtSurfTmFacetCenter( nNewProcLoc, nFacInd, GDB_ID.ROOT)
|
||||
local _, vtN2 = EgtSurfTmFacetCenter( nNewProcLoc, tFacAdj[1][1], GDB_ID.ROOT)
|
||||
local _, vtN3 = EgtSurfTmFacetCenter( nNewProcLoc, tFacAdj[1][2], GDB_ID.ROOT)
|
||||
local _, vtN2 = EgtSurfTmFacetCenter( nNewProcLoc, tFacAdj[1], GDB_ID.ROOT)
|
||||
local _, vtN3 = EgtSurfTmFacetCenter( nNewProcLoc, tFacAdj[2], GDB_ID.ROOT)
|
||||
-- trovo il punto sulla superfice di riferimento
|
||||
local _, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( nNewProcLoc, nFacInd, tFacAdj[1][1], GDB_ID.ROOT)
|
||||
local _, ptLocP3, ptLocP4, _ = EgtSurfTmFacetsContact( nNewProcLoc, nFacInd, tFacAdj[1][2], GDB_ID.ROOT)
|
||||
local _, ptLocP1, ptLocP2, _ = EgtSurfTmFacetsContact( nNewProcLoc, nFacInd, tFacAdj[1], GDB_ID.ROOT)
|
||||
local _, ptLocP3, ptLocP4, _ = EgtSurfTmFacetsContact( nNewProcLoc, nFacInd, tFacAdj[2], GDB_ID.ROOT)
|
||||
-- se ho creato faccia locale su copia superficie, cancella la copia
|
||||
if bMakeLocSurf then
|
||||
EgtErase( nNewProcLoc)
|
||||
@@ -841,16 +843,16 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
local nIdIniPoint
|
||||
local nIdEndPoint
|
||||
if ptLocP1 and ptLocP2 then
|
||||
if ( dist( ptLocP1, tFacAdj[1][4]) < GEO.EPS_SMALL) or ( dist( ptLocP2, tFacAdj[1][4]) < GEO.EPS_SMALL) then
|
||||
if ( dist( ptLocP1, tFacAdj[4]) < GEO.EPS_SMALL) or ( dist( ptLocP2, tFacAdj[4]) < GEO.EPS_SMALL) then
|
||||
nIdEndPoint = 4
|
||||
nIdIniPoint = 5
|
||||
elseif ( dist( ptLocP1, tFacAdj[1][5]) < GEO.EPS_SMALL) or ( dist( ptLocP2, tFacAdj[1][5]) < GEO.EPS_SMALL) then
|
||||
elseif ( dist( ptLocP1, tFacAdj[5]) < GEO.EPS_SMALL) or ( dist( ptLocP2, tFacAdj[5]) < GEO.EPS_SMALL) then
|
||||
nIdEndPoint = 5
|
||||
nIdIniPoint = 4
|
||||
end
|
||||
end
|
||||
-- versore direzione
|
||||
local vtExtr = tFacAdj[1][nIdIniPoint] - tFacAdj[1][nIdEndPoint]
|
||||
local vtExtr = tFacAdj[nIdIniPoint] - tFacAdj[nIdEndPoint]
|
||||
vtExtr:normalize()
|
||||
-- versore direzione di uscita
|
||||
local vtExtrExit
|
||||
@@ -879,44 +881,44 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
vtCheck:rotate( Z_AX(), dOffsAng)
|
||||
end
|
||||
-- controllo se c'è collisione con le facce della superfice
|
||||
if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
|
||||
if nTypeConeCut == 1 and CalcInterference( nNewProc, vtCheck, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), dDiam1, dDiam2,
|
||||
dTall1, dTall2, dDiam3, dTall3) then
|
||||
local sErr = 'Collision detect from clean corner tool and surface'
|
||||
EgtOutLog( sErr)
|
||||
return true, ''
|
||||
end
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdIniPoint], tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdIniPoint], tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
table.insert( pAuxId, nAuxId)
|
||||
-- se uso utensile cono 60°
|
||||
if nTypeConeCut == 1 then
|
||||
-- se offset angolare valido e/o negativo creo il baffo precedente
|
||||
if dOffsAng < ( 100 * GEO.EPS_SMALL) then
|
||||
-- se il punto finale corrisponde con il punto utilizzato in precedenza, uso l'altro
|
||||
if dist( tFacAdj[1][nIdEndPoint], ptLocP1) < 10 * GEO.EPS_SMALL then
|
||||
if dist( tFacAdj[nIdEndPoint], ptLocP1) < 10 * GEO.EPS_SMALL then
|
||||
ptApPoint = ptLocP2
|
||||
else
|
||||
ptApPoint = ptLocP1
|
||||
end
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
local dLenTrimExt = dist( tFacAdj[1][nIdEndPoint], ptApPoint) - (( dToolDiam/2) + 0.2)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
local dLenTrimExt = dist( tFacAdj[nIdEndPoint], ptApPoint) - (( dToolDiam/2) + 0.2)
|
||||
-- se la distanza dei due punti della linea è maggiore dal raggio fresa + delta, trimmo al raggio fresa + delta
|
||||
if dLenTrimExt > 10 * GEO.EPS_SMALL then
|
||||
EgtTrimExtendCurveByLen( nAuxId , -dLenTrimExt, ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
-- se ho l'offset angolare ruoto la linea per compensare la rotazione che verrà applicata
|
||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
||||
EgtRotate( nAuxId, tFacAdj[1][nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
EgtRotate( nAuxId, tFacAdj[nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
-- prendo il nuovo punto finale
|
||||
ptApPoint = EgtEP( nAuxId, GDB_RT.GLOB) + Point3d( 0, 0, dDepthMach)
|
||||
else
|
||||
-- se ho l'offset angolare ruoto la linea per compensare la rotazione che verrà applicata
|
||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
||||
EgtRotate( nAuxId, tFacAdj[1][nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
EgtRotate( nAuxId, tFacAdj[nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
end
|
||||
table.insert( pAuxId, nAuxId)
|
||||
-- creo linea di ritorno
|
||||
nAuxId = EgtLine( nAddGrpId, ptApPoint + Point3d( 0, 0, -dDepthMach), tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
nAuxId = EgtLine( nAddGrpId, ptApPoint + Point3d( 0, 0, -dDepthMach), tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
table.insert( pAuxId, nAuxId)
|
||||
end
|
||||
end
|
||||
@@ -926,7 +928,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
ptLocP1, ptLocP2 = ptLocP3, ptLocP4
|
||||
if ptLocP1 and ptLocP2 then
|
||||
-- se il punto finale corrisponde con il punto utilizzato in precedenza, uso l'altro
|
||||
if dist( tFacAdj[1][nIdEndPoint], ptLocP1) < 10 * GEO.EPS_SMALL then
|
||||
if dist( tFacAdj[nIdEndPoint], ptLocP1) < 10 * GEO.EPS_SMALL then
|
||||
ptApPoint = ptLocP2
|
||||
else
|
||||
ptApPoint = ptLocP1
|
||||
@@ -935,36 +937,36 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
if nTypeConeCut == 1 then
|
||||
-- se offset angolare valido e/o negativo creo il baffo precedente
|
||||
if dOffsAng > -( 100 * GEO.EPS_SMALL) then
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
local dLenTrimExt = dist( tFacAdj[1][nIdEndPoint], ptApPoint) - (( dToolDiam/2) + 0.2)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
local dLenTrimExt = dist( tFacAdj[nIdEndPoint], ptApPoint) - (( dToolDiam/2) + 0.2)
|
||||
-- se la distanza dei due punti della linea è maggiore dal raggio fresa + delta, trimmo al raggio fresa + delta
|
||||
if dLenTrimExt > 10 * GEO.EPS_SMALL then
|
||||
EgtTrimExtendCurveByLen( nAuxId , -dLenTrimExt, ptApPoint + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
-- se ho l'offset angolare ruoto la linea per compensare la rotazione che verrà applicata
|
||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
||||
EgtRotate( nAuxId, tFacAdj[1][nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
EgtRotate( nAuxId, tFacAdj[nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
-- prendo il nuovo punto finale
|
||||
ptApPoint = EgtEP( nAuxId, GDB_RT.GLOB) + Point3d( 0, 0, dDepthMach)
|
||||
else
|
||||
-- se ho l'offset angolare ruoto la linea per compensare la rotazione che verrà applicata
|
||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
||||
EgtRotate( nAuxId, tFacAdj[1][nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
EgtRotate( nAuxId, tFacAdj[nIdEndPoint], Z_AX(), -dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
end
|
||||
table.insert( pAuxId, nAuxId)
|
||||
-- creo linea di ritorno
|
||||
nAuxId = EgtLine( nAddGrpId, ptApPoint + Point3d( 0, 0, -dDepthMach), tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
nAuxId = EgtLine( nAddGrpId, ptApPoint + Point3d( 0, 0, -dDepthMach), tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), GDB_RT.GLOB)
|
||||
table.insert( pAuxId, nAuxId)
|
||||
end
|
||||
-- ultima linea di distacco (5mm in direzione utensile)
|
||||
local pEnd = tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach) + ( 5 * vtExtr)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdEndPoint] + Point3d( 0, 0, -dDepthMach), pEnd, GDB_RT.GLOB)
|
||||
local pEnd = tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach) + ( 5 * vtExtr)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdEndPoint] + Point3d( 0, 0, -dDepthMach), pEnd, GDB_RT.GLOB)
|
||||
table.insert( pAuxId, nAuxId)
|
||||
else
|
||||
-- linea di distacco (2mm in direzione utensile)
|
||||
local pEnd = tFacAdj[1][nIdEndPoint] + ( 2 * vtExtr)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[1][nIdEndPoint], pEnd, GDB_RT.GLOB)
|
||||
local pEnd = tFacAdj[nIdEndPoint] + ( 2 * vtExtr)
|
||||
nAuxId = EgtLine( nAddGrpId, tFacAdj[nIdEndPoint], pEnd, GDB_RT.GLOB)
|
||||
table.insert( pAuxId, nAuxId)
|
||||
-- ultima linea di risalita in Z
|
||||
local pIni = pEnd
|
||||
@@ -987,7 +989,7 @@ local function AddMillCornerMachining( nPartId, nNewProc, nFacInd, tFacAdj, nTyp
|
||||
EgtModifyCurveExtrusion( AuxId, vtExtr, GDB_RT.GLOB)
|
||||
-- se ho un offset angolare ruoto il percorso
|
||||
if abs(dOffsAng) > 100 * GEO.EPS_SMALL then
|
||||
EgtRotate( AuxId, tFacAdj[1][nIdEndPoint], Z_AX(), dOffsAng, GDB_RT.GLOB)
|
||||
EgtRotate( AuxId, tFacAdj[nIdEndPoint], Z_AX(), dOffsAng, GDB_RT.GLOB)
|
||||
end
|
||||
-- inserisco la lavorazione
|
||||
local sName = 'Clean_' .. ( EgtGetName( nNewProc) or tostring( nNewProc))
|
||||
@@ -1094,7 +1096,8 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
local nFacCnt = EgtSurfTmFacetCount( nNewProc)
|
||||
local nFacInd, dDimMin, dDimMax, dDepth, nSurfInt
|
||||
local bMakeLocSurf
|
||||
if nFacCnt <= 4 then
|
||||
-- RIMUOVERE
|
||||
if false and nFacCnt <= 4 then
|
||||
-- ottengo le dimensioni apertura, la normale e la faccia inferiore
|
||||
dDimMin, dDimMax, dDepth, _, _, nSurfInt = GetTunnelDimension( nNewProc, Proc.PartId, nAddGrpId)
|
||||
if nSurfInt then
|
||||
@@ -1111,6 +1114,7 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
EgtOutLog( sErr)
|
||||
return false, sErr
|
||||
end
|
||||
-- FINE PARTE DA RIMUOVERE
|
||||
else
|
||||
bMakeLocSurf = true
|
||||
end
|
||||
@@ -1130,38 +1134,37 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
while i <= #vFace do
|
||||
-- se tutta la faccia o la sua fine senza taglio, inserisco una fresatura
|
||||
if ( vFace[i].Type & 2) ~= 0 or vFace[i].Type == 4 then
|
||||
-- variabili costruzione geometria
|
||||
local tFacAdj = {}
|
||||
-- variabili costruzione geometria (nFace1, nFace2, tFacAdj)
|
||||
local nFace1 = vFace[i].Fac
|
||||
local nFace2
|
||||
-- ricavo i tre punti per eventuale superficie locale
|
||||
local ptLoc1, ptLoc2, ptLoc3
|
||||
-- punto precedente (punto precedente della faccia [i])
|
||||
ptLoc3 = vFace[i].PPrev
|
||||
-- aggiungo geometria
|
||||
i = i + 1
|
||||
local j = EgtIf( i <= #vFace, i, EgtIf( bClosed, 1, nil))
|
||||
if not j then
|
||||
return true
|
||||
end
|
||||
nFace2 = vFace[j].Fac
|
||||
local j = EgtIf( i < #vFace, i + 1, EgtIf( bClosed, 1, nil))
|
||||
if not j then return true end
|
||||
local nFace2 = vFace[j].Fac
|
||||
-- punto in comune tra le due facce (punto precedente della faccia [j])
|
||||
ptLoc1 = vFace[j].PPrev
|
||||
-- punto precedente (punto precedente della faccia [i])
|
||||
if vFace[i].PPrev then
|
||||
ptLoc3 = vFace[i].PPrev
|
||||
else
|
||||
ptLoc3 = Point3d( vFace[i].Cen:getX(), vFace[i].Cen:getY(), ptLoc1:getZ())
|
||||
end
|
||||
-- punto successivo ( precedente della faccia successiva)
|
||||
j = j + 1
|
||||
local k = EgtIf( j <= #vFace, j, EgtIf( bClosed, 1, nil))
|
||||
local k = EgtIf( j < #vFace, j + 1, EgtIf( bClosed, 1, nil))
|
||||
-- se è un percorso aperto prendo il punto medio della seconda faccia come punto locale 2
|
||||
if not k then
|
||||
ptLoc2 = Point3d( vFace[j-1].Cen:getX(), vFace[j-1].Cen:getY(), ptLoc1:getZ())
|
||||
ptLoc2 = Point3d( vFace[j].Cen:getX(), vFace[j].Cen:getY(), ptLoc1:getZ())
|
||||
else
|
||||
ptLoc2 = vFace[k].PPrev
|
||||
end
|
||||
-- ricavo i punti e l'angolo interno
|
||||
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc, nFace1, nFace2, GDB_ID.ROOT)
|
||||
-- se punti validi e angolo è interno e non è quasi piatto e >= 90 creo istanza
|
||||
local tFacAdj = {}
|
||||
if ptP1 and ptP2 and dAng < 0 and dAng < -6 and dAng > EgtIf( nTypeConeCut == 1, -(90 + 10 * GEO.EPS_SMALL), -(180-dAngleSmall + 10 * GEO.EPS_SMALL)) then
|
||||
local dLen = dist( ptP1, ptP2)
|
||||
table.insert( tFacAdj, { nFace1, nFace2, dLen, ptP1, ptP2, dAng, ptLoc1, ptLoc2, ptLoc3})
|
||||
tFacAdj = { nFace1, nFace2, dLen, ptP1, ptP2, dAng, ptLoc1, ptLoc2, ptLoc3}
|
||||
end
|
||||
-- se ho un elemento creo percorso o percorsi in base al tipo di cono e all'apertura dall'angolo rispetto ai 90°
|
||||
-- con una tolleranza di 2 gradi
|
||||
@@ -1189,9 +1192,9 @@ local function AddMillCorner( nTypeConeCut, vFace, Proc, nRawId, b3Raw,
|
||||
if not bOk then return bOk, sErr end
|
||||
end
|
||||
end
|
||||
else
|
||||
i = i + 1
|
||||
end
|
||||
-- passo alla successiva
|
||||
i = i + 1
|
||||
end
|
||||
-- cancello la copia della superfice
|
||||
if nNewProc then
|
||||
@@ -1399,7 +1402,7 @@ local function MakeByMill( Proc, nFacet, nOthFac, nRawId, b3Raw, dSideDist)
|
||||
-- imposto posizione braccio porta testa
|
||||
local nSCC = MCH_SCC.ADIR_ZP
|
||||
if AreSameOrOppositeVectorApprox( vtN, Z_AX()) then
|
||||
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XP)
|
||||
nSCC = EgtIf( Proc.Box:getDimX() >= Proc.Box:getDimY(), MCH_SCC.ADIR_YP, MCH_SCC.ADIR_XM)
|
||||
end
|
||||
EgtSetMachiningParam( MCH_MP.SCC, nSCC)
|
||||
-- imposto modo di lavorare la faccia
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
==== Wall Update Log ====
|
||||
|
||||
Versione 2.5i3 (21/09/2023)
|
||||
- Modif : per pulizia corner di FreeContour disabilitato metodo con tunnel ed esteso metodo con tre punti
|
||||
- Modif : in LapJoint aggiornata pulizia corner come FreeContour
|
||||
- Fixed : in FreeContour e Lapjoint, in MakeByMill, modificato SCC per correggere caso con lama su testa fresa.
|
||||
|
||||
Versione 2.5i2 (20/09/2023)
|
||||
- Modif : in LapJoint con una sola faccia controllo lavorabilità ora come per FreeContour
|
||||
- Modif : in CleanCorner ora AuxDir (SCC) sempre Z+
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@
|
||||
-- Gestione della versione di Wall
|
||||
|
||||
NAME = 'Wall'
|
||||
VERSION = '2.5i2'
|
||||
VERSION = '2.5i3'
|
||||
MIN_EXE = '2.5b3'
|
||||
|
||||
Reference in New Issue
Block a user