Shape Healing - Reusing Surface Analysis for Wire fixing (#565)

Providing prepared analysis from ShapeFix_Face to wire.
This commit is contained in:
Pasukhin Dmitry
2025-06-23 18:22:47 +01:00
committed by GitHub
parent 9726e465a9
commit 57d6038b26
5 changed files with 50 additions and 4 deletions
@@ -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());
@@ -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);
@@ -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);
@@ -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);
@@ -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 :