CapPlanarHoles()

Hi all,

I have a problem with the Brep-method CapPlanarHoles(). I am lofting three circles and then caping them with the CapPlanarHoles. However, it does not only cap the planar holes but also adds a surface on the side. Attached a picture of what it looks like. Do anyone know why this happens? When I do the capping with the GH-node or use the NodeInCode I do not have that issue (however, then get other issues as NodeInCode returns Object instead of Brep).

My code is:

List<Brep> breps = new List<Brep>();

var tempBreps = Brep.CreateFromLoft(_circles, Point3d.Unset, Point3d.Unset, LoftType.Straight, false);

foreach (var brep in tempBreps)
{
      breps.Add(brep);
}

for (int i = 0; i < breps.Count; i++)
{
      brep[i] = breps[i].CapPlanarHoles(0.001);
}

Capture2

Hi @jmhannu,

Can you post your GH file?

– Dale

It’s part of a VS-project so I’ve cut out the parts with the lofts into a C#-node. So, now I’ve attached the GH-file - sorry if the adaption got a bit messy - @dale I would really appreciate it if you would have a look.

/Julia

Loft.gh (7.0 KB)

Hi @jmhannu,

Lofting with straight sections will create a surface with kinks.

Because kinked surface can cause problems down stream, Rhino always splits kinked surfaces when adding Breps to the document.

Since you are not adding these Breps to the document, split the kinked surfaces yourself.

uncaped[i].Faces.SplitKinkyFaces(RhinoMath.DefaultAngleTolerance, true);

Hope this helps.

– Dale

1 Like

Thanks a lot @dale , this solved it!