mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0027271: Unifysamedomain invalid result
Prevent merging of faces along periodic direction. Test case "bugs heal bug27000_1" has been corrected to actual state of the algorithm.
This commit is contained in:
parent
7644c7f4a1
commit
f0144633d9
@ -86,6 +86,8 @@
|
|||||||
#include <gp_Circ.hxx>
|
#include <gp_Circ.hxx>
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
#include <BRepClass_FaceClassifier.hxx>
|
#include <BRepClass_FaceClassifier.hxx>
|
||||||
|
#include <BRepAdaptor_Curve2d.hxx>
|
||||||
|
#include <gp_Vec2d.hxx>
|
||||||
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_UnifySameDomain,MMgt_TShared)
|
IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_UnifySameDomain,MMgt_TShared)
|
||||||
|
|
||||||
@ -95,6 +97,42 @@ struct SubSequenceOfEdges
|
|||||||
TopoDS_Edge UnionEdges;
|
TopoDS_Edge UnionEdges;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static Standard_Boolean IsLikeSeam(const TopoDS_Edge& anEdge,
|
||||||
|
const TopoDS_Face& aFace,
|
||||||
|
const Handle(Geom_Surface)& aBaseSurface)
|
||||||
|
{
|
||||||
|
if (!aBaseSurface->IsUPeriodic() && !aBaseSurface->IsVPeriodic())
|
||||||
|
return Standard_False;
|
||||||
|
|
||||||
|
BRepAdaptor_Curve2d BAcurve2d(anEdge, aFace);
|
||||||
|
gp_Pnt2d FirstPoint, LastPoint;
|
||||||
|
gp_Vec2d FirstDir, LastDir;
|
||||||
|
BAcurve2d.D1(BAcurve2d.FirstParameter(), FirstPoint, FirstDir);
|
||||||
|
BAcurve2d.D1(BAcurve2d.LastParameter(), LastPoint, LastDir);
|
||||||
|
Standard_Real Length = FirstDir.Magnitude();
|
||||||
|
if (Length <= gp::Resolution())
|
||||||
|
return Standard_False;
|
||||||
|
else
|
||||||
|
FirstDir /= Length;
|
||||||
|
Length = LastDir.Magnitude();
|
||||||
|
if (Length <= gp::Resolution())
|
||||||
|
return Standard_False;
|
||||||
|
else
|
||||||
|
LastDir /= Length;
|
||||||
|
|
||||||
|
Standard_Real Tol = 1.e-7;
|
||||||
|
if (aBaseSurface->IsUPeriodic() &&
|
||||||
|
(Abs(FirstDir.X()) < Tol) &&
|
||||||
|
(Abs(LastDir.X()) < Tol))
|
||||||
|
return Standard_True;
|
||||||
|
|
||||||
|
if (aBaseSurface->IsVPeriodic() &&
|
||||||
|
(Abs(FirstDir.Y()) < Tol) &&
|
||||||
|
(Abs(LastDir.Y()) < Tol))
|
||||||
|
return Standard_True;
|
||||||
|
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AddOrdinaryEdges
|
//function : AddOrdinaryEdges
|
||||||
@ -1200,6 +1238,10 @@ void ShapeUpgrade_UnifySameDomain::UnifyFaces()
|
|||||||
|
|
||||||
if (IsSameDomain(aFace,anCheckedFace)) {
|
if (IsSameDomain(aFace,anCheckedFace)) {
|
||||||
|
|
||||||
|
// hotfix for 27271: prevent merging along periodic direction.
|
||||||
|
if (IsLikeSeam(edge, aFace, aBaseSurface))
|
||||||
|
continue;
|
||||||
|
|
||||||
// replacing pcurves
|
// replacing pcurves
|
||||||
TopoDS_Face aMockUpFace;
|
TopoDS_Face aMockUpFace;
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
restore [locate_data_file bug27000_1.brep] shape
|
restore [locate_data_file bug27000_1.brep] shape
|
||||||
unifysamedom result shape
|
unifysamedom result shape
|
||||||
checkshape result
|
checkshape result
|
||||||
checknbshapes result -vertex 60 -edge 87 -wire 35 -face 33 -shell 2 -solid 2 -compsolid 0 -compound 1 -shape 220
|
checknbshapes result -vertex 62 -edge 90 -wire 36 -face 34 -shell 2 -solid 2 -compsolid 0 -compound 1 -shape 227
|
11
tests/bugs/modalg_6/bug27271
Normal file
11
tests/bugs/modalg_6/bug27271
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC27271"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###########################################################################################################
|
||||||
|
# Unifysamedomain invalid result
|
||||||
|
###########################################################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug27271_Shape.brep] a
|
||||||
|
unifysamedom result a
|
||||||
|
checkshape result
|
Loading…
x
Reference in New Issue
Block a user