]> OCCT Git - occt.git/commitdiff
Shape Healing, STP Import - Revolved shape in STEP file is imported inverted (#699)
authorikochetkova <irina.kochetkova@opencascade.com>
Thu, 4 Sep 2025 16:05:44 +0000 (17:05 +0100)
committerGitHub <noreply@github.com>
Thu, 4 Sep 2025 16:05:44 +0000 (17:05 +0100)
Make the degenerated torus bounded in two values of parameters processed as a regular to insert a seam edge properly.

src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx
tests/bugs/step/gh_bug378 [new file with mode: 0644]

index 7376d2dea779c594d280ec420e4faab9539ddde7..acee21dbaf8de1af2a2b7f1490032ca7a3e8ffb8 100644 (file)
@@ -1687,6 +1687,12 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam()
   Handle(Geom_ToroidalSurface) aTorSurf = Handle(Geom_ToroidalSurface)::DownCast(mySurf->Surface());
   Standard_Boolean             anIsDegeneratedTor =
     (aTorSurf.IsNull() ? Standard_False : aTorSurf->MajorRadius() < aTorSurf->MinorRadius());
+  // if the second wire is not null, we don't need mark the torus as degenerated
+  // and should process it as a regular one.
+  if (anIsDegeneratedTor && !w2.IsNull())
+  {
+    anIsDegeneratedTor = Standard_False;
+  }
 
   if (w1.IsNull())
     return Standard_False;
diff --git a/tests/bugs/step/gh_bug378 b/tests/bugs/step/gh_bug378
new file mode 100644 (file)
index 0000000..b899a14
--- /dev/null
@@ -0,0 +1,8 @@
+puts "================================================"
+puts "Revolved shape in STEP file is imported inverted"
+puts "================================================"
+puts ""
+
+stepread [locate_data_file gh_bug378.stp] a *
+checkprops a_1 -v 10504.9
+