diff --git a/src/BOPTools/BOPTools_AlgoTools2D.cxx b/src/BOPTools/BOPTools_AlgoTools2D.cxx index c0542888ae..2798ee393c 100644 --- a/src/BOPTools/BOPTools_AlgoTools2D.cxx +++ b/src/BOPTools/BOPTools_AlgoTools2D.cxx @@ -589,14 +589,16 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace { Standard_Real aTolR; Handle(Geom2d_Curve) aC2DA; - - BRepAdaptor_Surface aBAS(aF, Standard_False); - Handle(BRepAdaptor_HSurface) aBAHS = new BRepAdaptor_HSurface(aBAS); - Handle(GeomAdaptor_HCurve) aBAHC = new - GeomAdaptor_HCurve(aC3D, aFirst, aLast); + // + Handle(Geom_Surface) aS=BRep_Tool::Surface(aF); + GeomAdaptor_Surface aGAS(aS); + Handle(GeomAdaptor_HSurface) aBAHS= + new GeomAdaptor_HSurface(aGAS); + Handle(GeomAdaptor_HCurve) aBAHC = + new GeomAdaptor_HCurve(aC3D, aFirst, aLast); //when the type of surface is GeomAbs_SurfaceOfRevolution - if (aBAS.GetType() == GeomAbs_SurfaceOfRevolution) { + if (aGAS.GetType() == GeomAbs_SurfaceOfRevolution) { Standard_Real aTR = 1.e-7; ProjLib_ProjectedCurve aProj1(aBAHS, aBAHC, aTR); BOPTools_AlgoTools2D::MakePCurveOfType(aProj1, aC2D); diff --git a/tests/bugs/modalg_5/bug24973 b/tests/bugs/modalg_5/bug24973 new file mode 100755 index 0000000000..38bd88fc91 --- /dev/null +++ b/tests/bugs/modalg_5/bug24973 @@ -0,0 +1,26 @@ +puts "============" +puts "OCC24973" +puts "============" +puts "" +###################################################### +# Incorrect PCurve construction +###################################################### + +restore [locate_data_file bug24973_Face.brep] f + +pcurve f +explode f e + +tcopy f_9 e +bhaspc e f do +mk2dcurve c e f +to3d c3d c +mkedge e c3d + +set info [bopargcheck e #F] + +if { [regexp "to be valid for BOP" ${info}] == 1 } { + puts "OK : Created curve is correct" +} else { + puts "Error : Created curve is not correct" +}