- Correzioni e migliorie su pezzo di esempio

- Gestione avvio script solo quando eseguiti precedenti
- Correzioni varie
This commit is contained in:
Emmanuele Sassi
2022-04-13 15:35:05 +02:00
parent 4cdade69e4
commit 261aec363d
12 changed files with 417 additions and 239 deletions
+26 -9
View File
@@ -1,4 +1,4 @@
-- CalcPaths.lua by Egaltech s.r.l. 2022/03/30
-- CalcPaths.lua by Egaltech s.r.l. 2022/04/13
-- Calcolo percorsi di lavoro per Stampa 3d
-- Tabella per definizione modulo
@@ -56,7 +56,7 @@ local function GetPathsFromSurf( nSrfId, sName, nType, nGrpId, nLayId, dStrand)
-- scelta start point
local ptStart = GetLayerStartPoint( nLayId)
EgtChangeClosedCurveStartPoint( nCrvId + nInd, ptStart)
EgtChangeClosedCurveStartPoint( nCrvId + nInd, ptStart, GDB_RT.GLOB)
end
end
end
@@ -123,19 +123,36 @@ function CalcPaths.Exec( nPartId)
if nSrf then
-- esterno
local nSrfId = EgtCopyGlob( nSrf, nCrvGrpId)
local dOffs = 0.5 * LayerParams.dStrand - LayerParams.dOffs
EgtSurfFrOffset( nSrfId, - dOffs)
-- estraggo i contorni (pareti esterne)
GetPathsFromSurf( nSrfId, SHELL_CRV..'0', TYPE.OUTER_SHELL, nGrpId, nLayId, LayerParams.dStrand)
local dOffs = 0.5 * LayerParams.dStrand - LayerParams.dOffs
local bOk = ( EgtSurfFrOffset( nSrfId, -dOffs) and EgtSurfFrChunkCount( nSrfId) > 0)
if not bOk then
EgtErase( nSrfId)
nSrfId = EgtCopyGlob( nSrf, nCrvGrpId)
bOk = ( EgtSurfFrOffset( nSrfId, -dOffs + 0.05) and EgtSurfFrChunkCount( nSrfId) > 0)
end
-- se offset riuscito, estraggo i contorni (pareti esterne)
if bOk then
GetPathsFromSurf( nSrfId, SHELL_CRV..'0', TYPE.OUTER_SHELL, nGrpId, nLayId, LayerParams.dStrand)
else
EgtOutLog( 'Error on ExtOffset (layer '..tostring( nIdx)..') - CalcPaths')
end
EgtErase( nSrfId)
-- calcolo pareti interne
for nInd2 = 1, LayerParams.nShellsNbr - 1 do
-- offset della superficie originale
local nSrfId = EgtCopy( nSrf, nGrpId)
if EgtSurfFrOffset( nSrfId, - dOffs - nInd2 * LayerParams.dStrand) then
-- estraggo i contorni ( pareti interne)
GetPathsFromSurf( nSrfId, SHELL_CRV..tostring( nInd2), TYPE.INNER_SHELL, nGrpId, nLayId, LayerParams.dStrand)
local bOk = ( EgtSurfFrOffset( nSrfId, - dOffs - nInd2 * LayerParams.dStrand) and EgtSurfFrChunkCount( nSrfId) > 0)
if not bOk then
EgtErase( nSrfId)
nSrfId = EgtCopyGlob( nSrf, nCrvGrpId)
bOk = ( EgtSurfFrOffset( nSrfId, -dOffs + 0.05 - nInd2 * LayerParams.dStrand) and EgtSurfFrChunkCount( nSrfId) > 0)
end
-- se offset riuscito, estraggo i contorni ( pareti interne)
if bOk then
GetPathsFromSurf( nSrfId, SHELL_CRV..tostring( nInd2), TYPE.INNER_SHELL, nGrpId, nLayId, LayerParams.dStrand)
else
EgtOutLog( 'Error on IntOffset (layer '..tostring( nIdx)..') - CalcPaths')
end
EgtErase( nSrfId)
end