-- CalcBezier.lua by Egalware s.r.l. 2026/01/22 require( 'EgtBase') _ENV = EgtProtectGlobal() EgtEnableDebug( false) -- Carico le costanti di Trimming EgtAddToPackagePath( EgtGetSourceDir() .. '?.lua') local GlobVar = require( 'TrimmingLib') -- Costante di Errore local ERROR_BEZIER_CREATION = 'Error in Ruled Bezier Creation : ' -- Recupero il Part e il Layer di Trimming con le relative Info local nCurrPartId = EgtGetCurrPart() local nCurrLayerId = GlobVar.GetTrimmingLayerRefId( EgtGetCurrLayer()) if not GlobVar.IsTrimmingLayer( nCurrLayerId) then EgtOutBox( ERROR_BEZIER_CREATION .. 'Not a valid Trimming Layer', 'Error', 'ERROR', 'OK') return end -- Chiedo Conferma dell'Operazione local bDelete = EgtOutBox( 'Do you want erase the Bezier Surface ?', 'Confirm', 'QUESTION', 'YESNO') if not bDelete then EgtSetCurrPartLayer( nCurrPartId, nCurrLayerId) return end -- Rimuovo tutte le entità che sono Superfici di Bezier Ruled nel Layer corrente local vIdToErase = {} local nId = EgtGetFirstInGroup( nCurrLayerId) while nId do local sName = EgtGetName( nId) if sName == RULED_BZ_NAME then table.insert( vIdToErase, nId) end nId = EgtGetNext( nId) end EgtErase( vIdToErase) -- Aggiorno la Grafica EgtDraw()