Commit 6d10f9fd authored by Christophe Geuzaine's avatar Christophe Geuzaine

better addFaceFilling, which should not duplicate bnoundary edges anymore

parent b009c283
......@@ -1418,9 +1418,6 @@ bool OCC_Internals::addSurfaceFilling(int &tag, int wireTag)
for(exp0.Init(wire, TopAbs_EDGE); exp0.More(); exp0.Next()){
TopoDS_Edge edge = TopoDS::Edge(exp0.Current());
f.Add(edge, GeomAbs_C0);
// face filling will duplicate the edge
unbind(edge, _edgeTag.Find(edge), true);
// TODO: add optional point constraints using f.Add(gp_Pnt(x, y, z);
......@@ -1428,7 +1425,15 @@ bool OCC_Internals::addSurfaceFilling(int &tag, int wireTag)
Msg::Error("Could not build surface filling");
return false;
result = TopoDS::Face(f.Shape());
// face filling duplicates the edges, so we need to go back to the
// underlying surface, and remake a new face explicitly with the wire;
// applying ShapeFix is mandatory (not sure why...)
TopoDS_Face tmp = TopoDS::Face(f.Shape());
Handle(Geom_Surface) s = BRep_Tool::Surface(tmp);
result = BRepBuilderAPI_MakeFace(s, wire);
ShapeFix_Face fix(result);
result = fix.Face();
catch(Standard_Failure &err){
Msg::Error("OpenCASCADE exception %s", err.GetMessageString());
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment