3dPrinting :

- slicing a 90°.
This commit is contained in:
SaraP
2022-10-20 17:23:48 +02:00
parent 217bb4f26e
commit d875e31491
6 changed files with 113 additions and 76 deletions
+59 -40
View File
@@ -15,6 +15,7 @@ local AMD = require( 'AddManData')
---------------------------------------------------------------------
local s_nPartId
local s_nDefaultWipeAng = -90 -- angolo = 0° per wipe significa che esce ortogonalmente alla direzione del movimento
local s_dHMin
---------------------------------------------------------------------
local function GetLayerParamsForToolPathCalc()
@@ -33,7 +34,7 @@ local function GetLayerParamsForToolPathCalc()
LayerParams.nLeadOutType = EgtGetInfo( s_nPartId, KEY_LEAD_OUT_TYPE, 'i')
LayerParams.dLeadOutTangDist = EgtGetInfo( s_nPartId, KEY_LEAD_OUT_TANG_DIST, 'd')
LayerParams.dLeadOutOrthoDist = EgtGetInfo( s_nPartId, KEY_LEAD_OUT_ORTHO_DIST, 'd')
LayerParams.dOffsetLP = EgtGetInfo( s_nPartId, KEY_OFFSET_LEAD_POINT, 'd')
LayerParams.dOffsetLP = EgtGetInfo( s_nPartId, KEY_OFFSET_LEAD_POINT, 'd')
LayerParams.dSPOffs = EgtGetInfo( s_nPartId, KEY_SP_OFFSET_ON_SLICE, 'd')
LayerParams.dCoastingLen = EgtGetInfo( s_nPartId, KEY_COASTING_LEN, 'd')
LayerParams.dWipeLen = EgtGetInfo( s_nPartId, KEY_WIPE_LEN, 'd')
@@ -56,6 +57,8 @@ local function ComputeZCorrection( LayerParams)
local vtN = LayerParams.vtSlicing
local dNxy = sqrt( vtN:getX() * vtN:getX() + vtN:getY() * vtN:getY())
local dNz = vtN:getZ()
-- altezza necessaria per ugello
s_dHMin = LayerParams.dTDiam / 2 * dNxy
-- correzione per l'offset
local dCorr1 = LayerParams.dOffs * dNxy
-- correzione per il diametro dell'ugello
@@ -146,7 +149,7 @@ local function AddLeadIn( nCrvId, LayerParams, nGrpId)
vtOrtho:rotate( LayerParams.vtSlicing, dAng)
local ptS = ptE - LayerParams.dLeadInTangDist * vtTang + LayerParams.dLeadInOrthoDist * vtOrtho
-- verifico che non affondi nella tavola
if ptS:getZ() < GEO.EPS_SMALL then return end
if ptS:getZ() < s_dHMin + GEO.EPS_SMALL then return end
local nLeadInCrv
if LayerParams.nLeadInType == LEAD_TYPE.LINEAR then
@@ -196,7 +199,7 @@ local function AddLeadOut( nCrvId, LayerParams, nGrpId)
end
--------------------------------------------------------------------
local function AddRetraction( nCrvId, vtSlicing, dTDiam, dCoastingLen, dWipeLen, dWipeDir)
local function AddRetraction( nCrvId, vtSlicing, dCoastingLen, dWipeLen, dWipeDir)
-- recupero i parametri per retrazione
local nType = EgtGetInfo( nCrvId, KEY_TYPE, 'i')
@@ -255,9 +258,8 @@ local function AddRetraction( nCrvId, vtSlicing, dTDiam, dCoastingLen, dWipeLen,
local ptS = EgtEP( nCoastingId or nCrvId)
local ptE = ptS + vtDir * dWipeLen
-- verifico soddisfi altezza minima per dimensioni utensile
local dHMin = 0.5 * dTDiam * sqrt( vtSlicing:getX() * vtSlicing:getX() + vtSlicing:getY() * vtSlicing:getY())
local k = 1
while ptE:getZ() < dHMin + GEO.EPS_SMALL and k < 36 do
local k = 1
while ptE:getZ() < s_dHMin + GEO.EPS_SMALL and k < 36 do
vtDir:rotate( vtSlicing, EgtIf( bChangeSign, 10, -10))
ptE = ptS + vtDir * dWipeLen
k = k + 1
@@ -281,27 +283,28 @@ end
local function AddRetractionOnLastCrv( nCrvId, nTpathGrpId, LayerParams, dCoastingLen, dWipeLen, dWipeDir)
if LayerParams.nLeadOutType == LEAD_TYPE.NONE then
AddRetraction( nCrvId, LayerParams.vtSlicing, LayerParams.dTDiam, dCoastingLen, dWipeLen, dWipeDir)
AddRetraction( nCrvId, LayerParams.vtSlicing, dCoastingLen, dWipeLen, dWipeDir)
else
local nLeadOutId = EgtGetLastInGroup( nTpathGrpId)
local dLen = EgtCurveLength( nLeadOutId)
if dLen > dCoastingLen - 500 * GEO.EPS_SMALL then
-- coinvolge solo la curva di lead out
local dNewCoastingLen = EgtIf( abs( dCoastingLen - dLen) < 500 * GEO.EPS_SMALL, dLen, dCoastingLen) -- verifico se interamente coinvolta
AddRetraction( nLeadOutId, LayerParams.vtSlicing, LayerParams.dTDiam, dNewCoastingLen, dWipeLen, dWipeDir)
AddRetraction( nLeadOutId, LayerParams.vtSlicing, dNewCoastingLen, dWipeLen, dWipeDir)
else
-- coinvolge parte dell'ultima shell crv
local dNewCoastingLen = dCoastingLen - dLen
local nCoastingId = AddRetraction( nCrvId, LayerParams.vtSlicing, LayerParams.dTDiam, dNewCoastingLen, 0.0, dWipeDir)
local nCoastingId = AddRetraction( nCrvId, LayerParams.vtSlicing, dNewCoastingLen, 0.0, dWipeDir)
EgtAddCurveCompoCurve( nCoastingId, nLeadOutId)
EgtSetInfo( nCoastingId, KEY_CLOSED_CRV, 0)
-- wipe
AddRetraction( nCoastingId, LayerParams.vtSlicing, LayerParams.dTDiam, 0, dWipeLen, dWipeDir)
AddRetraction( nCoastingId, LayerParams.vtSlicing, 0, dWipeLen, dWipeDir)
end
end
end
--------------------------------------------------------------------
local function VerifyRibsLink( nLinkId, nCurr, nNext, dStrand)
local function VerifyRibsLink( nLinkId, nCurr, nNext, dStrand, nGrpTmp)
local nGrp = EgtGetParent( nCurr)
@@ -323,9 +326,11 @@ local function VerifyRibsLink( nLinkId, nCurr, nNext, dStrand)
-- verifico se il link interseca una delle altre costolature
local vRibsIds = EgtGetNameInGroup( nGrp, RIBS_CRV .. '*')
local nLinkLoc = EgtCopyGlob( nLinkId, nGrpTmp)
for i = 1, #vRibsIds do
if vRibsIds[i] ~= nCurr and vRibsIds[i] ~= nNext then
local ptInt = EgtIP( nLinkId, vRibsIds[i], ORIG())
local nCrvLoc = EgtCopyGlob( vRibsIds[i], nGrpTmp)
local ptInt = EgtIP( nLinkLoc, nCrvLoc, ORIG())
if ptInt then
return false
end
@@ -337,7 +342,7 @@ local function VerifyRibsLink( nLinkId, nCurr, nNext, dStrand)
end
--------------------------------------------------------------------
local function CalcRibsLink( nCurr, nNext, nLoopGrp, dStrand, bForceLink, vtSlicing)
local function CalcRibsLink( nCurr, nNext, nLoopGrp, dStrand, bForceLink, vtSlicing, nGrpTmp)
local ptS = EgtEP( nCurr)
local ptE = EgtSP( nNext)
@@ -380,7 +385,7 @@ local function CalcRibsLink( nCurr, nNext, nLoopGrp, dStrand, bForceLink, vtSlic
EgtSetInfo( nLinkId, KEY_TYPE, TYPE.RIB)
if bInvert then EgtInvertCurve( nLinkId) end
-- verifico se è valido
local bValid = VerifyRibsLink( nLinkId, nCurr, nNext, dStrand)
local bValid = VerifyRibsLink( nLinkId, nCurr, nNext, dStrand, nGrpTmp)
if not bValid then
EgtErase( nLinkId)
EgtErase( nCopyId)
@@ -404,7 +409,7 @@ local function CalcRibsLink( nCurr, nNext, nLoopGrp, dStrand, bForceLink, vtSlic
-- se non ho trovato un collegamento sul bordo, creo una linea tra ptS e ptE
if bForceLink then
local nLinkId = EgtCurveCompoFromPoints( EgtGetParent( nCurr), {ptS, ptE})
local bValid = VerifyRibsLink( nLinkId, nCurr, nNext, dStrand)
local bValid = VerifyRibsLink( nLinkId, nCurr, nNext, dStrand, nGrpTmp)
if bValid then
EgtSetInfo( nLinkId, KEY_TYPE, TYPE.RIB)
EgtModifyCurveExtrusion( nLinkId, vtSlicing, GDB_RT.GLOB)
@@ -417,7 +422,7 @@ local function CalcRibsLink( nCurr, nNext, nLoopGrp, dStrand, bForceLink, vtSlic
end
--------------------------------------------------------------------
local function VerifyRibsLead( nId, nRibId, dStrand, bInVsOut)
local function VerifyRibsLead( nId, nRibId, dStrand, bInVsOut, nGrpTmp)
local nGrp = EgtGetParent( nRibId)
local nLeadId = EgtCopyGlob( nId, nGrp)
@@ -461,9 +466,11 @@ local function VerifyRibsLead( nId, nRibId, dStrand, bInVsOut)
-- verifico non intersechi altri setti
local vRibsIds = EgtGetNameInGroup( EgtGetParent( nRibId), RIBS_CRV .. '*')
local nLeadLoc = EgtCopyGlob( nLeadId, nGrpTmp)
for i = 1, #vRibsIds do
if vRibsIds[i] ~= nRibId then
local ptInt = EgtIP( nLeadId, vRibsIds[i], ORIG())
local nCrvLoc = EgtCopyGlob( vRibsIds[i], nGrpTmp)
local ptInt = EgtIP( nLeadLoc, nCrvLoc, ORIG())
if ptInt then
EgtErase( nLeadId)
return false
@@ -504,7 +511,7 @@ local function VerifyRibsLead( nId, nRibId, dStrand, bInVsOut)
end
-------------------------------------------------------------------
local function FindCorrectRibsLead( dPar, nCrv, nCrvOffs, bLeadInvert, dLeadLen, dStrand, bInVsOut)
local function FindCorrectRibsLead( dPar, nCrv, nCrvOffs, bLeadInvert, dLeadLen, dStrand, bInVsOut, nGrpTmp)
local nLeadId
local bInvert = bLeadInvert -- valore di default è quello settato nel file dei parametri
@@ -547,7 +554,7 @@ local function FindCorrectRibsLead( dPar, nCrv, nCrvOffs, bLeadInvert, dLeadLen,
if bInvert then EgtInvertCurve( nLeadId) end
EgtTrimCurveEndAtLen( nLeadId, dLeadLen)
if bInVsOut then EgtInvertCurve( nLeadId) end
if VerifyRibsLead( nLeadId, nCrv, dStrand, bInVsOut) then
if VerifyRibsLead( nLeadId, nCrv, dStrand, bInVsOut, nGrpTmp) then
-- se valido aggiorno le curve per prossimi lead in/out
if bInvert then
EgtTrimCurveEndAtLen( nMainCrv, EgtCurveLength( nCrvOffs) - dLeadLen)
@@ -565,7 +572,7 @@ local function FindCorrectRibsLead( dPar, nCrv, nCrvOffs, bLeadInvert, dLeadLen,
if not bInvert then EgtInvertCurve( nLeadId) end
EgtTrimCurveEndAtLen( nLeadId, dLeadLen)
if bInVsOut then EgtInvertCurve( nLeadId) end
if VerifyRibsLead( nLeadId, nCrv, dStrand, bInVsOut) then
if VerifyRibsLead( nLeadId, nCrv, dStrand, bInVsOut, nGrpTmp) then
if bInvert then
EgtTrimCurveStartAtLen( nOtherCrv, dLeadLen)
else
@@ -584,7 +591,7 @@ local function FindCorrectRibsLead( dPar, nCrv, nCrvOffs, bLeadInvert, dLeadLen,
end
--------------------------------------------------------------------
local function AddRibsLeadIn( nCrv, nLoopsGrp, dStrand, vtSlicing)
local function AddRibsLeadIn( nCrv, nLoopsGrp, dStrand, vtSlicing, nGrpTmp)
local dLILen = EgtGetInfo( nCrv, KEY_RIBS_LEAD_IN_LEN, 'd')
local bLIInvert = EgtGetInfo( nCrv, KEY_RIBS_LEAD_IN_INVERT, 'b')
@@ -598,7 +605,7 @@ local function AddRibsLeadIn( nCrv, nLoopsGrp, dStrand, vtSlicing)
local dParS = EgtCurveParamAtPoint( nCrvOffs, ptS)
if dParS then
local nLeadIn = FindCorrectRibsLead( dParS, nCrv, nCrvOffs, bLIInvert, dLILen, dStrand, true)
local nLeadIn = FindCorrectRibsLead( dParS, nCrv, nCrvOffs, bLIInvert, dLILen, dStrand, true, nGrpTmp)
-- se lead in possibile
if nLeadIn then
EgtModifyCurveExtrusion( nLeadIn, vtSlicing)
@@ -613,7 +620,7 @@ local function AddRibsLeadIn( nCrv, nLoopsGrp, dStrand, vtSlicing)
end
--------------------------------------------------------------------
local function AddRibsLeadOut( nCrv, nTPathGrp, nLoopsGrp, vtSlicing, dStrand, dTDiam)
local function AddRibsLeadOut( nCrv, nTPathGrp, nLoopsGrp, vtSlicing, dStrand, nGrpTmp)
local dRibsLOLen = EgtGetInfo( nCrv, KEY_RIBS_LEAD_OUT_LEN, 'd')
local dRibsLOCoasting = EgtGetInfo( nCrv, KEY_RIBS_LEAD_OUT_COASTING, 'd')
@@ -639,7 +646,7 @@ local function AddRibsLeadOut( nCrv, nTPathGrp, nLoopsGrp, vtSlicing, dStrand, d
local nWipe
-- trovo curva opportuna per lead out
local nCrvRef, bInvert = FindCorrectRibsLead( dParE, nCrv, nCrvOffs, bRibsLOInvert, dRibsLOLen + dRibsLOCoasting, dStrand, false)
local nCrvRef, bInvert = FindCorrectRibsLead( dParE, nCrv, nCrvOffs, bRibsLOInvert, dRibsLOLen + dRibsLOCoasting, dStrand, false, nGrpTmp)
if nCrvRef then
-- verifico se la curva ha lunghezza sufficiente
@@ -681,9 +688,8 @@ local function AddRibsLeadOut( nCrv, nTPathGrp, nLoopsGrp, vtSlicing, dStrand, d
vtE:rotate( vtSlicing, EgtIf( bInvert, - dAng, dAng))
local ptFinal = ptE + vtE * dRibsLOWipe
-- verifico soddisfi altezza minima per dimensioni utensile
local dHMin = 0.5 * dTDiam * sqrt( vtSlicing:getX() * vtSlicing:getX() + vtSlicing:getY() * vtSlicing:getY())
local k = 1
while ptFinal:getZ() < dHMin + GEO.EPS_SMALL and k < 36 do
while ptFinal:getZ() < s_dHMin + GEO.EPS_SMALL and k < 36 do
vtE:rotate( vtSlicing, EgtIf( bInvert, - 10, 10))
ptFinal = ptE + vtE * dRibsLOWipe
k = k + 1
@@ -698,7 +704,7 @@ local function AddRibsLeadOut( nCrv, nTPathGrp, nLoopsGrp, vtSlicing, dStrand, d
end
else
-- aggiungo coasting e wipe come sulle shell normali
AddRetraction( nCrv, vtSlicing, dTDiam, dRibsLOCoasting, dRibsLOWipe, dRibsLOWipeAng)
AddRetraction( nCrv, vtSlicing, dRibsLOCoasting, dRibsLOWipe, dRibsLOWipeAng)
end
return
end
@@ -707,13 +713,17 @@ local function AddRibsLeadOut( nCrv, nTPathGrp, nLoopsGrp, vtSlicing, dStrand, d
end
-- se non ho trovato curva sul bordo su cui fare il lead out aggiungo coasting e wipe come sulle shell normali
AddRetraction( nCrv, vtSlicing, dTDiam, dRibsLOCoasting, dRibsLOWipe, dRibsLOWipeAng)
AddRetraction( nCrv, vtSlicing, dRibsLOCoasting, dRibsLOWipe, dRibsLOWipeAng)
end
---------------------------------------------------------------------
local function CalcRibsToolPath( nCrvGrp, nTpathGrpId, LayerParams, dCorrZ)
-- gruppo temporaneo con sistema di riferimento locale per conti
local frLoc = Frame3d( ORIG(), LayerParams.vtSlicing)
local nGrpTmp = EgtGroup( nCrvGrp, frLoc)
local nRibsGrp = EgtGetFirstNameInGroup( nCrvGrp, RIBS_GRP)
-- aggiungo le costolature nel toolpath
local vEntIds = EgtGetNameInGroup( nRibsGrp, RIBS_CRV .. '*')
@@ -803,15 +813,15 @@ local function CalcRibsToolPath( nCrvGrp, nTpathGrpId, LayerParams, dCorrZ)
-- collego le passate di una stessa costolatura
for i = 1, #tabRibs do
for j = 1, #tabRibs[i] - 1 do
CalcRibsLink( tabRibs[i][j], tabRibs[i][j + 1], nLoopGrp, LayerParams.dStrand, true, LayerParams.vtSlicing)
CalcRibsLink( tabRibs[i][j], tabRibs[i][j + 1], nLoopGrp, LayerParams.dStrand, true, LayerParams.vtSlicing, nGrpTmp)
if not bSpecialCase then
-- creo link fittizio per eliminare tratto corrispondente sulla curva di offset
local nFakeLink = CalcRibsLink( tabRibs[i][j + 1], tabRibs[i][j], nLoopGrp, LayerParams.dStrand, false, LayerParams.vtSlicing)
local nFakeLink = CalcRibsLink( tabRibs[i][j + 1], tabRibs[i][j], nLoopGrp, LayerParams.dStrand, false, LayerParams.vtSlicing, nGrpTmp)
EgtErase( nFakeLink)
end
end
if bSpecialCase then
local nFakeLink = CalcRibsLink( tabRibs[i][#tabRibs[i]], tabRibs[i][1], nLoopGrp, LayerParams.dStrand, false, LayerParams.vtSlicing)
local nFakeLink = CalcRibsLink( tabRibs[i][#tabRibs[i]], tabRibs[i][1], nLoopGrp, LayerParams.dStrand, false, LayerParams.vtSlicing, nGrpTmp)
EgtErase( nFakeLink)
end
end
@@ -819,7 +829,7 @@ local function CalcRibsToolPath( nCrvGrp, nTpathGrpId, LayerParams, dCorrZ)
if LayerParams.bRibsLink then
for i = 1, #tabRibs - 1 do
local nCnt = #tabRibs[i]
CalcRibsLink( tabRibs[i][nCnt], tabRibs[i + 1][1], nLoopGrp, LayerParams.dStrand, false, LayerParams.vtSlicing)
CalcRibsLink( tabRibs[i][nCnt], tabRibs[i + 1][1], nLoopGrp, LayerParams.dStrand, false, LayerParams.vtSlicing, nGrpTmp)
end
end
@@ -829,15 +839,18 @@ local function CalcRibsToolPath( nCrvGrp, nTpathGrpId, LayerParams, dCorrZ)
-- verifico se necessario lead in
local nPrev = EgtGetPrev( nCrvRib)
if not nPrev or EgtGetName( nPrev) then
AddRibsLeadIn( nCrvRib, nLoopGrp, LayerParams.dStrand, LayerParams.vtSlicing)
AddRibsLeadIn( nCrvRib, nLoopGrp, LayerParams.dStrand, LayerParams.vtSlicing, nGrpTmp)
end
-- verifico se necessario lead out
local nNext = EgtGetNext( nCrvRib)
if not nNext or EgtGetName( nNext) then
AddRibsLeadOut( nCrvRib, nTpathGrpId, nLoopGrp, LayerParams.vtSlicing, LayerParams.dStrand, LayerParams.dTDiam)
AddRibsLeadOut( nCrvRib, nTpathGrpId, nLoopGrp, LayerParams.vtSlicing, LayerParams.dStrand, nGrpTmp)
end
nCrvRib = EgtGetNextName( nCrvRib, RIBS_CRV .. '*')
end
EgtErase( nGrpTmp)
end
---------------------------------------------------------------------
@@ -896,7 +909,7 @@ local function CalcAuxSolidsToolPath( nAuxSolidsGrp, nAuxSolidsPathGrp, nTpathGr
local nNextId = EgtGetNext( vNewEntIds[i]) or GDB_ID.NULL
local nType = EgtGetInfo( nNextId, KEY_TYPE, 'i')
if nType ~= TYPE.LINK then
AddRetraction( vNewEntIds[i], LayerParams.vtSlicing, LayerParams.dTDiam, dCoastingLen, dWipeLen, dWipeDir)
AddRetraction( vNewEntIds[i], LayerParams.vtSlicing, dCoastingLen, dWipeLen, dWipeDir)
end
end
end
@@ -918,7 +931,7 @@ local function AddSpiralVaseLeadOut( nOldId, LayerParams)
end
AddRetractionOnLastCrv( nOldId, EgtGetParent( nOldId), LayerParams, LayerParams.dCoastingLen, LayerParams.dWipeLen, LayerParams.dWipeDir)
else
AddRetraction( nOldId, LayerParams.vtSlicing, LayerParams.dTDiam, LayerParams.dCoastingLen, LayerParams.dWipeLen, LayerParams.dWipeDir)
AddRetraction( nOldId, LayerParams.vtSlicing, LayerParams.dCoastingLen, LayerParams.dWipeLen, LayerParams.dWipeDir)
end
end
@@ -1042,7 +1055,13 @@ function CalcToolPath.Exec( nPartId)
-- se necessario sposto anche il solido di partenza
if dCorrZ > 10 * GEO.EPS_SMALL then
local vtMove = Vector3d( 0, 0, dCorrZ) + LayerParams.dLayHeight / 2 * LayerParams.vtSlicing
local vtMove = Vector3d( 0, 0, dCorrZ)
-- se slicing a 45° aggiungo correzione anche in direzione dello slicing
local nSlicingType = EgtGetInfo( s_nPartId, KEY_SLICING_TYPE, 'i') or 1
local bSlicing45 = EgtGetInfo( s_nPartId, KEY_SLICING_45, 'b') or false -- da rimuovere
if nSlicingType == SLICING_TYPE.DEG45 or bSlicing45 then
vtMove = vtMove + LayerParams.dLayHeight / 2 * LayerParams.vtSlicing
end
local SolidLayId = EgtGetFirstNameInGroup( s_nPartId, PRINT_SOLID)
if SolidLayId then
EgtSetInfo( s_nPartId, KEY_MOVED_PART, vtMove)
@@ -1162,7 +1181,7 @@ function CalcToolPath.Exec( nPartId)
local bClosed = EgtGetInfo( nId, KEY_CLOSED_CRV, 'b') or false
local dCoastingLen = EgtIf( ( nType == TYPE.EXTRA_SHELL or nType == TYPE.EXTRA_OUTER_SHELL) and not bClosed, LayerParams.dShellNbrCoasting, LayerParams.dCoastingLen)
local dWipeLen = EgtIf( ( nType == TYPE.EXTRA_SHELL or nType == TYPE.EXTRA_OUTER_SHELL) and not bClosed, LayerParams.dShellNbrWipe, LayerParams.dWipeLen)
local dWipeDir = EgtIf( ( nType == TYPE.EXTRA_SHELL or nType == TYPE.EXTRA_OUTER_SHELL) and not bClosed, LayerParams.dShellNbrWipeDir, 0)
local dWipeDir = EgtIf( ( nType == TYPE.EXTRA_SHELL or nType == TYPE.EXTRA_OUTER_SHELL) and not bClosed, LayerParams.dShellNbrWipeDir, LayerParams.dWipeDir)
if nId == nLastId then
AddRetractionOnLastCrv( nId, nTpathGrpId, LayerParams, dCoastingLen, dWipeLen, dWipeDir)
@@ -1171,9 +1190,9 @@ function CalcToolPath.Exec( nPartId)
if EgtGetInfo( nNextId, KEY_TYPE, 'i') ~= TYPE.LINK then
-- aggiungo retrazione
if nId == nFirstId then
AddRetraction( nId, LayerParams.vtSlicing, LayerParams.dTDiam, dCoastingLen, EgtIf( LayerParams.nLeadInType == LEAD_TYPE.NONE, dWipeLen, 0), dWipeDir)
AddRetraction( nId, LayerParams.vtSlicing, dCoastingLen, EgtIf( LayerParams.nLeadInType == LEAD_TYPE.NONE, dWipeLen, 0), dWipeDir)
else
AddRetraction( nId, LayerParams.vtSlicing, LayerParams.dTDiam, dCoastingLen, dWipeLen, dWipeDir)
AddRetraction( nId, LayerParams.vtSlicing, dCoastingLen, dWipeLen, dWipeDir)
end
end
end