3dPrinting :

- piccola correzione a AddRetraction per evitare crash.
This commit is contained in:
DarioS
2022-12-20 11:05:16 +01:00
parent ef49a211ab
commit 5e3def88fa
2 changed files with 11 additions and 12 deletions
+9 -10
View File
@@ -1,4 +1,4 @@
-- CalcToolPath.lua by Egaltech s.r.l. 2022/10/01
-- CalcToolPath.lua by Egaltech s.r.l. 2022/12/20
-- Calcolo percorsi di lavoro per Stampa 3d
-- Tabella per definizione modulo
@@ -234,18 +234,18 @@ end
--------------------------------------------------------------------
local function AddRetraction( nCrvId, vtSlicing, dCoastingLen, dWipeLen, dWipeDir)
-- recupero i parametri per retrazione
local nType = EgtGetInfo( nCrvId, KEY_TYPE, 'i')
local bClosed = EgtGetInfo( nCrvId, KEY_CLOSED_CRV, 'b') or false
local bInverted = EgtGetInfo( nCrvId, KEY_INVERTED_CRV, 'b') or false
-- 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)
@@ -272,9 +272,9 @@ local function AddRetraction( nCrvId, vtSlicing, dCoastingLen, dWipeLen, dWipeDi
local nWipeId
if bClosed then
-- se era chiusa ( quindi analogo alle shell)
nWipeId = EgtCopyGlob( nCopyId, nCoastingId or nCrvId, GDB_IN.AFTER)
nWipeId = nCopyId
nCopyId = nil
EgtTrimCurveEndAtLen( nWipeId, dWipeLen)
else
-- se extra shell, infill a zigzag, spiral vase o rib che non termina sulla parete
local vtDir = EgtEV( nCoastingId or nCrvId, GDB_ID.ROOT)
@@ -298,8 +298,7 @@ local function AddRetraction( nCrvId, vtSlicing, dCoastingLen, dWipeLen, dWipeDi
ptE = ptS + vtDir * dWipeLen
k = k + 1
end
nWipeId = EgtCurveCompoFromPoints( EgtGetParent( nCrvId), {ptS, ptE}, GDB_RT.GLOB)
nWipeId = EgtCurveCompoFromPoints( EgtGetParent( nCoastingId or nCrvId), {ptS, ptE}, GDB_RT.GLOB)
EgtModifyCurveExtrusion( nWipeId, vtSlicing, GDB_RT.GLOB)
EgtRelocateGlob( nWipeId, nCoastingId or nCrvId, GDB_IN.AFTER)
end
@@ -308,8 +307,8 @@ local function AddRetraction( nCrvId, vtSlicing, dCoastingLen, dWipeLen, dWipeDi
EgtSetInfo( nWipeId, KEY_TYPE, TYPE.WIPE)
EgtSetColor( nWipeId, EgtStdColor('AQUA'))
end
EgtErase( nCopyId)
if nCopyId then EgtErase( nCopyId) end
return nCoastingId
end