diff --git a/LuaLibs/AddManData.lua b/LuaLibs/AddManData.lua index ff56ca8..2aefe40 100644 --- a/LuaLibs/AddManData.lua +++ b/LuaLibs/AddManData.lua @@ -102,6 +102,7 @@ KEY_INFILL_TYPE = 'InfillType' KEY_INFILL_DENSITY = 'InfillDensity' KEY_INFILL_LINK = 'InfillLink' KEY_INFILL_OVERLAP = 'InfillOverlap' +KEY_INFILL_STRAND_OVERLAP = 'InfillStrandOverlap' KEY_INFILL_GRID_OVERLAP = 'InfillGridOverlap' KEY_INFILL_DIR = 'InfillDirection' KEY_INFILL_OFFSET_X = 'InfillOffsetX' diff --git a/LuaLibs/CalcPaths.lua b/LuaLibs/CalcPaths.lua index 7f08e8c..49ea9f3 100644 --- a/LuaLibs/CalcPaths.lua +++ b/LuaLibs/CalcPaths.lua @@ -51,6 +51,7 @@ local function GetLayerParamsForPathCalc() if LayerParams.dInfillStrand < GEO.EPS_SMALL then LayerParams.dInfillStrand = LayerParams.dStrand end LayerParams.bInfillLink = EgtGetInfo( s_nPartId, KEY_INFILL_LINK, 'b') or false LayerParams.dInfillOverlap = EgtGetInfo( s_nPartId, KEY_INFILL_OVERLAP, 'd') or 0 + LayerParams.dInfillStrandOverlap = EgtGetInfo( s_nPartId, KEY_INFILL_STRAND_OVERLAP, 'd') or 0 LayerParams.nInfillType = EgtGetInfo( s_nPartId, KEY_INFILL_TYPE, 'i') or FILL_TYPE.NONE -- eventuale modifica dei parametri per gestire correttamente il caso spiral vase @@ -657,22 +658,15 @@ local function GetZigZagDirection( nSrfId, nBorderSurf, dStrand, nGrp, frLoc, nT -- verifico se ho direzione definita nei layer precedenti local nPrevSlice = EgtGetPrevName( nSliceLayId, SLICE_LAYER .. '*') - local nPrevPrevSlice = EgtGetPrevName( nPrevSlice or GDB_ID.NULL, SLICE_LAYER .. '*') - if nPrevPrevSlice then - vtDir = EgtGetInfo( nPrevPrevSlice, sInfoKey, 'v') + if nPrevSlice then + vtDir = EgtGetInfo( nPrevSlice, sInfoKey, 'v') end - if not vtDir then - -- se è definita sul layer precedente la ruoto di 90° rispetto a Z ( visto che siamo in un frame locale a vtSlicing) altrimenti la calcolo in modo che sia quella ottimale - if nPrevSlice then - vtDir = EgtGetInfo( nPrevSlice, sInfoKey, 'v') - if vtDir then - vtDir:rotate( Z_AX(), 90) - end - end - if not vtDir then - vtDir = FindOptimalZigZagDirection( nSrfId, nBorderSurf, dStrand, nGrp, frLoc) - end + -- se è definita sul layer precedente la ruoto di 90° rispetto a Z ( visto che siamo in un frame locale a vtSlicing) altrimenti la calcolo in modo che sia quella ottimale + if vtDir then + vtDir:rotate( Z_AX(), 90) + else + vtDir = FindOptimalZigZagDirection( nSrfId, nBorderSurf, dStrand, nGrp, frLoc) end EgtSetInfo( nSliceLayId, sInfoKey, vtDir) @@ -741,7 +735,7 @@ local function CalcSolidFillPath( nLayId, LayerParams, nStartLay, nFillType) end -- distanza tra passate tenendo conto dell'overlap indicato - local dDist = ( 1 - LayerParams.dStrandOverlap / 100) * LayerParams.dInfillStrand + local dDist = ( 1 - LayerParams.dInfillStrandOverlap / 100) * LayerParams.dInfillStrand -- inserisco il riempimento if nFillType == FILL_TYPE.OFFSET then -- recupero le shell precedenti dal PathGrp