mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-12 17:50:35 +05:00
Usage of ShapeUpgrade_UnifySameDomain instead of BlockFix_UnionFaces and BlockFix_UnionEdges.
This commit is contained in:
parent
d6f16273ad
commit
8db1e932e3
@ -31,6 +31,8 @@
|
|||||||
#include <BlockFix_UnionEdges.hxx>
|
#include <BlockFix_UnionEdges.hxx>
|
||||||
|
|
||||||
#include <ShapeUpgrade_RemoveLocations.hxx>
|
#include <ShapeUpgrade_RemoveLocations.hxx>
|
||||||
|
#include <TopoDS_Edge.hxx>
|
||||||
|
#include <ShapeUpgrade_UnifySameDomain.hxx>
|
||||||
|
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
|
||||||
@ -67,10 +69,31 @@ void BlockFix_BlockFixAPI::Perform()
|
|||||||
myShape = BlockFix::RefillProblemFaces(myShape);
|
myShape = BlockFix::RefillProblemFaces(myShape);
|
||||||
|
|
||||||
// faces unification
|
// faces unification
|
||||||
|
TopoDS_Shape aResult = myShape;
|
||||||
|
if (myOptimumNbFaces > 1) {
|
||||||
|
// use old algo BlockFix_UnionFaces for exactly given resulting number of faces
|
||||||
BlockFix_UnionFaces aFaceUnifier;
|
BlockFix_UnionFaces aFaceUnifier;
|
||||||
aFaceUnifier.GetTolerance() = myTolerance;
|
aFaceUnifier.GetTolerance() = myTolerance;
|
||||||
aFaceUnifier.GetOptimumNbFaces() = myOptimumNbFaces;
|
aFaceUnifier.GetOptimumNbFaces() = myOptimumNbFaces;
|
||||||
TopoDS_Shape aResult = aFaceUnifier.Perform(myShape);
|
aResult = aFaceUnifier.Perform(aResult);
|
||||||
|
}
|
||||||
|
else if (myOptimumNbFaces != -1) {
|
||||||
|
// use OCCT algo ShapeUpgrade_UnifySameDomain
|
||||||
|
ShapeUpgrade_UnifySameDomain Unifier;
|
||||||
|
//only faces
|
||||||
|
Standard_Boolean isUnifyEdges = Standard_False;
|
||||||
|
Standard_Boolean isUnifyFaces = Standard_True;
|
||||||
|
Standard_Boolean isConcatBSplines = Standard_True;
|
||||||
|
Unifier.Initialize(myShape, isUnifyEdges, isUnifyFaces, isConcatBSplines);
|
||||||
|
//Unifier.SetLinearTolerance(myTolerance);
|
||||||
|
Unifier.SetLinearTolerance(Precision::Confusion());
|
||||||
|
Unifier.SetAngularTolerance(Precision::Confusion());
|
||||||
|
Unifier.Build();
|
||||||
|
aResult = Unifier.Shape();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// myOptimumNbFaces == -1 means do not union faces
|
||||||
|
}
|
||||||
|
|
||||||
// avoid problem with degenerated edges appearance
|
// avoid problem with degenerated edges appearance
|
||||||
// due to shape quality regress
|
// due to shape quality regress
|
||||||
@ -79,8 +102,16 @@ void BlockFix_BlockFixAPI::Perform()
|
|||||||
aResult = RemLoc.GetResult();
|
aResult = RemLoc.GetResult();
|
||||||
|
|
||||||
// edges unification
|
// edges unification
|
||||||
BlockFix_UnionEdges anEdgeUnifier;
|
//BlockFix_UnionEdges anEdgeUnifier;
|
||||||
myShape = anEdgeUnifier.Perform(aResult,myTolerance);
|
//myShape = anEdgeUnifier.Perform(aResult,myTolerance);
|
||||||
|
ShapeUpgrade_UnifySameDomain Unifier;
|
||||||
|
Standard_Boolean isUnifyEdges = Standard_True;
|
||||||
|
Standard_Boolean isUnifyFaces = Standard_False; //only edges
|
||||||
|
Standard_Boolean isConcatBSplines = Standard_True;
|
||||||
|
Unifier.Initialize(aResult, isUnifyEdges, isUnifyFaces, isConcatBSplines);
|
||||||
|
Unifier.SetLinearTolerance(myTolerance);
|
||||||
|
Unifier.Build();
|
||||||
|
myShape = Unifier.Shape();
|
||||||
|
|
||||||
TopoDS_Shape aRes = BlockFix::FixRanges(myShape,myTolerance);
|
TopoDS_Shape aRes = BlockFix::FixRanges(myShape,myTolerance);
|
||||||
myShape = aRes;
|
myShape = aRes;
|
||||||
|
@ -63,6 +63,8 @@
|
|||||||
#include <BRepExtrema_ExtPF.hxx>
|
#include <BRepExtrema_ExtPF.hxx>
|
||||||
#include <BRepExtrema_DistShapeShape.hxx>
|
#include <BRepExtrema_DistShapeShape.hxx>
|
||||||
|
|
||||||
|
#include <ShapeUpgrade_UnifySameDomain.hxx>
|
||||||
|
|
||||||
#include <TopAbs.hxx>
|
#include <TopAbs.hxx>
|
||||||
#include <TopoDS.hxx>
|
#include <TopoDS.hxx>
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
@ -742,10 +744,19 @@ Standard_Integer GEOMImpl_BlockDriver::Execute(Handle(TFunction_Logbook)& log) c
|
|||||||
Standard_NullObject::Raise("Null Shape given");
|
Standard_NullObject::Raise("Null Shape given");
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockFix_UnionFaces aFaceUnifier;
|
//BlockFix_UnionFaces aFaceUnifier;
|
||||||
|
//aFaceUnifier.GetOptimumNbFaces() = 0; // To force union faces.
|
||||||
aFaceUnifier.GetOptimumNbFaces() = 0; // To force union faces.
|
//aShape = aFaceUnifier.Perform(aBlockOrComp);
|
||||||
aShape = aFaceUnifier.Perform(aBlockOrComp);
|
// Use OCCT algo ShapeUpgrade_UnifySameDomain instead of BlockFix_UnionFaces:
|
||||||
|
Standard_Boolean isUnifyEdges = Standard_False;
|
||||||
|
Standard_Boolean isUnifyFaces = Standard_True;
|
||||||
|
Standard_Boolean isConcatBSplines = Standard_True;
|
||||||
|
ShapeUpgrade_UnifySameDomain aUnifier (aBlockOrComp,
|
||||||
|
isUnifyEdges, isUnifyFaces, isConcatBSplines);
|
||||||
|
aUnifier.SetLinearTolerance(Precision::Confusion());
|
||||||
|
aUnifier.SetAngularTolerance(Precision::Confusion());
|
||||||
|
aUnifier.Build();
|
||||||
|
aShape = aUnifier.Shape();
|
||||||
} else { // unknown function type
|
} else { // unknown function type
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user