3dPrinting :
- piccola correzione a AddRetraction per evitare crash.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user