mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0023137: Class BRepAlgoAPI_Cut does not made correct result on attached shapes.
class ShellFaceClassifier; - method: void BOP_ShellFaceClassifier::ResetElement(const TopoDS_Shape& theElement) The order of choice a testing point for the element has been changed. The following order is: -point inside an edge -point as an vertex-point -point inside UV-range of a surface Adding test cases Expected sduare is corrected
This commit is contained in:
parent
cc1d74e225
commit
8f15a0d540
@ -24,6 +24,8 @@
|
|||||||
#include <TopExp_Explorer.hxx>
|
#include <TopExp_Explorer.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <BRepAdaptor_Surface.hxx>
|
#include <BRepAdaptor_Surface.hxx>
|
||||||
|
#include <Geom_Curve.hxx>
|
||||||
|
#include <IntTools_Tools.hxx>
|
||||||
|
|
||||||
// ==================================================================
|
// ==================================================================
|
||||||
// function: BOP_ShellFaceClassifier::BOP_ShellFaceClassifier
|
// function: BOP_ShellFaceClassifier::BOP_ShellFaceClassifier
|
||||||
@ -89,14 +91,36 @@ BOP_ShellFaceClassifier::BOP_ShellFaceClassifier
|
|||||||
// function: ResetElement
|
// function: ResetElement
|
||||||
// purpose:
|
// purpose:
|
||||||
// ===============================================================================================
|
// ===============================================================================================
|
||||||
void BOP_ShellFaceClassifier::ResetElement(const TopoDS_Shape& theElement)
|
void BOP_ShellFaceClassifier::ResetElement(const TopoDS_Shape& theElement)
|
||||||
{
|
{
|
||||||
const TopAbs_ShapeEnum aShapeType= theElement.ShapeType();
|
Standard_Boolean bFound;
|
||||||
|
TopAbs_ShapeEnum aShapeType;
|
||||||
|
TopExp_Explorer anExp;
|
||||||
|
//
|
||||||
|
myFirstCompare=Standard_True;
|
||||||
|
aShapeType=theElement.ShapeType();
|
||||||
|
//
|
||||||
|
bFound=Standard_False;
|
||||||
|
anExp.Init(theElement, TopAbs_EDGE);
|
||||||
|
for(; anExp.More(); anExp.Next()) {
|
||||||
|
const TopoDS_Edge& aE=*((TopoDS_Edge*)&anExp.Current());
|
||||||
|
if (!BRep_Tool::Degenerated(aE)) {
|
||||||
|
Standard_Real aT, aT1, aT2;
|
||||||
|
Handle(Geom_Curve) aC;
|
||||||
|
//
|
||||||
|
aC=BRep_Tool::Curve(aE, aT1, aT2);
|
||||||
|
aT=IntTools_Tools::IntermediatePoint(aT1, aT2);
|
||||||
|
aC->D0(aT, myPoint);
|
||||||
|
bFound=Standard_True;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bFound) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
// initialize myPoint with first vertex of face <E>
|
// initialize myPoint with first vertex of face <E>
|
||||||
myFirstCompare = Standard_True;
|
anExp.Init(theElement, TopAbs_VERTEX);
|
||||||
TopExp_Explorer anExp(theElement, TopAbs_VERTEX);
|
|
||||||
|
|
||||||
if(anExp.More()) {
|
if(anExp.More()) {
|
||||||
const TopoDS_Vertex& aVertex = TopoDS::Vertex(anExp.Current());
|
const TopoDS_Vertex& aVertex = TopoDS::Vertex(anExp.Current());
|
||||||
myPoint = BRep_Tool::Pnt(aVertex);
|
myPoint = BRep_Tool::Pnt(aVertex);
|
||||||
|
2
tests/boolean/boptuc_complex/B5
Normal file → Executable file
2
tests/boolean/boptuc_complex/B5
Normal file → Executable file
@ -4,4 +4,4 @@ restore [locate_data_file b60] b
|
|||||||
bop a b
|
bop a b
|
||||||
boptuc result
|
boptuc result
|
||||||
|
|
||||||
set square 12500
|
set square 15000
|
||||||
|
21
tests/bugs/modalg/CR23137_1
Executable file
21
tests/bugs/modalg/CR23137_1
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR23137"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# Class BRepAlgoAPI_Cut does not made correct result on attached shapes.
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file CR23137-bspl_cut.brep] b
|
||||||
|
explode b
|
||||||
|
copy b_1 b1
|
||||||
|
copy b_2 b2
|
||||||
|
#to provide positive volume of b2
|
||||||
|
invert b2
|
||||||
|
|
||||||
|
bop b1 b2
|
||||||
|
bopcut result
|
||||||
|
|
||||||
|
set square 44460.7
|
||||||
|
|
||||||
|
set 3dviewer 1
|
21
tests/bugs/modalg/CR23137_2
Executable file
21
tests/bugs/modalg/CR23137_2
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "CR23137"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
##########################################################################################################
|
||||||
|
# Class BRepAlgoAPI_Cut does not made correct result on attached shapes.
|
||||||
|
##########################################################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file CR23137-rev_cut.brep] b
|
||||||
|
explode b
|
||||||
|
copy b_1 b1
|
||||||
|
copy b_2 b2
|
||||||
|
#to provide positive volume of b1
|
||||||
|
invert b1
|
||||||
|
|
||||||
|
bop b1 b2
|
||||||
|
bopcut result
|
||||||
|
|
||||||
|
set square 3452.78
|
||||||
|
|
||||||
|
set 3dviewer 1
|
Loading…
x
Reference in New Issue
Block a user