- 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:
@@ -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??)
|
||||
|
||||
Reference in New Issue
Block a user