]> OCCT Git - occt.git/commitdiff
0032864: Modeling Algorithms - Normal projection of a wire on a cylinder produces...
authorjgv <jgv@opencascade.com>
Thu, 21 Apr 2022 07:02:51 +0000 (10:02 +0300)
committersmoskvin <smoskvin@opencascade.com>
Wed, 20 Jul 2022 12:53:26 +0000 (15:53 +0300)
Minor correction in method BRepAlgo_NormalProjection::Build: correct mixed up first and last parameters of the projected curve.

src/BRepAlgo/BRepAlgo_NormalProjection.cxx
tests/bugs/modalg_8/bug32864 [new file with mode: 0644]

index f94dab3b0009365f86ee11c6c3f1b9cf0aa560b3..56355a7d85ee04816db041abaffeccb3838f6421 100644 (file)
@@ -340,7 +340,7 @@ void BRepAlgo_NormalProjection::SetDefaultParams()
          
          if(Only2d && Only3d) {
            BRepLib_MakeEdge MKed(GeomAdaptor::MakeCurve(hcur->Curve()), 
-                                 Ufin, Udeb);
+                                 Udeb, Ufin);
            prj = MKed.Edge();
            BB.UpdateEdge(TopoDS::Edge(prj), 
                          PCur2d, 
diff --git a/tests/bugs/modalg_8/bug32864 b/tests/bugs/modalg_8/bug32864
new file mode 100644 (file)
index 0000000..fd3afdb
--- /dev/null
@@ -0,0 +1,21 @@
+puts "========================================================================="
+puts "OCC32864: Normal projection of a wire on a cylinder produces wrong result"
+puts "========================================================================="
+puts ""
+
+restore [locate_data_file bug32864.brep] a
+explode a
+
+nproject result a_2 a_1
+
+checkshape result
+
+checknbshapes result -t -edge 8 -vertex 16
+
+set tolres [checkmaxtol result]
+
+if { ${tolres} > 0.0001} {
+   puts "Error: bad tolerance of result"
+}
+
+checkprops result -l 37.1616