Grasshopper

algorithmic modeling for Rhino

hello all,

I need to convert from GH_Mesh to Rhino.Geometry Mesh

with no success, any clue?

thanks in advance

c.

Im trying this:

GH_Structure<Grasshopper.Kernel.Types.GH_Mesh> datatreeMeshing = null;

if (!DA.GetDataTree(0, out datatreeMeshing)) { return; }

List<Grasshopper.Kernel.Types.GH_Mesh> meshlist = datatreeMeshing.FlattenData();

foreach(Grasshopper.Kernel.Types.GH_Mesh ghMesh in meshlist)

{

  if (ghM.IsValid)
  {

    Mesh m = new Mesh();
    ghMesh.CastFrom(m); //fails here in the Castform...

  }

}

Views: 554

Replies to This Discussion

CastFrom goes the other way around. CastTo would do it, but you can also just access the mesh inside the GH_Mesh directly using the Value property.

Note the GH_Mesh may be shared, so if you want to make changes to the mesh, you must create a duplicate first.

thanks David,

I try CastTo<> also but didn't work. 

I'm using the Value property instead.

regards

C

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service