3dPrinting :

- aggiunto collegamento infill.
This commit is contained in:
SaraP
2023-06-30 12:52:39 +02:00
parent e629f1b12d
commit ba9470ee88
4 changed files with 278 additions and 55 deletions
+17 -3
View File
@@ -44,6 +44,7 @@ local function GetLayerParamsForPathCalc()
LayerParams.nCeilType = EgtGetInfo( s_nPartId, KEY_CEIL_TYPE, 'i') or FILL_TYPE.OFFSET
-- parametri infill
LayerParams.dInfillStrand = EgtGetInfo( s_nPartId, KEY_INFILL_STRAND, 'd') or LayerParams.dStrand
LayerParams.bInfillLink = EgtGetInfo( s_nPartId, KEY_INFILL_LINK, 'b') or false
LayerParams.dInfillOverlap = EgtGetInfo( s_nPartId, KEY_INFILL_OVERLAP, 'd') or 0
LayerParams.nInfillType = EgtGetInfo( s_nPartId, KEY_INFILL_TYPE, 'i') or FILL_TYPE.NONE
@@ -320,9 +321,15 @@ local function CalcInfillPaths( nLayId, nInfillGrp, LayerParams)
if bNoOverlap then
EgtOutLog( 'Warning : Infill without correct overlap (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
end
for i = 1, #vIds do
local nNewId = EgtCopyGlob( vIds[i], nInfillPathGrp)
-- eventuale inversione della curva per link
if LayerParams.bInfillLink and i % 2 == 0 then
EgtInvertCurve( nNewId)
UpdateInvertInfo( nNewId)
end
-- faccio trim con la superficie
local nRes, nCnt = EgtTrimCurveWithRegion( nNewId, nTrimSrf, true, true)
for nId = nRes, nRes + nCnt - 1 do
@@ -2917,7 +2924,7 @@ local function AddExtraZigZag( nSrf, sName, dStrand, vtSlicing, nGrp, nSrfTrim)
end
-------------------------------------------------------------------
local function ComputeAuxSolidsGenericInfill( nSrf, dStrand, vtSlicing, sName, nPathGrp, vPtStart, nOrigSurf, dOverlap, nAuxSolidsGrp)
local function ComputeAuxSolidsGenericInfill( nSrf, dStrand, vtSlicing, sName, nPathGrp, vPtStart, nOrigSurf, dOverlap, nAuxSolidsGrp, bLink)
-- estraggo i contorni della superficie ( perimetro)
GetPathsFromSurf( nSrf, sName, TYPE.AUX_SOLID, nPathGrp, vPtStart)
@@ -2948,6 +2955,12 @@ local function ComputeAuxSolidsGenericInfill( nSrf, dStrand, vtSlicing, sName, n
-- eseguo trim con la superficie
for i = 1, #vInfillIds do
local nCrv = EgtCopyGlob( vInfillIds[i], nPathGrp)
-- eventuale inversione della curva per link
if bLink and i % 2 == 0 then
EgtInvertCurve( nCrv)
UpdateInvertInfo( nCrv)
end
local nRes, nCnt = EgtTrimCurveWithRegion( nCrv, nSrfTrim, true, true)
for nId = nRes, nRes + nCnt - 1 do
-- verifico se lunghezza minima
@@ -3003,6 +3016,7 @@ local function CalcAuxSolidsPaths( nSliceGrp, nSolidGrp, LayerParams, vPtStart)
local dStrand = EgtGetInfo( vSolidIds[i][1], KEY_AUX_SOLIDS_STRAND, 'd')
local dOverlap = EgtGetInfo( vSolidIds[i][1], KEY_AUX_SOLIDS_OVERLAP, 'd')
local nOrigSurf = EgtGetInfo( vSolidIds[i][1], KEY_ORIGINAL_SURF, 'i')
local bInfillLink = EgtGetInfo( vSolidIds[i][1], KEY_AUX_SOLIDS_INFILL_LINK, 'b')
local nSrfId = EgtSurfFlatRegion( nSolidPathGrp, vSolidIds[i])
if nSrfId then
@@ -3046,7 +3060,7 @@ local function CalcAuxSolidsPaths( nSliceGrp, nSolidGrp, LayerParams, vPtStart)
UpdateTrimSurfWithAuxSolidsZigZag( nSolidPathGrp, sNewName, nSrfBase, dStrand, nFirst + j)
else
ComputeAuxSolidsGenericInfill( nFirst + j, dStrand, LayerParams.vtSlicing, sNewName, nSolidPathGrp, vPtStart, nOrigSurf, dOverlap, nSolidGrp)
ComputeAuxSolidsGenericInfill( nFirst + j, dStrand, LayerParams.vtSlicing, sNewName, nSolidPathGrp, vPtStart, nOrigSurf, dOverlap, nSolidGrp, bInfillLink)
-- aggiorno la trim surf
UpdateTrimSurfWithAuxSolidsOffset( nFirst + j, nSrfBase, dStrand, nSolidPathGrp)
end