- in BLADETOWASTE varie modifiche; cubetti funzionanti, da testare

- in BeamLib aggiunta funzione FindEdgeBestOrientedAsDirection
- in FeatureLib aggiunta funzione GetProcFromTrimesh per costruire il pacchetto Proc a partire da una trimesh
This commit is contained in:
luca.mazzoleni
2025-03-11 09:40:20 +01:00
parent d47343aba9
commit 1dc1aa5a7c
5 changed files with 213 additions and 99 deletions
+16
View File
@@ -526,6 +526,22 @@ function BeamLib.TableCopyDeep( OriginalTable)
return CopiedTable
end
---------------------------------------------------------------------
function BeamLib.FindEdgeBestOrientedAsDirection( Edges, vtDirection)
local BestEdge = {}
local dMaxDotProduct = GEO.INFINITO
for i = 1, #Edges do
local dCurrentDotProduct = ( Edges[i].vtN * vtDirection)
if ( i == 1) or ( dCurrentDotProduct > dMaxDotProduct + 10 * GEO.EPS_SMALL) then
dMaxDotProduct = dCurrentDotProduct
BestEdge = Edges[i]
end
end
return BestEdge
end
---------------------------------------------------------------------
-- Merge sorting - algoritmo di sorting stabile, ossia che mantiene l'ordine relativo se gli elementi sono equivalenti
-- TODO vedere come riordinare (tutto in tabella MergeSort??)