mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
7a0a64d727 |
@@ -468,7 +468,14 @@ static void PERFORM_C0(const TopoDS_Edge& S1, const TopoDS_Edge& S2,
|
||||
if (fabs(Dstmin - sqrt(Ext.SquareDistance(ii))) < Eps)
|
||||
{
|
||||
Pt = Ext.Point(ii);
|
||||
if (TRI_SOLUTION(SeqSol2, Pt))
|
||||
// Pt - point on the curve pCurvOther/Eother, but
|
||||
// if iE == 0 -> Eother correspond to edge S2
|
||||
// and to edge S1 in the opposite case.
|
||||
// Therefore we should search Pt through previous solution points on Other curve (edge):
|
||||
// if iE == 0 - on edge S2, namely through SeqSol2,
|
||||
// else - on edge S1, namely through SeqSol1.
|
||||
const bool triSolutionResult = (iE == 0) ? TRI_SOLUTION(SeqSol2, Pt) : TRI_SOLUTION(SeqSol1, Pt);
|
||||
if (triSolutionResult)
|
||||
{
|
||||
// Check if the parameter does not correspond to a vertex
|
||||
const Standard_Real t = Ext.Parameter(ii);
|
||||
@@ -869,9 +876,19 @@ void BRepExtrema_DistanceSS::Perform (const TopoDS_Edge& theS1,
|
||||
|
||||
if (!seqSol1.IsEmpty() && !seqSol2.IsEmpty())
|
||||
{
|
||||
theSeqSolShape1.Append(seqSol1);
|
||||
theSeqSolShape2.Append(seqSol2);
|
||||
myModif = Standard_True;
|
||||
BRepExtrema_SeqOfSolution::iterator anIt1 = seqSol1.begin();
|
||||
BRepExtrema_SeqOfSolution::iterator anIt2 = seqSol2.begin();
|
||||
for (; anIt1 != seqSol1.end() && anIt2 != seqSol2.end(); anIt1++, anIt2++)
|
||||
{
|
||||
gp_Pnt Pt1 = anIt1->Point();
|
||||
gp_Pnt Pt2 = anIt2->Point();
|
||||
if (TRI_SOLUTION(theSeqSolShape1, Pt1) || TRI_SOLUTION(theSeqSolShape2, Pt2))
|
||||
{
|
||||
theSeqSolShape1.Append(*anIt1);
|
||||
theSeqSolShape2.Append(*anIt2);
|
||||
myModif = Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -78,13 +78,11 @@ void HLRAlgo_PolyInternalData::UpdateLinks (HLRAlgo_Array1OfTData& theTData,
|
||||
HLRAlgo_PolyInternalNode::NodeIndices& A2 = thePINod.ChangeValue(TD->Node2)->Indices();
|
||||
HLRAlgo_PolyInternalNode::NodeIndices& A3 = thePINod.ChangeValue(TD->Node3)->Indices();
|
||||
|
||||
bool notFound = true;
|
||||
{
|
||||
n1 = TD->Node1;
|
||||
n2 = TD->Node2;
|
||||
newSeg = Standard_False;
|
||||
if (A1.NdSg == 0 && A2.NdSg == 0) {
|
||||
notFound = false;
|
||||
newSeg = Standard_True;
|
||||
myNbPISeg++;
|
||||
A1.NdSg = myNbPISeg;
|
||||
@@ -109,7 +107,6 @@ void HLRAlgo_PolyInternalData::UpdateLinks (HLRAlgo_Array1OfTData& theTData,
|
||||
}
|
||||
}
|
||||
if (find == 0) {
|
||||
notFound = false;
|
||||
newSeg = Standard_True;
|
||||
myNbPISeg++;
|
||||
if (icsv == 1) aSegIndices->NxtSg1 = myNbPISeg;
|
||||
@@ -118,7 +115,6 @@ void HLRAlgo_PolyInternalData::UpdateLinks (HLRAlgo_Array1OfTData& theTData,
|
||||
else aSegIndices->Conex2 = i;
|
||||
}
|
||||
else {
|
||||
notFound = false;
|
||||
newSeg = Standard_True;
|
||||
myNbPISeg++;
|
||||
A1.NdSg = myNbPISeg;
|
||||
@@ -149,13 +145,11 @@ void HLRAlgo_PolyInternalData::UpdateLinks (HLRAlgo_Array1OfTData& theTData,
|
||||
}
|
||||
}
|
||||
|
||||
if (notFound)
|
||||
{
|
||||
n1 = TD->Node2;
|
||||
n2 = TD->Node3;
|
||||
newSeg = Standard_False;
|
||||
if (A2.NdSg == 0 && A3.NdSg == 0) {
|
||||
notFound = false;
|
||||
newSeg = Standard_True;
|
||||
myNbPISeg++;
|
||||
A2.NdSg = myNbPISeg;
|
||||
@@ -180,7 +174,6 @@ void HLRAlgo_PolyInternalData::UpdateLinks (HLRAlgo_Array1OfTData& theTData,
|
||||
}
|
||||
}
|
||||
if (find == 0) {
|
||||
notFound = false;
|
||||
newSeg = Standard_True;
|
||||
myNbPISeg++;
|
||||
if (icsv == 1) aSegIndices->NxtSg1 = myNbPISeg;
|
||||
@@ -189,7 +182,6 @@ void HLRAlgo_PolyInternalData::UpdateLinks (HLRAlgo_Array1OfTData& theTData,
|
||||
else aSegIndices->Conex2 = i;
|
||||
}
|
||||
else {
|
||||
notFound = false;
|
||||
newSeg = Standard_True;
|
||||
myNbPISeg++;
|
||||
A2.NdSg = myNbPISeg;
|
||||
@@ -220,13 +212,11 @@ void HLRAlgo_PolyInternalData::UpdateLinks (HLRAlgo_Array1OfTData& theTData,
|
||||
}
|
||||
}
|
||||
|
||||
if (notFound)
|
||||
{
|
||||
n1 = TD->Node3;
|
||||
n2 = TD->Node1;
|
||||
newSeg = Standard_False;
|
||||
if (A3.NdSg == 0 && A1.NdSg == 0) {
|
||||
notFound = false;
|
||||
newSeg = Standard_True;
|
||||
myNbPISeg++;
|
||||
A3.NdSg = myNbPISeg;
|
||||
@@ -251,7 +241,6 @@ void HLRAlgo_PolyInternalData::UpdateLinks (HLRAlgo_Array1OfTData& theTData,
|
||||
}
|
||||
}
|
||||
if (find == 0) {
|
||||
notFound = false;
|
||||
newSeg = Standard_True;
|
||||
myNbPISeg++;
|
||||
if (icsv == 1) aSegIndices->NxtSg1 = myNbPISeg;
|
||||
@@ -260,7 +249,6 @@ void HLRAlgo_PolyInternalData::UpdateLinks (HLRAlgo_Array1OfTData& theTData,
|
||||
else aSegIndices->Conex2 = i;
|
||||
}
|
||||
else {
|
||||
notFound = false;
|
||||
newSeg = Standard_True;
|
||||
myNbPISeg++;
|
||||
A3.NdSg = myNbPISeg;
|
||||
|
25
tests/bugs/modalg_7/bug32934
Normal file
25
tests/bugs/modalg_7/bug32934
Normal file
@@ -0,0 +1,25 @@
|
||||
puts "========"
|
||||
puts "OCC32934"
|
||||
puts "========"
|
||||
puts ""
|
||||
###############################################################################################
|
||||
# BRepExtrema_DistShapeShape BRepExtrema_DistShapeShape returns two solutions instead of one.
|
||||
###############################################################################################
|
||||
|
||||
pload ALL
|
||||
restore [locate_data_file bug32934.brep] edges
|
||||
explode edges E
|
||||
|
||||
distmini di edges_1 edges_2
|
||||
if { ([isdraw di2]) } {
|
||||
puts "Error : result of distmini is wrong"
|
||||
} else {
|
||||
checknbshapes di -vertex 1 -edge 0
|
||||
}
|
||||
|
||||
distmini dii edges_2 edges_1
|
||||
if { ([isdraw dii2]) } {
|
||||
puts "Error : result of distmini is wrong"
|
||||
} else {
|
||||
checknbshapes dii -vertex 1 -edge 0
|
||||
}
|
Reference in New Issue
Block a user