C#_Brep Outlines

unhandled
(OmKar) #1

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;

(Michael Pryor) #2

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

1 Like
(OmKar) #3

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

(Menno Deij - van Rijswijk) #4

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

(OmKar) #5

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

(Tim Stark) #6

Is this Kuwait International Airport?

1 Like