mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0029494: Intersection line between two parametric surfaces is restricted incorrectly if it matches the surface boundary
Creation of IntPatch_Points is forbidden in tangent-zones exceptionally domain boundaries of intersected surface.
This commit is contained in:
parent
7797eb389a
commit
8dc56d0f88
@ -365,7 +365,7 @@ static Standard_Integer xdistcs(Draw_Interpretor& di, Standard_Integer n, const
|
||||
// report error or warning if distance is greater than tolerance
|
||||
if (aD > anErrTol)
|
||||
{
|
||||
di << "Error :";
|
||||
di << "Error in " << a[1] << ":";
|
||||
}
|
||||
else if (aD > aWarnTol)
|
||||
{
|
||||
|
@ -234,40 +234,6 @@ static void GetLinePoint2d (const Handle(IntPatch_Line)& L,
|
||||
V = (1.-par)*vs1+par*vs2;
|
||||
}
|
||||
|
||||
static void GetWLinePoint (const Handle(IntPatch_WLine)& wlin,
|
||||
const Standard_Real param,
|
||||
Standard_Real& U1, Standard_Real& V1,
|
||||
Standard_Real& U2, Standard_Real& V2,
|
||||
gp_Pnt& P)
|
||||
{
|
||||
Standard_Integer Nbptlin = wlin->NbPnts();
|
||||
Standard_Real par = IntegerPart(param);
|
||||
Standard_Integer Irang = Standard_Integer(par);
|
||||
if (Irang == Nbptlin) {
|
||||
Irang--;
|
||||
par = 1.0;
|
||||
}
|
||||
else
|
||||
par = Abs(param-par);
|
||||
|
||||
const IntSurf_PntOn2S& p2s1 = wlin->Point(Irang);
|
||||
const IntSurf_PntOn2S& p2s2 = wlin->Point(Irang+1);
|
||||
const gp_Pnt& p1 = p2s1.Value();
|
||||
const gp_Pnt& p2 = p2s2.Value();
|
||||
P.ChangeCoord().SetLinearForm(1.-par, p1.XYZ(), par, p2.XYZ());
|
||||
|
||||
Standard_Real us1,vs1,us2,vs2;
|
||||
p2s1.ParametersOnS1(us1,vs1);
|
||||
p2s2.ParametersOnS1(us2,vs2);
|
||||
U1 = (1.-par)*us1+par*us2;
|
||||
V1 = (1.-par)*vs1+par*vs2;
|
||||
|
||||
p2s1.ParametersOnS2(us1,vs1);
|
||||
p2s2.ParametersOnS2(us2,vs2);
|
||||
U2 = (1.-par)*us1+par*us2;
|
||||
V2 = (1.-par)*vs1+par*vs2;
|
||||
}
|
||||
|
||||
static Standard_Boolean FindParameter(const Handle(IntPatch_Line)& L,
|
||||
const Handle(Adaptor3d_HSurface)& OtherSurf,
|
||||
const Standard_Real Tol,
|
||||
@ -394,50 +360,6 @@ inline Standard_Boolean ArePnt2dEqual(const gp_Pnt2d& p1, const gp_Pnt2d& p2,
|
||||
return Abs(p1.X()-p2.X()) < tolU && Abs(p1.Y()-p2.Y()) < tolV;
|
||||
}
|
||||
|
||||
static gp_Pnt2d GetPointOnPolygo(const IntPatch_Polygo& Pol,
|
||||
const Standard_Real param)
|
||||
{
|
||||
Standard_Real par = IntegerPart(param);
|
||||
Standard_Integer irang = Standard_Integer(par) + 1;
|
||||
if (irang == Pol.NbPoints()) {
|
||||
irang--;
|
||||
par = 1.;
|
||||
}
|
||||
else {
|
||||
par = Abs(param-par);
|
||||
}
|
||||
gp_Pnt2d p1 = Pol.Point(irang);
|
||||
gp_Pnt2d p2 = Pol.Point(irang+1);
|
||||
gp_Pnt2d p;
|
||||
p.ChangeCoord().SetLinearForm(1.-par,p1.XY(),par,p2.XY());
|
||||
return p;
|
||||
}
|
||||
|
||||
static Standard_Boolean IsSegment2dSmall(const IntPatch_Polygo& Pol,
|
||||
const Standard_Real parmin,
|
||||
const Standard_Real parmax,
|
||||
const Standard_Real URes,
|
||||
const Standard_Real VRes)
|
||||
{
|
||||
Standard_Integer irang1 = Standard_Integer(IntegerPart(parmin)) + 2;
|
||||
Standard_Integer irang2 = Standard_Integer(IntegerPart(parmax)) + 1;
|
||||
gp_Pnt2d p1,p2;
|
||||
Standard_Real du=0.,dv=0.;
|
||||
p1 = GetPointOnPolygo(Pol,parmin);
|
||||
for (Standard_Integer i=irang1; i <= irang2 && du <= URes && dv <= VRes; i++) {
|
||||
p2 = Pol.Point(i);
|
||||
du += Abs(p2.X()-p1.X());
|
||||
dv += Abs(p2.Y()-p1.Y());
|
||||
p1 = p2;
|
||||
}
|
||||
if (du <= URes && dv <= VRes) {
|
||||
p2 = GetPointOnPolygo(Pol,parmax);
|
||||
du += Abs(p2.X()-p1.X());
|
||||
dv += Abs(p2.Y()-p1.Y());
|
||||
}
|
||||
return du <= URes && dv <= VRes;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : PutVertexOnLine
|
||||
//purpose :
|
||||
@ -467,7 +389,6 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
Handle(IntPatch_RLine) rlin (Handle(IntPatch_RLine)::DownCast (L)); //-- aucune verification n est
|
||||
Handle(IntPatch_WLine) wlin (Handle(IntPatch_WLine)::DownCast (L)); //-- faite au cast.
|
||||
Standard_Integer Nbvtx =0;
|
||||
Standard_Integer Nbptlin =0;
|
||||
Standard_Real tolPLin = Surf->UResolution(Precision::Confusion());
|
||||
tolPLin = Max (tolPLin, Surf->VResolution(Precision::Confusion()));
|
||||
tolPLin = Min (tolPLin, Precision::Confusion());
|
||||
@ -491,12 +412,10 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
if (typL == IntPatch_Walking) {
|
||||
Nbvtx = wlin->NbVertex();
|
||||
PLin.SetWLine(OnFirst,wlin);
|
||||
Nbptlin = wlin->NbPnts();
|
||||
}
|
||||
else if ( typL == IntPatch_Restriction) {
|
||||
Nbvtx = rlin->NbVertex();
|
||||
PLin.SetRLine(OnFirst,rlin);
|
||||
Nbptlin = rlin->NbPnts();
|
||||
}
|
||||
else {
|
||||
throw Standard_DomainError();
|
||||
@ -553,8 +472,6 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
|
||||
// MSV Oct 15, 2001: use tolerance of this edge if possible
|
||||
Standard_Real edgeTol = Tol3d(arc,Domain,Tol);
|
||||
Standard_Real URes = Surf->UResolution(edgeTol);
|
||||
Standard_Real VRes = Surf->VResolution(edgeTol);
|
||||
|
||||
IntPatch_HInterTool::Bounds(arc,PFirst,PLast);
|
||||
if(Precision::IsNegativeInfinite(PFirst))
|
||||
@ -567,26 +484,16 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
// return;
|
||||
//}
|
||||
|
||||
Standard_Boolean isVFirst = Standard_False, isVLast = Standard_False;
|
||||
gp_Pnt2d p2dFirst,p2dLast;
|
||||
Standard_Real tolUFirst=0.,tolVFirst=0.,tolULast=0.,tolVLast=0.;
|
||||
Domain->Initialize(arc);
|
||||
for (Domain->InitVertexIterator(); Domain->MoreVertex(); Domain->NextVertex()) {
|
||||
Handle(Adaptor3d_HVertex) vtx = Domain->Vertex();
|
||||
Standard_Real prm = IntPatch_HInterTool::Parameter(vtx,arc);
|
||||
if (Abs(prm - PFirst) < Precision::PConfusion()) {
|
||||
arc->D0(PFirst,p2dFirst);
|
||||
Standard_Real tol3d = Max (Tol3d(vtx,Domain), edgeTol);
|
||||
tolUFirst = Surf->UResolution(tol3d);
|
||||
tolVFirst = Surf->VResolution(tol3d);
|
||||
isVFirst = Standard_True;
|
||||
}
|
||||
else if (Abs(prm - PLast) < Precision::PConfusion()) {
|
||||
arc->D0(PLast,p2dLast);
|
||||
Standard_Real tol3d = Max (edgeTol, Tol3d(vtx,Domain));
|
||||
tolULast = Surf->UResolution(tol3d);
|
||||
tolVLast = Surf->VResolution(tol3d);
|
||||
isVLast = Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
@ -697,110 +604,34 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
Commun.Perform(PLin,Brise);
|
||||
locpt.Clear();
|
||||
locpt2.Clear();
|
||||
Standard_Integer Commun_NbSectionPoints = Commun.NbSectionPoints();
|
||||
Standard_Integer Commun_NbTangentZones = Commun.NbTangentZones();
|
||||
Standard_Integer Commun_Section_Tangent = Commun_NbSectionPoints
|
||||
+ Commun_NbTangentZones;
|
||||
for (i=1;i<=Commun_Section_Tangent;i++) {
|
||||
Standard_Real W1[2],W2[2];
|
||||
Standard_Boolean refine[2],useWL[2];
|
||||
Standard_Integer nbpt = 1;
|
||||
if(i<=Commun_NbSectionPoints) {
|
||||
// intersection point
|
||||
W1[0] = Commun.PntValue(i).ParamOnFirst();
|
||||
W2[0] = Commun.PntValue(i).ParamOnSecond();
|
||||
refine[0] = Standard_True;
|
||||
}
|
||||
else {
|
||||
// tangent zone
|
||||
Standard_Real UMinCh,UMaxCh; //-- ligne de cheminement 0..(Nbptlin-1)
|
||||
Standard_Real UMinAr,UMaxAr; //-- polyline of arc 0..(NbEchant-1)
|
||||
Commun.ZoneValue(i-Commun_NbSectionPoints).ParamOnFirst(UMinCh,UMaxCh);
|
||||
Commun.ZoneValue(i-Commun_NbSectionPoints).ParamOnSecond(UMinAr,UMaxAr);
|
||||
gp_Pnt2d p1Ar = GetPointOnPolygo(Brise,UMinAr);
|
||||
gp_Pnt2d p2Ar = GetPointOnPolygo(Brise,UMaxAr);
|
||||
Standard_Real tolU = URes*2.;
|
||||
Standard_Real tolV = VRes*2.;
|
||||
if (isVFirst && ArePnt2dEqual(p1Ar,p2dFirst,tolUFirst,tolVFirst)) {
|
||||
tolU = Max(tolUFirst,tolU); tolV = Max(tolVFirst,tolV);
|
||||
}
|
||||
if (isVLast && ArePnt2dEqual(p2Ar,p2dLast,tolULast,tolVLast)) {
|
||||
tolU = Max(tolULast,tolU); tolV = Max(tolVLast,tolV);
|
||||
}
|
||||
Standard_Real nptCh = UMaxCh-UMinCh;
|
||||
Standard_Boolean isNptLow = (nptCh < 10. && nptCh < Nbptlin/100.) ||
|
||||
(!Domain->Has3d() && Standard_Integer(nptCh)+1 < Nbptlin);
|
||||
if (!isNptLow && !IsSegment2dSmall(Brise,UMinAr,UMaxAr,tolU,tolV)) {
|
||||
// treat both ends
|
||||
Standard_Real UMinChP,UMinArP,UMaxArP;
|
||||
UMinChP = IntegerPart(UMinCh);
|
||||
UMinArP = IntegerPart(UMinAr);
|
||||
UMaxArP = IntegerPart(UMaxAr);
|
||||
Standard_Integer irangAr1,irangAr2;
|
||||
irangAr1 = Standard_Integer(UMinArP)+1;
|
||||
irangAr2 = Standard_Integer(UMaxArP)+1;
|
||||
UMinChP = UMinCh - UMinChP;
|
||||
UMinArP = UMinAr - UMinArP;
|
||||
//UMaxChP = UMaxCh - UMaxChP; UMaxArP = UMaxAr - UMaxArP;
|
||||
const Standard_Real eps = 1e-10;
|
||||
// Standard_Boolean isChExtr1 = irangCh1==1 && UMinChP<eps;
|
||||
// Standard_Boolean isChExtr2 = irangCh2==Nbptlin;
|
||||
Standard_Boolean isArExtr1 = irangAr1==1 && UMinArP<eps;
|
||||
Standard_Boolean isArExtr2 = irangAr2==NbEchant;
|
||||
// detect orientation
|
||||
gp_Pnt2d p1Ch = GetPointOnPolygo(PLin,UMinCh);
|
||||
Standard_Real d11 = p1Ch.SquareDistance(p1Ar);
|
||||
Standard_Real d12 = p1Ch.SquareDistance(p2Ar);
|
||||
Standard_Boolean sameOri = d11 < d12;
|
||||
if (!sameOri) {
|
||||
Standard_Boolean itmp=isArExtr1; isArExtr1=isArExtr2; isArExtr2=itmp;
|
||||
Standard_Real dtmp=UMinAr; UMinAr=UMaxAr; UMaxAr=dtmp;
|
||||
}
|
||||
W1[0] = UMinCh; W1[1] = UMaxCh;
|
||||
W2[0] = UMinAr; W2[1] = UMaxAr;
|
||||
//refine[0] = ! (isChExtr1 || isArExtr1);
|
||||
//refine[1] = ! (isChExtr2 || isArExtr2);
|
||||
refine[0] = refine[1] = Standard_False;
|
||||
useWL[0] = !isArExtr1;
|
||||
useWL[1] = !isArExtr2;
|
||||
nbpt = 2;
|
||||
}
|
||||
else {
|
||||
// treat the middle point as an intersection point
|
||||
W1[0] = 0.5*(UMinCh+UMaxCh);
|
||||
W2[0] = 0.5*(UMinAr+UMaxAr);
|
||||
refine[0] = Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
// We do not need in putting vertex into tangent zone(s).
|
||||
// Therefore, only section points are interested by us.
|
||||
// Boundary of WLine (its first/last points) will be
|
||||
// marked by some vertex later. See bug #29494.
|
||||
const Standard_Integer aNbSectionPts = Commun.NbSectionPoints();
|
||||
for (i = 1; i <= aNbSectionPts; i++)
|
||||
{
|
||||
const Standard_Real aW1 = Commun.PntValue(i).ParamOnFirst(),
|
||||
aW2 = Commun.PntValue(i).ParamOnSecond();
|
||||
|
||||
Standard_Integer nbTreated = 0;
|
||||
for (Standard_Integer ip=0; ip < nbpt; ip++) {
|
||||
GetLinePoint2d (L, W1[ip]+1, !OnFirst, U,V);
|
||||
GetLinePoint2d (L, aW1+1, !OnFirst, U,V);
|
||||
|
||||
if (!refine[ip] && useWL[ip]) {
|
||||
Standard_Real aU1,aV1;
|
||||
GetLinePoint2d (L, W1[ip]+1, OnFirst, aU1,aV1);
|
||||
p2d.SetCoord(aU1,aV1);
|
||||
Standard_Real paramProj;
|
||||
if (!IntPatch_HInterTool::Project(arc,p2d,paramProj,p2d)) continue;
|
||||
W = paramProj;
|
||||
}
|
||||
else {
|
||||
Standard_Real par = IntegerPart(W2[ip]);
|
||||
Standard_Real par = IntegerPart(aW2);
|
||||
Standard_Integer Irang = Standard_Integer(par) + 1;
|
||||
if (Irang == Brise.NbPoints()) {
|
||||
if (Irang == Brise.NbPoints())
|
||||
{
|
||||
Irang--;
|
||||
par = 1.;
|
||||
}
|
||||
else {
|
||||
par =Abs(W2[ip]-par);
|
||||
}
|
||||
W = (1.-par)*Brise.Parameter(Irang) + par*Brise.Parameter(Irang+1);
|
||||
else
|
||||
{
|
||||
par = Abs(aW2 - par);
|
||||
}
|
||||
|
||||
Standard_Boolean refined = Standard_False;
|
||||
if (refine[ip])
|
||||
{
|
||||
W = (1. - par)*Brise.Parameter(Irang) + par*Brise.Parameter(Irang + 1);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
//-- On a trouve un point 2d approche Ua,Va intersection de la ligne
|
||||
//-- de cheminement et de la restriction.
|
||||
@ -809,19 +640,17 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
//--
|
||||
IntPatch_CSFunction thefunc(OtherSurf,arc,Surf);
|
||||
// MSV: extend UV bounds to not miss solution near the boundary
|
||||
Standard_Real margCoef = 0.004;
|
||||
const Standard_Real margCoef = 0.004;
|
||||
Standard_Boolean refined = Standard_False;
|
||||
IntPatch_CurvIntSurf IntCS(U,V,W,thefunc,edgeTol,margCoef);
|
||||
if (IntCS.IsDone())
|
||||
{
|
||||
if (!IntCS.IsEmpty())
|
||||
if (IntCS.IsDone() && !IntCS.IsEmpty())
|
||||
{
|
||||
ptsommet = IntCS.Point();
|
||||
IntCS.ParameterOnSurface(U2,V2);
|
||||
gp_Pnt anOldPnt, aNewPnt;
|
||||
OtherSurf->D0(U,V, anOldPnt);
|
||||
OtherSurf->D0(U2,V2, aNewPnt);
|
||||
if (anOldPnt.SquareDistance(aNewPnt) < Precision::Confusion()
|
||||
* Precision::Confusion())
|
||||
if (anOldPnt.SquareDistance(aNewPnt) < Precision::SquareConfusion())
|
||||
{
|
||||
U2 = U;
|
||||
V2 = V;
|
||||
@ -829,16 +658,8 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
paramarc = IntCS.ParameterOnCurve();
|
||||
refined = Standard_True;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
U2 = U; V2 = V;
|
||||
paramarc = W;
|
||||
arc->D0(paramarc,p2d);
|
||||
Surf->D0(p2d.X(),p2d.Y(),ptsommet);
|
||||
}
|
||||
|
||||
if (!refine[ip] || refined) {
|
||||
if (refined) {
|
||||
duplicate = Standard_False;
|
||||
for (j=1; j<=locpt.Length();j++) {
|
||||
if (ptsommet.Distance(locpt(j)) <= edgeTol) {
|
||||
@ -854,7 +675,7 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
}
|
||||
|
||||
if (!duplicate) {
|
||||
Standard_Integer ParamApproxOnLine = Standard_Integer(W1[ip])+1;
|
||||
Standard_Integer ParamApproxOnLine = Standard_Integer(aW1)+1;
|
||||
|
||||
arc->D1(paramarc,p2d,d2d);
|
||||
U1 = p2d.X(); V1 = p2d.Y();
|
||||
@ -974,14 +795,6 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
else
|
||||
IntSurf::MakeTransition(tgline,tgrst,normsurf,transline,transarc);
|
||||
|
||||
if (typL == IntPatch_Walking && !refine[ip]) {
|
||||
// for new vertex use coordinates from Line
|
||||
if (OnFirst)
|
||||
GetWLinePoint (wlin, paramline, U1,V1,U2,V2,ptsommet);
|
||||
else
|
||||
GetWLinePoint (wlin, paramline, U2,V2,U1,V1,ptsommet);
|
||||
}
|
||||
|
||||
nbTreated++;
|
||||
if (!ivtx) {
|
||||
Sommet.SetValue(ptsommet,vtxTol,Standard_False); // pour tangence
|
||||
@ -1167,7 +980,6 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nbTreated == 2 && typL == IntPatch_Walking) {
|
||||
// We processed a tangent zone, and both ends have been treated.
|
||||
// So mark WLine as having arc
|
||||
|
@ -6,6 +6,10 @@ puts ""
|
||||
## Wrong section curves
|
||||
###############################
|
||||
|
||||
puts "TODO OCC29501 ALL: Error in ii12_22"
|
||||
|
||||
set MaxToler 1.5e-4
|
||||
|
||||
restore [locate_data_file bug24472_Pipe_1.brep] b1
|
||||
|
||||
explode b1 f
|
||||
@ -19,43 +23,51 @@ mksurface s3 f3
|
||||
puts ""
|
||||
puts "First test"
|
||||
# 1.1 geometry
|
||||
intersect i s1 s2
|
||||
intersect ii12 s1 s2
|
||||
|
||||
#donly i_22; fit
|
||||
foreach c [directory ii12*] {
|
||||
bounds $c U1 U2
|
||||
|
||||
xdistcs i_22 s1 0 1 10 1e-7
|
||||
if {[dval U2-U1] < 1.0e-9} {
|
||||
puts "Error: Wrong curve's range!"
|
||||
}
|
||||
|
||||
xdistcs $c s1 U1 U2 10 $MaxToler
|
||||
xdistcs $c s2 U1 U2 10 $MaxToler
|
||||
}
|
||||
|
||||
puts ""
|
||||
puts "Second test"
|
||||
# 1.2 topology
|
||||
bsection r f1 f2
|
||||
bopcheck r
|
||||
# r is self interfered
|
||||
explode r e
|
||||
mkcurve c r_1
|
||||
bsection r12 f1 f2
|
||||
bopcheck r12
|
||||
# OK
|
||||
|
||||
#donly r_1; fit
|
||||
|
||||
xdistcs c s1 0.0714822451660209 1 10 1e-12 1e-7
|
||||
regexp {Tolerance MAX=([-0-9.+eE]+)} [tolerance r12] full toler
|
||||
if { $toler > $MaxToler } { puts "Error: Tolerance of the section r12 is too large" }
|
||||
|
||||
puts ""
|
||||
puts "Third test"
|
||||
# 2.1 geometry
|
||||
intersect i s1 s3
|
||||
intersect ii13 s1 s3
|
||||
|
||||
#donly i_4; fit
|
||||
foreach c [directory ii13*] {
|
||||
bounds $c U1 U2
|
||||
|
||||
xdistcs i_4 s1 0 1 10 1e-6 1e-7
|
||||
if {[dval U2-U1] < 1.0e-9} {
|
||||
puts "Error: Wrong curve's range!"
|
||||
}
|
||||
|
||||
xdistcs $c s1 U1 U2 10 $MaxToler
|
||||
xdistcs $c s2 U1 U2 10 $MaxToler
|
||||
}
|
||||
|
||||
puts ""
|
||||
puts "Fourth test"
|
||||
# 2.2 topology
|
||||
bsection r f1 f3
|
||||
bopcheck r
|
||||
#r is self interfered
|
||||
explode r
|
||||
mkcurve c r_1
|
||||
bsection r13 f1 f3
|
||||
bopcheck r13
|
||||
# OK
|
||||
|
||||
#donly r_1; fit
|
||||
|
||||
xdistcs c s1 0.0714822451660209 1 10 1e-12 1e-7
|
||||
regexp {Tolerance MAX=([-0-9.+eE]+)} [tolerance r13] full toler
|
||||
if { $toler > $MaxToler } { puts "Error: Tolerance of the section r13 is too large" }
|
||||
|
@ -6,15 +6,19 @@ puts ""
|
||||
## Intersection algorithm produces curves overlaped
|
||||
###############################
|
||||
|
||||
set ExpToler 1.5361108163989659e-007
|
||||
set ExpLen 5.036361740755879
|
||||
|
||||
restore [locate_data_file bug25890_f1.brep] f1
|
||||
restore [locate_data_file bug25890_f2.brep] f2
|
||||
|
||||
set log [bopcurves f1 f2]
|
||||
set log [ bopcurves f1 f2 -2d ]
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
|
||||
|
||||
if { ${NbCurv} != 5 } {
|
||||
checkreal TolReached $Toler $ExpToler 0.0 0.1
|
||||
|
||||
if { ${NbCurv} != 1 } {
|
||||
puts "Error : NbCurv is bad"
|
||||
}
|
||||
|
||||
set nbshapes_expected "
|
||||
Number of shapes in shape
|
||||
@ -29,7 +33,12 @@ Number of shapes in shape
|
||||
SHAPE : 1
|
||||
"
|
||||
|
||||
set SumLen 0.0
|
||||
|
||||
# Check for overlapping
|
||||
for {set i 1} {$i <= $NbCurv} {incr i} {
|
||||
regexp "The +length+ c_$i +is +(\[-0-9.+eE\]+)" [ length c_$i ] full m
|
||||
set SumLen [ expr $SumLen + $m]
|
||||
for {set j [expr $i+1]} {$j <= $NbCurv} {incr j} {
|
||||
puts " Check c_$i and c_$j"
|
||||
mkedge e1 c_$i
|
||||
@ -38,3 +47,9 @@ for {set i 1} {$i <= $NbCurv} {incr i} {
|
||||
checknbshapes rr -ref "${nbshapes_expected}" -t -m "Partition of 2 shapes"
|
||||
}
|
||||
}
|
||||
|
||||
checkreal Length $SumLen $ExpLen 1.0e-7 0.0
|
||||
} else {
|
||||
checklength c_1 -l $ExpLen
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
puts "TODO OCC24418 ALL: Error : T="
|
||||
puts "TODO OCC24418 ALL: Error in ii_2: T="
|
||||
|
||||
puts "========"
|
||||
puts "OCC24418"
|
||||
|
@ -1,4 +1,4 @@
|
||||
puts "TODO OCC24418 ALL: Error : T="
|
||||
puts "TODO OCC24418 ALL: Error in ii_1: T="
|
||||
|
||||
puts "========"
|
||||
puts "OCC24418"
|
||||
|
@ -1,4 +1,4 @@
|
||||
puts "TODO OCC28544 ALL: Error : T="
|
||||
puts "TODO OCC28544 ALL: Error in ii: T="
|
||||
|
||||
puts "========"
|
||||
puts "OCC28544"
|
||||
|
@ -10,7 +10,17 @@ restore [locate_data_file bug29488_shapes.brep] s
|
||||
eval mkvolume result [lrange [explode s] 1 end]
|
||||
|
||||
checkshape result
|
||||
checknbshapes result -wire 77 -face 77 -shell 1 -solid 1
|
||||
checknbshapes result -wire 74 -face 74 -shell 1 -solid 1
|
||||
checkprops result -s 3073.39 -v 10240.8
|
||||
|
||||
set MinArea 0.001
|
||||
foreach f [explode result f] {
|
||||
regexp {Mass +: +([-0-9.+eE]+)} [sprops $f 1.0e-4] full anArea
|
||||
if { $anArea == 0.0 } {
|
||||
puts "Error in area computation: it is equal to 0"
|
||||
} elseif {$anArea < $MinArea} {
|
||||
puts "Error: Too small face has been created (S < $MinArea)"
|
||||
}
|
||||
}
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
@ -6,9 +6,6 @@ puts ""
|
||||
# Regression: boolean operation " general fuse" creates solid containing 5 not connected shells lying on the one level
|
||||
#################################################
|
||||
|
||||
puts "TODO OCC29494 ALL: Error : is WRONG because number of WIRE entities"
|
||||
puts "TODO OCC29494 ALL: Error : is WRONG because number of FACE entities"
|
||||
|
||||
restore [locate_data_file bug29488_shapes.brep] s
|
||||
|
||||
bclearobjects
|
||||
@ -18,5 +15,17 @@ bfillds
|
||||
bbuild result
|
||||
|
||||
checkshape result
|
||||
checknbshapes result -wire 401 -face 377 -shell 10 -solid 2
|
||||
checkprops result -s 77135.9 -v 246693
|
||||
checknbshapes result -wire 390 -face 366 -shell 10 -solid 2
|
||||
checkprops result -s 77135.9 -v 245074
|
||||
|
||||
set MinArea 0.001
|
||||
foreach f [explode result f] {
|
||||
regexp {Mass +: +([-0-9.+eE]+)} [sprops $f 1.0e-4] full anArea
|
||||
if { $anArea == 0.0 } {
|
||||
puts "Error in area computation: it is equal to 0"
|
||||
} elseif {$anArea < $MinArea} {
|
||||
puts "Error: Too small face has been created (S < $MinArea)"
|
||||
}
|
||||
}
|
||||
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
35
tests/bugs/modalg_7/bug29494
Normal file
35
tests/bugs/modalg_7/bug29494
Normal file
@ -0,0 +1,35 @@
|
||||
puts "========"
|
||||
puts "OCC29494"
|
||||
puts "========"
|
||||
puts ""
|
||||
#################################################
|
||||
# Intersection line between two parametric surfaces is restricted incorrectly if it matches
|
||||
# the surface boundary
|
||||
#################################################
|
||||
|
||||
restore [locate_data_file bug29488_shapes.brep] s
|
||||
explode s
|
||||
|
||||
explode s_4 f; copy s_4_13 f1
|
||||
explode s_6 f; copy s_6_18 f2
|
||||
|
||||
smallview
|
||||
clear
|
||||
bopcurves f1 f2 -2d
|
||||
|
||||
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves f1 f2 -2d] full Toler NbCurv
|
||||
|
||||
if {$Toler > 1.0e-7} {
|
||||
puts "Error: Big tolerance is returned by intersector"
|
||||
}
|
||||
|
||||
if {$NbCurv != 1} {
|
||||
puts "Error: Please check NbCurves for intersector"
|
||||
} else {
|
||||
checklength c_1 -l 19.2
|
||||
}
|
||||
|
||||
fit
|
||||
disp f1 f2
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
Loading…
x
Reference in New Issue
Block a user