Get rid of strange code: preliminary check of self-intersections is made on a polygonal representation of a curve, it is able to find possible intersections, but after that it filter out segments neighbor to the pair of non-intersected segments.
Test case de step_4 I1 has been marked BAD, because the self-intersection is treated correctly, but the projection algorithm generates such crooked 2D curve.
Reference data in test cases heal split_angle_advanced ZA5 and ZA6 has been updated, because those shapes have self-intersected edges, which are being detected now.
}
}
- Standard_Integer Nelarg=(Poly1.NbSegments()/20);
- if(Nelarg<2) Nelarg=2;
-
for(Standard_Integer sp=1; sp <= Nbsp; sp++) {
if(TriIndex[sp]>0) {
const Intf_SectionPoint& SPnt = InterPP.PntValue(TriIndex[sp]);
if(Abs(SegIndex1-SegIndex2)>1) {
EIP.Perform(Poly1,Poly1,SegIndex1,SegIndex2,ParamOn1,ParamOn2);
- if(EIP.NbRoots()==0) {
- //-- All neighbor segments are removed
- for(Standard_Integer k=sp+1;k<=Nbsp;k++) {
- Standard_Integer kk=TriIndex[k];
- // --- avoid negative indices as well as in outer done
- if( kk > 0 ) {
- if( Abs(SegIndex1-PtrSegIndex1[kk])< Nelarg
- && Abs(SegIndex2-PtrSegIndex2[kk])< Nelarg) {
- TriIndex[k]=-k;
- }
- }
- }
- }
- else if(EIP.NbRoots()>=1) {
+ if(EIP.NbRoots()>=1) {
//--------------------------------------------------------------------
//-- It is checked if the found point is a root
//--------------------------------------------------------------------
--- /dev/null
+puts "================================================="
+puts "0032915: Geom2dAPI_InterCurveCurve, The algorithm lost an intersection point."
+puts "================================================="
+puts ""
+
+restore [locate_data_file bug32915.brep] e
+mkcurve c3d e
+plane p 0 0 1
+project c2d c3d p
+
+set inter [2dintersect c2d]
+if {[regexp -all "Intersection point" $inter] != 29} {
+ puts "Error: Wrong number of self-intersections (expected 29 points)."
+}
+
+v2d
+2dfit
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
# !!!! This file is generated automatically, do not edit manually! See end script
+puts "TODO ALL: Error : 1 differences with reference data found"
set filename PRO7187.stp
if {[string compare $command "SplitAngle"] == 0 } {
- puts "TODO OCC23127 ALL: Faulty shapes in variables faulty_1 to faulty_4 "
+ puts "TODO OCC23127 ALL: Faulty shapes in variables faulty_1 to faulty_"
}
restore [locate_data_file SEB-1.brep] a
if {[string compare $command "SplitAngle"] == 0 } {
- puts "TODO OCC23127 ALL: Faulty shapes in variables faulty_1 to faulty_4 "
+ puts "TODO OCC23127 ALL: Faulty shapes in variables faulty_1 to faulty_"
}
restore [locate_data_file SEB-1B.brep] a