Grasshopper

algorithmic modeling for Rhino

Dear Reader,

I have many shaped selected in a C# plugin. I want to join and merge them into one unique shape .

After that I want to do Ray Tracing So I need to test my tracer with no purpose else. If you know any easier way please help me.

Thanks

Mohmmad

Views: 3564

Replies to This Discussion

Perhaps you can supply us with what kind of geometry you want to join? For raytracing you can easily use the mesh merge to merge multiple meshes, in C# you can append a list of meshes by using:

List<Mesh> myMeshes;

Mesh singleMesh = new Mesh();

foreach (Mesh partialMesh in myMeshes)

{

      singleMesh.Append(partialMesh);

}

Output = singleMesh;

Dear Arend,

Thanks for your Reply. I have test it and it worked. But I think that merge them into a Brep is more suitable for me. I have done it by following Code :


this.unifiedBrep = new Brep();
foreach (ObjRef obj_i in selected_objects_ref)
{
this.unifiedBrep.Append(obj_i.Brep());
}

foreach (ObjRef obj in selected_objects_ref)
{
doc.Objects.Delete(obj.ObjectId, true);
}
doc.Objects.AddBrep(unifiedBrep);
doc.Views.Redraw();

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