Standard_Real DistA1A2=A1A2.Distance();
gp_Dir DA1=Con1.Position().Direction();
gp_Vec O1O2(Con1.Apex(),Con2.Apex());
- Standard_Real O1O2_DA1=gp_Vec(DA1).Dot(O1O2);
-
- gp_Vec O1_Proj_A2(O1O2.X()-O1O2_DA1*DA1.X(),
- O1O2.Y()-O1O2_DA1*DA1.Y(),
- O1O2.Z()-O1O2_DA1*DA1.Z());
+ gp_Dir O1O2n(O1O2); // normalization of the vector before projection
+ Standard_Real O1O2_DA1=gp_Vec(DA1).Dot(gp_Vec(O1O2n));
+
+ gp_Vec O1_Proj_A2(O1O2n.X()-O1O2_DA1*DA1.X(),
+ O1O2n.Y()-O1O2_DA1*DA1.Y(),
+ O1O2n.Z()-O1O2_DA1*DA1.Z());
gp_Dir DB1=gp_Dir(O1_Proj_A2);
-
+
Standard_Real yO1O2=O1O2.Dot(gp_Vec(DA1));
Standard_Real ABSTG1 = Abs(tg1);
Standard_Real X2 = (DistA1A2/ABSTG1 - yO1O2)*0.5;
set status 0
if { [regexp "Faulty shapes in variables faulty_1 to faulty_2" $info1] != 1 } {
- puts "Error : There is no 2 mistakes by checkshape on face1
+ puts "Error : There is no 2 mistakes by checkshape on face1"
set status 1
}
if { [regexp "Faulty shapes in variables faulty_1 to faulty_2" $info2] != 1 } {
- puts "Error : There is no 2 mistakes by checkshape on face2
+ puts "Error : There is no 2 mistakes by checkshape on face2"
set stauts 1
}
--- /dev/null
+puts "================"
+puts "OCC24142"
+puts "================"
+puts ""
+#################################################################
+## Wrong section curve
+#################################################################
+
+restore [locate_data_file OCC152.brep] sh
+explode sh f
+
+mksurface s1 sh_3
+mksurface s2 sh_5
+
+trim st1 s1 0 6.28318530717959 0 74.9999999999999
+trim st2 s2 0 6.28318530717959 -74.0551172696384 125.944882730362
+
+intersect i st1 st2
+
+dlog reset
+dlog on
+xdistcs i st2 0 1 10
+set log_on [dlog get]
+
+if { [regexp "i is null curve" ${log_on}] != 1 } {
+ puts "Error : Wrong section curve"
+}
+
+set 2dviewer 1