3dPrinting :

- correzioni varie.
This commit is contained in:
DarioS
2022-04-19 17:21:45 +02:00
parent abcf0df3e9
commit aa7e4f87c4
6 changed files with 149 additions and 77 deletions
+16 -13
View File
@@ -1,4 +1,4 @@
-- CalcSolids.lua by Egaltech s.r.l. 2022/04/13
-- CalcSolids.lua by Egaltech s.r.l. 2022/04/19
-- Calcolo percorsi di lavoro per Stampa 3d
-- Tabella per definizione modulo
@@ -127,6 +127,7 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams)
local nCopyId = EgtCopyGlob( nCrvId, nSolidGrp)
local nId = EgtSplitCurve( nCopyId, nParts)
local bOk = true
for nInd = 0, nParts - 1 do
local ptS = EgtSP( nId + nInd)
@@ -138,23 +139,16 @@ local function CreateSolidFromCurve( nCrvId, nSolidGrp, LayerParams)
EgtErase( nSectId)
if nSrfId then
nSrfId = CloseSolid( nId + nInd, nSrfId, nSolidGrp, LayerParams)
EgtSetColor( nSrfId or GDB_ID.NULL, Color)
EgtSetInfo( nSrfId or GDB_ID.NULL, KEY_TYPE, nType)
else
EgtErase( nSectId)
for nInd3 = 0, nParts - 1 do
EgtErase( nId + nInd3)
end
for nInd3 = 0, nInd - 1 do
local nId2 = EgtGetLastInGroup( nSolidGrp)
EgtErase( nId2)
end
EgtOutBox( 'CalcSolid error', '')
return
bOk = false
end
EgtSetColor( nSrfId, Color)
EgtSetInfo( nSrfId, KEY_TYPE, nType)
EgtErase( nId + nInd)
end
return bOk
end
---------------------------------------------------------------------
@@ -166,6 +160,7 @@ function CalcSolids.Exec( nPartId)
return
end
local vErr = {}
for nIdx = 1, #vLayIds do
-- recupero i parametri relativi al layer
local LayerParams = GetLayerParamsForSolidCalc()
@@ -193,7 +188,10 @@ function CalcSolids.Exec( nPartId)
-- scorro le curve del percorso utensile
local nId = EgtGetFirstInGroup( nTPathGrpId)
while nId do
CreateSolidFromCurve( nId, nSolidGrpId, LayerParams)
local bOk = CreateSolidFromCurve( nId, nSolidGrpId, LayerParams)
if not bOk then
table.insert( vErr, nIdx)
end
nId = EgtGetNext( nId)
end
@@ -219,6 +217,11 @@ function CalcSolids.Exec( nPartId)
return
end
end
-- eventuale segnalazione errori
if #vErr > 0 then
EgtOutBox( 'Error on layers :\n' .. table.concat( vErr, ','), 'SolidCalc')
end
end
---------------------------------------------------------------------