]> 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>
Thu, 21 Apr 2022 21:29:38 +0000 (00:29 +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 bd31fde08b6c98643239345f37928522c573d376..65bc1922e061fac16d6dfc2c13f6fa91168b9acd 100644 (file)
@@ -334,7 +334,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