diff --git a/src/BRepFill/BRepFill_SectionPlacement.cxx b/src/BRepFill/BRepFill_SectionPlacement.cxx index 1a8ea20df5..6a71f992a7 100644 --- a/src/BRepFill/BRepFill_SectionPlacement.cxx +++ b/src/BRepFill/BRepFill_SectionPlacement.cxx @@ -283,9 +283,8 @@ BRepFill_SectionPlacement(const Handle(BRepFill_LocationLaw)& Law, // In the general case : Localisation via concatenation of the spine TColStd_Array1OfReal SuperKnot(1, myLaw->NbLaw()+1); - TColStd_Array1OfInteger Index(1, myLaw->NbLaw()); for (ii=1; ii<=myLaw->NbLaw(); ii++) { - SuperKnot(ii+1) = Index(ii) = ii; + SuperKnot(ii+1) = ii; } SuperKnot(1) = 0; @@ -318,8 +317,17 @@ BRepFill_SectionPlacement(const Handle(BRepFill_LocationLaw)& Law, } if (Bof) throw Standard_ConstructionError("Interval non trouve !!"); - Ind1 = Index(Ind1); - if (Ind2) Ind2 = Index(Ind2); + //Search of the by vertex + if (!TheV.IsNull()) + for (Ind1 = 1; Ind1 <= myLaw->NbLaw(); Ind1++) + { + TopoDS_Edge anEdge = myLaw->Edge(Ind1); + TopoDS_Vertex V1, V2; + TopExp::Vertices(anEdge, V1, V2); + if (V1.IsSame(TheV) || V2.IsSame(TheV)) + break; + } + //////////////////// // Positioning on the localized edge (or 2 Edges) Standard_Real Angle; diff --git a/tests/bugs/modalg_6/bug28468_1 b/tests/bugs/modalg_6/bug28468_1 new file mode 100644 index 0000000000..75f9e2f3bd --- /dev/null +++ b/tests/bugs/modalg_6/bug28468_1 @@ -0,0 +1,30 @@ +puts "============" +puts "OCC28468" +puts "============" +puts "" +############################################################################################## +# Sweep with different sections raises Standard_NoSuchObject: BRep_Tool:: no parameter on edge +############################################################################################## + +restore [locate_data_file bug28468_wire3.brep] sp +restore [locate_data_file bug28468_section_entree.brep] pr1 +restore [locate_data_file bug28468_section_passage1.brep] pr2 +restore [locate_data_file bug28468_section_passage2.brep] pr3 +restore [locate_data_file bug28468_section_sortie.brep] pr4 + +wire pr1 pr1 +wire pr4 pr4 + +explode sp V + +mksweep sp +addsweep pr1 sp_1 +addsweep pr2 sp_2 +addsweep pr3 sp_3 +addsweep pr4 sp_4 +buildsweep r + +checkshape r + +checknbshapes r -shell 1 -face 3 -wire 3 -edge 7 -vertex 4 +checkprops r -s 222710 diff --git a/tests/bugs/modalg_6/bug28468_2 b/tests/bugs/modalg_6/bug28468_2 new file mode 100644 index 0000000000..7c4d55aa78 --- /dev/null +++ b/tests/bugs/modalg_6/bug28468_2 @@ -0,0 +1,29 @@ +puts "============" +puts "OCC28468" +puts "============" +puts "" +############################################################################################## +# Sweep with different sections raises Standard_NoSuchObject: BRep_Tool:: no parameter on edge +############################################################################################## + +beziercurve bc1 3 100 0 0 1 0 100 0 3 -100 0 0 1 +beziercurve bc2 3 -100 0 0 1 0 -100 0 3 100 0 0 1 +mkedge e1 bc1 +mkedge e2 bc2 +wire sp e1 e2 +polyline pr1 110 0 10 90 0 10 90 0 -10 110 0 -10 110 0 10 +circle pr2 -100 0 0 0 1 0 10 +mkedge pr2 pr2 +wire pr2 pr2 +donly sp pr1 pr2 +explode sp v + +mksweep sp +addsweep pr1 sp_1 +addsweep pr2 sp_2 +buildsweep r + +checkshape r + +checknbshapes r -shell 1 -face 10 -wire 10 -edge 25 -vertex 15 +checkprops r -s 28569.4