mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-05-25 20:50:48 +05:00
PAL12149: Cannot create non-planar shells. Non-planar faces creation algorithm improved.
This commit is contained in:
parent
2e76e5e42e
commit
aeeebe32c2
@ -19,10 +19,10 @@
|
||||
//
|
||||
#include <Standard_Stream.hxx>
|
||||
|
||||
#include <BRepOffsetAPI_MakeFilling.hxx>
|
||||
|
||||
#include <GEOMImpl_Block6Explorer.hxx>
|
||||
|
||||
#include <ShHealOper_ShapeProcess.hxx>
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
#include <BRep_Tool.hxx>
|
||||
@ -33,6 +33,8 @@
|
||||
#include <BRepTools.hxx>
|
||||
#include <BRepTools_WireExplorer.hxx>
|
||||
#include <BRepOffsetAPI_ThruSections.hxx>
|
||||
#include <BRepOffsetAPI_MakeFilling.hxx>
|
||||
#include <BRepCheck_Analyzer.hxx>
|
||||
#include <BRepBuilderAPI_Copy.hxx>
|
||||
#include <BRepBuilderAPI_MakeEdge.hxx>
|
||||
#include <BRepBuilderAPI_MakeWire.hxx>
|
||||
@ -1202,6 +1204,24 @@ void GEOMImpl_Block6Explorer::MakeFace (const TopoDS_Wire& theWire,
|
||||
// Result of filling
|
||||
TopoDS_Shape aFace = MF.Shape();
|
||||
|
||||
// 12.04.2006 for PAL12149 begin
|
||||
Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(aFace));
|
||||
BRepBuilderAPI_MakeFace MK1 (aGS, theWire);
|
||||
if (MK1.IsDone()) {
|
||||
TopoDS_Shape aFace1 = MK1.Shape();
|
||||
|
||||
BRepCheck_Analyzer ana (aFace1, false);
|
||||
if (!ana.IsValid()) {
|
||||
TopoDS_Shape aFace2;
|
||||
ShHealOper_ShapeProcess aHealer;
|
||||
aHealer.Perform(aFace1, aFace2);
|
||||
if (aHealer.isDone())
|
||||
theResult = aFace2;
|
||||
}
|
||||
}
|
||||
// 12.04.2006 for PAL12149 end
|
||||
|
||||
if (theResult.IsNull()) { // try to deal with pure result of filling
|
||||
// Update tolerance
|
||||
Standard_Real aTol = MF.G0Error();
|
||||
|
||||
@ -1234,11 +1254,11 @@ void GEOMImpl_Block6Explorer::MakeFace (const TopoDS_Wire& theWire,
|
||||
}
|
||||
theResult = aFace;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// try to update wire tolerances to build a planar face
|
||||
|
||||
// With OCCT6.0 or lower
|
||||
|
||||
#if 1 //(OCC_VERSION_MAJOR < 6) || (OCC_VERSION_MAJOR == 6 && OCC_VERSION_MINOR <= 1)
|
||||
// Find a deviation
|
||||
Standard_Real aToleranceReached, aTol;
|
||||
BRepLib_FindSurface aFS;
|
||||
@ -1276,12 +1296,13 @@ void GEOMImpl_Block6Explorer::MakeFace (const TopoDS_Wire& theWire,
|
||||
return;
|
||||
}
|
||||
|
||||
// After migration on OCCT version higher than 6.0
|
||||
//BRepLib_MakeFace aBMF;
|
||||
//aBMF.Init(theWire, isPlanarWanted, Standard_True);
|
||||
//if (aBMF.Error() == BRepLib_FaceDone) {
|
||||
// theResult = aBMF.Shape();
|
||||
// return;
|
||||
//}
|
||||
#else // After migration on OCCT version, containing PKV's fix. See bug 8293
|
||||
BRepLib_MakeFace aBMF;
|
||||
aBMF.Init(theWire, isPlanarWanted, Standard_True);
|
||||
if (aBMF.Error() == BRepLib_FaceDone) {
|
||||
theResult = aBMF.Shape();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user