3dPrinting 2.5j2 :
- aggiunta possibilità di unire i setti alla shell interna - migliorie varie.
This commit is contained in:
+61
-58
@@ -1872,7 +1872,8 @@ local function SpiralVase( vLayIds, LayerParams)
|
||||
local vCrvGrpIds = EgtGetNameInGroup( vLayIds[ nIdx], CONTOUR_GRP.."*")
|
||||
if #vCrvGrpIds > 1 then
|
||||
-- se più di un gruppo di curve warning
|
||||
EgtOutLog( 'Warning : in spiral vase mode more than one curve (layer '..tostring( nIdx)..') - CalcToolPath')
|
||||
EgtOutBox( 'Error in spiral vase : layer ' .. tostring( nIdx) .. ' has more than one toolpath', 'ToolPathCalc')
|
||||
return false
|
||||
end
|
||||
|
||||
for i = 1, #vCrvGrpIds do
|
||||
@@ -1895,65 +1896,67 @@ local function SpiralVase( vLayIds, LayerParams)
|
||||
end
|
||||
|
||||
-- creo il percorso di lavoro :
|
||||
local nEntId = EgtGetFirstInGroup( nPathGrpId)
|
||||
while nEntId do
|
||||
local nNewEntId = EgtCopyGlob( nEntId, nTpathGrpId, GDB_IN.LAST_SON)
|
||||
|
||||
local vtMove = V_NULL()
|
||||
-- eventuale spostamento dell'altezza layer
|
||||
if nSlicingType == SLICING_TYPE.DEG45_X or nSlicingType == SLICING_TYPE.DEG45_Y then
|
||||
vtMove = LayerParams.dLayHeight * LayerParams.vtSlicing
|
||||
EgtMove( nNewEntId, vtMove, GDB_RT.GLOB)
|
||||
end
|
||||
|
||||
EgtModifyCurveExtrusion( nNewEntId, LayerParams.vtSlicing, GDB_RT.GLOB)
|
||||
EgtSetInfo( nNewEntId, KEY_CRV_STRAND, LayerParams.dStrand)
|
||||
|
||||
-- eventuale inversione
|
||||
if LayerParams.bInvert then
|
||||
EgtInvertCurve( nNewEntId)
|
||||
EgtSetInfo( nNewEntId, KEY_INVERTED_CRV, 1)
|
||||
end
|
||||
EgtSetColor( nNewEntId, EgtStdColor('GRAY'))
|
||||
|
||||
-- se primo layer
|
||||
if bFirst and nNewEntId then
|
||||
-- mi sposto dell'altezza layer
|
||||
EgtMove( nNewEntId, LayerParams.dLayHeight * LayerParams.vtSlicing, GDB_RT.GLOB)
|
||||
-- eventuale lead in
|
||||
if LayerParams.nLeadInType ~= LEAD_TYPE.NONE then
|
||||
EgtTrimCurveStartAtLen( nNewEntId, LayerParams.dOffsetLP)
|
||||
AddLeadIn( nNewEntId, LayerParams, nTpathGrpId)
|
||||
end
|
||||
bFirst = false
|
||||
else
|
||||
local ptOld = EgtEP( nOldId, GDB_ID.ROOT)
|
||||
local ptNew = EgtSP( nNewEntId, GDB_ID.ROOT)
|
||||
if dist( ptNew, ptOld) < LayerParams.dStrand then
|
||||
-- se i punti sono vicini ma non coincidenti modifico la curva per avere transizione più uniforme
|
||||
if not AreSamePointApprox( ptOld, ptNew) then
|
||||
-- recupero la curva da usare come guida
|
||||
local nGuideId = EgtCopyGlob( nOldPathId, nTpathGrpId)
|
||||
-- la porto alla stessa quota del toolpath
|
||||
EgtMove( nGuideId, vtMove + LayerParams.dLayHeight * LayerParams.vtSlicing, GDB_RT.GLOB)
|
||||
EgtChangeClosedCurveStartPoint( nGuideId, ptOld, GDB_RT.GLOB)
|
||||
|
||||
EgtSpiralizeCurveAlongGuide( nNewEntId, nGuideId)
|
||||
EgtErase( nGuideId)
|
||||
end
|
||||
else
|
||||
EgtOutLog( 'Warning : in spiral vase mode no link betweeen toolpaths (layer '..tostring( nIdx)..') - CalcToolPath')
|
||||
-- aggiungo uscita, coasting e wipe sulla curva precedente
|
||||
AddSpiralVaseLeadOut( nOldId, LayerParams)
|
||||
end
|
||||
EgtSpiralizeCurveAlongExtrusion( nNewEntId, LayerParams.dLayHeight)
|
||||
end
|
||||
|
||||
nOldPathId = nEntId
|
||||
nOldId = nNewEntId
|
||||
nEntId = EgtGetNext( nEntId)
|
||||
local vEntIds = EgtGetAllInGroup( nPathGrpId)
|
||||
if #vEntIds > 1 then
|
||||
EgtOutBox( 'Error in spiral vase : layer ' .. tostring( nIdx) .. ' has more than one toolpath', 'ToolPathCalc')
|
||||
return false
|
||||
end
|
||||
|
||||
local nNewEntId = EgtCopyGlob( vEntIds[1], nTpathGrpId, GDB_IN.LAST_SON)
|
||||
|
||||
local vtMove = V_NULL()
|
||||
-- eventuale spostamento dell'altezza layer
|
||||
if nSlicingType == SLICING_TYPE.DEG45_X or nSlicingType == SLICING_TYPE.DEG45_Y then
|
||||
vtMove = LayerParams.dLayHeight * LayerParams.vtSlicing
|
||||
EgtMove( nNewEntId, vtMove, GDB_RT.GLOB)
|
||||
end
|
||||
|
||||
EgtModifyCurveExtrusion( nNewEntId, LayerParams.vtSlicing, GDB_RT.GLOB)
|
||||
EgtSetInfo( nNewEntId, KEY_CRV_STRAND, LayerParams.dStrand)
|
||||
|
||||
-- eventuale inversione
|
||||
if LayerParams.bInvert then
|
||||
EgtInvertCurve( nNewEntId)
|
||||
EgtSetInfo( nNewEntId, KEY_INVERTED_CRV, 1)
|
||||
end
|
||||
EgtSetColor( nNewEntId, EgtStdColor('GRAY'))
|
||||
|
||||
-- se primo layer
|
||||
if bFirst and nNewEntId then
|
||||
-- mi sposto dell'altezza layer
|
||||
EgtMove( nNewEntId, LayerParams.dLayHeight * LayerParams.vtSlicing, GDB_RT.GLOB)
|
||||
-- eventuale lead in
|
||||
if LayerParams.nLeadInType ~= LEAD_TYPE.NONE then
|
||||
EgtTrimCurveStartAtLen( nNewEntId, LayerParams.dOffsetLP)
|
||||
AddLeadIn( nNewEntId, LayerParams, nTpathGrpId)
|
||||
end
|
||||
bFirst = false
|
||||
else
|
||||
local ptOld = EgtEP( nOldId, GDB_ID.ROOT)
|
||||
local ptNew = EgtSP( nNewEntId, GDB_ID.ROOT)
|
||||
if dist( ptNew, ptOld) < LayerParams.dStrand then
|
||||
-- se i punti sono vicini ma non coincidenti modifico la curva per avere transizione più uniforme
|
||||
if not AreSamePointApprox( ptOld, ptNew) then
|
||||
-- recupero la curva da usare come guida
|
||||
local nGuideId = EgtCopyGlob( nOldPathId, nTpathGrpId)
|
||||
-- la porto alla stessa quota del toolpath
|
||||
EgtMove( nGuideId, vtMove + LayerParams.dLayHeight * LayerParams.vtSlicing, GDB_RT.GLOB)
|
||||
EgtChangeClosedCurveStartPoint( nGuideId, ptOld, GDB_RT.GLOB)
|
||||
|
||||
EgtSpiralizeCurveAlongGuide( nNewEntId, nGuideId)
|
||||
EgtErase( nGuideId)
|
||||
end
|
||||
else
|
||||
EgtOutLog( 'Warning : in spiral vase mode no link betweeen toolpaths (layer '..tostring( nIdx)..') - CalcToolPath')
|
||||
-- aggiungo uscita, coasting e wipe sulla curva precedente
|
||||
AddSpiralVaseLeadOut( nOldId, LayerParams)
|
||||
end
|
||||
EgtSpiralizeCurveAlongExtrusion( nNewEntId, LayerParams.dLayHeight)
|
||||
end
|
||||
|
||||
nOldPathId = vEntIds[1]
|
||||
nOldId = nNewEntId
|
||||
|
||||
-- aggiorno il box dei toolpath
|
||||
local b3Box = ComputeToolPathBox( nTpathGrpId)
|
||||
b3Tot:Add( b3Box)
|
||||
|
||||
Reference in New Issue
Block a user