-// Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#include <Standard_Stream.hxx>
#include "utilities.h"
+#include <Basics_OCCTVersion.hxx>
+
#include <BRep_Tool.hxx>
#include <BRep_TFace.hxx>
#include <BRep_Builder.hxx>
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()) {
// 12.04.2006 for PAL12149 begin
Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(aFace));
+
+// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN
+// the following block, when enabled, leads to extra vertices generation by partition algorithm
+// in some cases, for example when fillet is made on a PipeTShape
+//#if OCC_VERSION_LARGE > 0x06050200
+#if 0
+// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END
+ 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();