diff --git a/src/BRepMesh/BRepMesh_FastDiscret.cxx b/src/BRepMesh/BRepMesh_FastDiscret.cxx index 1d4d9273d6..a2e543a7ef 100755 --- a/src/BRepMesh/BRepMesh_FastDiscret.cxx +++ b/src/BRepMesh/BRepMesh_FastDiscret.cxx @@ -990,8 +990,39 @@ void BRepMesh_FastDiscret::Add( const TopoDS_Edge& theEdge, TopLoc_Location L; Standard_Integer nbpmin = 2; - if (cons.GetType() == GeomAbs_Circle) nbpmin = 4; //OCC287 - BRepMesh_GeomTool GT(cons, wFirst, wLast, 0.5*myAngle, otherdefedge, nbpmin); + const GeomAbs_CurveType aCurveType = cons.GetType(); + if ( aCurveType == GeomAbs_Circle ) + nbpmin = 4; //OCC287 + + BRepMesh_GeomTool GT(cons, wFirst, wLast, 0.5 * myAngle, otherdefedge, nbpmin); + + if ( aCurveType == GeomAbs_BSplineCurve ) + { + const Standard_Integer aNbInt = cons.NbIntervals( GeomAbs_C1 ); + if ( aNbInt > 0 ) + { + TColStd_Array1OfReal anIntervals( 1, aNbInt + 1 ); + cons.Intervals( anIntervals, GeomAbs_C1 ); + for ( Standard_Integer aIntIt = 1; aIntIt <= aNbInt; ++aIntIt ) + { + const Standard_Real& aStartInt = anIntervals.Value( aIntIt ); + const Standard_Real& anEndInt = anIntervals.Value( aIntIt + 1 ); + + BRepMesh_GeomTool aDetalizator( cons, aStartInt, anEndInt, + 0.5 * myAngle, otherdefedge, nbpmin ); + + Standard_Integer aNbAddNodes = aDetalizator.NbPoints(); + for ( Standard_Integer aNodeIt = 1; aNodeIt <= aNbAddNodes; ++aNodeIt ) + { + Standard_Real aParam; + gp_Pnt aPoint3d; + gp_Pnt2d aPoint2d; + aDetalizator.Value( cons, theGFace, aNodeIt, aParam, aPoint3d, aPoint2d ); + GT.AddPoint( aPoint3d, aParam, Standard_False ); + } + } + } + } // PTv, chl/922/G9, Take into account internal vertices // it is necessary for internal edges, which do not split other edges, by their vertex diff --git a/tests/bugs/mesh/bug23184_1 b/tests/bugs/mesh/bug23184_1 new file mode 100755 index 0000000000..e8b51c0301 --- /dev/null +++ b/tests/bugs/mesh/bug23184_1 @@ -0,0 +1,24 @@ +puts "========================" +puts "CR23184" +puts "========================" +puts "" +####################################################################### +# Bad face tessellation result +####################################################################### + +brestore [locate_data_file bug23184_tessface2.brep] result + +checkshape result + +tclean result + +set Deflection 0.045 + +incmesh result ${Deflection} + +vinit +vsetdispmode 1 +vdisplay result +vfit + +set only_screen 1 diff --git a/tests/bugs/mesh/bug23184_2 b/tests/bugs/mesh/bug23184_2 new file mode 100755 index 0000000000..0bc02ebc8d --- /dev/null +++ b/tests/bugs/mesh/bug23184_2 @@ -0,0 +1,24 @@ +puts "========================" +puts "CR23184" +puts "========================" +puts "" +####################################################################### +# Bad face tessellation result +####################################################################### + +brestore [locate_data_file bug23184_tessface.brep] result + +checkshape result + +tclean result + +set Deflection 0.045 + +incmesh result ${Deflection} + +vinit +vsetdispmode 1 +vdisplay result +vfit + +set only_screen 1