I am getting a Invalid brep every time i try this - what can be the cause for this ?
The boundary i supply is planar and consisting of a closed polyline with 5 points.
Also, it would be great if someone could highlight usage and difference between following methods as they both seem to serve similar purpose, unfortunately explanation in the sdk documentation is a bit thin :
Rhino.Geometry.Brep.Loops.AddOuterLoop() -> just needs a faceindex as input -> where do you supply a curve for this ?
Internally, ON_Brep::NewPlanarFaceLoop, which is what Rhino.Geometry.Brep.Loops.AddPlanarFaceLoop ends up calling, is somewhat of an expert tool. And while it works adding inner loops, it doesn’t work to add an outer loop to a face that already has an outer loop - you end up with 2 and, thus, an invalid Brep.
Ideally, you should be able to create a Brep by providing a plane and one our more outer loops. Then you can call AddPlanarFaceLoop to add what you want.
Since there isn’t anything available in RhinoCommon that does this in V5, I’ve added an item to get one added to V6.