C#_Brep Outlines

Hello,

I am trying to extract outer edges of surfaces. However output is really weird. Let me know what I am doing wrong.

Find attached code and image bellow.

Thanks!

DataTree<Curve> outlines = new DataTree<Curve>();

for(int i = 0; i < iSrf.BranchCount;i++)
{
  GH_Path gp = new GH_Path(i);

  for(int j = 0; j < iSrf.Branch(i).Count; j++)
  {
    Brep bR = iSrf.Branch(i)[j].ToBrep();

    foreach(BrepLoop loop in bR.Loops)
    {
      if(loop.LoopType == BrepLoopType.Outer)
      {
        outlines.Add(loop.To3dCurve(), gp);
      }
    }
  }
}

A = outlines;

You could just run Brep.DuplicateEdgeCurves for each face.
Curve[] edges= yourBrepFace.DuplicateEdgeCurves();

1 Like

This gives me all the edges of Brep. I need outer curves and not interior curves of breps, therefore i used BrepLoop.

In that case, you could maybe use only the naked edges like so

Curve[] nakedEdges = yourBrep.DuplicateEdges(nakedOnly:true);

https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_Brep_DuplicateEdgeCurves_1.htm

No, It still shows all the edges. With BrepLoopType.Outer I am able to get outlines but dont understand why the outlines are moved.

Is this Kuwait International Airport?

1 Like