3dPrinting :

- gestione setti chiusi
- correzioni varie nelle regioni con diverse passate.
This commit is contained in:
SaraP
2023-01-03 16:36:47 +01:00
parent b2cba54453
commit d576203a97
2 changed files with 67 additions and 33 deletions
+24 -16
View File
@@ -374,7 +374,7 @@ local function CalcExtraShellToolPath( vEntIds, nTpathGrpId, LayerParams, dCorrZ
if not vEntIds then return end
-- aggiungo le curve nel toolpath
local vIds = AddCurvesToToolPath( vEntIds, nTpathGrpId, LayerParams.nOrder, false, LayerParams.vtSlicing, LayerParams.dLayHeight, dCorrZ)
local vIds = AddCurvesToToolPath( vEntIds, nTpathGrpId, PRINT_ORDER.EXT_INT, false, LayerParams.vtSlicing, LayerParams.dLayHeight, dCorrZ)
-- aggiungo gli opportuni raccordi
local sPrevName = EgtGetName( vIds[1])
@@ -576,6 +576,7 @@ local function CalcRibsLink( nCurr, nNext, nLoopGrp, dStrand, bForceLink, vtSlic
EgtTrimCurveStartEndAtParam( nLinkId, dParS, dParE)
EgtSetInfo( nLinkId, KEY_TYPE, TYPE.RIB)
EgtSetName( nLinkId, LINK_CRV)
if bInvert then EgtInvertCurve( nLinkId) end
-- verifico se è valido
local bValid = VerifyRibsLink( nLinkId, nCurr, nNext, dStrand, nGrpTmp)
@@ -605,6 +606,7 @@ local function CalcRibsLink( nCurr, nNext, nLoopGrp, dStrand, bForceLink, vtSlic
local bValid = VerifyRibsLink( nLinkId, nCurr, nNext, dStrand, nGrpTmp)
if bValid then
EgtSetInfo( nLinkId, KEY_TYPE, TYPE.RIB)
EgtSetName( nLinkId, LINK_CRV)
EgtModifyCurveExtrusion( nLinkId, vtSlicing, GDB_RT.GLOB)
EgtRelocateGlob( nLinkId, nCurr, GDB_IN.AFTER)
else
@@ -998,9 +1000,11 @@ local function CalcRibsToolPath( nRibsGrp, nTpathGrpId, LayerParams, dCorrZ)
end
-- oriento tutte le passate relative ad una stessa costolatura
for j = 1, #tabRibs[i] do
if ( bInvert and j % 2 == 1) or ( not bInvert and j % 2 == 0) then
EgtInvertCurve( tabRibs[i][j])
if not EgtCurveIsClosed( tabRibs[i][1]) then
for j = 1, #tabRibs[i] do
if ( bInvert and j % 2 == 1) or ( not bInvert and j % 2 == 0) then
EgtInvertCurve( tabRibs[i][j])
end
end
end
end
@@ -1008,7 +1012,7 @@ local function CalcRibsToolPath( nRibsGrp, nTpathGrpId, LayerParams, dCorrZ)
-- Link
-- se modifiche nell'ordine ricalcolo i gruppi di costolature
if bSwap then
if bSwap then
tabRibs = {}
nFirst = EgtGetFirstNameInGroup( nTpathGrpId, RIBS_CRV .. '*')
while nFirst do
@@ -1021,18 +1025,22 @@ local function CalcRibsToolPath( nRibsGrp, 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, 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, nGrpTmp)
if EgtCurveIsClosed( tabRibs[i][1]) then
-- AddLink( tabRibs[i], nTpathGrpId, LayerParams.nLinkType, LayerParams.dLinkParam, LayerParams.dSPOffs, LayerParams.dStrand, LayerParams.vtSlicing)
else
for j = 1, #tabRibs[i] - 1 do
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, nGrpTmp)
EgtErase( nFakeLink)
end
end
if bSpecialCase then
local nFakeLink = CalcRibsLink( tabRibs[i][#tabRibs[i]], tabRibs[i][1], 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, nGrpTmp)
EgtErase( nFakeLink)
end
end
-- se necessario collego le diverse costolature
@@ -1050,12 +1058,12 @@ local function CalcRibsToolPath( nRibsGrp, nTpathGrpId, LayerParams, dCorrZ)
while nCrvRib do
-- verifico se necessario lead in
local nPrev = EgtGetPrev( nCrvRib)
if not nPrev or EgtGetName( nPrev) then
if not nPrev or EgtGetName( nPrev) ~= LINK_CRV then
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
if not nNext or EgtGetName( nNext) ~= LINK_CRV then
AddRibsLeadOut( nCrvRib, nTpathGrpId, nLoopGrp, LayerParams.vtSlicing, LayerParams.dStrand, nGrpTmp)
end
nCrvRib = EgtGetNextName( nCrvRib, RIBS_CRV .. '*')