Check for double solutions has been added in algorithms Extrema_ELPCOfLocateExtPC and Extrema_ELPCOfLocateExtPC2d
that find extrema between point and curve.
Standard_EXPORT void IntervalPerform (const gp_Pnt& P);
+ Standard_EXPORT void AddSol(const Standard_Real theU,
+ const gp_Pnt& theP,
+ const Standard_Real theSqDist,
+ const Standard_Boolean isMin);
Standard_EXPORT void IntervalPerform (const gp_Pnt2d& P);
+ Standard_EXPORT void AddSol(const Standard_Real theU,
+ const gp_Pnt2d& theP,
+ const Standard_Real theSqDist,
+ const Standard_Boolean isMin);
Standard_EXPORT void IntervalPerform (const gp_Pnt& P);
+ Standard_EXPORT void AddSol(const Standard_Real theU,
+ const gp_Pnt& theP,
+ const Standard_Real theSqDist,
+ const Standard_Boolean isMin);
Standard_EXPORT void IntervalPerform (const gp_Pnt2d& P);
+ Standard_EXPORT void AddSol(const Standard_Real theU,
+ const gp_Pnt2d& theP,
+ const Standard_Real theSqDist,
+ const Standard_Boolean isMin);
}
if ((U >= myuinf - mytolu) && (U <= myusup + mytolu))
{
- PC.SetValues(U, PC.Value());
- mySqDist.Append(myExtPC.SquareDistance(i));
- myismin.Append(myExtPC.IsMin(i));
- mypoint.Append(PC);
+ AddSol(U, PC.Value(),
+ myExtPC.SquareDistance(i),
+ myExtPC.IsMin(i));
}
}
}
}
+//=======================================================================
+//function : AddSol
+//purpose :
+//=======================================================================
+
+void Extrema_GExtPC::AddSol(const Standard_Real theU, const ThePoint& theP,
+ const Standard_Real theSqDist,
+ const Standard_Boolean isMin)
+{
+ Standard_Integer i, NbExt = mypoint.Length();
+ for (i = 1; i <= NbExt; i++)
+ {
+ Standard_Real t = mypoint.Value(i).Parameter();
+ if (Abs(t - theU) <= mytolu)
+ {
+ return;
+ }
+ }
+ ThePOnC PC(theU, theP);
+ mySqDist.Append(theSqDist);
+ myismin.Append(isMin);
+ mypoint.Append(PC);
+
+ }
//=======================================================================
set y 6.0
set z -3.0
set pp_ch1 1
-set pp_ch2 1
restore [locate_data_file bug23706_c03.draw] c
set info [proj c $x $y $z]
regexp {parameter 1 += +([-0-9.+eE]+)} $info full pp1
-regexp {parameter 2 += +([-0-9.+eE]+)} $info full pp2
-if { $pp1 != $pp_ch1 || $pp2 != $pp_ch2 } {
+if { $pp1 != $pp_ch1 } {
puts "Error : Projection is not correct"
} else {
puts "OK: Projection is correct"
set y 6.0
set z -3.0
set pp_ch1 1
-set pp_ch2 1
restore [locate_data_file bug23706_c04.draw] c
set info [proj c $x $y $z]
regexp {parameter 1 += +([-0-9.+eE]+)} $info full pp1
-regexp {parameter 2 += +([-0-9.+eE]+)} $info full pp2
-if { $pp1 != $pp_ch1 || $pp2 != $pp_ch2 } {
+if { $pp1 != $pp_ch1 } {
puts "Error : Projection is not correct"
} else {
puts "OK: Projection is correct"
set y 6.0
set z -3.0
set pp_ch1 1
-set pp_ch2 1
restore [locate_data_file bug23706_c05.draw] c
set info [proj c $x $y $z]
regexp {parameter 1 += +([-0-9.+eE]+)} $info full pp1
-regexp {parameter 2 += +([-0-9.+eE]+)} $info full pp2
-if { $pp1 != $pp_ch1 || $pp2 != $pp_ch2 } {
+if { $pp1 != $pp_ch1 } {
puts "Error : Projection is not correct"
} else {
puts "OK: Projection is correct"
set y 6.0
set z -3.0
set pp_ch1 1
-set pp_ch2 1
restore [locate_data_file bug23706_c07.draw] c
set info [proj c $x $y $z]
regexp {parameter 1 += +([-0-9.+eE]+)} $info full pp1
-regexp {parameter 2 += +([-0-9.+eE]+)} $info full pp2
-if { $pp1 != $pp_ch1 || $pp2 != $pp_ch2 } {
+if { $pp1 != $pp_ch1 } {
puts "Error : Projection is not correct"
} else {
puts "OK: Projection is correct"
set y 6.0
set z -3.0
set pp_ch1 1
-set pp_ch2 1
restore [locate_data_file bug23706_c08.draw] c
set info [proj c $x $y $z]
regexp {parameter 1 += +([-0-9.+eE]+)} $info full pp1
-regexp {parameter 2 += +([-0-9.+eE]+)} $info full pp2
-if { $pp1 != $pp_ch1 || $pp2 != $pp_ch2 } {
+if { $pp1 != $pp_ch1 } {
puts "Error : Projection is not correct"
} else {
puts "OK: Projection is correct"
set pp_ch5 5.4804063007678074
set pp_ch6 6.2485611263687888
set pp_ch7 6.7381612209715556
-set pp_ch8 1.1738953633378706
restore [locate_data_file bug23706_c12.draw] c
set info [proj c $x $y $z]
regexp {parameter 5 += +([-0-9.+eE]+)} $info full pp5
regexp {parameter 6 += +([-0-9.+eE]+)} $info full pp6
regexp {parameter 7 += +([-0-9.+eE]+)} $info full pp7
-regexp {parameter 8 += +([-0-9.+eE]+)} $info full pp8
if { $pp1 != $pp_ch1 ||
$pp2 != $pp_ch2 ||
$pp3 != $pp_ch3 ||
$pp4 != $pp_ch4 ||
$pp5 != $pp_ch5 ||
$pp6 != $pp_ch6 ||
- $pp7 != $pp_ch7 ||
- $pp8 != $pp_ch8} {
+ $pp7 != $pp_ch7 } {
puts "Error : Projection is not correct"
} else {
puts "OK: Projection is correct"
--- /dev/null
+puts "========"
+puts "OCC29857"
+puts "========"
+puts ""
+####################################
+## Extrema between Point and Curve returns two results
+## (there should be only one) that are actually the same
+####################################
+
+
+restore [locate_data_file bug29857.brep] c
+set info [proj c -53.9663741221239 118.723988602907 -57.6228206908223]
+
+set pp1 ""
+set pp2 ""
+regexp {ext_1} $info pp1
+regexp {ext_2} $info pp2
+
+if { $pp2 != "" } {
+ puts "Error : Projection is not correct"
+}
+if { $pp1 != "" } {
+ puts "OK: Projection is correct"
+} else {
+ puts "Error : Projection is not correct"
+}
--- /dev/null
+puts "========"
+puts "OCC29857_1"
+puts "========"
+puts ""
+####################################
+## Extrema between Point and Curve returns three solutions
+## (there should be only two), two of these are actually the same
+####################################
+
+
+restore [locate_data_file bug29857_1.brep] c
+set info [proj c -139.04514104219 128.256108703487 -64.9999999999983]
+
+set pp1 ""
+set pp2 ""
+set pp3 ""
+regexp {ext_1} $info pp1
+regexp {ext_2} $info pp2
+regexp {ext_3} $info pp3
+if { $pp3 != "" } {
+ puts "Error : Projection is not correct"
+}
+if { $pp1 != "" && $pp2 != "" } {
+ puts "OK: Projection is correct"
+} else {
+ puts "Error : Projection is not correct"
+}
# !!!! This file is generated automatically, do not edit manually! See end script
puts "TODO CR23096 ALL: TPSTAT : Faulty"
+
set filename bm4_ct_punch.stp
set ref_data {
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 4 ) Summary = 0 ( 4 )
-TPSTAT : Faulties = 0 ( 0 ) Warnings = 32 ( 7 ) Summary = 32 ( 7 )
+TPSTAT : Faulties = 0 ( 0 ) Warnings = 31 ( 5 ) Summary = 31 ( 5 )
CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
NBSHAPES : Solid = 3 ( 3 ) Shell = 21 ( 21 ) Face = 197 ( 197 ) Summary = 1443 ( 1443 )
STATSHAPE : Solid = 3 ( 3 ) Shell = 21 ( 21 ) Face = 197 ( 197 ) FreeWire = 0 ( 0 ) FreeEdge = 0 ( 0 ) SharedEdge = 573 ( 573 )
-TOLERANCE : MaxTol = 0.255769437 ( 0.255769437 ) AvgTol = 0.0008786095241 ( 0.001031806589 )
+TOLERANCE : MaxTol = 0.01857875733 ( 0.344407912 ) AvgTol = 0.0002556280658 ( 0.00124778276 )
LABELS : N0Labels = 6 ( 6 ) N1Labels = 45 ( 45 ) N2Labels = 0 ( 0 ) TotalLabels = 51 ( 51 ) NameLabels = 11 ( 11 ) ColorLabels = 41 ( 41 ) LayerLabels = 21 ( 21 )
PROPS : Centroid = 0 ( 0 ) Volume = 0 ( 0 ) Area = 0 ( 0 )
NCOLORS : NColors = 4 ( 4 )