DataWall 2.5l1 :

- in FreeContour correzione a MakeCustomPath per calcolare correttamente puliture spigoli di tipo 2 (Clean 30) e 3 (Gola di Scarico)
- in LapJoint aggiunta segnalazione lavorazione tipo Side non trovata.
This commit is contained in:
Dario Sassi
2023-10-02 13:24:03 +02:00
parent 09ce7d2d01
commit 33deb8b5e3
3 changed files with 40 additions and 33 deletions
+31 -29
View File
@@ -1,4 +1,4 @@
-- ProcessFreeContour.lua by Egaltech s.r.l. 2023/09/26
-- ProcessFreeContour.lua by Egaltech s.r.l. 2023/10/02
-- 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.
@@ -24,6 +24,7 @@
-- 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.
-- 2023/10/02 Correzione a MakeCustomPath per calcolare correttamente puliture spigoli di tipo 2 (Clean 30) e 3 (Gola di Scarico).
-- Tabella per definizione modulo
local WPF = {}
@@ -629,41 +630,48 @@ end
---------------------------------------------------------------------
local function MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick, bClosed)
-- creo il percorso di lavorazione come contorni inferiori delle facce
local nPath = {}
local nPathData = {}
for i = 1, #vGeom do
local dAng
-- ottengo curva inferiore 1
local ptP1, ptP2, ptP3, vtV1, vtV2, dDim1, dDim2 = EgtSurfTmFacetOppositeSide( vGeom[i][1], vGeom[i][2], Z_AX() , GDB_ID.ROOT)
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 bClosed then
-- ricavo i punti e l'angolo interno
_, _, _, dAng = EgtSurfTmFacetsContact( vGeom[i][1], vGeom[i][2], vGeom[1][2], GDB_ID.ROOT)
else
dAng = 0
end
local ptP1, _, ptP3 = EgtSurfTmFacetOppositeSide( vGeom[i][1], vGeom[i][2], Z_AX() , GDB_ID.ROOT)
-- creo linea
local nId1 = EgtLine( nAddGrpId, ptP1, ptP3, GDB_RT.GLOB)
table.insert( nPath, nId1)
table.insert( nPathData, {nId1, dAng})
end
-- creo il percorso e poi lo offsetto del raggio utensile
local AuxId = EgtCurveCompo( nAddGrpId, nPath, true)
EgtOffsetCurve( AuxId, dMillDiam / 2, GDB_OT.EXTEND)
-- offsetto a destra il percorso del raggio utensile
EgtOffsetCurve( AuxId, dMillDiam / 2, GDB_OT.FILLET)
-- spezzo il percorso nelle entità componenti
local nId1st, nIdCount = EgtExplodeCurveCompo( AuxId)
-- se il numero entità è diverso da quelle iniziali esco con errore
if nIdCount ~= #vGeom then
if not nId1st then
local sErr = 'Error : cannot make offset path'
return 0, sErr
end
-- calcolo angoli tra le entità consecutive
local nPathData = {}
local nIdLast = nId1st + nIdCount - 1
for i = nId1st, nIdLast do
if i < nIdLast or bClosed then
local j = EgtIf( i < nIdLast, i + 1, nId1st)
local vtDirFin = EgtEV( i, GDB_ID.ROOT)
local vtDirSta = EgtSV( j, GDB_ID.ROOT)
local dAng = GetAngleXY( vtDirFin, vtDirSta)
local vtBisett = -vtDirFin + vtDirSta
if not vtBisett:normalize() then
vtBisett = VectorFromRotated( vtDirFin, Z_AX(), -90)
end
table.insert( nPathData, { i, dAng, vtBisett})
end
end
-- resetto la tabella
nPath = {}
AuxId = nil
-- in base al tipo di ripresa spigolo modifico il percorso
if nConeCut == 2 then
-- acquisisco la lunghezza utensile
@@ -690,13 +698,10 @@ local function MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick, bC
table.insert( nPath, ( nId1st + i - 1))
-- se non è la linea finale e l'angolo tra le due facce è ammesso
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
nPathData[i][2] < -5 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[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
local vtExtrExit = nPathData[i][3]
vtExtrExit:normalize()
-- linea intermedia (componente lunghezza utensile in direzione bisettrice)
local pEnd = ptP1 + ( dLenAdd * vtExtrExit)
@@ -718,15 +723,12 @@ local function MakeCustomPath( vGeom, nConeCut, dMillDiam, nAddGrpId, dThick, bC
-- se non è la linea finale e l'angolo tra le due facce è ammesso
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, 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
local vtExtrExit = nPathData[i][3]
vtExtrExit:normalize()
vtExtrExit = -vtExtrExit
-- calcolo di quanto entrare
local dLenAdd = abs( (dMillDiam/2) / cos( nPathData[i][2]/2)) + dExtraCorner - (dMillDiam/2)
local dLenAdd = abs( (dMillDiam/2) / cos( nPathData[i][2]/2)) + dExtraCorner - ( dMillDiam / 2)
-- linea intermedia (componente lunghezza utensile in direzione bisettrice)
local pEnd = ptP1 + ( dLenAdd * vtExtrExit)
local nAuxId = EgtLine( nAddGrpId, ptP1, pEnd, GDB_RT.GLOB)