mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0032850: Modeling Algorithms - Surface Surface Intersect Lost one line
IntStart_SearchOnBoundaries.gxx - improving tangent criteria
This commit is contained in:
parent
f55fe3b3f7
commit
492b09dcae
@ -714,7 +714,8 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
|||||||
}
|
}
|
||||||
|
|
||||||
IntPatch_Point aVtx = theALine->Vertex(aVertexNumber);
|
IntPatch_Point aVtx = theALine->Vertex(aVertexNumber);
|
||||||
const Standard_Real aNewVertexParam = aLinOn2S->NbPoints() + 1;
|
Standard_Real aNewVertexParam = aLinOn2S->NbPoints() + 1;
|
||||||
|
Standard_Integer aNbPointsPrev = aLinOn2S->NbPoints();
|
||||||
|
|
||||||
//ATTENTION!!!
|
//ATTENTION!!!
|
||||||
// IsPoleOrSeam inserts new point in aLinOn2S if aVtx respects
|
// IsPoleOrSeam inserts new point in aLinOn2S if aVtx respects
|
||||||
@ -748,6 +749,7 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
|||||||
|
|
||||||
aPrePointExist = IsPoleOrSeam(myS1, myS2, aPrefIso, aLinOn2S, aVtx,
|
aPrePointExist = IsPoleOrSeam(myS1, myS2, aPrefIso, aLinOn2S, aVtx,
|
||||||
anArrPeriods, aTol, aSingularSurfaceID);
|
anArrPeriods, aTol, aSingularSurfaceID);
|
||||||
|
|
||||||
if (aPrePointExist == IntPatch_SPntPole ||
|
if (aPrePointExist == IntPatch_SPntPole ||
|
||||||
aPrePointExist == IntPatch_SPntPoleSeamU)
|
aPrePointExist == IntPatch_SPntPoleSeamU)
|
||||||
{
|
{
|
||||||
@ -761,6 +763,11 @@ void IntPatch_ALineToWLine::MakeWLine(const Handle(IntPatch_ALine)& theALine,
|
|||||||
const Standard_Real aCurVertParam = aVtx.ParameterOnLine();
|
const Standard_Real aCurVertParam = aVtx.ParameterOnLine();
|
||||||
if(aPrePointExist != IntPatch_SPntNone)
|
if(aPrePointExist != IntPatch_SPntNone)
|
||||||
{
|
{
|
||||||
|
if (aNbPointsPrev == aLinOn2S->NbPoints())
|
||||||
|
{
|
||||||
|
//Vertex coinsides any point of line and was not added into line
|
||||||
|
aNewVertexParam = aNbPointsPrev;
|
||||||
|
}
|
||||||
aPrevParam = aParameter = aCurVertParam;
|
aPrevParam = aParameter = aCurVertParam;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -354,6 +354,7 @@ void BoundedArc (const TheArc& A,
|
|||||||
{
|
{
|
||||||
const IntSurf_Quadric& aQuadric = Func.Quadric();
|
const IntSurf_Quadric& aQuadric = Func.Quadric();
|
||||||
GeomAbs_SurfaceType TypeQuad = aQuadric.TypeQuadric();
|
GeomAbs_SurfaceType TypeQuad = aQuadric.TypeQuadric();
|
||||||
|
GeomAbs_CurveType TypeConS = GeomAbs_OtherCurve;
|
||||||
|
|
||||||
IntCurveSurface_HInter IntCS;
|
IntCurveSurface_HInter IntCS;
|
||||||
Standard_Boolean IsIntCSdone = Standard_False;
|
Standard_Boolean IsIntCSdone = Standard_False;
|
||||||
@ -387,7 +388,7 @@ void BoundedArc (const TheArc& A,
|
|||||||
//Exact solution
|
//Exact solution
|
||||||
Handle(Adaptor3d_Surface) aSurf = Func.Surface();
|
Handle(Adaptor3d_Surface) aSurf = Func.Surface();
|
||||||
Adaptor3d_CurveOnSurface ConS(A, aSurf);
|
Adaptor3d_CurveOnSurface ConS(A, aSurf);
|
||||||
GeomAbs_CurveType TypeConS = ConS.GetType();
|
TypeConS = ConS.GetType();
|
||||||
#ifdef OCCT_DEBUG
|
#ifdef OCCT_DEBUG
|
||||||
Handle(Geom_Curve) CurveConS;
|
Handle(Geom_Curve) CurveConS;
|
||||||
switch(TypeConS)
|
switch(TypeConS)
|
||||||
@ -608,13 +609,27 @@ void BoundedArc (const TheArc& A,
|
|||||||
para = aSI(i).Value();
|
para = aSI(i).Value();
|
||||||
|
|
||||||
Standard_Real param=(para+parap1)*0.5;
|
Standard_Real param=(para+parap1)*0.5;
|
||||||
Standard_Real ym;
|
Standard_Real yf = 0.0;
|
||||||
if(Func.Value(param,ym)) {
|
Standard_Real ym = 0.0;
|
||||||
if(Abs(ym)<maxdist) {
|
Standard_Real yl = 0.0;
|
||||||
|
if(Func.Value(param,ym) && Abs(ym) < maxdist) {
|
||||||
|
Standard_Real sm = Sign(1., ym);
|
||||||
|
Standard_Boolean aTang = Func.Value(para,yf) && Func.Value(parap1,yl);
|
||||||
|
if (aTang) {
|
||||||
|
//Line can be tangent surface if all distances less then maxdist
|
||||||
|
aTang = aTang && Abs(yf) < maxdist && Abs(yl) < maxdist;
|
||||||
|
}
|
||||||
|
if (aTang && IsIntCSdone && TypeConS == GeomAbs_Line) {
|
||||||
|
//Interval is got by exact intersection
|
||||||
|
//Line can be tangent if all points are on the same side of surface
|
||||||
|
//it means that signs of all distances are the same
|
||||||
|
Standard_Real sf = Sign(1., yf), sl = Sign(1., yl);
|
||||||
|
aTang = aTang && (sm == sf) && (sm == sl);
|
||||||
|
}
|
||||||
|
if(aTang) {
|
||||||
// Modified by skv - Tue Aug 31 12:13:51 2004 OCC569 Begin
|
// Modified by skv - Tue Aug 31 12:13:51 2004 OCC569 Begin
|
||||||
// Consider this interval as tangent one. Treat it to find
|
// Consider this interval as tangent one. Treat it to find
|
||||||
// parameter with the lowest function value.
|
// parameter with the lowest function value.
|
||||||
|
|
||||||
// Compute the number of nodes.
|
// Compute the number of nodes.
|
||||||
Standard_Real aTol = TolBoundary*1000.0;
|
Standard_Real aTol = TolBoundary*1000.0;
|
||||||
if(aTol > 0.001)
|
if(aTol > 0.001)
|
||||||
@ -627,6 +642,7 @@ void BoundedArc (const TheArc& A,
|
|||||||
Standard_Integer aNbNodes = RealToInt(Ceiling((parap1 - para)/aTol));
|
Standard_Integer aNbNodes = RealToInt(Ceiling((parap1 - para)/aTol));
|
||||||
|
|
||||||
Standard_Real aVal = RealLast();
|
Standard_Real aVal = RealLast();
|
||||||
|
Standard_Real aValMax = 0.;
|
||||||
//Standard_Integer aNbNodes = 23;
|
//Standard_Integer aNbNodes = 23;
|
||||||
Standard_Real aDelta = (parap1 - para)/(aNbNodes + 1.);
|
Standard_Real aDelta = (parap1 - para)/(aNbNodes + 1.);
|
||||||
Standard_Integer ii;
|
Standard_Integer ii;
|
||||||
@ -637,17 +653,29 @@ void BoundedArc (const TheArc& A,
|
|||||||
aCurPar = (ii < aNbNodes + 1) ? para + ii*aDelta : parap1;
|
aCurPar = (ii < aNbNodes + 1) ? para + ii*aDelta : parap1;
|
||||||
|
|
||||||
if (Func.Value(aCurPar, aCurVal)) {
|
if (Func.Value(aCurPar, aCurVal)) {
|
||||||
//if (aCurVal < aVal) {
|
Standard_Real anAbsVal = Abs(aCurVal);
|
||||||
if (Abs(aCurVal) < aVal) {
|
if (anAbsVal < aVal) {
|
||||||
//aVal = aCurVal;
|
aVal = anAbsVal;
|
||||||
aVal = Abs(aCurVal);
|
|
||||||
param = aCurPar;
|
param = aCurPar;
|
||||||
}
|
}
|
||||||
|
if (anAbsVal > aValMax)
|
||||||
|
{
|
||||||
|
aValMax = anAbsVal;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Modified by skv - Tue Aug 31 12:13:51 2004 OCC569 End
|
// At last, interval got by exact intersection can be considered as tangent if
|
||||||
aSI(i).ChangeValue() = Pdeb - 1;
|
// minimal distance is inside interval and
|
||||||
aSI(i + 1).ChangeValue() = param;
|
// minimal and maximal values are almost the same
|
||||||
|
if (IsIntCSdone && aNbNodes > 1) {
|
||||||
|
aTang = Abs(param - para) > EpsX && Abs(parap1 - param) > EpsX &&
|
||||||
|
0.01*aValMax <= aVal;
|
||||||
|
}
|
||||||
|
if (aTang)
|
||||||
|
{
|
||||||
|
aSI(i).ChangeValue() = Pdeb - 1;
|
||||||
|
aSI(i + 1).ChangeValue() = param;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ puts "=========="
|
|||||||
puts "OCC29523"
|
puts "OCC29523"
|
||||||
puts "=========="
|
puts "=========="
|
||||||
|
|
||||||
cpulimit 60
|
cpulimit 120
|
||||||
|
|
||||||
restore [locate_data_file bug29523_cut_extrudewire09.brep] sw
|
restore [locate_data_file bug29523_cut_extrudewire09.brep] sw
|
||||||
restore [locate_data_file bug29523_cut_toolwire09.brep] tw
|
restore [locate_data_file bug29523_cut_toolwire09.brep] tw
|
||||||
|
19
tests/lowalgos/intss/bug32850
Normal file
19
tests/lowalgos/intss/bug32850
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "0032850: Modeling Algorithms - Surface Surface Intersect Lost one line"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
cylinder s1 25.8071575178163 0 -373.974517822281 0 1 0 -1.73024882663956e-06 0 0.999999999998503 408.974517822893
|
||||||
|
trim s1 s1 0 0.0225015452057227 -146.010003766057 2146.01000376606
|
||||||
|
cylinder s2 0 1974.19284248218 -373.974517822281 1 0 0 -0 1.73024882663956e-06 0.999999999998503 408.974517822893
|
||||||
|
trim s2 s2 0 0.0225015452057227 -146.010003766057 946.010003766057
|
||||||
|
mkface f1 s1;
|
||||||
|
mkface f2 s2;
|
||||||
|
set log [bopcurves f1 f2]
|
||||||
|
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} $log full Toler NbCurv
|
||||||
|
if {$NbCurv != 4} {
|
||||||
|
puts "Error: Number of curves is wrong"
|
||||||
|
}
|
||||||
|
if { $Toler > 1.0e-12} {
|
||||||
|
puts "Error: Big tolerance value"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user