3dPrinting :

- sistemate le tolleranze nel calcolo delle superfici per gestire errore con extra shell spezzata.
This commit is contained in:
SaraP
2024-01-18 10:39:46 +01:00
parent af03fe39d8
commit ff59ee3e5b
+6 -6
View File
@@ -14,7 +14,7 @@ local AMD = require( 'AddManData')
---------------------------------------------------------------------
local s_nPartId
local s_dOffsCorr = 50 * GEO.EPS_SMALL
local s_dOffsCorr = 20 * GEO.EPS_SMALL
local s_vErr = {}
local s_nCurrIdx
local s_vtSlicing
@@ -108,7 +108,7 @@ end
--------------------------------------------------------------------
local function ComputeTrimSurf( nSrf, nGrpId, dStrand, dOverlap)
local nTrimSurf = ComputeSurfOffset( nSrf, nGrpId, - dStrand * ( 0.5 - dOverlap / 100) + s_dOffsCorr)
local nTrimSurf = ComputeSurfOffset( nSrf, nGrpId, - dStrand * ( 0.5 - dOverlap / 100) + 2 * s_dOffsCorr)
local bNoOverlap = false
if not nTrimSurf and dOverlap > GEO.EPS_SMALL then
-- tento senza overlap
@@ -3216,7 +3216,7 @@ local function UpdateTrimSurfWithRibsMergedShell( nPathGrp, sName, LayerParams)
-- calcolo la regione occupata dalla nuova shell
local nType = EgtGetInfo( vNewShells[i], KEY_TYPE, 'i')
dStrand = EgtIf( nType == TYPE.OUTER_SHELL or nType == TYPE.EXTRA_OUTER_SHELL, LayerParams.dStrand, LayerParams.dInnerStrand)
local nSrfShell = EgtSurfFrFatCurve( nCrvGrp, vNewShells[i], dStrand * 0.5 + 0.5 * s_dOffsCorr, false, false, s_dOffsTol)
local nSrfShell = EgtSurfFrFatCurve( nCrvGrp, vNewShells[i], dStrand * 0.5 + s_dOffsCorr, false, false, s_dOffsTol)
if nSrfShell then
if not EgtSurfFrSubtract( nNewTrimSurf, nSrfShell) then
EgtOutLog( 'Error : EgtSurfFrSubtract with ribs-merged shell for TotTrimSurfRegion failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
@@ -3528,7 +3528,7 @@ end
--------------------------------------------------------------------
local function UpdateTrimSurfWithExtraShell( nSrf, nCrv, dStrand, nGrpId)
local nSrfExtraShell = EgtSurfFrFatCurve( nGrpId, nCrv, dStrand * 0.5 + s_dOffsCorr * 0.5, true, false, s_dOffsTol)
local nSrfExtraShell = EgtSurfFrFatCurve( nGrpId, nCrv, dStrand * 0.5 + s_dOffsCorr, true, false, s_dOffsTol)
if nSrfExtraShell then
if not EgtSurfFrSubtract( nSrf, nSrfExtraShell) then
EgtOutLog( 'Error : EgtSurfFrSubtract with ExtraShell for TotTrimSurfRegion failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
@@ -3841,8 +3841,8 @@ local function CalcExtraShellsPath( nMaxShellNbrDiff, nShellNbrGrp, nCrvGrpId, d
local nOffs, nOffsCnt = EgtOffsetCurveAdv( nCrvT, - dOffs, GDB_OT.FILLET, s_dOffsTol)
for nCrvOffs = nOffs, nOffs + nOffsCnt - 1 do
-- calcolo la regione con cui fare trim
local nTrimSurf, bNoOverlap = ComputeTrimSurf( nTotShellTrim, nGrpTmp, dCurrStrand, LayerParams.dStrandOverlap)
-- calcolo la regione con cui fare trim ( con correzione extra per evitare tratti on)
local nTrimSurf, bNoOverlap = ComputeTrimSurf( nTotShellTrim, nGrpTmp, dCurrStrand - 10 * s_dOffsCorr, LayerParams.dStrandOverlap)
if not nTrimSurf then
-- errore nel calcolo della superficie di trim
EgtOutLog( 'Error : creation of ExtraShell failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')