Hello everyone, is there a faster way to extract face boundaries from a mesh in C#? (faster than or as grasashopper component)?
Face Boundaries.gh (10.6 KB)
using System.Linq;
private void RunScript(Mesh mesh, ref object A)
{ Component.Name = "Face.Edge Boundaries by unweld Edge";
var ix = System.Linq.Enumerable.Range(0, mesh.Faces.QuadCount * 4 + mesh.Faces.TriangleCount * 3);
var edges = new List<Polyline>();
mesh.UnweldEdge(ix, true);
var meshf = mesh.ExplodeAtUnweldedEdges();
foreach(var m in meshf){
var v = m.Vertices.ToPoint3dArray().ToList();
edges.Add(new Polyline(v));}
A = edges; }
7 posts - 3 participants
