]> OCCT Git - occt.git/commitdiff
0033639: Modeling Algorithms - Boolean torus cut cone failed CR33639
authorakaftasev <akaftasev@opencascade.com>
Thu, 6 Jun 2024 13:45:35 +0000 (14:45 +0100)
committerakaftasev <akaftasev@opencascade.com>
Thu, 6 Jun 2024 13:45:35 +0000 (14:45 +0100)
Avoid adding an apex of cone as singular pole, which is lying on torus surface

src/IntPatch/IntPatch_SpecialPoints.cxx
tests/bugs/modalg_8/bug33639_1 [new file with mode: 0644]
tests/bugs/modalg_8/bug33639_2 [new file with mode: 0644]

index d2fb94add03c64e6f52d72b6efdc20a8716fa20e..af531197f16ed04a52f796be9efe2ba94a40f00d 100644 (file)
@@ -827,6 +827,16 @@ Standard_Boolean IntPatch_SpecialPoints::
     return Standard_False;
   }
 
+  if (theQSurf->GetType() == GeomAbs_Cone && thePSurf->GetType() == GeomAbs_Torus)
+  {
+    const gp_Pnt anApex = theQSurf->Cone().Apex();
+    Standard_Real aSqDist = anApex.SquareDistance(aPQuad);
+    if (aSqDist < aTol * aTol)
+    {
+      return Standard_False;
+    }
+  }
+
   //Pole is an intersection point
   //(lies in the quadric and the parametric surface)
 
diff --git a/tests/bugs/modalg_8/bug33639_1 b/tests/bugs/modalg_8/bug33639_1
new file mode 100644 (file)
index 0000000..a9c31ef
--- /dev/null
@@ -0,0 +1,15 @@
+puts "================================"
+puts " 0033639: Modeling Algorithms - Boolean torus cut cone incorrect"
+puts "================================"
+puts ""
+
+ptorus t 750 250 360
+pcone c 200 0 2000
+
+trotate c 0 0 0 1 0 0 90
+ttranslate c 0 1000 0
+
+bcut result t c
+
+checknbshapes result -vertex 8 -edge 13 -wire 5 -face 3
+checkview -display result -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/bugs/modalg_8/bug33639_2 b/tests/bugs/modalg_8/bug33639_2
new file mode 100644 (file)
index 0000000..03d8643
--- /dev/null
@@ -0,0 +1,16 @@
+puts "================================"
+puts " 0033639: Modeling Algorithms - Boolean torus cut cone incorrect"
+puts "================================"
+puts ""
+
+ptorus t 750 250 360
+pcone c 500 0 2000
+
+trotate c 0 0 0 1 0 0 90
+ttranslate c 0 1000 0
+trotate c 0 -1000 0 1 0 0 45
+
+bcut result t c
+
+checknbshapes result -vertex 4 -edge 7 -wire 3 -face 2
+checkview -display result -2d -path ${imagedir}/${test_image}.png