3dPrinting :
- modifiche a coasting e wipe.
This commit is contained in:
@@ -20,7 +20,8 @@ TOOLPATH_GRP = "ToolPath"
|
||||
LAYER_SRF = "LayerSurf"
|
||||
SHELL_CRV = "Shell"
|
||||
INFILL_CRV = "Infill"
|
||||
RETRACTION_CRV = "Retraction"
|
||||
COASTING_CRV = "Coasting"
|
||||
WIPE_CRV = "Wipe"
|
||||
FRAME_PART = "FramePart"
|
||||
|
||||
MIN_LEN = 1e-3
|
||||
@@ -72,7 +73,8 @@ TYPE = {
|
||||
INNER_SHELL = 2,
|
||||
INFILL = 3,
|
||||
LINK = 4,
|
||||
RETRACTION = 5,
|
||||
COASTING = 5,
|
||||
WIPE = 6,
|
||||
}
|
||||
|
||||
PRINT_ORDER = {
|
||||
|
||||
@@ -116,9 +116,10 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams)
|
||||
|
||||
-- scelta del colore
|
||||
|
||||
local nType = EgtGetInfo( nCrvId, KEY_TYPE, 'i')
|
||||
if nType == TYPE.WIPE then return end
|
||||
-- scelta del colore
|
||||
local Color = EgtStdColor( 'GRAY')
|
||||
if nType == TYPE.OUTER_SHELL then
|
||||
Color = EgtStdColor( 'TEAL')
|
||||
@@ -128,11 +129,11 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams)
|
||||
Color = EgtStdColor( 'GRAY')
|
||||
elseif nType == TYPE.INFILL then
|
||||
Color = EgtStdColor( 'YELLOW')
|
||||
elseif nType == TYPE.RETRACTION then
|
||||
elseif nType == TYPE.COASTING then
|
||||
Color = EgtStdColor( 'BLUE')
|
||||
end
|
||||
|
||||
local nParts = EgtIf( nType == TYPE.LINK or nType == TYPE.RETRACTION, 1, 10)
|
||||
local nParts = EgtIf( nType == TYPE.LINK or nType == TYPE.COASTING, 1, 10)
|
||||
|
||||
local nCopyId = EgtCopyGlob( nCrvId, nSolidGrp)
|
||||
EgtApproxCurve( nCopyId, GDB_CA.ARCS, 0.1)
|
||||
|
||||
+23
-17
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user