3dPrinting 3.1g1 :
- gestione di più solidi da stampare contemporaneamente nel gruppo "PrintSolid".
This commit is contained in:
@@ -196,7 +196,6 @@ KEY_MAX_SLICES_NBR = 'MaxSlicesNumber'
|
||||
KEY_SLICE_NBR = 'SliceNbr'
|
||||
KEY_SLICE_DIR = 'SliceDir'
|
||||
KEY_SLICE_POS = 'SlicePos'
|
||||
KEY_SLICE_DELTAZ = 'DeltaZ'
|
||||
KEY_ZIG_ZAG_INFILL = 'ZigZagInfill'
|
||||
KEY_ZIG_ZAG_DIR = 'ZigZagDir'
|
||||
KEY_INVERTED_CRV = 'InvertedCrv'
|
||||
@@ -204,6 +203,7 @@ KEY_CLOSED_CRV = 'ClosedCrv'
|
||||
KEY_ASSOCIATED_SURF = 'AssociatedSurf'
|
||||
KEY_ASSOCIATED_CRVS = 'AssociatedCrvs'
|
||||
KEY_ORIGINAL_SURF = 'OriginalSurf'
|
||||
KEY_ORIGINAL_SOLID = 'OriginalSolid'
|
||||
KEY_HAS_SOLIDS = 'Solids'
|
||||
KEY_BOX_MIN_Z = 'PartBoxMinZ'
|
||||
KEY_ORIGINAL_START_POINT = 'OriginalStartPoint'
|
||||
@@ -307,7 +307,6 @@ RIB_TYPE = {
|
||||
---------------------------------------------------------------------
|
||||
TABLE = 'Table'
|
||||
PART = 'Part'
|
||||
ORIGINAL_SOLID = 'OriginalSolid'
|
||||
PRINT_SOLID = 'PrintSolid'
|
||||
LAY_MACH_START = 'MachStart'
|
||||
LAY_RIBS = 'Ribs'
|
||||
|
||||
+192
-201
@@ -358,26 +358,23 @@ end
|
||||
--------------------------------------------------------------------
|
||||
------------------------- INFILL -----------------------------------
|
||||
--------------------------------------------------------------------
|
||||
local function CalcInfillPaths( nLayId, nInfillGrp, LayerParams)
|
||||
local function CalcInfillPaths( nCrvGrp, nInfillGrp, LayerParams)
|
||||
|
||||
if not nInfillGrp then return end
|
||||
|
||||
-- recupero le curve di infill
|
||||
local vIds = EgtGetAllInGroup( nInfillGrp)
|
||||
if not vIds or #vIds == 0 then return end
|
||||
|
||||
-- scorro i gruppi di curve
|
||||
local vCrvGrps = EgtGetNameInGroup( nLayId, CONTOUR_GRP .. '*')
|
||||
for i = 1, #vCrvGrps do
|
||||
|
||||
-- recupero le curve di infill legate al solido del CrvGrp corrente
|
||||
local nOrigStm = EgtGetInfo( nCrvGrp, KEY_ORIGINAL_SOLID, 'i')
|
||||
local vIds = EgtGetNameInGroup( nInfillGrp, INFILL_CRV .. tostring( nOrigStm) .. '*') or {}
|
||||
if #vIds > 0 then
|
||||
|
||||
-- creo il gruppo per infill
|
||||
local nInfillPathGrp = EgtGroup( vCrvGrps[i])
|
||||
local nInfillPathGrp = EgtGroup( nCrvGrp)
|
||||
EgtSetName( nInfillPathGrp, INFILL_GRP)
|
||||
EgtSetStatus( nInfillPathGrp, GDB_ST.OFF)
|
||||
EgtSetInfo( nInfillPathGrp, KEY_FILL_TYPE, LayerParams.nInfillType)
|
||||
|
||||
-- recupero la superficie occupata dalle shell
|
||||
local nSrfBase = EgtGetFirstNameInGroup( vCrvGrps[i], TOT_SHELL_TRIM_SURF)
|
||||
local nSrfBase = EgtGetFirstNameInGroup( nCrvGrp, TOT_SHELL_TRIM_SURF)
|
||||
if not nSrfBase then
|
||||
-- se non esiste non c'è spazio per infill
|
||||
EgtOutLog( 'Warning : Infill not possibile (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
@@ -395,10 +392,10 @@ local function CalcInfillPaths( nLayId, nInfillGrp, LayerParams)
|
||||
EgtOutLog( 'Warning : Infill without correct overlap (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
end
|
||||
|
||||
for i = 1, #vIds do
|
||||
local nNewId = EgtCopyGlob( vIds[i], nInfillPathGrp)
|
||||
for j = 1, #vIds do
|
||||
local nNewId = EgtCopyGlob( vIds[j], nInfillPathGrp)
|
||||
-- eventuale inversione della curva per link
|
||||
if LayerParams.bInfillLink and i % 2 == 0 then
|
||||
if LayerParams.bInfillLink and j % 2 == 0 then
|
||||
EgtInvertCurve( nNewId)
|
||||
UpdateInvertInfo( nNewId)
|
||||
end
|
||||
@@ -641,13 +638,17 @@ local function GetZigZagDirection( nSrfId, nBorderSurf, dStrand, nGrp, frLoc, nT
|
||||
local vtDir
|
||||
|
||||
local sInfoKey = KEY_ZIG_ZAG_DIR
|
||||
-- l'info è legata all'id del solido
|
||||
if nType == TYPE.AUX_SOLID then
|
||||
-- l'info è legata all'id del solido
|
||||
local vsSolidName = EgtSplitString( sName, '_')
|
||||
local nAuxSolidGrp = EgtGetFirstNameInGroup( nSliceLayId, AUX_SOLIDS_GRP)
|
||||
local nOrigCrvId = EgtGetFirstNameInGroup( nAuxSolidGrp, vsSolidName[1])
|
||||
local sOrigSolidId = EgtGetInfo( nOrigCrvId, KEY_ORIGINAL_SURF)
|
||||
sInfoKey = sInfoKey .. '_' .. sOrigSolidId
|
||||
else
|
||||
local nCrvGrp = EgtGetParent( nGrp)
|
||||
local sOrigSolidId = EgtGetInfo( nCrvGrp, KEY_ORIGINAL_SOLID)
|
||||
sInfoKey = sInfoKey .. '_' .. sOrigSolidId
|
||||
end
|
||||
|
||||
-- controllo se info già presente sul layer per altri chunk
|
||||
@@ -703,62 +704,57 @@ local function ComputeZigZagSolidFill( nSrf, dStrand, sName, nType, nGrp, nBorde
|
||||
end
|
||||
|
||||
------------------------------------------------------------------
|
||||
local function CalcSolidFillPath( nLayId, LayerParams, nStartLay, nFillType)
|
||||
local function CalcSolidFillPath( nCrvGrp, nLayId, LayerParams, nStartLay, nFillType)
|
||||
|
||||
-- scorro i gruppi di curve
|
||||
local vCrvGrps = EgtGetNameInGroup( nLayId, CONTOUR_GRP .. '*')
|
||||
for i = 1, #vCrvGrps do
|
||||
|
||||
-- creo il gruppo per infill
|
||||
local nInfillPathGrp = EgtGroup( vCrvGrps[i])
|
||||
EgtSetName( nInfillPathGrp, INFILL_GRP)
|
||||
EgtSetStatus( nInfillPathGrp, GDB_ST.OFF)
|
||||
EgtSetInfo( nInfillPathGrp, KEY_FILL_TYPE, nFillType)
|
||||
|
||||
-- recupero la superficie occupata dalle shell
|
||||
local nSrfBase = EgtGetFirstNameInGroup( vCrvGrps[i], TOT_SHELL_TRIM_SURF)
|
||||
if not nSrfBase then
|
||||
-- se non esiste non c'è spazio per solid fill
|
||||
-- creo il gruppo per infill
|
||||
local nInfillPathGrp = EgtGroup( nCrvGrp)
|
||||
EgtSetName( nInfillPathGrp, INFILL_GRP)
|
||||
EgtSetStatus( nInfillPathGrp, GDB_ST.OFF)
|
||||
EgtSetInfo( nInfillPathGrp, KEY_FILL_TYPE, nFillType)
|
||||
|
||||
-- recupero la superficie occupata dalle shell
|
||||
local nSrfBase = EgtGetFirstNameInGroup( nCrvGrp, TOT_SHELL_TRIM_SURF)
|
||||
if not nSrfBase then
|
||||
-- se non esiste non c'è spazio per solid fill
|
||||
EgtOutLog( 'Warning : SolidFill not possibile (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
else
|
||||
-- calcolo la superficie da riempire
|
||||
local nSrfToFill, bNoOverlap = ComputeTrimSurf( nSrfBase, nInfillPathGrp, LayerParams.dInfillStrand, LayerParams.dInfillOverlap)
|
||||
if not nSrfToFill then
|
||||
-- errore
|
||||
EgtOutLog( 'Error : creation of SolidFill region failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of SolidFill region failed')
|
||||
elseif nSrfToFill == GDB_ID.NULL then
|
||||
EgtOutLog( 'Warning : SolidFill not possibile (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
else
|
||||
-- calcolo la superficie da riempire
|
||||
local nSrfToFill, bNoOverlap = ComputeTrimSurf( nSrfBase, nInfillPathGrp, LayerParams.dInfillStrand, LayerParams.dInfillOverlap)
|
||||
if not nSrfToFill then
|
||||
-- errore
|
||||
EgtOutLog( 'Error : creation of SolidFill region failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of SolidFill region failed')
|
||||
elseif nSrfToFill == GDB_ID.NULL then
|
||||
EgtOutLog( 'Warning : SolidFill not possibile (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
else
|
||||
if bNoOverlap then
|
||||
EgtOutLog( 'Warning : SolidFill without correct overlap (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
end
|
||||
|
||||
-- distanza tra passate tenendo conto dell'overlap indicato
|
||||
local dDist = ( 1 - LayerParams.dInfillStrandOverlap / 100) * LayerParams.dInfillStrand
|
||||
-- inserisco il riempimento
|
||||
if nFillType == FILL_TYPE.OFFSET then
|
||||
-- recupero le shell precedenti dal PathGrp
|
||||
local nPathGrp = EgtGetFirstNameInGroup( vCrvGrps[i], PATH_GRP)
|
||||
local nLast = EgtGetLastNameInGroup( nPathGrp, SHELL_CRV .. '*') or EgtGetLastNameInGroup( nPathGrp, EXTRA_SHELL_CRV .. '*')
|
||||
local vOldIds = EgtGetNameInGroup( nPathGrp, EgtGetName( nLast))
|
||||
if not ComputeOffsetShells( nSrfToFill, dDist, INFILL_CRV, TYPE.INFILL, nInfillPathGrp, nStartLay, vOldIds) then
|
||||
EgtOutLog( 'Error : creation of SolidFill failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of SolidFill failed')
|
||||
end
|
||||
elseif nFillType == FILL_TYPE.ZIGZAG then
|
||||
ComputeZigZagSolidFill( nSrfToFill, dDist, INFILL_CRV, TYPE.INFILL, nInfillPathGrp, nil, nLayId)
|
||||
end
|
||||
|
||||
-- avendo riempito la regione, la TotShellTrimSurf non deve esistere
|
||||
EgtErase( nSrfBase)
|
||||
if bNoOverlap then
|
||||
EgtOutLog( 'Warning : SolidFill without correct overlap (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
end
|
||||
|
||||
-- distanza tra passate tenendo conto dell'overlap indicato
|
||||
local dDist = ( 1 - LayerParams.dInfillStrandOverlap / 100) * LayerParams.dInfillStrand
|
||||
-- inserisco il riempimento
|
||||
if nFillType == FILL_TYPE.OFFSET then
|
||||
-- recupero le shell precedenti dal PathGrp
|
||||
local nPathGrp = EgtGetFirstNameInGroup( nCrvGrp, PATH_GRP)
|
||||
local nLast = EgtGetLastNameInGroup( nPathGrp, SHELL_CRV .. '*') or EgtGetLastNameInGroup( nPathGrp, EXTRA_SHELL_CRV .. '*')
|
||||
local vOldIds = EgtGetNameInGroup( nPathGrp, EgtGetName( nLast))
|
||||
if not ComputeOffsetShells( nSrfToFill, dDist, INFILL_CRV, TYPE.INFILL, nInfillPathGrp, nStartLay, vOldIds) then
|
||||
EgtOutLog( 'Error : creation of SolidFill failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of SolidFill failed')
|
||||
end
|
||||
elseif nFillType == FILL_TYPE.ZIGZAG then
|
||||
ComputeZigZagSolidFill( nSrfToFill, dDist, INFILL_CRV, TYPE.INFILL, nInfillPathGrp, nil, nLayId)
|
||||
end
|
||||
|
||||
-- avendo riempito la regione, la TotShellTrimSurf non deve esistere
|
||||
EgtErase( nSrfBase)
|
||||
end
|
||||
|
||||
-- se gruppo vuoto lo cancello
|
||||
if not EgtGetFirstInGroup( nInfillPathGrp) then
|
||||
EgtErase( nInfillPathGrp)
|
||||
end
|
||||
end
|
||||
|
||||
-- se gruppo vuoto lo cancello
|
||||
if not EgtGetFirstInGroup( nInfillPathGrp) then
|
||||
EgtErase( nInfillPathGrp)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4261,7 +4257,7 @@ local function ComputeAuxSolidsGenericInfill( nSrf, dStrand, sName, nPathGrp, nS
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------
|
||||
local function CalcAuxSolidsPaths( nSliceGrp, nSolidGrp, LayerParams, nStartLay)
|
||||
local function CalcAuxSolidsPaths( nCrvGrp, nSliceGrp, nSolidGrp, LayerParams, nStartLay)
|
||||
|
||||
-- recupero i solidi ausiliari dividendoli per nome
|
||||
local vSolidIds = {}
|
||||
@@ -4273,125 +4269,117 @@ local function CalcAuxSolidsPaths( nSliceGrp, nSolidGrp, LayerParams, nStartLay)
|
||||
nFirst = EgtGetNextName( vIds[#vIds], AUX_SOLIDS_CRV .. '*')
|
||||
end
|
||||
|
||||
-- scorro i gruppi di curve
|
||||
local nCrvGrp = EgtGetFirstNameInGroup( nSliceGrp, CONTOUR_GRP .. '*')
|
||||
while nCrvGrp do
|
||||
|
||||
-- creo o svuoto il gruppo per i solidi ausiliari
|
||||
local nSolidPathGrp = EgtGetFirstNameInGroup( nCrvGrp, AUX_SOLIDS_GRP)
|
||||
if not nSolidPathGrp then
|
||||
nSolidPathGrp = EgtGroup( nCrvGrp)
|
||||
EgtSetName( nSolidPathGrp, AUX_SOLIDS_GRP)
|
||||
EgtSetStatus( nSolidPathGrp, GDB_ST.OFF)
|
||||
else
|
||||
EgtEmptyGroup( nSolidPathGrp)
|
||||
end
|
||||
-- creo o svuoto il gruppo per i solidi ausiliari
|
||||
local nSolidPathGrp = EgtGetFirstNameInGroup( nCrvGrp, AUX_SOLIDS_GRP)
|
||||
if not nSolidPathGrp then
|
||||
nSolidPathGrp = EgtGroup( nCrvGrp)
|
||||
EgtSetName( nSolidPathGrp, AUX_SOLIDS_GRP)
|
||||
EgtSetStatus( nSolidPathGrp, GDB_ST.OFF)
|
||||
else
|
||||
EgtEmptyGroup( nSolidPathGrp)
|
||||
end
|
||||
|
||||
-- creo le superfici con cui fare i trim
|
||||
local nSrfBase = EgtGetFirstNameInGroup( nCrvGrp, TOT_SHELL_TRIM_SURF)
|
||||
if not nSrfBase then
|
||||
EgtOutLog( 'Warning : AuxSolids not possible (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
else
|
||||
-- creo le superfici con cui fare i trim
|
||||
local nSrfBase = EgtGetFirstNameInGroup( nCrvGrp, TOT_SHELL_TRIM_SURF)
|
||||
if not nSrfBase then
|
||||
EgtOutLog( 'Warning : AuxSolids not possible (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
else
|
||||
|
||||
for i = 1, #vSolidIds do
|
||||
-- creo la flat region corrispondente al solido ausiliario
|
||||
local sName = EgtGetName( vSolidIds[i][1])
|
||||
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 nInfillType = EgtGetInfo( vSolidIds[i][1], KEY_AUX_SOLIDS_INFILL, 'i')
|
||||
local bInfillLink = EgtGetInfo( vSolidIds[i][1], KEY_AUX_SOLIDS_INFILL_LINK, 'b')
|
||||
local nShells = EgtGetInfo( vSolidIds[i][1], KEY_AUX_SOLIDS_SHELLS_NBR, 'i')
|
||||
if nInfillType == FILL_TYPE.OFFSET then
|
||||
-- realizzo le shells insieme al riempimento
|
||||
nShells = 0
|
||||
end
|
||||
|
||||
local nSrfId = EgtSurfFlatRegion( nSolidPathGrp, vSolidIds[i])
|
||||
if nSrfId then
|
||||
EgtSetName( nSrfId, AUX_SOLIDS_SRF)
|
||||
-- calcolo superficie con cui fare trim
|
||||
local nTrimSurf, bNoOverlap = ComputeTrimSurf( nSrfBase, nSolidPathGrp, dStrand, dOverlap)
|
||||
if not nTrimSurf then
|
||||
EgtOutLog( 'Error : creation of AuxSolid region failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of AuxSolid region failed')
|
||||
elseif nTrimSurf == GDB_ID.NULL then
|
||||
EgtOutLog( 'Warning : AuxSolids not possible (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
else
|
||||
if bNoOverlap then
|
||||
EgtOutLog( 'Warning : AuxSolids without correct overlap (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
end
|
||||
|
||||
-- trim con la superficie di offset
|
||||
EgtSurfFrIntersect( nSrfId, nTrimSurf)
|
||||
|
||||
local nFirst, nCnt = EgtExplodeSurf( nSrfId)
|
||||
for j = 0, nCnt - 1 do
|
||||
local sNewName = sName .. EgtIf( j == 0, '', '_' .. tostring( j))
|
||||
|
||||
-- calcolo shells
|
||||
if not ComputeOffsetShells( nFirst + j, dStrand, sNewName, TYPE.AUX_SOLID, nSolidPathGrp, nStartLay, nil, nShells) then
|
||||
EgtOutLog( 'Error : creation of AuxSolid shells failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of AuxSolid shells failed')
|
||||
end
|
||||
|
||||
-- calcolo la superficie per il riempimento
|
||||
local nSrfFill
|
||||
if nShells > 0 then
|
||||
local dOffs = ( nShells - dOverlap / 100) * dStrand
|
||||
nSrfFill = ComputeSurfOffset( nFirst + j, nSolidPathGrp, - dOffs)
|
||||
if not nSrfFill then
|
||||
EgtOutLog( 'Error : creation of AuxSolid infill region failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of AuxSolid infill region failed')
|
||||
elseif nSrfFill == GDB_ID.NULL then
|
||||
EgtOutLog( 'Warning : AuxSolids infill not possible (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
end
|
||||
else
|
||||
-- la superficie per il riempimento è la surf del solido
|
||||
nSrfFill = nFirst + j
|
||||
end
|
||||
|
||||
-- riempimento
|
||||
if nInfillType == FILL_TYPE.OFFSET then
|
||||
-- recupero le shells
|
||||
if not ComputeOffsetShells( nSrfFill, dStrand, sNewName, TYPE.AUX_SOLID, nSolidPathGrp, nStartLay) then
|
||||
EgtOutLog( 'Error : creation of AuxSolid offset infill failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of AuxSolid offset infill failed')
|
||||
end
|
||||
elseif nInfillType == FILL_TYPE.ZIGZAG then
|
||||
ComputeZigZagSolidFill( nSrfFill, dStrand, sNewName, TYPE.AUX_SOLID, nSolidPathGrp, EgtIf( nShells == 0, nTrimSurf, nil), nSliceGrp)
|
||||
if nShells == 0 then
|
||||
-- aggiungo eventuale passata extra
|
||||
AddExtraZigZag( nSrfFill, sNewName, dStrand, nSolidPathGrp, nTrimSurf)
|
||||
end
|
||||
elseif nInfillType ~= FILL_TYPE.NONE then
|
||||
ComputeAuxSolidsGenericInfill( nSrfFill, dStrand, sNewName, nSolidPathGrp, nStartLay, nOrigSurf, dOverlap, nSolidGrp, bInfillLink)
|
||||
end
|
||||
|
||||
-- aggiorno la superficie di trim con il solido ausiliario
|
||||
if nShells == 0 and nInfillType == FILL_TYPE.ZIGZAG then
|
||||
-- gestione speciale perchè non è detto che le passate corrispondano esattamente al solido
|
||||
UpdateTrimSurfWithAuxSolidsZigZag( nSolidPathGrp, sNewName, nSrfBase, dStrand, nFirst + j)
|
||||
else
|
||||
UpdateTrimSurfWithAuxSolidsOffset( nFirst + j, nSrfBase, dStrand, nSolidPathGrp)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
else
|
||||
for i = 1, #vSolidIds do
|
||||
-- creo la flat region corrispondente al solido ausiliario
|
||||
local sName = EgtGetName( vSolidIds[i][1])
|
||||
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 nInfillType = EgtGetInfo( vSolidIds[i][1], KEY_AUX_SOLIDS_INFILL, 'i')
|
||||
local bInfillLink = EgtGetInfo( vSolidIds[i][1], KEY_AUX_SOLIDS_INFILL_LINK, 'b')
|
||||
local nShells = EgtGetInfo( vSolidIds[i][1], KEY_AUX_SOLIDS_SHELLS_NBR, 'i')
|
||||
if nInfillType == FILL_TYPE.OFFSET then
|
||||
-- realizzo le shells insieme al riempimento
|
||||
nShells = 0
|
||||
end
|
||||
|
||||
local nSrfId = EgtSurfFlatRegion( nSolidPathGrp, vSolidIds[i])
|
||||
if nSrfId then
|
||||
EgtSetName( nSrfId, AUX_SOLIDS_SRF)
|
||||
-- calcolo superficie con cui fare trim
|
||||
local nTrimSurf, bNoOverlap = ComputeTrimSurf( nSrfBase, nSolidPathGrp, dStrand, dOverlap)
|
||||
if not nTrimSurf then
|
||||
EgtOutLog( 'Error : creation of AuxSolid region failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of AuxSolid region failed')
|
||||
elseif nTrimSurf == GDB_ID.NULL then
|
||||
EgtOutLog( 'Warning : AuxSolids not possible (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
else
|
||||
if bNoOverlap then
|
||||
EgtOutLog( 'Warning : AuxSolids without correct overlap (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
end
|
||||
|
||||
-- trim con la superficie di offset
|
||||
EgtSurfFrIntersect( nSrfId, nTrimSurf)
|
||||
|
||||
local nFirst, nCnt = EgtExplodeSurf( nSrfId)
|
||||
for j = 0, nCnt - 1 do
|
||||
local sNewName = sName .. EgtIf( j == 0, '', '_' .. tostring( j))
|
||||
|
||||
-- calcolo shells
|
||||
if not ComputeOffsetShells( nFirst + j, dStrand, sNewName, TYPE.AUX_SOLID, nSolidPathGrp, nStartLay, nil, nShells) then
|
||||
EgtOutLog( 'Error : creation of AuxSolid shells failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of AuxSolid shells failed')
|
||||
end
|
||||
|
||||
-- calcolo la superficie per il riempimento
|
||||
local nSrfFill
|
||||
if nShells > 0 then
|
||||
local dOffs = ( nShells - dOverlap / 100) * dStrand
|
||||
nSrfFill = ComputeSurfOffset( nFirst + j, nSolidPathGrp, - dOffs)
|
||||
if not nSrfFill then
|
||||
EgtOutLog( 'Error : creation of AuxSolid infill region failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of AuxSolid infill region failed')
|
||||
elseif nSrfFill == GDB_ID.NULL then
|
||||
EgtOutLog( 'Warning : AuxSolids infill not possible (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
end
|
||||
else
|
||||
-- la superficie per il riempimento è la surf del solido
|
||||
nSrfFill = nFirst + j
|
||||
end
|
||||
|
||||
-- riempimento
|
||||
if nInfillType == FILL_TYPE.OFFSET then
|
||||
-- recupero le shells
|
||||
if not ComputeOffsetShells( nSrfFill, dStrand, sNewName, TYPE.AUX_SOLID, nSolidPathGrp, nStartLay) then
|
||||
EgtOutLog( 'Error : creation of AuxSolid offset infill failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of AuxSolid offset infill failed')
|
||||
end
|
||||
elseif nInfillType == FILL_TYPE.ZIGZAG then
|
||||
ComputeZigZagSolidFill( nSrfFill, dStrand, sNewName, TYPE.AUX_SOLID, nSolidPathGrp, EgtIf( nShells == 0, nTrimSurf, nil), nSliceGrp)
|
||||
if nShells == 0 then
|
||||
-- aggiungo eventuale passata extra
|
||||
AddExtraZigZag( nSrfFill, sNewName, dStrand, nSolidPathGrp, nTrimSurf)
|
||||
end
|
||||
elseif nInfillType ~= FILL_TYPE.NONE then
|
||||
ComputeAuxSolidsGenericInfill( nSrfFill, dStrand, sNewName, nSolidPathGrp, nStartLay, nOrigSurf, dOverlap, nSolidGrp, bInfillLink)
|
||||
end
|
||||
|
||||
-- aggiorno la superficie di trim con il solido ausiliario
|
||||
if nShells == 0 and nInfillType == FILL_TYPE.ZIGZAG then
|
||||
-- gestione speciale perchè non è detto che le passate corrispondano esattamente al solido
|
||||
UpdateTrimSurfWithAuxSolidsZigZag( nSolidPathGrp, sNewName, nSrfBase, dStrand, nFirst + j)
|
||||
else
|
||||
UpdateTrimSurfWithAuxSolidsOffset( nFirst + j, nSrfBase, dStrand, nSolidPathGrp)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
else
|
||||
EgtOutLog( 'Error : creation of AuxSolid region failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
|
||||
table.insert( s_vErr, ' - layer ' .. EgtNumToString( s_nCurrIdx) .. ' : creation of AuxSolid region failed')
|
||||
end
|
||||
end
|
||||
|
||||
-- verifico se il gruppo contine qualcosa
|
||||
if not EgtGetFirstNameInGroup( nSolidPathGrp, AUX_SOLIDS_CRV .. '*') then
|
||||
EgtErase( nSolidPathGrp)
|
||||
end
|
||||
|
||||
-- passo al gruppo di contorni successivo
|
||||
nCrvGrp = EgtGetNextName( nCrvGrp, CONTOUR_GRP .. '*')
|
||||
end
|
||||
|
||||
-- verifico se il gruppo contine qualcosa
|
||||
if not EgtGetFirstNameInGroup( nSolidPathGrp, AUX_SOLIDS_CRV .. '*') then
|
||||
EgtErase( nSolidPathGrp)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4410,8 +4398,6 @@ function CalcPaths.Exec( nPartId)
|
||||
|
||||
-- recupero i parametri per calcolo dei path
|
||||
local LayerParams = GetLayerParamsForPathCalc()
|
||||
local nFirstSolidLay = EgtGetInfo( s_nPartId, KEY_FIRST_SOLID_LAY, 'i') or -1
|
||||
local nLastSolidLay = EgtGetInfo( s_nPartId, KEY_LAST_SOLID_LAY, 'i') or -1
|
||||
local nSlicingType = EgtGetInfo( s_nPartId, KEY_SLICING_TYPE, 'i')
|
||||
|
||||
-- scorro tutti i suoi layer
|
||||
@@ -4439,6 +4425,11 @@ function CalcPaths.Exec( nPartId)
|
||||
local nCrvGrpId = EgtGetFirstNameInGroup( vLayIds[nIdx], CONTOUR_GRP.."*") or GDB_ID.NULL
|
||||
while nCrvGrpId ~= GDB_ID.NULL do
|
||||
|
||||
-- recupero i layer estremi con il solido
|
||||
local nOrigStm = EgtGetInfo( nCrvGrpId, KEY_ORIGINAL_SOLID, 'i')
|
||||
local nFirstLay = EgtGetInfo( s_nPartId, KEY_FIRST_SOLID_LAY .. tostring( nOrigStm), 'i') or -1
|
||||
local nLastLay = EgtGetInfo( s_nPartId, KEY_LAST_SOLID_LAY .. tostring( nOrigStm), 'i') or -1
|
||||
|
||||
-- verifico se il path è già stato calcolato
|
||||
local nGrpId = EgtGetFirstNameInGroup( nCrvGrpId, PATH_GRP) or GDB_ID.NULL
|
||||
if nGrpId == GDB_ID.NULL then
|
||||
@@ -4546,29 +4537,29 @@ function CalcPaths.Exec( nPartId)
|
||||
ReorderExtraShells( nGrpId, nStartLay, LayerParams)
|
||||
end
|
||||
|
||||
-- gestione solidi ausiliari ( se no floor o ceil)
|
||||
if nAuxSolidsGrp and nFirstLay + LayerParams.nFloorNbr <= nIdx and nIdx <= nLastLay - LayerParams.nCeilNbr then
|
||||
CalcAuxSolidsPaths( nCrvGrpId, vLayIds[nIdx], nAuxSolidsGrp, LayerParams, nStartLay)
|
||||
end
|
||||
|
||||
-- gestione riempimenti
|
||||
if LayerParams.nShellsNbr > 0 then
|
||||
-- floor
|
||||
if nIdx < nFirstLay + LayerParams.nFloorNbr then
|
||||
CalcSolidFillPath( nCrvGrpId, vLayIds[nIdx], LayerParams, nStartLay, LayerParams.nFloorType)
|
||||
-- infill
|
||||
elseif nIdx <= nLastLay - LayerParams.nCeilNbr then
|
||||
CalcInfillPaths( nCrvGrpId, nInfillGrp, LayerParams)
|
||||
-- ceil
|
||||
else
|
||||
CalcSolidFillPath( nCrvGrpId, vLayIds[nIdx], LayerParams, nStartLay, LayerParams.nCeilType)
|
||||
end
|
||||
end
|
||||
|
||||
-- passo al gruppo di contorni successivo
|
||||
nCrvGrpId = EgtGetNextName( nCrvGrpId, CONTOUR_GRP.."*") or GDB_ID.NULL
|
||||
end
|
||||
|
||||
-- gestione solidi ausiliari ( se no floor o ceil)
|
||||
if nAuxSolidsGrp and LayerParams.nFloorNbr < nIdx and nIdx <= nLastSolidLay - LayerParams.nCeilNbr then
|
||||
CalcAuxSolidsPaths( vLayIds[nIdx], nAuxSolidsGrp, LayerParams, nStartLay)
|
||||
end
|
||||
|
||||
-- gestione riempimenti
|
||||
if LayerParams.nShellsNbr > 0 then
|
||||
-- floor
|
||||
if nIdx <= LayerParams.nFloorNbr then
|
||||
CalcSolidFillPath( vLayIds[nIdx], LayerParams, nStartLay, LayerParams.nFloorType)
|
||||
-- infill
|
||||
elseif nIdx <= nLastSolidLay - LayerParams.nCeilNbr then
|
||||
CalcInfillPaths( vLayIds[nIdx], nInfillGrp, LayerParams)
|
||||
-- ceil
|
||||
else
|
||||
CalcSolidFillPath( vLayIds[nIdx], LayerParams, nStartLay, LayerParams.nCeilType)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- gestione costolature
|
||||
if nRibsGrp then
|
||||
CalcRibsPaths( vLayIds[nIdx], nRibsGrp, LayerParams, nStartLay, bIgnoreMergedRibs)
|
||||
|
||||
+444
-364
File diff suppressed because it is too large
Load Diff
@@ -3088,7 +3088,8 @@ function CalcToolPath.Exec( nPartId)
|
||||
local vSpiralVaseIds = {}
|
||||
if LayerParams.bSpiralVase then
|
||||
if LayerParams.nFloorNbr > 0 then
|
||||
for i = LayerParams.nFloorNbr + 1, #vLayIds do
|
||||
local nFirstLay = EgtGetInfo( s_nPartId, KEY_FIRST_SOLID_LAY, 'i')
|
||||
for i = LayerParams.nFloorNbr + nFirstLay, #vLayIds do
|
||||
table.insert( vSpiralVaseIds, vLayIds[i])
|
||||
vLayIds[i] = nil
|
||||
end
|
||||
|
||||
+11
-12
@@ -27,7 +27,9 @@ local function GetLayerParamsForSolidCalc( nPartId)
|
||||
LayerParams.vtSlicing = EgtGetInfo( nPartId, KEY_SLICE_DIR, 'v') or EgtGetInfo( nPartId, 'SlicingDir', 'v')
|
||||
LayerParams.dStrand = EgtGetInfo( nPartId, KEY_STRAND, 'd')
|
||||
LayerParams.vtCorr = EgtGetInfo( nPartId, KEY_MOVED_PART2, 'v') or V_NULL()
|
||||
LayerParams.nFloorNbr = EgtGetInfo( s_nPartId, KEY_FLOOR_NBR, 'i') or 0
|
||||
local nFloorNbr = EgtGetInfo( s_nPartId, KEY_FLOOR_NBR, 'i') or 0
|
||||
local nFirstSolidLay = EgtGetInfo( s_nPartId, KEY_FIRST_SOLID_LAY, 'i') or 1
|
||||
LayerParams.nFirstSpiralLay = nFloorNbr + nFirstSolidLay
|
||||
return LayerParams
|
||||
end
|
||||
|
||||
@@ -643,7 +645,7 @@ local function CreateFullSpiralVaseMultiPlanarSolids( vIds, nSolidGrpId, LayerPa
|
||||
local ptProj = ptVertex + dDistCrv * LayerParams.vtSlicing
|
||||
local dDistPlanePrev = ( ptProj - ptSlicingPrev) * vtSlicingPrev / dCosAng
|
||||
local dDeltaPos
|
||||
if nSliceNbr == 2 + LayerParams.nFloorNbr and dCurrLen < 0.5 * dLen then
|
||||
if nSliceNbr == LayerParams.nFirstSpiralLay + 1 and dCurrLen < 0.5 * dLen then
|
||||
dDeltaPos = 0.5 * dDistPlanePrev
|
||||
else
|
||||
dDeltaPos = dDistPlanePrev * ( dLen - dCurrLen) / dLen
|
||||
@@ -651,7 +653,7 @@ local function CreateFullSpiralVaseMultiPlanarSolids( vIds, nSolidGrpId, LayerPa
|
||||
|
||||
-- 2) per calcolare la vera altezza del solido calcolo la distanza dal toolpath precedente guardando il punto di riferimento sul percorso corrente
|
||||
local dNewH
|
||||
if nSliceNbr == 2 + LayerParams.nFloorNbr then
|
||||
if nSliceNbr == LayerParams.nFirstSpiralLay + 1 then
|
||||
-- il primo layer è ad altezza costante quindi è semplice distanza dal piano precedente lungo vtSlicing
|
||||
dNewH = ( ptProj - ptSlicingPrev) * vtSlicingPrev / dCosAng - dDeltaPos
|
||||
else
|
||||
@@ -812,7 +814,6 @@ function RunCalcSolids.Exec()
|
||||
s_dMultiPlanarH = min( dMaxFactor, 5) * LayerParams.dLayHeight
|
||||
end
|
||||
|
||||
local bFirst = true
|
||||
for nIdx = 1, #vLayIds do
|
||||
-- flag di interruzione perchè trovati solidi già ok
|
||||
local bSolidsOk = false
|
||||
@@ -843,13 +844,13 @@ function RunCalcSolids.Exec()
|
||||
if nSlicingType == SLICING_TYPE.MULTIPLANAR or nSlicingType == SLICING_TYPE.MULTIPLANAR_DEG45 or nSlicingType == SLICING_TYPE.MULTIPLANAR_HOR then
|
||||
LayerParams.vtSlicing = EgtGetInfo( vLayIds[nIdx], KEY_SLICE_DIR, 'v')
|
||||
|
||||
if LayerParams.bSpiralVase and nIdx > LayerParams.nFloorNbr then
|
||||
if LayerParams.bSpiralVase and nIdx >= LayerParams.nFirstSpiralLay then
|
||||
local dTransitionLen = EgtGetInfo( nPartId, KEY_SPIRAL_VASE_LEN, 'd') or 0
|
||||
-- a) spiral vase completo ( con transizione in altezza su tutto il layer)
|
||||
if dTransitionLen < GEO.EPS_SMALL then
|
||||
if nIdx == LayerParams.nFloorNbr + 1 then
|
||||
if nIdx == LayerParams.nFirstSpiralLay then
|
||||
-- il primo layer va gestito come uno spiral vase con transizione parziale ( curva a quota costante e ultimo tratto che si alza)
|
||||
CreatePartialSpiralVaseMultiPlanarSolids( vIds, nSolidGrpId, LayerParams, vLayIds[nIdx], bFirst)
|
||||
CreatePartialSpiralVaseMultiPlanarSolids( vIds, nSolidGrpId, LayerParams, vLayIds[nIdx], nIdx == 1)
|
||||
elseif nIdx == #vLayIds then
|
||||
-- gestione speciale per lead out e coasting
|
||||
CreateFullSpiralVaseMultiPlanarSolidsLastLayer( vIds, nSolidGrpId, LayerParams, vLayIds[nIdx])
|
||||
@@ -863,13 +864,13 @@ function RunCalcSolids.Exec()
|
||||
-- ultimo layer è un multiplanare standard perchè non ha tratto finale che si alza
|
||||
CreateMultiPlanarSolids( vIds, nSolidGrpId, LayerParams, vLayIds[nIdx], false)
|
||||
else
|
||||
CreatePartialSpiralVaseMultiPlanarSolids( vIds, nSolidGrpId, LayerParams, vLayIds[nIdx], bFirst)
|
||||
CreatePartialSpiralVaseMultiPlanarSolids( vIds, nSolidGrpId, LayerParams, vLayIds[nIdx], nIdx == 1)
|
||||
end
|
||||
end
|
||||
|
||||
-- c) multiplanare standard
|
||||
else
|
||||
CreateMultiPlanarSolids( vIds, nSolidGrpId, LayerParams, vLayIds[nIdx], bFirst)
|
||||
CreateMultiPlanarSolids( vIds, nSolidGrpId, LayerParams, vLayIds[nIdx], nIdx == 1)
|
||||
end
|
||||
|
||||
-- slicing standard spiral vase
|
||||
@@ -916,14 +917,12 @@ function RunCalcSolids.Exec()
|
||||
CreateSolidFromCurve( vIds[i], nSolidGrpId, LayerParams, nSliceNbr)
|
||||
end
|
||||
end
|
||||
bFirst = false
|
||||
end
|
||||
else
|
||||
bSolidsOk = true
|
||||
break
|
||||
end
|
||||
|
||||
--passo al gruppo di contorni successivo
|
||||
-- passo al gruppo di contorni successivo
|
||||
nCrvGrpId = EgtGetNextName( nCrvGrpId, CONTOUR_GRP.."*") or GDB_ID.NULL
|
||||
end
|
||||
if bSolidsOk then
|
||||
|
||||
@@ -156,11 +156,6 @@ function RunSlicing.Exec()
|
||||
return
|
||||
end
|
||||
local nSolidLayId = EgtGetFirstNameInGroup( nPartId, PRINT_SOLID)
|
||||
local nStmId = EgtGetFirstInGroup( nSolidLayId or GDB_ID.NULL)
|
||||
if nStmId and EgtGetType( nStmId) ~= GDB_TY.SRF_MESH then
|
||||
EgtOutBox( "Part without surface!", 'Warning', 'WARNING')
|
||||
return
|
||||
end
|
||||
local nRibsLayId = EgtGetFirstNameInGroup( nPartId, LAY_RIBS)
|
||||
local nShellNbrLay = EgtGetFirstNameInGroup( nPartId, LAY_SHELL_NBR)
|
||||
local nAuxSolidsLay = EgtGetFirstNameInGroup( nPartId, LAY_AUX_SOLIDS)
|
||||
@@ -181,7 +176,7 @@ function RunSlicing.Exec()
|
||||
RemoveOldTFS()
|
||||
|
||||
-- Calcolo delle fette
|
||||
local bOk = CSLICES.Exec( nPartId, nStmId)
|
||||
local bOk = CSLICES.Exec( nPartId, nSolidLayId)
|
||||
EgtDraw()
|
||||
|
||||
-- Calcolo dei percorsi sul centro strand in basso
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
-- Version.lua by Egaltech s.r.l. 2026/06/24
|
||||
-- Version.lua by Egaltech s.r.l. 2026/07/01
|
||||
-- Gestione della versione di 3dPrinting
|
||||
|
||||
VERSION = '3.1f4'
|
||||
VERSION = '3.1g1'
|
||||
Reference in New Issue
Block a user