mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0029972: Intersection curve has a weird gap in the middle of it
1. The condition of WLine breaking (in IntWalk_IWalking algorithm) has become more independent of the input tolerance. 2. Currently the algorithm of IntPatch_Points of WLine processing depends on the algorithm of obtaining the WLine. 3. The methods IntSurf_LineOn2S::Add(...) and IntSurf_LineOn2S::SetUV(...) have become not inline (see the message ~0077431 in the issue #29866).
This commit is contained in:
@@ -698,59 +698,52 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
||||
continue;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
//-- Computation of transitions of the line on two surfaces ---
|
||||
//-----------------------------------------------------------------
|
||||
IntSurf_TypeTrans trans1,trans2;
|
||||
{
|
||||
Standard_Integer indice1;
|
||||
Standard_Real dotcross;
|
||||
gp_Pnt aPP0, aPP1;
|
||||
//
|
||||
trans1=IntSurf_Undecided;
|
||||
trans2=IntSurf_Undecided;
|
||||
//
|
||||
indice1 = aLinOn2S->NbPoints()/3;
|
||||
if(indice1<=2) {
|
||||
indice1 = 2;
|
||||
}
|
||||
//
|
||||
aPP1=aLinOn2S->Value(indice1).Value();
|
||||
aPP0=aLinOn2S->Value(indice1-1).Value();
|
||||
//
|
||||
gp_Vec tgvalid(aPP0, aPP1);
|
||||
gp_Vec aNQ1 = myQuad1.Normale(aPP0);
|
||||
gp_Vec aNQ2 = myQuad2.Normale(aPP0);
|
||||
//
|
||||
dotcross = tgvalid.DotCross(aNQ2, aNQ1);
|
||||
if (dotcross > myTolTransition) {
|
||||
trans1 = IntSurf_Out;
|
||||
trans2 = IntSurf_In;
|
||||
}
|
||||
else if(dotcross < -myTolTransition) {
|
||||
trans1 = IntSurf_In;
|
||||
trans2 = IntSurf_Out;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
//-- W L i n e c r e a t i o n ---
|
||||
//-----------------------------------------------------------------
|
||||
Handle(IntPatch_WLine) aWLine;
|
||||
//
|
||||
if(theALine->TransitionOnS1() == IntSurf_Touch) {
|
||||
aWLine = new IntPatch_WLine(aLinOn2S,
|
||||
if(theALine->TransitionOnS1() == IntSurf_Touch)
|
||||
{
|
||||
aWLine = new IntPatch_WLine(aLinOn2S,
|
||||
theALine->IsTangent(),
|
||||
theALine->SituationS1(),
|
||||
theALine->SituationS2());
|
||||
aWLine->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLImpImp);
|
||||
}
|
||||
else if(theALine->TransitionOnS1() == IntSurf_Undecided) {
|
||||
else if(theALine->TransitionOnS1() == IntSurf_Undecided)
|
||||
{
|
||||
aWLine = new IntPatch_WLine(aLinOn2S, theALine->IsTangent());
|
||||
aWLine->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLImpImp);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
//Computation of transitions of the line on two surfaces ---
|
||||
const Standard_Integer indice1 = Max(aLinOn2S->NbPoints() / 3, 2);
|
||||
const gp_Pnt &aPP0 = aLinOn2S->Value(indice1 - 1).Value(),
|
||||
&aPP1 = aLinOn2S->Value(indice1).Value();
|
||||
const gp_Vec tgvalid(aPP0, aPP1);
|
||||
const gp_Vec aNQ1(myQuad1.Normale(aPP0)), aNQ2(myQuad2.Normale(aPP0));
|
||||
|
||||
const Standard_Real dotcross = tgvalid.DotCross(aNQ2, aNQ1);
|
||||
|
||||
IntSurf_TypeTrans trans1 = IntSurf_Undecided,
|
||||
trans2 = IntSurf_Undecided;
|
||||
|
||||
if (dotcross > myTolTransition)
|
||||
{
|
||||
trans1 = IntSurf_Out;
|
||||
trans2 = IntSurf_In;
|
||||
}
|
||||
else if (dotcross < -myTolTransition)
|
||||
{
|
||||
trans1 = IntSurf_In;
|
||||
trans2 = IntSurf_Out;
|
||||
}
|
||||
|
||||
aWLine = new IntPatch_WLine(aLinOn2S, theALine->IsTangent(),
|
||||
trans1, // aline->TransitionOnS1(),
|
||||
trans2); //aline->TransitionOnS2());
|
||||
trans1, trans2);
|
||||
aWLine->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLImpImp);
|
||||
}
|
||||
|
||||
for(Standard_Integer i = aSeqVertex.Lower(); i <= aNewVertID; i++)
|
||||
|
@@ -2810,6 +2810,7 @@ static IntPatch_ImpImpIntersection::IntStatus
|
||||
{
|
||||
aL2S[i] = new IntSurf_LineOn2S();
|
||||
aWLine[i] = new IntPatch_WLine(aL2S[i], Standard_False);
|
||||
aWLine[i]->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLImpImp);
|
||||
aWLFindStatus[i] = WLFStatus_Absent;
|
||||
isAddingWLEnabled[i] = Standard_True;
|
||||
aU2[i] = aV1[i] = aV2[i] = 0.0;
|
||||
@@ -3531,6 +3532,7 @@ static IntPatch_ImpImpIntersection::IntStatus
|
||||
|
||||
Handle(IntSurf_LineOn2S) aL2S = new IntSurf_LineOn2S();
|
||||
Handle(IntPatch_WLine) aWLine = new IntPatch_WLine(aL2S, Standard_False);
|
||||
aWLine->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLImpImp);
|
||||
|
||||
//Define the index of WLine, which lies the point aPnt2S in.
|
||||
Standard_Integer anIndex = 0;
|
||||
|
@@ -852,6 +852,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
}
|
||||
// <-A
|
||||
wline = new IntPatch_WLine(thelin,Standard_False,trans1,trans2);
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLImpPrm);
|
||||
|
||||
#ifdef INTPATCH_IMPPRMINTERSECTION_DEBUG
|
||||
wline->Dump(0);
|
||||
@@ -2379,6 +2380,7 @@ static Handle(IntPatch_WLine) MakeSplitWLine (Handle(IntPatch_WLine)& WLi
|
||||
sline->Add(SLine->Value(ip));
|
||||
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(sline,Tang,Trans1,Trans2);
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLImpPrm);
|
||||
|
||||
gp_Pnt aSPnt;
|
||||
IntPatch_Point TPntF,TPntL;
|
||||
@@ -2958,6 +2960,7 @@ static Standard_Boolean DecomposeResult(const Handle(IntPatch_PointLine)& theLin
|
||||
Handle(IntPatch_WLine) wline =
|
||||
new IntPatch_WLine(sline,Standard_False,
|
||||
theLine->TransitionOnS1(),theLine->TransitionOnS2());
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLImpPrm);
|
||||
|
||||
Standard_Real aU1 = 0.0, aV1 = 0.0, aU2 = 0.0, aV2 = 0.0;
|
||||
gp_Pnt aSPnt(sline->Value(1).Value());
|
||||
|
@@ -237,6 +237,7 @@ static void SeveralWlinesProcessing(const Handle(Adaptor3d_HSurface)& theSurf1,
|
||||
newVtx.SetParameter(VPold.Value(ciV));
|
||||
|
||||
Handle(IntPatch_WLine) NWLine = new IntPatch_WLine(newL2s,Standard_False,theTrans1,theTrans2);
|
||||
NWLine->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm);
|
||||
|
||||
Standard_Integer iV;
|
||||
for( iV = 1; iV <= cnbV; iV++ )
|
||||
@@ -591,6 +592,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm);
|
||||
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
@@ -740,6 +743,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm);
|
||||
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
@@ -998,6 +1003,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PWLine,Standard_False,trans1,trans2);
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm);
|
||||
|
||||
const IntSurf_PntOn2S& POn2SDeb = wline->Point(1);
|
||||
const IntSurf_PntOn2S& POn2SFin = wline->Point(wline->NbPnts());
|
||||
if((POn2SDeb.Value()).Distance(POn2SFin.Value()) <= TolTangency) {
|
||||
@@ -1174,6 +1181,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PWLine,Standard_False,trans1,trans2);
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm);
|
||||
|
||||
const IntSurf_PntOn2S& POn2SDeb = wline->Point(1);
|
||||
const IntSurf_PntOn2S& POn2SFin = wline->Point(wline->NbPnts());
|
||||
if((POn2SDeb.Value()).Distance(POn2SFin.Value()) <= TolTangency) {
|
||||
@@ -1324,7 +1333,10 @@ Handle(IntPatch_Line) IntPatch_PrmPrmIntersection::NewLine (const Handle(Adaptor
|
||||
|
||||
ResultPntOn2SLine->Add(TheLine->Point(High));
|
||||
|
||||
return(new IntPatch_WLine(ResultPntOn2SLine,Standard_False));
|
||||
Handle(IntPatch_WLine) aRWL = new IntPatch_WLine(ResultPntOn2SLine, Standard_False);
|
||||
aRWL->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm);
|
||||
|
||||
return(aRWL);
|
||||
}
|
||||
|
||||
//==================================================================================
|
||||
@@ -1787,6 +1799,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm);
|
||||
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline, Surf1, D1, Surf2, Standard_True, TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
@@ -1939,6 +1953,8 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_HSurface)& S
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm);
|
||||
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
@@ -2474,6 +2490,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm);
|
||||
wline->EnablePurging(!hasBeenAdded);
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
@@ -2688,6 +2705,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm);
|
||||
wline->EnablePurging(!hasBeenAdded);
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
@@ -2885,6 +2903,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
|
||||
Standard_Real TolTang = TolTangency;
|
||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||
wline->SetCreatingWayInfo(IntPatch_WLine::IntPatch_WLPrmPrm);
|
||||
|
||||
//the method PutVertexOnLine can reduce the number of points in <wline>
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
if (wline->NbPnts() < 2)
|
||||
|
@@ -42,7 +42,8 @@ IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line,
|
||||
const IntSurf_TypeTrans Trans2) :
|
||||
IntPatch_PointLine(Tang,Trans1,Trans2),fipt(Standard_False),lapt(Standard_False),
|
||||
hasArcOnS1(Standard_False),hasArcOnS2(Standard_False),
|
||||
myIsPurgerAllowed(Standard_True)
|
||||
myIsPurgerAllowed(Standard_True),
|
||||
myCreationWay(IntPatch_WLUnknown)
|
||||
{
|
||||
typ = IntPatch_Walking;
|
||||
curv = Line;
|
||||
@@ -56,7 +57,8 @@ IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line,
|
||||
const IntSurf_Situation Situ2) :
|
||||
IntPatch_PointLine(Tang,Situ1,Situ2),fipt(Standard_False),lapt(Standard_False),
|
||||
hasArcOnS1(Standard_False),hasArcOnS2(Standard_False),
|
||||
myIsPurgerAllowed(Standard_True)
|
||||
myIsPurgerAllowed(Standard_True),
|
||||
myCreationWay(IntPatch_WLUnknown)
|
||||
{
|
||||
typ = IntPatch_Walking;
|
||||
curv = Line;
|
||||
@@ -68,7 +70,8 @@ IntPatch_WLine::IntPatch_WLine (const Handle(IntSurf_LineOn2S)& Line,
|
||||
const Standard_Boolean Tang) :
|
||||
IntPatch_PointLine(Tang),fipt(Standard_False),lapt(Standard_False),
|
||||
hasArcOnS1(Standard_False),hasArcOnS2(Standard_False),
|
||||
myIsPurgerAllowed(Standard_True)
|
||||
myIsPurgerAllowed(Standard_True),
|
||||
myCreationWay(IntPatch_WLUnknown)
|
||||
{
|
||||
typ = IntPatch_Walking;
|
||||
curv = Line;
|
||||
|
@@ -47,6 +47,14 @@ class IntPatch_WLine : public IntPatch_PointLine
|
||||
|
||||
public:
|
||||
|
||||
//! Enumeration of ways of WLine creation.
|
||||
enum IntPatch_WLType
|
||||
{
|
||||
IntPatch_WLUnknown,
|
||||
IntPatch_WLImpImp,
|
||||
IntPatch_WLImpPrm,
|
||||
IntPatch_WLPrmPrm
|
||||
};
|
||||
|
||||
//! Creates a WLine as an intersection when the
|
||||
//! transitions are In or Out.
|
||||
@@ -183,18 +191,30 @@ public:
|
||||
//! Otherwise, prints list of 2d-points on the 2nd surface
|
||||
Standard_EXPORT void Dump(const Standard_Integer theMode) const;
|
||||
|
||||
//! Allows or forbides purging of existing WLine
|
||||
//! Allows or forbids purging of existing WLine
|
||||
void EnablePurging(const Standard_Boolean theIsEnabled)
|
||||
{
|
||||
myIsPurgerAllowed = theIsEnabled;
|
||||
}
|
||||
|
||||
//! Returns TRUE if purging is allowed or forbiden for existing WLine
|
||||
//! Returns TRUE if purging is allowed or forbidden for existing WLine
|
||||
Standard_Boolean IsPurgingAllowed()
|
||||
{
|
||||
return myIsPurgerAllowed;
|
||||
}
|
||||
|
||||
//! Returns the way of <*this> creation.
|
||||
IntPatch_WLType GetCreatingWay() const
|
||||
{
|
||||
return myCreationWay;
|
||||
}
|
||||
|
||||
//! Sets the info about the way of <*this> creation.
|
||||
void SetCreatingWayInfo(IntPatch_WLType theAlgo)
|
||||
{
|
||||
myCreationWay = theAlgo;
|
||||
}
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(IntPatch_WLine,IntPatch_PointLine)
|
||||
|
||||
@@ -222,6 +242,8 @@ private:
|
||||
Handle(Adaptor2d_HCurve2d) theArcOnS2;
|
||||
Standard_Boolean myIsPurgerAllowed;
|
||||
|
||||
//! identifies the way of <*this> creation
|
||||
IntPatch_WLType myCreationWay;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -99,6 +99,7 @@ static Handle(IntPatch_WLine) MakeNewWLine(const Handle(IntPatch_WLine)
|
||||
|
||||
Handle(IntSurf_LineOn2S) aPurgedLineOn2S = new IntSurf_LineOn2S();
|
||||
Handle(IntPatch_WLine) aLocalWLine = new IntPatch_WLine(aPurgedLineOn2S, Standard_False);
|
||||
aLocalWLine->SetCreatingWayInfo(theWLine->GetCreatingWay());
|
||||
Standard_Integer anOldLineIdx = 1, aVertexIdx = 1, anIndexPrev = -1, anIdxOld = -1;
|
||||
gp_Pnt aPPrev, aPOld;
|
||||
for(i = 1; i <= thePointsHash.Upper(); i++)
|
||||
@@ -1347,6 +1348,7 @@ Handle(IntPatch_WLine) IntPatch_WLineTool::
|
||||
Handle(IntPatch_WLine) aTmpWLine = theWLine;
|
||||
Handle(IntSurf_LineOn2S) aLineOn2S = new IntSurf_LineOn2S();
|
||||
aLocalWLine = new IntPatch_WLine(aLineOn2S, Standard_False);
|
||||
aLocalWLine->SetCreatingWayInfo(theWLine->GetCreatingWay());
|
||||
for(i = 1; i <= nb; i++)
|
||||
aLineOn2S->Add(theWLine->Point(i));
|
||||
|
||||
@@ -1390,6 +1392,7 @@ Handle(IntPatch_WLine) IntPatch_WLineTool::
|
||||
{
|
||||
aTmpWLine = aLocalWLine;
|
||||
aLocalWLine = new IntPatch_WLine(aLineOn2S, Standard_False);
|
||||
aLocalWLine->SetCreatingWayInfo(theWLine->GetCreatingWay());
|
||||
|
||||
for(v = 1; v <= aTmpWLine->NbVertex(); v++)
|
||||
{
|
||||
|
Reference in New Issue
Block a user