mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-07-20 12:45:50 +03:00
0028012: Exception while intersecting two surfaces
Test case for issue CR28012
This commit is contained in:
parent
ff1541f179
commit
bc9a61ec69
@ -1894,60 +1894,58 @@ void IntPatch_PrmPrmIntersection::Perform(const Handle(Adaptor3d_HSurface)& S
|
|||||||
|
|
||||||
PW.Perform(StartParams);
|
PW.Perform(StartParams);
|
||||||
if(PW.IsDone()) {
|
if(PW.IsDone()) {
|
||||||
|
if(PW.NbPoints()>2) {
|
||||||
|
Point3dDebut = PW.Value(1).Value();
|
||||||
|
Point3dFin = PW.Value(PW.NbPoints()).Value();
|
||||||
|
|
||||||
Point3dDebut = PW.Value(1).Value();
|
IntSurf_TypeTrans trans1,trans2;
|
||||||
Point3dFin = PW.Value(PW.NbPoints()).Value();
|
Standard_Real locu,locv;
|
||||||
|
gp_Vec norm1,norm2,d1u,d1v;
|
||||||
|
gp_Pnt ptbid;
|
||||||
|
Standard_Integer indextg;
|
||||||
|
gp_Vec tgline(PW.TangentAtLine(indextg));
|
||||||
|
PW.Line()->Value(indextg).ParametersOnS1(locu,locv);
|
||||||
|
Surf1->D1(locu,locv,ptbid,d1u,d1v);
|
||||||
|
norm1 = d1u.Crossed(d1v);
|
||||||
|
PW.Line()->Value(indextg).ParametersOnS2(locu,locv);
|
||||||
|
Surf2->D1(locu,locv,ptbid,d1u,d1v);
|
||||||
|
norm2 = d1u.Crossed(d1v);
|
||||||
|
if (tgline.DotCross(norm2,norm1)>0.) {
|
||||||
|
trans1 = IntSurf_Out;
|
||||||
|
trans2 = IntSurf_In;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
trans1 = IntSurf_In;
|
||||||
|
trans2 = IntSurf_Out;
|
||||||
|
}
|
||||||
|
|
||||||
IntSurf_TypeTrans trans1,trans2;
|
Standard_Real TolTang = TolTangency;
|
||||||
Standard_Real locu,locv;
|
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
||||||
gp_Vec norm1,norm2,d1u,d1v;
|
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||||
gp_Pnt ptbid;
|
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
|
||||||
Standard_Integer indextg;
|
|
||||||
gp_Vec tgline(PW.TangentAtLine(indextg));
|
//---------------
|
||||||
PW.Line()->Value(indextg).ParametersOnS1(locu,locv);
|
if(wline->NbVertex() == 0) {
|
||||||
Surf1->D1(locu,locv,ptbid,d1u,d1v);
|
IntPatch_Point vtx;
|
||||||
norm1 = d1u.Crossed(d1v);
|
IntSurf_PntOn2S POn2S = PW.Line()->Value(1);
|
||||||
PW.Line()->Value(indextg).ParametersOnS2(locu,locv);
|
POn2S.Parameters(pu1,pv1,pu2,pv2);
|
||||||
Surf2->D1(locu,locv,ptbid,d1u,d1v);
|
vtx.SetValue(Point3dDebut,TolTang,Standard_False);
|
||||||
norm2 = d1u.Crossed(d1v);
|
vtx.SetParameters(pu1,pv1,pu2,pv2);
|
||||||
if (tgline.DotCross(norm2,norm1)>0.) {
|
vtx.SetParameter(1);
|
||||||
trans1 = IntSurf_Out;
|
wline->AddVertex(vtx);
|
||||||
trans2 = IntSurf_In;
|
|
||||||
|
POn2S = PW.Line()->Value(wline->NbPnts());
|
||||||
|
POn2S.Parameters(pu1,pv1,pu2,pv2);
|
||||||
|
vtx.SetValue(Point3dFin,TolTang,Standard_False);
|
||||||
|
vtx.SetParameters(pu1,pv1,pu2,pv2);
|
||||||
|
vtx.SetParameter(wline->NbPnts());
|
||||||
|
wline->AddVertex(vtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------
|
||||||
|
SLin.Append(wline);
|
||||||
|
empt = Standard_False;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
trans1 = IntSurf_In;
|
|
||||||
trans2 = IntSurf_Out;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Standard_Real TolTang = TolTangency;
|
|
||||||
Handle(IntPatch_WLine) wline = new IntPatch_WLine(PW.Line(),Standard_False,trans1,trans2);
|
|
||||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
|
||||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
|
|
||||||
|
|
||||||
//---------------
|
|
||||||
if(wline->NbVertex() == 0) {
|
|
||||||
IntPatch_Point vtx;
|
|
||||||
IntSurf_PntOn2S POn2S = PW.Line()->Value(1);
|
|
||||||
POn2S.Parameters(pu1,pv1,pu2,pv2);
|
|
||||||
vtx.SetValue(Point3dDebut,TolTang,Standard_False);
|
|
||||||
vtx.SetParameters(pu1,pv1,pu2,pv2);
|
|
||||||
vtx.SetParameter(1);
|
|
||||||
wline->AddVertex(vtx);
|
|
||||||
|
|
||||||
POn2S = PW.Line()->Value(wline->NbPnts());
|
|
||||||
POn2S.Parameters(pu1,pv1,pu2,pv2);
|
|
||||||
vtx.SetValue(Point3dFin,TolTang,Standard_False);
|
|
||||||
vtx.SetParameters(pu1,pv1,pu2,pv2);
|
|
||||||
vtx.SetParameter(wline->NbPnts());
|
|
||||||
wline->AddVertex(vtx);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------
|
|
||||||
SLin.Append(wline);
|
|
||||||
empt = Standard_False;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
17
tests/bugs/modalg_6/bug28012
Normal file
17
tests/bugs/modalg_6/bug28012
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "OCC28012"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
#################################################
|
||||||
|
# Exception while intersecting two surfaces
|
||||||
|
#################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug28012_s1.draw] s1
|
||||||
|
restore [locate_data_file bug28012_s2.draw] s2
|
||||||
|
|
||||||
|
intersect result s1 s2 0.00012162815337817315 0.0010404164685680738 0.99999999999999989 0.22068942273845651
|
||||||
|
|
||||||
|
smallview
|
||||||
|
fit
|
||||||
|
|
||||||
|
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user