3dPrinting :

- modifiche per utilizzare la nuova funzione per il calcolo degli offset di flat regions ( per Voronoi).
This commit is contained in:
SaraP
2024-01-29 14:43:43 +01:00
parent 5619072e46
commit e37a2f8e85
+16 -20
View File
@@ -85,24 +85,16 @@ 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
--------------------------------------------------------------------
@@ -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
----------------------------------------------------------------------
@@ -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