Mesh vertex normals list

Hi all,

how can I convert the MeshVertexNormalList to a List of Vectors?
https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_Geometry_Collections_MeshVertexNormalList.htm
I just can found the .ToFloatArray() method.
Is there a more direct way?

Thanks!

Hi @Baris, in case of a python script, you could try below:

import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
import System

from System.Collections.Generic import List
from Rhino.Geometry import Vector3f

def DoSomething():
    mesh_id = rs.GetObject("Mesh", 32, True, True)
    if not mesh_id: return
    
    mesh_obj = scriptcontext.doc.Objects.FindId(mesh_id)
    normals = List[Vector3f](mesh_obj.Geometry.Normals)
    
    print type(normals)

DoSomething() 

it should give you one List[Vector3f].
_
c.

1 Like

Thanks for the answer ill give it a try.
Probably my initial problem requieres another approach.The Mesh thing is still kind a new for me.

Screen%20Shot%20082

NOTE: Prior asking for Normals you sould compute them.

NOTE: M.Normals indexing is acc M.Vertices indexing that IS NOT the same with M.TopologyVertices indexing. Prior doing anything with meshes resolve this 100% in your mind.

BTW: The attached can shed some light on Normal matters (what exactly is a vertex Normal? is it a bird? is it a plane? is it the Superman? etc etc)

Mesh_NormalsHowToCompute_V1.gh (11.0 KB)

1 Like

Hi Peter,

thanks for the example. It´s nice to study with.

Regards Baris