3dPrinting :

- modifiche a coasting e wipe.
This commit is contained in:
SaraP
2022-05-26 17:39:21 +02:00
parent 64604d81f4
commit 419468c696
3 changed files with 32 additions and 23 deletions
+23 -17
View File
@@ -64,7 +64,7 @@ local function AddLeadIn( nCrvId, LayerParams, nGrpId)
EgtRelocate( nLeadInCrv, nGrpId, GDB_IN.FIRST_SON)
EgtModifyCurveExtrusion( nLeadInCrv, Z_AX(), GDB_RT.GLOB)
EgtSetInfo( nLeadInCrv, KEY_TYPE, TYPE.LINK)
EgtSetColor( nLeadInCrv, EgtStdColor('GRAY'))
end
--------------------------------------------------------------------
@@ -94,37 +94,41 @@ local function AddLeadOut( nCrvId, LayerParams, nGrpId)
EgtRelocate( nLeadOutCrv, nGrpId, GDB_IN.LAST_SON)
EgtModifyCurveExtrusion( nLeadOutCrv, Z_AX(), GDB_RT.GLOB)
EgtSetInfo( nLeadOutCrv, KEY_TYPE, TYPE.LINK)
EgtSetColor( nLeadOutCrv, EgtStdColor('GRAY'))
end
--------------------------------------------------------------------
local function AddRetraction( nCrvId, dCoastingLen, dWipeLen)
if dCoastingLen < GEO.EPS_SMALL and dWipeLen < GEO.EPS_SMALL then return end
local nRetractionId = EgtCopyGlob( nCrvId, nCrvId, GDB_IN.AFTER)
local nCoastingId
if dCoastingLen > GEO.EPS_SMALL then
local dPar = EgtCurveParamAtLength( nRetractionId, EgtCurveLength( nRetractionId) - dCoastingLen)
nCoastingId = EgtCopyGlob( nCrvId, nCrvId, GDB_IN.AFTER)
local dPar = EgtCurveParamAtLength( nCoastingId, EgtCurveLength( nCoastingId) - dCoastingLen)
if not dPar then
EgtErase( nRetractionId)
EgtErase( nCoastingId)
return
end
EgtChangeClosedCurveStart( nRetractionId, dPar)
if not EgtCurveIsClosed( nCrvId) then
EgtTrimCurveStartAtParam( nRetractionId, dPar)
end
EgtTrimCurveStartAtParam( nCoastingId, dPar)
-- aggiorno la curva originale
if dPar > GEO.EPS_SMALL then
EgtTrimCurveEndAtParam( nCrvId, dPar)
else
EgtErase( nCrvId)
end
EgtSetName( nCoastingId, COASTING_CRV)
EgtSetInfo( nCoastingId, KEY_TYPE, TYPE.COASTING)
EgtSetColor( nCoastingId, EgtStdColor('ORANGE'))
end
EgtTrimCurveEndAtLen( nRetractionId, dCoastingLen + dWipeLen)
EgtSetName( nRetractionId, RETRACTION_CRV)
EgtSetInfo( nRetractionId, KEY_TYPE, TYPE.RETRACTION)
return nRetractionId
if dWipeLen > GEO.EPS_SMALL then
local nWipeId = EgtCopyGlob( nCrvId, EgtIf( nCoastingId, nCoastingId, nCrvId), GDB_IN.AFTER)
EgtTrimCurveEndAtLen( nWipeId, dWipeLen)
EgtSetName( nWipeId, WIPE_CRV)
EgtSetInfo( nWipeId, KEY_TYPE, TYPE.WIPE)
EgtSetColor( nWipeId, EgtStdColor('TEAL'))
end
return nCoastingId
end
--------------------------------------------------------------------
@@ -143,8 +147,8 @@ local function AddRetractionOnLastCrv( nTpathGrpId, LayerParams)
else
-- coinvolge parte dell'ultima shell crv
local dNewCoastingLen = LayerParams.dCoastingLen - dLen
local nRetractionId = AddRetraction( nCrvId, dNewCoastingLen, 0.0)
EgtAddCurveCompoCurve( nRetractionId, nLeadOutId)
local nCoastingId = AddRetraction( nCrvId, dNewCoastingLen, 0.0)
EgtAddCurveCompoCurve( nCoastingId, nLeadOutId)
end
end
end
@@ -198,6 +202,7 @@ function CalcToolPath.Exec( nPartId)
EgtInvertCurve( nNewEntId)
end
EgtModifyCurveExtrusion( nNewEntId, Z_AX(), GDB_RT.GLOB)
EgtSetColor( nNewEntId, EgtStdColor('GRAY'))
nEntId = EgtGetNext( nEntId)
end
@@ -244,6 +249,7 @@ function CalcToolPath.Exec( nPartId)
if nLinkId then
EgtRelocate( nLinkId, nCurrId, GDB_IN.BEFORE)
EgtSetColor( nLinkId, EgtStdColor('GRAY'))
EgtModifyCurveExtrusion( nLinkId, Z_AX(), GDB_RT.GLOB)
EgtSetInfo( nLinkId, KEY_TYPE, TYPE.LINK)
end