mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0032814: Modeling algorithms - Unifysamedom produces invalid result
Minor correction in ShapeUpgrade_UnifySameDomain::IntUnifyFaces: correct collecting splitting vertices in the new wire
This commit is contained in:
parent
3c61e8f7e0
commit
43764346a1
@ -104,6 +104,19 @@
|
|||||||
|
|
||||||
IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_UnifySameDomain,Standard_Transient)
|
IMPLEMENT_STANDARD_RTTIEXT(ShapeUpgrade_UnifySameDomain,Standard_Transient)
|
||||||
|
|
||||||
|
static Standard_Boolean IsOnSingularity(const TopTools_ListOfShape& theEdgeList)
|
||||||
|
{
|
||||||
|
TopTools_ListIteratorOfListOfShape anItl (theEdgeList);
|
||||||
|
for (; anItl.More(); anItl.Next())
|
||||||
|
{
|
||||||
|
const TopoDS_Edge& anEdge = TopoDS::Edge (anItl.Value());
|
||||||
|
if (BRep_Tool::Degenerated (anEdge))
|
||||||
|
return Standard_True;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Standard_False;
|
||||||
|
}
|
||||||
|
|
||||||
static void SplitWire (const TopoDS_Wire& theWire,
|
static void SplitWire (const TopoDS_Wire& theWire,
|
||||||
const TopoDS_Face& theFace,
|
const TopoDS_Face& theFace,
|
||||||
const TopTools_IndexedMapOfShape& theVmap,
|
const TopTools_IndexedMapOfShape& theVmap,
|
||||||
@ -3292,6 +3305,10 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
|
|||||||
if (NextEdge.IsNull())
|
if (NextEdge.IsNull())
|
||||||
{
|
{
|
||||||
Standard_Boolean EndOfWire = Standard_False;
|
Standard_Boolean EndOfWire = Standard_False;
|
||||||
|
|
||||||
|
Standard_Boolean anIsOnSingularity = IsOnSingularity (Elist);
|
||||||
|
if (!anIsOnSingularity && Elist.Extent() > 1)
|
||||||
|
SplittingVertices.Add (CurVertex);
|
||||||
|
|
||||||
TopTools_ListOfShape TmpElist, TrueElist;
|
TopTools_ListOfShape TmpElist, TrueElist;
|
||||||
//<TrueElist> will be the list of candidates to become <NextEdge>
|
//<TrueElist> will be the list of candidates to become <NextEdge>
|
||||||
@ -3311,7 +3328,6 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//we must choose the closest direction - the biggest angle
|
//we must choose the closest direction - the biggest angle
|
||||||
SplittingVertices.Add (CurVertex);
|
|
||||||
Standard_Real MaxAngle = RealFirst();
|
Standard_Real MaxAngle = RealFirst();
|
||||||
TopoDS_Edge TrueEdge;
|
TopoDS_Edge TrueEdge;
|
||||||
Handle(Geom2d_Curve) CurPCurve = BRep_Tool::CurveOnSurface(CurEdge, F_RefFace, fpar, lpar);
|
Handle(Geom2d_Curve) CurPCurve = BRep_Tool::CurveOnSurface(CurEdge, F_RefFace, fpar, lpar);
|
||||||
|
23
tests/bugs/heal/bug32814_1
Normal file
23
tests/bugs/heal/bug32814_1
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
puts "=============================================="
|
||||||
|
puts "OCC32814: Unifysamedom produces invalid result"
|
||||||
|
puts "=============================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug32814_1.brep] s
|
||||||
|
|
||||||
|
unifysamedom result s -a 1e-4
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
bopargcheck result
|
||||||
|
|
||||||
|
checknbshapes result -t -face 7 -wire 13 -edge 70 -vertex 64
|
||||||
|
|
||||||
|
set tolres [checkmaxtol result]
|
||||||
|
|
||||||
|
if { ${tolres} > 1.e-7} {
|
||||||
|
puts "Error: bad tolerance of result"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkprops result -s 5.54082e+06
|
||||||
|
|
||||||
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
23
tests/bugs/heal/bug32814_2
Normal file
23
tests/bugs/heal/bug32814_2
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
puts "=============================================="
|
||||||
|
puts "OCC32814: Unifysamedom produces invalid result"
|
||||||
|
puts "=============================================="
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
restore [locate_data_file bug32814_2.brep] s
|
||||||
|
|
||||||
|
unifysamedom result s
|
||||||
|
|
||||||
|
checkshape result
|
||||||
|
bopargcheck result
|
||||||
|
|
||||||
|
checknbshapes result -t -solid 1 -shell 1 -face 78 -wire 110 -edge 220 -vertex 136
|
||||||
|
|
||||||
|
set tolres [checkmaxtol result]
|
||||||
|
|
||||||
|
if { ${tolres} > 2.e-7} {
|
||||||
|
puts "Error: bad tolerance of result"
|
||||||
|
}
|
||||||
|
|
||||||
|
checkprops result -s 1.61456e+06 -v 3e+07
|
||||||
|
|
||||||
|
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user