Close 4 sided hole with continuity

Hi All, I have this simple example where I want to close this hole of 4 edges using OpenCascade functions.

I tried BRepOffsetAPI_MakeFilling which gives sort of a solution, but the problem is that it approximates the edges and uses the edges as trim edges. I would expect the end result to be a BSplineSurface with these 4 edges as boundaries and touch the faces at least G1.

Another try was to use GeomFill_ConstrainedFilling, by providing GeomFill_BoundWithSurf constraints. If I use GeomFill_SimpleBound​, the function works ok, but if I use GeomFill_BoundWithSurf ​, the result is weird and doesn't give any sensible surface.

If I try this in Rhino, it does what I expect to happen

Do you have any suggestion which function can be used in 3 or 4 sided holes where we have the edges from the neighboring faces.


liuhuiwei's picture

Use code like this

GeomFill_ConstrainedFilling aConstrainedFilling(8, 2);

Handle(GeomFill_SimpleBound) B1 =

new GeomFill_SimpleBound(constrainedCurve[0], Precision::Approximation(), Precision::Angular());

Handle(GeomFill_SimpleBound) B2 =

new GeomFill_SimpleBound(constrainedCurve[1], Precision::Approximation(), Precision::Angular());

Handle(GeomFill_SimpleBound) B3 =

new GeomFill_SimpleBound(constrainedCurve[2], Precision::Approximation(), Precision::Angular());

Handle(GeomFill_SimpleBound) B4 =

new GeomFill_SimpleBound(constrainedCurve[3], Precision::Approximation(), Precision::Angular());

aConstrainedFilling.Init(B1, B2, B3, B4);

Handle(Geom_BSplineSurface) aBSplineSurface = aConstrainedFilling.Surface();

The result shape look good

Kostadin Vrantzaliev's picture

Thank you so much for the help, but although it works ok on this specific example, we don't use any constraints. I am looking more to be able to fill holes like in this example. The goal is to get continuity. If you ignore for now the small panels (we can get G0 there) how to make a nice transition between the two big patches. Tried with SimpleBound condition, but it is no enough, we need to provide at least tangency, but it doesn't work.



liuhuiwei's picture

Yes,using GeomFill_BoundWithSurf throw with exception,using GeomFill_SimpleBound can get result.It seems that GeomFill_ConstrainedFilling has bugs