]> OCCT Git - occt.git/commitdiff
Shape Healing - Reusing Surface Analysis for Wire fixing (#565)
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Mon, 23 Jun 2025 17:22:47 +0000 (18:22 +0100)
committerGitHub <noreply@github.com>
Mon, 23 Jun 2025 17:22:47 +0000 (18:22 +0100)
Providing prepared analysis from ShapeFix_Face to wire.

src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Wire.cxx
src/ModelingAlgorithms/TKShHealing/ShapeAnalysis/ShapeAnalysis_Wire.hxx
src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Face.cxx
src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.hxx
src/ModelingAlgorithms/TKShHealing/ShapeFix/ShapeFix_Wire.lxx

index 1bdd5c82c7af1832aff8102e52e26ac207745663..161794cad991f50e9a18f13483f331118a6af8ce 100644 (file)
@@ -156,6 +156,22 @@ void ShapeAnalysis_Wire::SetFace(const TopoDS_Face& face)
 
 //=================================================================================================
 
+void ShapeAnalysis_Wire::SetFace(const TopoDS_Face&                   theFace,
+                                 const Handle(ShapeAnalysis_Surface)& theSurfaceAnalysis)
+{
+  myFace = theFace;
+  mySurf = theSurfaceAnalysis;
+}
+
+//=================================================================================================
+
+void ShapeAnalysis_Wire::SetSurface(const Handle(ShapeAnalysis_Surface)& theSurfaceAnalysis)
+{
+  mySurf = theSurfaceAnalysis;
+}
+
+//=================================================================================================
+
 void ShapeAnalysis_Wire::SetSurface(const Handle(Geom_Surface)& surface)
 {
   SetSurface(surface, TopLoc_Location());
index e1c4c5053bb19bc5ca823de3419ca58ad0bcc03b..deb0fd9505eef40278d23db4baacae3bad5385e9 100644 (file)
@@ -126,6 +126,13 @@ public:
   //! Loads the face the wire lies on
   Standard_EXPORT void SetFace(const TopoDS_Face& face);
 
+  //! Loads the face the wire lies on and surface analysis object
+  Standard_EXPORT void SetFace(const TopoDS_Face&                   theFace,
+                               const Handle(ShapeAnalysis_Surface)& theSurfaceAnalysis);
+
+  //! Loads the surface analysis object
+  Standard_EXPORT void SetSurface(const Handle(ShapeAnalysis_Surface)& theSurfaceAnalysis);
+
   //! Loads the surface the wire lies on
   Standard_EXPORT void SetSurface(const Handle(Geom_Surface)& surface);
 
index 34b1f85aaccb1b54651462b74515d5feed0e2aac..129e0b6cabcb4c87d0130e1ee6cde60859944ef5 100644 (file)
@@ -346,7 +346,7 @@ Standard_Boolean ShapeFix_Face::Perform()
   Standard_Real aSavPreci = Precision();
   if (NeedFix(myFixWireMode))
   {
-    theAdvFixWire->SetFace(myFace);
+    theAdvFixWire->SetFace(myFace, mySurf);
 
     Standard_Integer usFixLackingMode = theAdvFixWire->FixLackingMode();
     // Standard_Integer usFixNotchedEdgesMode = theAdvFixWire->FixNotchedEdgesMode(); // CR0024983
@@ -508,7 +508,7 @@ Standard_Boolean ShapeFix_Face::Perform()
     // perform second part of fixes on wires
     if (NeedFix(myFixWireMode))
     {
-      theAdvFixWire->SetFace(myFace);
+      theAdvFixWire->SetFace(myFace, mySurf);
 
       Standard_Integer usFixSmallMode       = theAdvFixWire->FixSmallMode();
       Standard_Integer usFixConnectedMode   = theAdvFixWire->FixConnectedMode();
@@ -1014,7 +1014,7 @@ Standard_Boolean ShapeFix_Face::FixAddNaturalBound()
         bnd->Add(sbwd, k + 1);
         ws.Remove(i--);
         nb--;
-        myFixWire->SetFace(myFace);
+        myFixWire->SetFace(myFace, mySurf);
         myFixWire->Load(bnd);
         myFixWire->FixConnected();
         myFixWire->FixDegenerated();
@@ -1901,7 +1901,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam()
 
   // sort original wires
   Handle(ShapeFix_Wire) sfw = new ShapeFix_Wire;
-  sfw->SetFace(myFace);
+  sfw->SetFace(myFace, mySurf);
   sfw->SetPrecision(Precision());
   Handle(ShapeExtend_WireData) wd1 = new ShapeExtend_WireData(w1);
   Handle(ShapeExtend_WireData) wd2 = new ShapeExtend_WireData(w2);
index 99564d42048d4d20445cfddb69260c3196b06931..acb27d1bf3028650e06c24a85c0872b44e00e138 100644 (file)
@@ -24,6 +24,8 @@
 #include <ShapeFix_Root.hxx>
 #include <TopoDS_Wire.hxx>
 #include <ShapeExtend_Status.hxx>
+#include <ShapeAnalysis_Surface.hxx>
+
 class ShapeFix_Edge;
 class ShapeAnalysis_Wire;
 class TopoDS_Wire;
@@ -124,6 +126,12 @@ public:
   //! Set working face for the wire
   void SetFace(const TopoDS_Face& face);
 
+  //! Set working face for the wire and surface analysis object
+  void SetFace(const TopoDS_Face& theFace, const Handle(ShapeAnalysis_Surface)& theSurfaceAnalysis);
+
+  //! Set surface analysis for the wire
+  void SetSurface(const Handle(ShapeAnalysis_Surface)& theSurfaceAnalysis);
+
   //! Set surface for the wire
   void SetSurface(const Handle(Geom_Surface)& surf);
 
index 80ac34133653ef31b5a114bfd0edf8917037f5ef..186f6378793659be873297cb927b585df42d0311 100644 (file)
@@ -39,6 +39,21 @@ inline void ShapeFix_Wire::SetSurface(const Handle(Geom_Surface)& surf)
   myAnalyzer->SetSurface(surf);
 }
 
+//=================================================================================================
+
+inline void ShapeFix_Wire::SetFace(const TopoDS_Face&                   theFace,
+                                   const Handle(ShapeAnalysis_Surface)& theSurfaceAnalysis)
+{
+  myAnalyzer->SetFace(theFace, theSurfaceAnalysis);
+}
+
+//=================================================================================================
+
+inline void ShapeFix_Wire::SetSurface(const Handle(ShapeAnalysis_Surface)& theSurfaceAnalysis)
+{
+  myAnalyzer->SetSurface(theSurfaceAnalysis);
+}
+
 //=======================================================================
 // function : SetSurface
 // purpose  :