mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0025263: Wrong result of cut operation.
Changes: class BOPDS_DS method: void BOPDS_DS::InitPaveBlocks(const Standard_Integer theI) The treatment of internal edges has been added. Test case for issue CR25263
This commit is contained in:
@@ -813,8 +813,9 @@ BOPDS_ListOfPaveBlock& BOPDS_DS::ChangePaveBlocks
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPDS_DS::InitPaveBlocks(const Standard_Integer theI)
|
void BOPDS_DS::InitPaveBlocks(const Standard_Integer theI)
|
||||||
{
|
{
|
||||||
Standard_Integer nV = 0, iRef, aNbV, nVSD, i;
|
Standard_Integer nV=0, iRef, aNbV, nVSD;
|
||||||
Standard_Real aT;
|
Standard_Real aT;
|
||||||
|
TopAbs_Orientation aOrE;
|
||||||
TopoDS_Vertex aV;
|
TopoDS_Vertex aV;
|
||||||
BOPCol_ListIteratorOfListOfInteger aIt;
|
BOPCol_ListIteratorOfListOfInteger aIt;
|
||||||
BOPDS_Pave aPave;
|
BOPDS_Pave aPave;
|
||||||
@@ -822,6 +823,7 @@ void BOPDS_DS::InitPaveBlocks(const Standard_Integer theI)
|
|||||||
//
|
//
|
||||||
BOPDS_ShapeInfo& aSI=ChangeShapeInfo(theI);
|
BOPDS_ShapeInfo& aSI=ChangeShapeInfo(theI);
|
||||||
const TopoDS_Edge& aE=*(TopoDS_Edge*)(&aSI.Shape());
|
const TopoDS_Edge& aE=*(TopoDS_Edge*)(&aSI.Shape());
|
||||||
|
aOrE=aE.Orientation();
|
||||||
//
|
//
|
||||||
const BOPCol_ListOfInteger& aLV=aSI.SubShapes();
|
const BOPCol_ListOfInteger& aLV=aSI.SubShapes();
|
||||||
aNbV=aLV.Extent();
|
aNbV=aLV.Extent();
|
||||||
@@ -832,33 +834,49 @@ void BOPDS_DS::InitPaveBlocks(const Standard_Integer theI)
|
|||||||
aPB=new BOPDS_PaveBlock;
|
aPB=new BOPDS_PaveBlock;
|
||||||
aPB->SetOriginalEdge(theI);
|
aPB->SetOriginalEdge(theI);
|
||||||
//
|
//
|
||||||
aIt.Initialize(aLV);
|
if (aOrE!=TopAbs_INTERNAL) {
|
||||||
for (i=0; aIt.More(); aIt.Next(), ++i) {
|
aIt.Initialize(aLV);
|
||||||
nV=aIt.Value();
|
for (; aIt.More(); aIt.Next()) {
|
||||||
//
|
nV=aIt.Value();
|
||||||
const BOPDS_ShapeInfo& aSIV=ShapeInfo(nV);
|
//
|
||||||
aV=*(TopoDS_Vertex*)(&aSIV.Shape());
|
const BOPDS_ShapeInfo& aSIV=ShapeInfo(nV);
|
||||||
if (aSIV.HasFlag()) {
|
aV=*(TopoDS_Vertex*)(&aSIV.Shape());
|
||||||
aT=ComputeParameter(aV, aE);
|
if (aSIV.HasFlag()) {
|
||||||
|
aT=ComputeParameter(aV, aE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
aT=BRep_Tool::Parameter(aV, aE);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (HasShapeSD(nV, nVSD)) {
|
||||||
|
nV=nVSD;
|
||||||
|
}
|
||||||
|
aPave.SetIndex(nV);
|
||||||
|
aPave.SetParameter(aT);
|
||||||
|
aPB->AppendExtPave(aPave);
|
||||||
}
|
}
|
||||||
else {
|
//
|
||||||
|
if (aNbV==1) {
|
||||||
|
aV.Reverse();
|
||||||
aT=BRep_Tool::Parameter(aV, aE);
|
aT=BRep_Tool::Parameter(aV, aE);
|
||||||
}
|
aPave.SetIndex(nV);
|
||||||
//
|
aPave.SetParameter(aT);
|
||||||
if (HasShapeSD(nV, nVSD)) {
|
aPB->AppendExtPave1(aPave);
|
||||||
nV=nVSD;
|
|
||||||
}
|
}
|
||||||
aPave.SetIndex(nV);
|
|
||||||
aPave.SetParameter(aT);
|
|
||||||
aPB->AppendExtPave(aPave);
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (aNbV==1) {
|
else {
|
||||||
aV.Reverse();
|
TopoDS_Iterator aItE;
|
||||||
aT=BRep_Tool::Parameter(aV, aE);
|
//
|
||||||
aPave.SetIndex(nV);
|
aItE.Initialize(aE, Standard_False, Standard_True);
|
||||||
aPave.SetParameter(aT);
|
for (; aItE.More(); aItE.Next()) {
|
||||||
aPB->AppendExtPave1(aPave);
|
aV=*((TopoDS_Vertex*)&aItE.Value());
|
||||||
|
nV=Index(aV);
|
||||||
|
aT=BRep_Tool::Parameter(aV, aE);
|
||||||
|
aPave.SetIndex(nV);
|
||||||
|
aPave.SetParameter(aT);
|
||||||
|
aPB->AppendExtPave1(aPave);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
iRef = myPaveBlocksPool.Append() - 1;
|
iRef = myPaveBlocksPool.Append() - 1;
|
||||||
|
28
tests/bugs/modalg_5/bug25263
Normal file
28
tests/bugs/modalg_5/bug25263
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC25263"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
######################################################
|
||||||
|
# Wrong result of cut operation.
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug25263_Face_cylindrique.brep] b1
|
||||||
|
restore [locate_data_file bug25263_camembert.brep] b2
|
||||||
|
|
||||||
|
bop b1 b2
|
||||||
|
bopcut result
|
||||||
|
|
||||||
|
set square 3.76991
|
||||||
|
|
||||||
|
# Analysis of "nbshapes res"
|
||||||
|
set nb_v_good 3
|
||||||
|
set nb_e_good 4
|
||||||
|
set nb_w_good 1
|
||||||
|
set nb_f_good 1
|
||||||
|
set nb_sh_good 1
|
||||||
|
set nb_sol_good 0
|
||||||
|
set nb_compsol_good 0
|
||||||
|
set nb_compound_good 1
|
||||||
|
set nb_shape_good 11
|
||||||
|
|
||||||
|
set 2dviewer 1
|
Reference in New Issue
Block a user