LapJoint - CleanCorner piccola correzione

This commit is contained in:
daniele.nicoli
2026-07-09 09:48:34 +02:00
parent 771a56d832
commit f077b2c204
+13 -5
View File
@@ -6780,9 +6780,9 @@ local function AddMillCorner( vFace, Proc, dToolDiam, nAddGrpId, nMasterNewProc,
end
end
-- punto successivo ( precedente della faccia successiva)
local k = EgtIf( j < #vFace, j + 1, 1)
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 bClosed then
if not k then
if vFace[j].PNoSucc then
ptLoc2 = vFace[j].PNoSucc
elseif abs( vtN:getZ()) > abs( vtN:getY()) then
@@ -6791,7 +6791,15 @@ local function AddMillCorner( vFace, Proc, dToolDiam, nAddGrpId, nMasterNewProc,
ptLoc2 = Point3d( vFace[j].Cen:getX(), ptLoc1:getY(), vFace[j].Cen:getZ())
end
else
ptLoc2 = vFace[k].PPrev
if vFace[j].PNoSucc then
ptLoc2 = vFace[j].PNoSucc
elseif vFace[k].PPrev then
ptLoc2 = vFace[k].PPrev
elseif abs( vtN:getZ()) > abs( vtN:getY()) then
ptLoc2 = Point3d( vFace[j].Cen:getX(), vFace[j].Cen:getY(), ptLoc1:getZ())
else
ptLoc2 = Point3d( vFace[j].Cen:getX(), ptLoc1:getY(), vFace[j].Cen:getZ())
end
end
-- ricavo i punti e l'angolo interno
local _, ptP1, ptP2, dAng = EgtSurfTmFacetsContact( nNewProc.Id, nFace1, nFace2, GDB_ID.ROOT)
@@ -6930,7 +6938,7 @@ local function GetCleanCornerFacesData( nNewProc, dToolDiam, dToolMaxDepth, dToo
local bAdj, ptLocP1, ptLocP2, dAng = EgtSurfTmFacetsContact( nNewProc, nPrecFac, nFac, GDB_ID.ROOT)
-- salvo i dati
vFace[i] = { Fac = nFac, Cen = ptCen, Norm = vtN, Len = dLen, Width = dWidth, AngPrev = EgtIf( bAdj, dAng, 0)}
if not bAdj then
if not bAdj and Proc.Fct > 3 then
vFace[i].PNoPrev = GetCleanCornerPointIfNoAdj( nNewProc, Proc, nFac, vFace[i], nil, nil)
end
-- verifico che l'adiacenza sia veramente con il precedente (percorro con normale a destra)
@@ -6955,7 +6963,7 @@ local function GetCleanCornerFacesData( nNewProc, dToolDiam, dToolMaxDepth, dToo
end
end
local bAdj_2, ptLocP1_2, ptLocP2_2, dAng_2 = EgtSurfTmFacetsContact( nNewProc, nFac, nFac+1, GDB_ID.ROOT)
if not bAdj_2 then
if not bAdj_2 and Proc.Fct > 3 then
vFace[i].PNoSucc = GetCleanCornerPointIfNoAdj( nNewProc, Proc, nFac, vFace[i], ptLocP1, ptLocP2)
end
end