mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Compare commits
3 Commits
V7_8_1
...
CR690-MONT
Author | SHA1 | Date | |
---|---|---|---|
|
94e2d0be0f | ||
|
1ed0e5502e | ||
|
a5416a8c8c |
@@ -74,6 +74,8 @@ void AppCont_LeastSquare::FixSingleBorderPoint(const AppCont_Function& the
|
|||||||
aPrevP = aTabP;
|
aPrevP = aTabP;
|
||||||
aPrevP2d = aTabP2d;
|
aPrevP2d = aTabP2d;
|
||||||
aPrevDist = aCurrDist;
|
aPrevDist = aCurrDist;
|
||||||
|
if(aCurrDist == 0.0)//protection of the division by 0 in the next iteration.
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
theFix2d = aPrevP2d;
|
theFix2d = aPrevP2d;
|
||||||
theFix = aPrevP;
|
theFix = aPrevP;
|
||||||
|
@@ -240,7 +240,7 @@ is
|
|||||||
theF2: Face from TopoDS;
|
theF2: Face from TopoDS;
|
||||||
theTolR3D:Real from Standard;
|
theTolR3D:Real from Standard;
|
||||||
theNC:out Curve from BOPDS;
|
theNC:out Curve from BOPDS;
|
||||||
theMVB:out MapOfInteger from BOPCol)
|
theLBV:out ListOfInteger from BOPCol)
|
||||||
is protected;
|
is protected;
|
||||||
|
|
||||||
IsExistingPaveBlock(me:out;
|
IsExistingPaveBlock(me:out;
|
||||||
@@ -367,9 +367,9 @@ is
|
|||||||
ProcessExistingPaveBlocks(me:out;
|
ProcessExistingPaveBlocks(me:out;
|
||||||
theInt : Integer from Standard;
|
theInt : Integer from Standard;
|
||||||
theMPBOnIn : IndexedMapOfPaveBlock from BOPDS;
|
theMPBOnIn : IndexedMapOfPaveBlock from BOPDS;
|
||||||
|
theDMBV : DataMapOfIntegerListOfInteger from BOPCol;
|
||||||
theMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
|
theMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
|
||||||
theMVI : out DataMapOfShapeInteger from BOPCol;
|
theMVI : out DataMapOfShapeInteger from BOPCol;
|
||||||
theMVB : MapOfInteger from BOPCol;
|
|
||||||
theMPB : out MapOfPaveBlock from BOPDS)
|
theMPB : out MapOfPaveBlock from BOPDS)
|
||||||
is protected;
|
is protected;
|
||||||
---Purpose:
|
---Purpose:
|
||||||
@@ -402,11 +402,12 @@ is
|
|||||||
-- is closed 3D-curve
|
-- is closed 3D-curve
|
||||||
|
|
||||||
PreparePostTreatFF(me:out;
|
PreparePostTreatFF(me:out;
|
||||||
aInt : Integer from Standard;
|
aInt : Integer from Standard;
|
||||||
|
aCur : Integer from Standard;
|
||||||
aPB : PaveBlock from BOPDS;
|
aPB : PaveBlock from BOPDS;
|
||||||
aMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
|
aMSCPB : out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS;
|
||||||
aMVI : out DataMapOfShapeInteger from BOPCol;
|
aMVI : out DataMapOfShapeInteger from BOPCol;
|
||||||
aVC : out VectorOfCurve from BOPDS)
|
aLPB : out ListOfPaveBlock from BOPDS)
|
||||||
is protected;
|
is protected;
|
||||||
---Purpose:
|
---Purpose:
|
||||||
-- Keeps data for post treatment
|
-- Keeps data for post treatment
|
||||||
|
@@ -374,10 +374,10 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
|||||||
//-----------------------------------------------------scope f
|
//-----------------------------------------------------scope f
|
||||||
aAllocator=new NCollection_IncAllocator();
|
aAllocator=new NCollection_IncAllocator();
|
||||||
//
|
//
|
||||||
BOPCol_ListOfInteger aLSE(aAllocator);
|
BOPCol_ListOfInteger aLSE(aAllocator), aLBV(aAllocator);
|
||||||
BOPCol_MapOfInteger aMVOnIn(100, aAllocator), aMF(100, aAllocator),
|
BOPCol_MapOfInteger aMVOnIn(100, aAllocator), aMF(100, aAllocator),
|
||||||
aMVStick(100,aAllocator), aMVEF(100, aAllocator),
|
aMVStick(100,aAllocator), aMVEF(100, aAllocator),
|
||||||
aMVB(100, aAllocator), aMI(100, aAllocator);
|
aMI(100, aAllocator);
|
||||||
BOPDS_IndexedMapOfPaveBlock aMPBOnIn(100, aAllocator);
|
BOPDS_IndexedMapOfPaveBlock aMPBOnIn(100, aAllocator);
|
||||||
BOPDS_MapOfPaveBlock aMPBAdd(100, aAllocator);
|
BOPDS_MapOfPaveBlock aMPBAdd(100, aAllocator);
|
||||||
BOPDS_ListOfPaveBlock aLPB(aAllocator);
|
BOPDS_ListOfPaveBlock aLPB(aAllocator);
|
||||||
@@ -385,8 +385,9 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
|||||||
BOPCol_DataMapOfShapeInteger aMVI(100, aAllocator);
|
BOPCol_DataMapOfShapeInteger aMVI(100, aAllocator);
|
||||||
BOPDS_DataMapOfPaveBlockListOfPaveBlock aDMExEdges(100, aAllocator);
|
BOPDS_DataMapOfPaveBlockListOfPaveBlock aDMExEdges(100, aAllocator);
|
||||||
BOPCol_DataMapOfIntegerReal aMVTol(100, aAllocator);
|
BOPCol_DataMapOfIntegerReal aMVTol(100, aAllocator);
|
||||||
BOPCol_DataMapIteratorOfDataMapOfIntegerReal aItMV;
|
|
||||||
BOPCol_DataMapOfIntegerInteger aDMI(100, aAllocator);
|
BOPCol_DataMapOfIntegerInteger aDMI(100, aAllocator);
|
||||||
|
BOPCol_DataMapOfIntegerListOfInteger aDMBV(100, aAllocator);
|
||||||
|
BOPCol_DataMapIteratorOfDataMapOfIntegerReal aItMV;
|
||||||
//
|
//
|
||||||
for (i=0; i<aNbFF; ++i) {
|
for (i=0; i<aNbFF; ++i) {
|
||||||
//
|
//
|
||||||
@@ -411,17 +412,19 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
|||||||
// Update face info
|
// Update face info
|
||||||
if (aMF.Add(nF1)) {
|
if (aMF.Add(nF1)) {
|
||||||
myDS->UpdateFaceInfoOn(nF1);
|
myDS->UpdateFaceInfoOn(nF1);
|
||||||
|
myDS->UpdateFaceInfoIn(nF1);
|
||||||
}
|
}
|
||||||
if (aMF.Add(nF2)) {
|
if (aMF.Add(nF2)) {
|
||||||
myDS->UpdateFaceInfoOn(nF2);
|
myDS->UpdateFaceInfoOn(nF2);
|
||||||
|
myDS->UpdateFaceInfoIn(nF2);
|
||||||
}
|
}
|
||||||
|
//
|
||||||
BOPDS_FaceInfo& aFI1=myDS->ChangeFaceInfo(nF1);
|
BOPDS_FaceInfo& aFI1=myDS->ChangeFaceInfo(nF1);
|
||||||
BOPDS_FaceInfo& aFI2=myDS->ChangeFaceInfo(nF2);
|
BOPDS_FaceInfo& aFI2=myDS->ChangeFaceInfo(nF2);
|
||||||
//
|
//
|
||||||
aMVOnIn.Clear();
|
aMVOnIn.Clear();
|
||||||
aMPBOnIn.Clear();
|
aMPBOnIn.Clear();
|
||||||
aMVB.Clear();
|
aDMBV.Clear();
|
||||||
aMVTol.Clear();
|
aMVTol.Clear();
|
||||||
//
|
//
|
||||||
myDS->VerticesOnIn(nF1, nF2, aMVOnIn, aMPBOnIn);
|
myDS->VerticesOnIn(nF1, nF2, aMVOnIn, aMPBOnIn);
|
||||||
@@ -465,7 +468,13 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (aIC.HasBounds()) {
|
if (aIC.HasBounds()) {
|
||||||
PutBoundPaveOnCurve(aF1, aF2, aTolR3D, aNC, aMVB);
|
aLBV.Clear();
|
||||||
|
//
|
||||||
|
PutBoundPaveOnCurve(aF1, aF2, aTolR3D, aNC, aLBV);
|
||||||
|
//
|
||||||
|
if (!aLBV.IsEmpty()) {
|
||||||
|
aDMBV.Bind(j, aLBV);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}//for (j=0; j<aNbC; ++j) {
|
}//for (j=0; j<aNbC; ++j) {
|
||||||
//
|
//
|
||||||
@@ -529,7 +538,7 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
|||||||
aFI2.PaveBlocksIn().Contains(aPBOut));
|
aFI2.PaveBlocksIn().Contains(aPBOut));
|
||||||
}
|
}
|
||||||
if (!bInBothFaces) {
|
if (!bInBothFaces) {
|
||||||
PreparePostTreatFF(i, aPBOut, aMSCPB, aMVI, aVC);
|
PreparePostTreatFF(i, j, aPBOut, aMSCPB, aMVI, aLPBC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@@ -580,7 +589,7 @@ void BOPAlgo_PaveFiller::MakeBlocks()
|
|||||||
TV->Tolerance(aTol);
|
TV->Tolerance(aTol);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
ProcessExistingPaveBlocks(i, aMPBOnIn, aMSCPB, aMVI, aMVB, aMPBAdd);
|
ProcessExistingPaveBlocks(i, aMPBOnIn, aDMBV, aMSCPB, aMVI, aMPBAdd);
|
||||||
}//for (i=0; i<aNbFF; ++i) {
|
}//for (i=0; i<aNbFF; ++i) {
|
||||||
//
|
//
|
||||||
// post treatment
|
// post treatment
|
||||||
@@ -913,22 +922,23 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo
|
|||||||
for (j=0; j<aNbC; ++j) {
|
for (j=0; j<aNbC; ++j) {
|
||||||
BOPDS_Curve& aNC=aVNC(j);
|
BOPDS_Curve& aNC=aVNC(j);
|
||||||
BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks();
|
BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks();
|
||||||
aItLPB.Initialize(aLPBC);
|
|
||||||
//
|
|
||||||
// Treat existing pave blocks
|
|
||||||
if (aItLPB.More() && theDME.IsBound(aLPBC.First())) {
|
|
||||||
const Handle(BOPDS_PaveBlock)& aPB=aLPBC.First();
|
|
||||||
BOPDS_ListOfPaveBlock& aLPB=theDME.ChangeFind(aPB);
|
|
||||||
UpdateExistingPaveBlocks(aPB, aLPB, nF1, nF2);
|
|
||||||
aLPBC.Clear();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
// Add section edges to face info
|
// Add section edges to face info
|
||||||
for (; aItLPB.More(); aItLPB.Next()) {
|
aItLPB.Initialize(aLPBC);
|
||||||
|
for (; aItLPB.More(); ) {
|
||||||
const Handle(BOPDS_PaveBlock)& aPB=aItLPB.Value();
|
const Handle(BOPDS_PaveBlock)& aPB=aItLPB.Value();
|
||||||
|
//
|
||||||
|
// Treat existing pave blocks
|
||||||
|
if (theDME.IsBound(aPB)) {
|
||||||
|
BOPDS_ListOfPaveBlock& aLPB=theDME.ChangeFind(aPB);
|
||||||
|
UpdateExistingPaveBlocks(aPB, aLPB, nF1, nF2);
|
||||||
|
aLPBC.Remove(aItLPB);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
aFI1.ChangePaveBlocksSc().Add(aPB);
|
aFI1.ChangePaveBlocksSc().Add(aPB);
|
||||||
aFI2.ChangePaveBlocksSc().Add(aPB);
|
aFI2.ChangePaveBlocksSc().Add(aPB);
|
||||||
|
aItLPB.Next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@@ -1006,6 +1016,11 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo
|
|||||||
const Handle(BOPDS_PaveBlock)& aPB = aMPBCopy(j);
|
const Handle(BOPDS_PaveBlock)& aPB = aMPBCopy(j);
|
||||||
if (theDME.IsBound(aPB)) {
|
if (theDME.IsBound(aPB)) {
|
||||||
const BOPDS_ListOfPaveBlock& aLPB = theDME.Find(aPB);
|
const BOPDS_ListOfPaveBlock& aLPB = theDME.Find(aPB);
|
||||||
|
if (aLPB.IsEmpty()) {
|
||||||
|
aMPBOnIn.Add(aPB);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
aItLPB.Initialize(aLPB);
|
aItLPB.Initialize(aLPB);
|
||||||
for (; aItLPB.More(); aItLPB.Next()) {
|
for (; aItLPB.More(); aItLPB.Next()) {
|
||||||
const Handle(BOPDS_PaveBlock)& aPB1 = aItLPB.Value();
|
const Handle(BOPDS_PaveBlock)& aPB1 = aItLPB.Value();
|
||||||
@@ -1189,7 +1204,7 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo
|
|||||||
const TopoDS_Face& aF2,
|
const TopoDS_Face& aF2,
|
||||||
const Standard_Real aTolR3D,
|
const Standard_Real aTolR3D,
|
||||||
BOPDS_Curve& aNC,
|
BOPDS_Curve& aNC,
|
||||||
BOPCol_MapOfInteger& aMVB)
|
BOPCol_ListOfInteger& aLVB)
|
||||||
{
|
{
|
||||||
Standard_Boolean bVF;
|
Standard_Boolean bVF;
|
||||||
Standard_Integer nV, iFlag, nVn, j, aNbEP;
|
Standard_Integer nV, iFlag, nVn, j, aNbEP;
|
||||||
@@ -1277,7 +1292,8 @@ void BOPAlgo_PaveFiller::UpdateFaceInfo
|
|||||||
BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nVn);
|
BOPDS_ShapeInfo& aSIDS=myDS->ChangeShapeInfo(nVn);
|
||||||
Bnd_Box& aBoxDS=aSIDS.ChangeBox();
|
Bnd_Box& aBoxDS=aSIDS.ChangeBox();
|
||||||
BRepBndLib::Add(aVn, aBoxDS);
|
BRepBndLib::Add(aVn, aBoxDS);
|
||||||
aMVB.Add(nVn);
|
//
|
||||||
|
aLVB.Append(nVn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1769,51 +1785,68 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
|
|||||||
void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks
|
void BOPAlgo_PaveFiller::ProcessExistingPaveBlocks
|
||||||
(const Standard_Integer theInt,
|
(const Standard_Integer theInt,
|
||||||
const BOPDS_IndexedMapOfPaveBlock& aMPBOnIn,
|
const BOPDS_IndexedMapOfPaveBlock& aMPBOnIn,
|
||||||
|
const BOPCol_DataMapOfIntegerListOfInteger& aDMBV,
|
||||||
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
|
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
|
||||||
BOPCol_DataMapOfShapeInteger& aMVI,
|
BOPCol_DataMapOfShapeInteger& aMVI,
|
||||||
const BOPCol_MapOfInteger& aMVB,
|
|
||||||
BOPDS_MapOfPaveBlock& aMPB)
|
BOPDS_MapOfPaveBlock& aMPB)
|
||||||
{
|
{
|
||||||
Standard_Integer nV, nE, iFlag, i, aNbPB;
|
if (aDMBV.IsEmpty()) {
|
||||||
Standard_Real aT;
|
return;
|
||||||
BOPCol_MapIteratorOfMapOfInteger aItB;
|
}
|
||||||
//
|
//
|
||||||
BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF();
|
Standard_Real aT;
|
||||||
|
Standard_Integer i, nV, nE, iC, aNbPB, iFlag;
|
||||||
|
BOPCol_ListIteratorOfListOfInteger aItLI;
|
||||||
|
BOPCol_DataMapIteratorOfDataMapOfIntegerListOfInteger aItBV;
|
||||||
|
//
|
||||||
|
BOPDS_VectorOfInterfFF& aFFs = myDS->InterfFF();
|
||||||
BOPDS_InterfFF& aFF = aFFs(theInt);
|
BOPDS_InterfFF& aFF = aFFs(theInt);
|
||||||
BOPDS_VectorOfCurve& aVC=aFF.ChangeCurves();
|
BOPDS_VectorOfCurve& aVC = aFF.ChangeCurves();
|
||||||
//
|
//
|
||||||
aItB.Initialize(aMVB);
|
aNbPB = aMPBOnIn.Extent();
|
||||||
for (; aItB.More(); aItB.Next()) {
|
//
|
||||||
nV = aItB.Value();
|
aItBV.Initialize(aDMBV);
|
||||||
const BOPDS_ShapeInfo& aSIV=myDS->ShapeInfo(nV);
|
for (; aItBV.More(); aItBV.Next()) {
|
||||||
const Bnd_Box& aBoxV=aSIV.Box();
|
iC = aItBV.Key();
|
||||||
const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&aSIV.Shape();
|
const BOPCol_ListOfInteger& aLBV = aItBV.Value();
|
||||||
if (!aMVI.IsBound(aV)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
aNbPB = aMPBOnIn.Extent();
|
BOPDS_Curve& aNC = aVC.ChangeValue(iC);
|
||||||
for (i = 1; i <= aNbPB; ++i) {
|
BOPDS_ListOfPaveBlock& aLPBC = aNC.ChangePaveBlocks();
|
||||||
const Handle(BOPDS_PaveBlock)& aPB = aMPBOnIn(i);
|
//
|
||||||
if (aPB->Pave1().Index() == nV || aPB->Pave2().Index() == nV) {
|
aItLI.Initialize(aLBV);
|
||||||
|
for (; aItLI.More(); aItLI.Next()) {
|
||||||
|
nV = aItLI.Value();
|
||||||
|
const BOPDS_ShapeInfo& aSIV=myDS->ShapeInfo(nV);
|
||||||
|
const Bnd_Box& aBoxV=aSIV.Box();
|
||||||
|
const TopoDS_Vertex& aV = *(TopoDS_Vertex*)&aSIV.Shape();
|
||||||
|
if (!aMVI.IsBound(aV)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
if (aMPB.Contains(aPB)) {
|
for (i = 1; i <= aNbPB; ++i) {
|
||||||
continue;
|
const Handle(BOPDS_PaveBlock)& aPB = aMPBOnIn(i);
|
||||||
}
|
if (aPB->Pave1().Index() == nV || aPB->Pave2().Index() == nV) {
|
||||||
nE=aPB->Edge();
|
continue;
|
||||||
const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
|
}
|
||||||
const Bnd_Box& aBoxE=aSIE.Box();
|
//
|
||||||
//
|
if (aMPB.Contains(aPB)) {
|
||||||
if (!aBoxV.IsOut(aBoxE)) {
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
nE = aPB->Edge();
|
||||||
|
const BOPDS_ShapeInfo& aSIE = myDS->ShapeInfo(nE);
|
||||||
|
const Bnd_Box& aBoxE = aSIE.Box();
|
||||||
|
//
|
||||||
|
if (aBoxV.IsOut(aBoxE)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//
|
||||||
const TopoDS_Edge& aE = *(TopoDS_Edge*)&aSIE.Shape();
|
const TopoDS_Edge& aE = *(TopoDS_Edge*)&aSIE.Shape();
|
||||||
//
|
//
|
||||||
iFlag=myContext->ComputeVE (aV, aE, aT);
|
iFlag = myContext->ComputeVE(aV, aE, aT);
|
||||||
if (!iFlag) {
|
if (!iFlag) {
|
||||||
aMPB.Add(aPB);
|
aMPB.Add(aPB);
|
||||||
//
|
PreparePostTreatFF(theInt, iC, aPB, aMSCPB, aMVI, aLPBC);
|
||||||
PreparePostTreatFF(theInt, aPB, aMSCPB, aMVI, aVC);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1888,10 +1921,11 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
|
|||||||
// 3. Update pave blocks
|
// 3. Update pave blocks
|
||||||
if (bCB) {
|
if (bCB) {
|
||||||
//create new common blocks
|
//create new common blocks
|
||||||
|
BOPDS_ListOfPaveBlock aLPBNew;
|
||||||
const BOPCol_ListOfInteger& aFaces = aCB1->Faces();
|
const BOPCol_ListOfInteger& aFaces = aCB1->Faces();
|
||||||
aIt.Initialize(aLPB);
|
aIt.Initialize(aLPB);
|
||||||
for (; aIt.More(); aIt.Next()) {
|
for (; aIt.More(); aIt.Next()) {
|
||||||
Handle(BOPDS_PaveBlock)& aPB = aIt.ChangeValue();
|
const Handle(BOPDS_PaveBlock)& aPB = aIt.Value();
|
||||||
//
|
//
|
||||||
aCB = new BOPDS_CommonBlock;
|
aCB = new BOPDS_CommonBlock;
|
||||||
aIt1.Initialize(aLPB1);
|
aIt1.Initialize(aLPB1);
|
||||||
@@ -1911,8 +1945,11 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
|
|||||||
aCB->AddFaces(aFaces);
|
aCB->AddFaces(aFaces);
|
||||||
myDS->SortPaveBlocks(aCB);
|
myDS->SortPaveBlocks(aCB);
|
||||||
//
|
//
|
||||||
aPB=aCB->PaveBlocks().First();
|
const Handle(BOPDS_PaveBlock)& aPBNew = aCB->PaveBlocks().First();
|
||||||
|
aLPBNew.Append(aPBNew);
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
aLPB = aLPBNew;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
nE = aPBf->OriginalEdge();
|
nE = aPBf->OriginalEdge();
|
||||||
@@ -2038,16 +2075,14 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void BOPAlgo_PaveFiller::PreparePostTreatFF
|
void BOPAlgo_PaveFiller::PreparePostTreatFF
|
||||||
(const Standard_Integer aInt,
|
(const Standard_Integer aInt,
|
||||||
|
const Standard_Integer aCur,
|
||||||
const Handle(BOPDS_PaveBlock)& aPB,
|
const Handle(BOPDS_PaveBlock)& aPB,
|
||||||
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
|
BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
|
||||||
BOPCol_DataMapOfShapeInteger& aMVI,
|
BOPCol_DataMapOfShapeInteger& aMVI,
|
||||||
BOPDS_VectorOfCurve& aVC)
|
BOPDS_ListOfPaveBlock& aLPBC)
|
||||||
{
|
{
|
||||||
Standard_Integer nV1, nV2, iC;
|
Standard_Integer nV1, nV2;
|
||||||
//
|
//
|
||||||
aVC.Append1();
|
|
||||||
iC=aVC.Extent()-1;
|
|
||||||
BOPDS_ListOfPaveBlock& aLPBC = aVC(iC).ChangePaveBlocks();
|
|
||||||
aLPBC.Append(aPB);
|
aLPBC.Append(aPB);
|
||||||
//
|
//
|
||||||
aPB->Indices(nV1, nV2);
|
aPB->Indices(nV1, nV2);
|
||||||
@@ -2057,7 +2092,7 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC,
|
|||||||
// Keep info for post treatment
|
// Keep info for post treatment
|
||||||
BOPDS_CoupleOfPaveBlocks aCPB;
|
BOPDS_CoupleOfPaveBlocks aCPB;
|
||||||
aCPB.SetIndexInterf(aInt);
|
aCPB.SetIndexInterf(aInt);
|
||||||
aCPB.SetIndex(iC);
|
aCPB.SetIndex(aCur);
|
||||||
aCPB.SetPaveBlock1(aPB);
|
aCPB.SetPaveBlock1(aPB);
|
||||||
//
|
//
|
||||||
aMSCPB.Add(aE, aCPB);
|
aMSCPB.Add(aE, aCPB);
|
||||||
|
@@ -54,6 +54,12 @@ static
|
|||||||
static
|
static
|
||||||
Standard_Boolean IsClosed(const TopoDS_Edge& ,
|
Standard_Boolean IsClosed(const TopoDS_Edge& ,
|
||||||
const TopoDS_Face& );
|
const TopoDS_Face& );
|
||||||
|
static
|
||||||
|
Standard_Real ComputeTol(const TopoDS_Edge& theE,
|
||||||
|
const Standard_Real theFirst,
|
||||||
|
const Standard_Real theLast,
|
||||||
|
const Handle(Geom2d_Curve)& theC,
|
||||||
|
const TopoDS_Face& theF);
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@@ -68,7 +74,7 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
|
|||||||
{
|
{
|
||||||
Standard_Boolean bIsToReverse, bIsClosed;
|
Standard_Boolean bIsToReverse, bIsClosed;
|
||||||
Standard_Integer iRet;
|
Standard_Integer iRet;
|
||||||
Standard_Real aTol, aT11, aT12, aT21, aT22, aTolPPC;
|
Standard_Real aTol, aTolSP, aT11, aT12, aT21, aT22, aTolPPC;
|
||||||
Handle(Geom2d_Curve) aC2Dold, aC2DoldC;
|
Handle(Geom2d_Curve) aC2Dold, aC2DoldC;
|
||||||
Handle(Geom2d_TrimmedCurve) aC2DT;
|
Handle(Geom2d_TrimmedCurve) aC2DT;
|
||||||
BRep_Builder aBB;
|
BRep_Builder aBB;
|
||||||
@@ -85,24 +91,22 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
|
|||||||
//
|
//
|
||||||
bIsToReverse=IsToReverse(aE2, aE1, aCtx);
|
bIsToReverse=IsToReverse(aE2, aE1, aCtx);
|
||||||
if (bIsToReverse) {
|
if (bIsToReverse) {
|
||||||
|
Standard_Real aT21r, aT22r;
|
||||||
|
//
|
||||||
aC2DoldC->Reverse();
|
aC2DoldC->Reverse();
|
||||||
//
|
//
|
||||||
gp_Pnt2d aP1, aP2;
|
aT21r=aC2DoldC->ReversedParameter(aT21);
|
||||||
//
|
aT22r=aC2DoldC->ReversedParameter(aT22);
|
||||||
aC2Dold->D0(aT22, aP2);
|
aT21=aT22r;
|
||||||
aC2DoldC->D0(aT21, aP1);
|
aT22=aT21r;
|
||||||
aC2DoldC->Translate(aP1, aP2);
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
aC2DT=new Geom2d_TrimmedCurve(aC2DoldC, aT21, aT22);
|
aC2DT=new Geom2d_TrimmedCurve(aC2DoldC, aT21, aT22);
|
||||||
//
|
//
|
||||||
aTol=BRep_Tool::Tolerance(aE1);
|
|
||||||
BRep_Tool::Range (aE1, aT11, aT12);
|
|
||||||
aBB.SameRange(aE1, Standard_False);
|
|
||||||
aBB.SameParameter(aE1, Standard_False);
|
|
||||||
|
|
||||||
aTolPPC=Precision::PConfusion();
|
aTolPPC=Precision::PConfusion();
|
||||||
//
|
//
|
||||||
|
BRep_Tool::Range (aE1, aT11, aT12);
|
||||||
|
//
|
||||||
GeomLib::SameRange(aTolPPC, aC2DT, aT21, aT22, aT11, aT12, aC2DT);
|
GeomLib::SameRange(aTolPPC, aC2DT, aT21, aT22, aT11, aT12, aC2DT);
|
||||||
//
|
//
|
||||||
if (aC2DT.IsNull()){
|
if (aC2DT.IsNull()){
|
||||||
@@ -110,6 +114,19 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
|
|||||||
return iRet;
|
return iRet;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
// check the curves on same parameter to prevent
|
||||||
|
// big tolerance increasing
|
||||||
|
aTol = BRep_Tool::Tolerance(aE1);
|
||||||
|
aTolSP = ComputeTol(aE1, aT11, aT12, aC2DT, aF);
|
||||||
|
//
|
||||||
|
if ((aTolSP > 10.*aTol) && aTolSP > 0.1) {
|
||||||
|
iRet = 3;
|
||||||
|
return iRet;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aBB.SameRange(aE1, Standard_False);
|
||||||
|
aBB.SameParameter(aE1, Standard_False);
|
||||||
|
//
|
||||||
aBB.UpdateEdge(aE1, aC2DT, aF, aTol);
|
aBB.UpdateEdge(aE1, aC2DT, aF, aTol);
|
||||||
BRepLib::SameParameter(aE1);
|
BRepLib::SameParameter(aE1);
|
||||||
BRepLib::SameRange(aE1);
|
BRepLib::SameRange(aE1);
|
||||||
@@ -118,7 +135,7 @@ Standard_Integer BOPTools_AlgoTools2D::AttachExistingPCurve
|
|||||||
if (bIsClosed) {
|
if (bIsClosed) {
|
||||||
iRet=UpdateClosedPCurve(aE2, aE1, aF, aCtx);
|
iRet=UpdateClosedPCurve(aE2, aE1, aF, aCtx);
|
||||||
if(iRet) {
|
if(iRet) {
|
||||||
iRet=3;
|
iRet=4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
@@ -308,4 +325,40 @@ Standard_Boolean IsClosed(const TopoDS_Edge& aE,
|
|||||||
}
|
}
|
||||||
return bRet;
|
return bRet;
|
||||||
}
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : ComputeTol
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
Standard_Real ComputeTol(const TopoDS_Edge& theE,
|
||||||
|
const Standard_Real theFirst,
|
||||||
|
const Standard_Real theLast,
|
||||||
|
const Handle(Geom2d_Curve)& theC,
|
||||||
|
const TopoDS_Face& theF)
|
||||||
|
{
|
||||||
|
Standard_Real f, l, aD, aDMax, aT, aDt;
|
||||||
|
gp_Pnt aP1, aP2;
|
||||||
|
gp_Pnt2d aP2d;
|
||||||
|
//
|
||||||
|
const Standard_Integer NCONTROL = 22;
|
||||||
|
//
|
||||||
|
const Handle(Geom_Curve)& aC = BRep_Tool::Curve(theE, f, l);
|
||||||
|
const Handle(Geom_Surface)& aS = BRep_Tool::Surface(theF);
|
||||||
|
//
|
||||||
|
aDMax = 0.;
|
||||||
|
aDt = (theLast - theFirst) / NCONTROL;
|
||||||
|
//
|
||||||
|
for (aT = theFirst; aT <= theLast; aT += aDt) {
|
||||||
|
theC->D0(aT, aP2d);
|
||||||
|
aS->D0(aP2d.X(), aP2d.Y(), aP1);
|
||||||
|
//
|
||||||
|
aC->D0(aT, aP2);
|
||||||
|
//
|
||||||
|
aD = aP1.SquareDistance(aP2);
|
||||||
|
if (aD > aDMax) {
|
||||||
|
aDMax = aD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
aDMax = sqrt(aDMax);
|
||||||
|
return aDMax;
|
||||||
|
}
|
||||||
|
36
tests/bugs/modalg_6/bug26218
Executable file
36
tests/bugs/modalg_6/bug26218
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC26218"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###############################
|
||||||
|
## Wrong result done by General Fuse algorithm
|
||||||
|
###############################
|
||||||
|
|
||||||
|
restore [locate_data_file bug26218_b11.brep] b1
|
||||||
|
restore [locate_data_file bug26218_b21.brep] b2
|
||||||
|
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects b1
|
||||||
|
baddcompound b2
|
||||||
|
|
||||||
|
bfillds
|
||||||
|
bbuild result
|
||||||
|
|
||||||
|
set square 2728.77
|
||||||
|
|
||||||
|
set nbshapes_expected "
|
||||||
|
Number of shapes in shape
|
||||||
|
VERTEX : 31
|
||||||
|
EDGE : 52
|
||||||
|
WIRE : 25
|
||||||
|
FACE : 25
|
||||||
|
SHELL : 4
|
||||||
|
SOLID : 4
|
||||||
|
COMPSOLID : 0
|
||||||
|
COMPOUND : 1
|
||||||
|
SHAPE : 142
|
||||||
|
"
|
||||||
|
checknbshapes result -ref ${nbshapes_expected} -t -m "result done by General Fuse algorithm"
|
||||||
|
|
||||||
|
set 3dviewer 1
|
37
tests/bugs/modalg_6/bug26224
Executable file
37
tests/bugs/modalg_6/bug26224
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC26224"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###############################
|
||||||
|
## Wrong result obtained by Common operator.
|
||||||
|
###############################
|
||||||
|
|
||||||
|
restore [locate_data_file bug26224_b1.brep] b1
|
||||||
|
restore [locate_data_file bug26224_b2.brep] b2
|
||||||
|
|
||||||
|
bclearobjects
|
||||||
|
bcleartools
|
||||||
|
baddobjects b1
|
||||||
|
baddtools b2
|
||||||
|
|
||||||
|
bfillds
|
||||||
|
bbop result 0
|
||||||
|
|
||||||
|
set square 35006.6
|
||||||
|
|
||||||
|
set nbshapes_expected "
|
||||||
|
Number of shapes in shape
|
||||||
|
VERTEX : 9
|
||||||
|
EDGE : 9
|
||||||
|
WIRE : 1
|
||||||
|
FACE : 1
|
||||||
|
SHELL : 1
|
||||||
|
SOLID : 0
|
||||||
|
COMPSOLID : 0
|
||||||
|
COMPOUND : 1
|
||||||
|
SHAPE : 22
|
||||||
|
|
||||||
|
"
|
||||||
|
checknbshapes result -ref ${nbshapes_expected} -t -m "result obtained by Common operator"
|
||||||
|
|
||||||
|
set 3dviewer 1
|
Reference in New Issue
Block a user