From 332a5b2f74d95dd31f3789d72c1d3559c9711c81 Mon Sep 17 00:00:00 2001 From: jfa Date: Thu, 29 Mar 2012 14:04:01 +0000 Subject: [PATCH] A patch by JGV for correct usage of filling in function MakeAnyFace. --- src/GEOMImpl/GEOMImpl_Block6Explorer.cxx | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/GEOMImpl/GEOMImpl_Block6Explorer.cxx b/src/GEOMImpl/GEOMImpl_Block6Explorer.cxx index 6ec0ebf1d..0acbe7b20 100644 --- a/src/GEOMImpl/GEOMImpl_Block6Explorer.cxx +++ b/src/GEOMImpl/GEOMImpl_Block6Explorer.cxx @@ -27,6 +27,8 @@ #include "utilities.h" +#include + #include #include #include @@ -994,12 +996,12 @@ void GEOMImpl_Block6Explorer::InitByTwoFaces (const TopoDS_Shape& theFace1, TopoDS_Vertex aV1, aV2; TopExp::Vertices(wire1, aV1, aV2); - if ( !aV1.IsNull() && !aV2.IsNull() && aV1.IsSame(aV2) ) - aWire1.Closed( true ); + if (!aV1.IsNull() && !aV2.IsNull() && aV1.IsSame(aV2)) + aWire1.Closed(true); TopExp::Vertices(wire2, aV1, aV2); - if ( !aV1.IsNull() && !aV2.IsNull() && aV1.IsSame(aV2) ) - aWire2.Closed( true ); + if (!aV1.IsNull() && !aV2.IsNull() && aV1.IsSame(aV2)) + aWire2.Closed(true); // 4. Generate side surface if (!aWire1.Closed() || !aWire2.Closed()) { @@ -1358,6 +1360,20 @@ TCollection_AsciiString GEOMImpl_Block6Explorer::MakeAnyFace (const TopoDS_Wire& // 12.04.2006 for PAL12149 begin Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(aFace)); +#if OCC_VERSION_LARGE > 0x06050200 + BRep_Builder BB; + TopoDS_Iterator itw(theWire); + for (; itw.More(); itw.Next()) + { + const TopoDS_Edge& anEdge = TopoDS::Edge(itw.Value()); + TopoDS_Edge NewEdge = TopoDS::Edge(MF.Generated(anEdge).First()); + Standard_Real fpar, lpar; + Handle(Geom2d_Curve) NewPCurve = BRep_Tool::CurveOnSurface(NewEdge, TopoDS::Face(aFace), fpar, lpar); + TopLoc_Location aLoc; + Standard_Real NewTol = BRep_Tool::Tolerance(NewEdge); + BB.UpdateEdge(anEdge, NewPCurve, aGS, aLoc, NewTol); + } +#endif BRepBuilderAPI_MakeFace MK1 (aGS, theWire); if (MK1.IsDone()) { TopoDS_Shape aFace1 = MK1.Shape(); -- 2.39.2