1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode "Complete" join type "Intersection"

Mark unchecked edges originated from vertices as invalid if they are contained in invalid faces.
This commit is contained in:
emv 2020-04-13 13:31:12 +03:00 committed by bugmaster
parent 9e9b826aa1
commit 4b59685af1
19 changed files with 635 additions and 0 deletions

View File

@ -304,6 +304,13 @@ static
const TopTools_IndexedMapOfShape& theMERemoved,
TopTools_IndexedMapOfShape& theInvEdges);
static
void CheckEdgesCreatedByVertex (const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
const TopTools_DataMapOfShapeShape& theArtInvFaces,
const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
const TopTools_IndexedMapOfShape& theValidEdges,
TopTools_IndexedMapOfShape& theInvEdges);
static
void FindFacesToRebuild(const TopTools_IndexedDataMapOfShapeListOfShape& theLFImages,
const TopTools_IndexedMapOfShape& theInvEdges,
@ -1185,6 +1192,10 @@ void BuildSplitsOfFaces(const TopTools_ListOfShape& theLF,
// filter invalid edges
FilterInvalidEdges(theInvFaces, theArtInvFaces, aDMFMIE, aMERemoved, theInvEdges);
//
// Check additionally validity of edges originated from vertices.
CheckEdgesCreatedByVertex (theInvFaces, theArtInvFaces, theEdgesOrigins,
theValidEdges, theEdgesToAvoid);
#ifdef OFFSET_DEBUG
// show invalid edges
TopoDS_Compound aCEInv;
@ -3970,6 +3981,56 @@ void FilterInvalidFaces(TopTools_IndexedDataMapOfShapeListOfShape& theFImages,
theInvFaces = aReallyInvFaces;
}
//=======================================================================
//function : CheckEdgesCreatedByVertex
//purpose : Checks additionally the unchecked edges originated from vertices
//=======================================================================
void CheckEdgesCreatedByVertex (const TopTools_IndexedDataMapOfShapeListOfShape& theInvFaces,
const TopTools_DataMapOfShapeShape& theArtInvFaces,
const TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
const TopTools_IndexedMapOfShape& theValidEdges,
TopTools_IndexedMapOfShape& theInvEdges)
{
// Mark the unchecked edges contained in invalid faces as invalid
const Standard_Integer aNbF = theInvFaces.Extent();
for (Standard_Integer i = 1; i <= aNbF; ++i)
{
const TopoDS_Shape& aF = theInvFaces.FindKey (i);
if (theArtInvFaces.IsBound (aF))
continue;
const TopTools_ListOfShape& aLFIm = theInvFaces (i);
for (TopTools_ListOfShape::Iterator it (aLFIm); it.More(); it.Next())
{
const TopoDS_Shape& aFIm = it.Value();
for (TopExp_Explorer expE (aFIm, TopAbs_EDGE); expE.More(); expE.Next())
{
const TopoDS_Shape& aE = expE.Current();
if (theInvEdges.Contains (aE)
|| theValidEdges.Contains (aE))
{
continue;
}
// check if this edges is created by vertex
const TopTools_ListOfShape* pLEOr = theEdgesOrigins.Seek (aE);
if (!pLEOr)
continue;
TopTools_ListOfShape::Iterator itLEO (*pLEOr);
for (; itLEO.More(); itLEO.Next())
{
if (itLEO.Value().ShapeType() != TopAbs_VERTEX)
break;
}
if (!itLEO.More())
{
theInvEdges.Add (aE);
}
}
}
}
}
//=======================================================================
//function : FilterInvalidEdges
//purpose : Filtering the invalid edges according to currently invalid faces

View File

@ -0,0 +1,20 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
restore [locate_data_file bug31542_trim.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
explode s f
offsetonface s_3 8
offsetonface s_2 2
offsetonface s_10 2
offsetperform result
checkprops result -s 80331.8 -v 940931
unifysamedom result_unif result
checknbshapes result_unif -wire 12 -face 12 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,20 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
restore [locate_data_file bug31542_trim.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
explode s f
offsetonface s_3 8
offsetonface s_2 2
offsetonface s_10 5
offsetperform result
checkprops result -s 81322.5 -v 962242
unifysamedom result_unif result
checknbshapes result_unif -wire 13 -face 13 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,20 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
restore [locate_data_file bug31542_trim.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
explode s f
offsetonface s_3 8
offsetonface s_2 5
offsetonface s_10 2
offsetperform result
checkprops result -s 81322.5 -v 962242
unifysamedom result_unif result
checknbshapes result_unif -wire 13 -face 13 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,20 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
restore [locate_data_file bug31542_trim.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
explode s f
offsetonface s_3 10
offsetonface s_2 5
offsetonface s_10 5
offsetperform result
checkprops result -s 83093.5 -v 1.0107e+06
unifysamedom result_unif result
checknbshapes result_unif -wire 11 -face 11 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,18 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
restore [locate_data_file bug31542_trim.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
explode s f
offsetonface s_9 7
offsetperform result
checkprops result -s 76756.9 -v 854480
unifysamedom result_unif result
checknbshapes result_unif -wire 14 -face 14 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,18 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
restore [locate_data_file bug31542_trim.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
explode s f
offsetonface s_9 15
offsetperform result
checkprops result -s 77082.5 -v 861875
unifysamedom result_unif result
checknbshapes result_unif -wire 15 -face 15 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,21 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
restore [locate_data_file bug31542_trim.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
explode s f
offsetonface s_3 5
offsetonface s_2 2
offsetonface s_9 8
offsetonface s_10 2
offsetperform result
checkprops result -s 78683.2 -v 908272
unifysamedom result_unif result
checknbshapes result_unif -wire 16 -face 16 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,45 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
set X1 5; # positive x-axis
set X2 10; # nagative x-axis
set Y1 5; # positive y-axis
set Y2 10; # negative y-axis
set TOP 0; # positive z-axis
set eps 1.e-5
restore [locate_data_file bug31542_trim.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
foreach f [explode s f] {
mksurface surf $f;
regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z
if {[regexp "REVERSED" [whatis $f]]} {
set x [dval -1*$x];
set y [dval -1*$y];
set z [dval -1*$z];
}
if {$y < -1*$eps} {
offsetonface $f $Y2
} elseif {$y > $eps} {
offsetonface $f $Y1
} elseif {$x < -1*$eps} {
offsetonface $f $X2
} elseif {$x > $eps} {
offsetonface $f $X1
} elseif {$z > $eps} {
offsetonface $f $TOP
}
}
offsetperform result
checkprops result -s 98415.4 -v 1.30965e+06
unifysamedom result_unif result
checknbshapes result_unif -wire 15 -face 15 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,45 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
set X1 10; # positive x-axis
set X2 5; # nagative x-axis
set Y1 10; # positive y-axis
set Y2 5; # negative y-axis
set TOP 5; # positive z-axis
set eps 1.e-5
restore [locate_data_file bug31542_trim.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
foreach f [explode s f] {
mksurface surf $f;
regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z
if {[regexp "REVERSED" [whatis $f]]} {
set x [dval -1*$x];
set y [dval -1*$y];
set z [dval -1*$z];
}
if {$y < -1*$eps} {
offsetonface $f $Y2
} elseif {$y > $eps} {
offsetonface $f $Y1
} elseif {$x < -1*$eps} {
offsetonface $f $X2
} elseif {$x > $eps} {
offsetonface $f $X1
} elseif {$z > $eps} {
offsetonface $f $TOP
}
}
offsetperform result
checkprops result -s 99229.3 -v 1.33021e+06
unifysamedom result_unif result
checknbshapes result_unif -wire 16 -face 16 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,45 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
set X1 10; # positive x-axis
set X2 5; # nagative x-axis
set Y1 10; # positive y-axis
set Y2 5; # negative y-axis
set TOP 5; # positive z-axis
set eps 1.e-5
restore [locate_data_file bug31542_dom-18777.input.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
foreach f [explode s f] {
mksurface surf $f;
regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z
if {[regexp "REVERSED" [whatis $f]]} {
set x [dval -1*$x];
set y [dval -1*$y];
set z [dval -1*$z];
}
if {$y < -1*$eps} {
offsetonface $f $Y2
} elseif {$y > $eps} {
offsetonface $f $Y1
} elseif {$x < -1*$eps} {
offsetonface $f $X2
} elseif {$x > $eps} {
offsetonface $f $X1
} elseif {$z > $eps} {
offsetonface $f $TOP
}
}
offsetperform result
checkprops result -s 705116 -v 2.26365e+07
unifysamedom result_unif result
checknbshapes result_unif -wire 32 -face 32 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,45 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
set X1 5; # positive x-axis
set X2 10; # nagative x-axis
set Y1 5; # positive y-axis
set Y2 10; # negative y-axis
set TOP 5; # positive z-axis
set eps 1.e-5
restore [locate_data_file bug31542_dom-18777.input.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
foreach f [explode s f] {
mksurface surf $f;
regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z
if {[regexp "REVERSED" [whatis $f]]} {
set x [dval -1*$x];
set y [dval -1*$y];
set z [dval -1*$z];
}
if {$y < -1*$eps} {
offsetonface $f $Y2
} elseif {$y > $eps} {
offsetonface $f $Y1
} elseif {$x < -1*$eps} {
offsetonface $f $X2
} elseif {$x > $eps} {
offsetonface $f $X1
} elseif {$z > $eps} {
offsetonface $f $TOP
}
}
offsetperform result
checkprops result -s 705116 -v 2.26365e+07
unifysamedom result_unif result
checknbshapes result_unif -wire 32 -face 32 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,45 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
set X1 5; # positive x-axis
set X2 5; # nagative x-axis
set Y1 10; # positive y-axis
set Y2 10; # negative y-axis
set TOP 5; # positive z-axis
set eps 1.e-5
restore [locate_data_file bug31542_dom-18777.input.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
foreach f [explode s f] {
mksurface surf $f;
regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z
if {[regexp "REVERSED" [whatis $f]]} {
set x [dval -1*$x];
set y [dval -1*$y];
set z [dval -1*$z];
}
if {$y < -1*$eps} {
offsetonface $f $Y2
} elseif {$y > $eps} {
offsetonface $f $Y1
} elseif {$x < -1*$eps} {
offsetonface $f $X2
} elseif {$x > $eps} {
offsetonface $f $X1
} elseif {$z > $eps} {
offsetonface $f $TOP
}
}
offsetperform result
checkprops result -s 705089 -v 2.27281e+07
unifysamedom result_unif result
checknbshapes result_unif -wire 32 -face 32 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,45 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
set X1 10; # positive x-axis
set X2 10; # nagative x-axis
set Y1 5; # positive y-axis
set Y2 5; # negative y-axis
set TOP 5; # positive z-axis
set eps 1.e-5
restore [locate_data_file bug31542_dom-18777.input.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
foreach f [explode s f] {
mksurface surf $f;
regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z
if {[regexp "REVERSED" [whatis $f]]} {
set x [dval -1*$x];
set y [dval -1*$y];
set z [dval -1*$z];
}
if {$y < -1*$eps} {
offsetonface $f $Y2
} elseif {$y > $eps} {
offsetonface $f $Y1
} elseif {$x < -1*$eps} {
offsetonface $f $X2
} elseif {$x > $eps} {
offsetonface $f $X1
} elseif {$z > $eps} {
offsetonface $f $TOP
}
}
offsetperform result
checkprops result -s 703838 -v 2.25528e+07
unifysamedom result_unif result
checknbshapes result_unif -wire 30 -face 30 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,45 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
set X1 5; # positive x-axis
set X2 10; # nagative x-axis
set Y1 5; # positive y-axis
set Y2 10; # negative y-axis
set TOP 0; # positive z-axis
set eps 1.e-5
restore [locate_data_file bug31542_dom-18777.input.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
foreach f [explode s f] {
mksurface surf $f;
regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z
if {[regexp "REVERSED" [whatis $f]]} {
set x [dval -1*$x];
set y [dval -1*$y];
set z [dval -1*$z];
}
if {$y < -1*$eps} {
offsetonface $f $Y2
} elseif {$y > $eps} {
offsetonface $f $Y1
} elseif {$x < -1*$eps} {
offsetonface $f $X2
} elseif {$x > $eps} {
offsetonface $f $X1
} elseif {$z > $eps} {
offsetonface $f $TOP
}
}
offsetperform result
checkprops result -s 702224 -v 2.17722e+07
unifysamedom result_unif result
checknbshapes result_unif -wire 28 -face 28 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,45 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
set X1 10; # positive x-axis
set X2 5; # nagative x-axis
set Y1 10; # positive y-axis
set Y2 5; # negative y-axis
set TOP 0; # positive z-axis
set eps 1.e-5
restore [locate_data_file bug31542_dom-18777.input.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
foreach f [explode s f] {
mksurface surf $f;
regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z
if {[regexp "REVERSED" [whatis $f]]} {
set x [dval -1*$x];
set y [dval -1*$y];
set z [dval -1*$z];
}
if {$y < -1*$eps} {
offsetonface $f $Y2
} elseif {$y > $eps} {
offsetonface $f $Y1
} elseif {$x < -1*$eps} {
offsetonface $f $X2
} elseif {$x > $eps} {
offsetonface $f $X1
} elseif {$z > $eps} {
offsetonface $f $TOP
}
}
offsetperform result
checkprops result -s 702224 -v 2.17722e+07
unifysamedom result_unif result
checknbshapes result_unif -wire 28 -face 28 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,45 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
set X1 10; # positive x-axis
set X2 5; # nagative x-axis
set Y1 10; # positive y-axis
set Y2 5; # negative y-axis
set TOP 10; # positive z-axis
set eps 1.e-5
restore [locate_data_file bug31542_dom-18777.input.brep] s
offsetparameter 1e-7 c i r
offsetload s 0
foreach f [explode s f] {
mksurface surf $f;
regexp {Axis :([-0-9.+eE]*), ([-0-9.+eE]*), ([-0-9.+eE]*)} [dump surf] full x y z
if {[regexp "REVERSED" [whatis $f]]} {
set x [dval -1*$x];
set y [dval -1*$y];
set z [dval -1*$z];
}
if {$y < -1*$eps} {
offsetonface $f $Y2
} elseif {$y > $eps} {
offsetonface $f $Y1
} elseif {$x < -1*$eps} {
offsetonface $f $X2
} elseif {$x > $eps} {
offsetonface $f $X1
} elseif {$z > $eps} {
offsetonface $f $TOP
}
}
offsetperform result
checkprops result -s 709138 -v 2.35754e+07
unifysamedom result_unif result
checknbshapes result_unif -wire 31 -face 31 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,16 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
restore [locate_data_file bug31542_dom-18777.input.brep] s
offsetparameter 1e-7 c i r
offsetload s 10
offsetperform result
checkprops result -s 747800 -v 2.65246e+07
unifysamedom result_unif result
checknbshapes result_unif -wire 30 -face 30 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png

View File

@ -0,0 +1,16 @@
puts "========"
puts "0031542: Modeling Algorithms - Offset algorithm produces incomplete result in mode Complete join type Intersection"
puts "========"
puts ""
restore [locate_data_file bug31542_dom-18777.input.brep] s
offsetparameter 1e-7 c i r
offsetload s 15
offsetperform result
checkprops result -s 799301 -v 3.0392e+07
unifysamedom result_unif result
checknbshapes result_unif -wire 34 -face 34 -shell 1 -solid 1
checkview -display result_unif -2d -path ${imagedir}/${test_image}.png