From 4c9080031993a14d1c7cc9783a340227efa5d402 Mon Sep 17 00:00:00 2001 From: SaraP Date: Fri, 22 Jul 2022 14:32:28 +0200 Subject: [PATCH] 3dPrinting : - corretto errore nella creazione wipe. --- LuaLibs/CalcToolPath.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/LuaLibs/CalcToolPath.lua b/LuaLibs/CalcToolPath.lua index 92a0520..9493984 100644 --- a/LuaLibs/CalcToolPath.lua +++ b/LuaLibs/CalcToolPath.lua @@ -124,16 +124,23 @@ end -------------------------------------------------------------------- local function AddRetraction( nCrvId, dCoastingLen, dWipeLen) + -- curva ausiliaria per generare correttamente wipe + local nCopyId = EgtCopyGlob( nCrvId, nCrvId, GDB_IN.AFTER) + EgtCloseCurveCompo( nCopyId) + local ptNewStart = EgtEP( nCrvId) + EgtChangeClosedCurveStartPoint( nCopyId, ptNewStart) + local nCoastingId if dCoastingLen > GEO.EPS_SMALL then nCoastingId = EgtCopyGlob( nCrvId, nCrvId, GDB_IN.AFTER) local dPar = EgtCurveParamAtLength( nCoastingId, EgtCurveLength( nCoastingId) - dCoastingLen) - if not dPar then + if not dPar then + EgtErase( nCopyId) EgtErase( nCoastingId) return - end - EgtTrimCurveStartAtParam( nCoastingId, dPar) - -- aggiorno la curva originale + end + EgtTrimCurveStartAtParam( nCoastingId, dPar) + -- aggiorno la curva originale if dPar > GEO.EPS_SMALL then EgtTrimCurveEndAtParam( nCrvId, dPar) else @@ -145,13 +152,14 @@ local function AddRetraction( nCrvId, dCoastingLen, dWipeLen) end if dWipeLen > GEO.EPS_SMALL then - local nWipeId = EgtCopyGlob( nCrvId, EgtIf( nCoastingId, nCoastingId, nCrvId), GDB_IN.AFTER) + local nWipeId = EgtCopyGlob( nCopyId, nCoastingId or nCrvId, GDB_IN.AFTER) EgtTrimCurveEndAtLen( nWipeId, dWipeLen) EgtSetName( nWipeId, WIPE_CRV) EgtSetInfo( nWipeId, KEY_TYPE, TYPE.WIPE) EgtSetColor( nWipeId, EgtStdColor('TEAL')) end + EgtErase( nCopyId) return nCoastingId end