Compare commits

...

9 Commits

Author SHA1 Message Date
Dario Sassi 94b02be20a 3dPrinting 2.6b1 :
- aggiornata versione.
2024-02-13 14:53:06 +01:00
SaraP a15593303f 3dPrinting :
- corretto errore.
2024-02-12 12:06:46 +01:00
SaraP 011f049c43 3dPrinting :
- migliorie in PrepareExport con utilizzo della fat curve di Voronoi.
2024-02-12 12:05:04 +01:00
SaraP e214e5a766 3dPrinting :
- corretta approssimazione toolpath in spiral vase.
2024-01-31 10:11:08 +01:00
Dario Sassi e4c696c498 3dPrinting :
- correzioni a calcolo TFS per layer vuoti (tipicamente primi e ultimi con estrusione a 45 gradi).
2024-01-31 09:08:18 +01:00
SaraP e37a2f8e85 3dPrinting :
- modifiche per utilizzare la nuova funzione per il calcolo degli offset di flat regions ( per Voronoi).
2024-01-29 14:43:43 +01:00
Dario Sassi 5619072e46 3dPrinting 2.6a1 :
- cambio versione.
2024-01-26 16:06:34 +01:00
SaraP ff59ee3e5b 3dPrinting :
- sistemate le tolleranze nel calcolo delle superfici per gestire errore con extra shell spezzata.
2024-01-18 10:39:46 +01:00
SaraP af03fe39d8 3dPrinting :
- nel calcolo dei toopath riassegnato punto di inizio dopo approssimazione delle curve.
2024-01-15 15:34:06 +01:00
5 changed files with 117 additions and 141 deletions
+22 -26
View File
@@ -14,7 +14,7 @@ local AMD = require( 'AddManData')
---------------------------------------------------------------------
local s_nPartId
local s_dOffsCorr = 50 * GEO.EPS_SMALL
local s_dOffsCorr = 20 * GEO.EPS_SMALL
local s_vErr = {}
local s_nCurrIdx
local s_vtSlicing
@@ -85,30 +85,22 @@ end
----------------------------------------------------------------------
local function ComputeSurfOffset( nSrf, nGrpId, dOffs)
-- restituisce id della superficie offsettata in caso di successo, nil in caso di errore, GDB_ID.NULL se la superficie offsettata scompare
local nOffsSrf = EgtCopyGlob( nSrf, nGrpId) or GDB_ID.NULL
local bOk = EgtSurfFrOffset( nOffsSrf, dOffs)
if not bOk then
local nOffsSrf = EgtSurfFrOffsetAdv( nSrf, dOffs)
if not nOffsSrf then
-- ritento modificando leggermente l'offset
EgtErase( nOffsSrf)
nOffsSrf = EgtCopyGlob( nSrf, nGrpId) or GDB_ID.NULL
bOk = EgtSurfFrOffset( nOffsSrf, dOffs + 0.05)
nOffsSrf = EgtSurfFrOffsetAdv( nSrf, dOffs + 0.05)
end
-- sposto nel gruppo desiderato
EgtRelocateGlob( nOffsSrf or GDB_ID.NULL, nGrpId)
if not bOk then
EgtErase( nOffsSrf)
return nil
elseif EgtSurfFrChunkCount( nOffsSrf) == 0 then
return GDB_ID.NULL
else
return nOffsSrf
end
return nOffsSrf
end
--------------------------------------------------------------------
local function ComputeTrimSurf( nSrf, nGrpId, dStrand, dOverlap)
local nTrimSurf = ComputeSurfOffset( nSrf, nGrpId, - dStrand * ( 0.5 - dOverlap / 100) + s_dOffsCorr)
local nTrimSurf = ComputeSurfOffset( nSrf, nGrpId, - dStrand * ( 0.5 - dOverlap / 100) + 2 * s_dOffsCorr)
local bNoOverlap = false
if not nTrimSurf and dOverlap > GEO.EPS_SMALL then
-- tento senza overlap
@@ -204,15 +196,14 @@ local function GetPathsFromSurf( nSrfId, sName, nType, nGrpId, vPtStart)
local _ , _ , dArea = EgtCurveArea( nCrvId + nInd)
if dLen < MIN_LEN or dArea < MIN_AREA then
EgtErase( nCrvId + nInd)
return
else
table.insert( vIds, nCrvId + nInd)
ModifyStartPoint( nCrvId + nInd, vPtStart)
end
table.insert( vIds, nCrvId + nInd)
ModifyStartPoint( nCrvId + nInd, vPtStart)
end
end
return vIds
return vIds or {}
end
----------------------------------------------------------------------
@@ -3216,7 +3207,7 @@ local function UpdateTrimSurfWithRibsMergedShell( nPathGrp, sName, LayerParams)
-- calcolo la regione occupata dalla nuova shell
local nType = EgtGetInfo( vNewShells[i], KEY_TYPE, 'i')
dStrand = EgtIf( nType == TYPE.OUTER_SHELL or nType == TYPE.EXTRA_OUTER_SHELL, LayerParams.dStrand, LayerParams.dInnerStrand)
local nSrfShell = EgtSurfFrFatCurve( nCrvGrp, vNewShells[i], dStrand * 0.5 + 0.5 * s_dOffsCorr, false, false, s_dOffsTol)
local nSrfShell = EgtSurfFrFatCurve( nCrvGrp, vNewShells[i], dStrand * 0.5 + s_dOffsCorr, false, false, s_dOffsTol)
if nSrfShell then
if not EgtSurfFrSubtract( nNewTrimSurf, nSrfShell) then
EgtOutLog( 'Error : EgtSurfFrSubtract with ribs-merged shell for TotTrimSurfRegion failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
@@ -3528,7 +3519,7 @@ end
--------------------------------------------------------------------
local function UpdateTrimSurfWithExtraShell( nSrf, nCrv, dStrand, nGrpId)
local nSrfExtraShell = EgtSurfFrFatCurve( nGrpId, nCrv, dStrand * 0.5 + s_dOffsCorr * 0.5, true, false, s_dOffsTol)
local nSrfExtraShell = EgtSurfFrFatCurve( nGrpId, nCrv, dStrand * 0.5 + s_dOffsCorr, true, false, s_dOffsTol)
if nSrfExtraShell then
if not EgtSurfFrSubtract( nSrf, nSrfExtraShell) then
EgtOutLog( 'Error : EgtSurfFrSubtract with ExtraShell for TotTrimSurfRegion failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
@@ -3841,8 +3832,8 @@ local function CalcExtraShellsPath( nMaxShellNbrDiff, nShellNbrGrp, nCrvGrpId, d
local nOffs, nOffsCnt = EgtOffsetCurveAdv( nCrvT, - dOffs, GDB_OT.FILLET, s_dOffsTol)
for nCrvOffs = nOffs, nOffs + nOffsCnt - 1 do
-- calcolo la regione con cui fare trim
local nTrimSurf, bNoOverlap = ComputeTrimSurf( nTotShellTrim, nGrpTmp, dCurrStrand, LayerParams.dStrandOverlap)
-- calcolo la regione con cui fare trim ( con correzione extra per evitare tratti on)
local nTrimSurf, bNoOverlap = ComputeTrimSurf( nTotShellTrim, nGrpTmp, dCurrStrand - 10 * s_dOffsCorr, LayerParams.dStrandOverlap)
if not nTrimSurf then
-- errore nel calcolo della superficie di trim
EgtOutLog( 'Error : creation of ExtraShell failed (layer '.. EgtNumToString( s_nCurrIdx) ..') - CalcPaths')
@@ -4209,6 +4200,8 @@ end
---------------------------------------------------------------------
function CalcPaths.Exec( nPartId)
EgtStartCounter()
s_nPartId = nPartId
local vLayIds = EgtGetNameInGroup( s_nPartId, SLICE_LAYER.."*")
@@ -4384,6 +4377,9 @@ function CalcPaths.Exec( nPartId)
end
end
-- report tempo di calcolo in log
EgtOutLog( string.format( ' CalcPathTime = %.2f ms', EgtStopCounter()))
if #s_vErr > 0 then
EgtOutBox( 'CalcPath Error on :\n' .. table.concat( s_vErr, '\n'), 'Calculating Paths')
end
+74 -51
View File
@@ -152,8 +152,13 @@ local function AddCurvesToToolPath( vEntIds, nTpathGrpId, nOrder, bInvert, vtSli
end
end
-- approssimo la curva e ne risetto il punto iniziale
local ptS = EgtSP( vIds[nIdx], GDB_ID.ROOT)
EgtApproxCurve( vIds[nIdx], GDB_CA.ARCS, s_dApproxTol)
if EgtCurveIsClosed( vIds[nIdx]) then
EgtChangeClosedCurveStartPoint( vIds[nIdx], ptS, GDB_RT.GLOB)
end
EgtSetInfo( vEntIds[i], KEY_ASSOCIATED_TP_CRV, vIds[nIdx])
EgtSetInfo( vIds[nIdx], KEY_ASSOCIATED_P_CRV, vEntIds[i])
@@ -1712,7 +1717,14 @@ local function CalcRibsToolPath( vEntIds, nRibsGrp, nTpathGrpId, LayerParams)
local nNewEntId = EgtCopyGlob( vEntIds[i], nTpathGrpId, GDB_IN.LAST_SON)
-- mi sposto dell'altezza layer
EgtMove( nNewEntId, LayerParams.dLayHeight * LayerParams.vtSlicing, GDB_RT.GLOB)
-- approssimo la curva e ne risetto punto iniziale (se chiusa)
local ptS = EgtSP( nNewEntId, GDB_ID.ROOT)
EgtApproxCurve( nNewEntId, GDB_CA.ARCS, s_dApproxTol)
if EgtCurveIsClosed( nNewEntId) then
EgtChangeClosedCurveStartPoint( nNewEntId, ptS, GDB_RT.GLOB)
end
EgtModifyCurveExtrusion( nNewEntId, LayerParams.vtSlicing, GDB_RT.GLOB)
EgtSetColor( nNewEntId, EgtStdColor('MAROON'))
@@ -1914,66 +1926,77 @@ local function SpiralVase( vLayIds, LayerParams)
return false
end
local nNewEntId = EgtCopyGlob( vEntIds[1], nTpathGrpId, GDB_IN.LAST_SON)
local nNewEntId = EgtCopyGlob( vEntIds[1] or GDB_ID.NULL, nTpathGrpId, GDB_IN.LAST_SON)
if nNewEntId then
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)
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
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)
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 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
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)
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
EgtSpiralizeCurveAlongExtrusion( nNewEntId, LayerParams.dLayHeight)
EgtApproxCurve( nNewEntId, GDB_CA.ARCS, s_dApproxTol)
-- approssimo la curva
if nNewEntId then
local ptS = EgtSP( nNewEntId, GDB_ID.ROOT)
EgtApproxCurve( nNewEntId, GDB_CA.ARCS, s_dApproxTol)
if EgtCurveIsClosed( nNewEntId) then
EgtChangeClosedCurveStartPoint( nNewEntId, ptS, GDB_RT.GLOB)
end
end
nOldPathId = vEntIds[1]
nOldId = nNewEntId
end
nOldPathId = vEntIds[1]
nOldId = nNewEntId
-- aggiorno il box dei toolpath
local b3Box = ComputeToolPathBox( nTpathGrpId)
b3Tot:Add( b3Box)
end
if EgtProcessEvents( EgtIf( PRINT, 300, 0) + nIdx / #vLayIds * 100, 0) == 1 then
+11 -51
View File
@@ -1,4 +1,4 @@
-- RunMachParamFromSWCalc.lua by Egaltech s.r.l. 2022/12/28
-- RunMachParamFromSWCalc.lua by Egaltech s.r.l. 2024/01/30
-- Calcolo dei parametri di stampa
-- Tabella per definizione modulo
@@ -126,44 +126,6 @@ function RunMachParamFromSWCalc.Exec()
end
nCrvId = EgtGetNextName( nCrvId, CONTOUR_GRP .. '*')
end
-- -- rimuovo eventuale info precedente del tempo di attesa
-- EgtRemoveInfo( nLayerId, KEY_WAITING_TIME)
-- -- calcolo lunghezza totale del layer
-- local dTotLayerLength = 0
-- local dTotLayerLengthForMass = 0
-- local dTotLayerArea = 0
-- local nCrvId = EgtGetFirstNameInGroup( nLayerId, CONTOUR_GRP .. '*')
-- while nCrvId do
-- local nToolPathId = EgtGetFirstNameInGroup( nCrvId, TOOLPATH_GRP)
-- -- sommo lunghezze percorsi
-- local dTotCrvLength = 0
-- local dTotCrvLengthForMass = 0
-- local nShellId = EgtGetFirstInGroup( nToolPathId)
-- while nShellId do
-- dTotCrvLength = dTotCrvLength + EgtCurveLength( nShellId)
-- if EgtGetName( nShellId) ~= WIPE_CRV then
-- dTotCrvLengthForMass = dTotCrvLengthForMass + EgtCurveLength( nShellId)
-- end
-- nShellId = EgtGetNext( nShellId)
-- end
-- dTotLayerLength = dTotLayerLength + dTotCrvLength
-- dTotLayerLengthForMass = dTotLayerLengthForMass + dTotCrvLengthForMass
-- -- recupero area
-- local nOuterCrvId = EgtGetFirstNameInGroup( nCrvId, OUTER_CRV)
-- if nOuterCrvId and dStrandCount > 0.5 then
-- local _, _, dTotCrvArea = EgtCurveArea( nOuterCrvId)
-- local dOuterLength = EgtCurveLength( nOuterCrvId)
-- -- recupero offset del part per aggiungerlo all'area interna
-- local dOffset = EgtGetInfo( nPartId, KEY_OFFSET_SLICE, 'd')
-- dTotCrvArea = dTotCrvArea + ( dOffset * dOuterLength)
-- dTotLayerArea = dTotLayerArea + dTotCrvArea
-- end
-- nCrvId = EgtGetNextName( nCrvId, CONTOUR_GRP .. '*')
-- end
-- recupero feed del layer
local dLayerFeed = 0
local dLayerWait = 0
@@ -192,12 +154,11 @@ function RunMachParamFromSWCalc.Exec()
for nMeanIndex = 1, #LengthCrvList do
dStrandMean = dStrandMean + LengthCrvList[nMeanIndex].Width * LengthCrvList[nMeanIndex].Length
end
dStrandMean = dStrandMean / dTotLayerLength
dStrandMean = dStrandMean / EgtIf( dTotLayerLength > 0.1, dTotLayerLength, 1)
-- calcolo costante MF
local dMF = 1
local dSC = 1
if dTotLayerArea > 1 then
-- dMF = dTotLayerLength * dStrand / dTotLayerArea * 100
dMF = dTotLayerLength * dStrandMean / dTotLayerArea * 100
dSC = dStrandCount
else
@@ -216,9 +177,9 @@ function RunMachParamFromSWCalc.Exec()
local dTMin = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.AMin) / MATERIAL.BMin * pow( 0.25 * dStrandMean, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dTTrg = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.ATrg) / MATERIAL.BTrg * pow( 0.25 * dStrandMean, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dTMax = ( MATERIAL.K_LAYERTIME / 100.0) * ( dMF + MATERIAL.AMax) / MATERIAL.BMax * pow( 0.25 * dStrandMean, MATERIAL.KW) * pow( dSliceStep, MATERIAL.KZ) * pow( dSC, MATERIAL.KN)
local dFMin = dTotLayerLength / dTMax * 60
local dFTrg = dTotLayerLength / dTTrg * 60
local dFMax = dTotLayerLength / dTMin * 60
local dFMin = dTotLayerLength / EgtIf( dTMax > 0.1, dTMax, 1) * 60
local dFTrg = dTotLayerLength / EgtIf( dTTrg > 0.1, dTTrg, 1) * 60
local dFMax = dTotLayerLength / EgtIf( dTMin > 0.1, dTMin, 1) * 60
local dLayerTime = dTTrg
if dLayerFeed == 0 then
dLayerFeed = dFTrg
@@ -241,8 +202,10 @@ function RunMachParamFromSWCalc.Exec()
dSpeed = dSMax
end
if not bSpeedOk then
dLayerFeed = ( MATERIAL.C1 * pow( ( dSpeed / (( MATERIAL.K_EXTRUSION / 100.0) * ( MACHINING.K / 100.0))), MATERIAL.C2)) * 1000 / ( ( dStrandMean - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2))
dLayerTime = dTotLayerLength / dLayerFeed * 60
if dTotLayerLength > 0.1 then
dLayerFeed = ( MATERIAL.C1 * pow( ( dSpeed / (( MATERIAL.K_EXTRUSION / 100.0) * ( MACHINING.K / 100.0))), MATERIAL.C2)) * 1000 / ( ( dStrandMean - dSliceStep) * dSliceStep + pi * pow( dSliceStep / 2, 2))
dLayerTime = dTotLayerLength / dLayerFeed * 60
end
dLayerWait = floor( dTMin + 0.5) - floor( dLayerTime + 0.5)
end
-- calcolo massa dello strato
@@ -276,15 +239,11 @@ function RunMachParamFromSWCalc.Exec()
EgtSetInfo( nLayerResultId, KEY_WAITING_TIME, dLayerWait)
end
-- scrivo valori in struttura dati
--local nLayerResultId = EgtGetFirstNameInGroup( nResultLayerId, nLayerIndex)
EgtSetInfo( nLayerResultId, KEY_TMIN, dTMin)
EgtSetInfo( nLayerResultId, KEY_TTRG, dTTrg)
EgtSetInfo( nLayerResultId, KEY_TMAX, dTMax)
EgtSetInfo( nLayerResultId, KEY_FTRG, dFTrg)
EgtSetInfo( nLayerResultId, KEY_FMAX, dFeedMax)
-- EgtSetInfo( nLayerResultId, KEY_FMIN, dFMin)
-- EgtSetInfo( nLayerResultId, KEY_FTRG, dFTrg)
-- EgtSetInfo( nLayerResultId, KEY_FMAX, dFMax)
EgtSetInfo( nLayerResultId, KEY_TCUR, dLayerTime)
EgtSetInfo( nLayerResultId, KEY_FCUR, dLayerFeed)
EgtSetInfo( nLayerResultId, KEY_LENGTH, dTotLayerLength)
@@ -296,11 +255,12 @@ function RunMachParamFromSWCalc.Exec()
EgtEmptyGroup( nResultLayerId)
return
end
-- passo al layer successivo
nLayerIndex = nLayerIndex + 1
nLayerId = EgtGetFirstNameInGroup( nPartId, SLICE_LAYER .. nLayerIndex) or EgtGetFirstNameInGroup( nPartId, "__" .. SLICE_LAYER .. nLayerIndex)
end
if nMaxIndex < nLayerIndex then nMaxIndex = nLayerIndex end
-- passo al pezzo successivo
nPartId = EgtGetNextPart( nPartId)
::continue::
end
+8 -11
View File
@@ -28,17 +28,16 @@ local function CalcCurves( nSliceId, nDestGrp, vtSlicing, dStrandBase)
if nType ~= TYPE.WIPE then
local dStrand = EgtGetInfo( nId, KEY_CRV_STRAND, 'd') or dStrandBase
-- TO DO : da sostituire con offset di Vroni che per curve aperte è la fat curve
-- calcolo fat curve a partire da una copia della curva ( in questo modo nel DB geometrico non restano
-- salvati i diagrammi di Voronoi che non servono per conti futuri)
local nCopy = EgtCopyGlob( nId, nDestGrp)
local nCopyInv = EgtCopyGlob( nId, nDestGrp)
EgtInvertCurve( nCopyInv)
EgtAddCurveCompoCurve( nCopy, nCopyInv)
local nCrv, nCnt = EgtOffsetCurveAdv( nCopy, 0.5 * dStrand)
local nCrv, nCnt = EgtCurveGetFatCurve( nCopy, nDestGrp, 0.5 * dStrand, false)
-- se fallisce ritento con valore leggermente diverso
if not nCrv or nCnt == 0 then
nCrv, nCnt = EgtOffsetCurveAdv( nCopy, 0.5 * dStrand - 0.05)
nCrv, nCnt = EgtCurveGetFatCurve( nCopy, nDestGrp, 0.5 * dStrand - 0.05, false)
end
EgtErase( nCopy)
if nCrv and nCnt > 0 then
-- se sono curve chiuse piccoli aggistamenti per creare un percorso unico
if nCnt > 1 then
@@ -76,8 +75,6 @@ local function CalcCurves( nSliceId, nDestGrp, vtSlicing, dStrandBase)
EgtSetColor( nCrv, EgtStdColor( 'AQUA'))
end
end
EgtErase( nCopy)
end
nId = EgtGetNext( nId)
@@ -117,7 +114,7 @@ end
------------------------------------------------------------------
function RunPrepareExport.Exec()
local nPartId = EgtGetFirstNameInGroup( GDB_ID.ROOT, PART .. '*')
if not nPartId then
EgtOutBox( 'Error : no part', 'Export')
@@ -183,7 +180,7 @@ function RunPrepareExport.Exec()
end
for i = 1, #vSlices do
-- creo il gruppo corrispondente
local nDestGrp = EgtGroup( nGrp)
EgtSetName( nDestGrp, EgtGetName( vSlices[i]))
+2 -2
View File
@@ -1,4 +1,4 @@
-- Version.lua by Egaltech s.r.l. 2023/10/02
-- Version.lua by Egaltech s.r.l. 2024/02/13
-- Gestione della versione di 3dPrinting
VERSION = '2.5l1'
VERSION = '2.6b1'