mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Compare commits
2 Commits
V7_8_1
...
CR0_master
Author | SHA1 | Date | |
---|---|---|---|
|
0d99c9a67d | ||
|
c8ccbfd045 |
@@ -480,7 +480,77 @@ void Recadre(const Standard_Boolean ,
|
||||
}
|
||||
pt.SetParameters(U1,V1,U2,V2);
|
||||
}
|
||||
static Standard_Real GetLocalStep(const Handle(Adaptor3d_Surface)& theSurf,
|
||||
const Standard_Real theStep)
|
||||
{
|
||||
Standard_Real aLocalStep = theStep;
|
||||
if (theSurf->UContinuity() > GeomAbs_C0 && theSurf->VContinuity() > GeomAbs_C0)
|
||||
{
|
||||
GeomAbs_SurfaceType aSType = theSurf->GetType();
|
||||
|
||||
if (aSType == GeomAbs_BezierSurface || aSType == GeomAbs_BSplineSurface)
|
||||
{
|
||||
Standard_Real aMinRes = Precision::Infinite();
|
||||
Standard_Integer aMaxDeg = 0;
|
||||
const Standard_Real aLimRes = 1.e-10;
|
||||
|
||||
aMinRes = Min(theSurf->UResolution(Precision::Confusion()),
|
||||
theSurf->VResolution(Precision::Confusion()));
|
||||
aMaxDeg = Max(theSurf->UDegree(), theSurf->VDegree());
|
||||
if (aMinRes < aLimRes && aMaxDeg > 3)
|
||||
{
|
||||
aLocalStep = 0.0001;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (theSurf->UContinuity() == GeomAbs_C0)
|
||||
{
|
||||
Standard_Integer aNbInt = theSurf->NbUIntervals(GeomAbs_C1);
|
||||
if (aNbInt > 1)
|
||||
{
|
||||
TColStd_Array1OfReal anInts(1, aNbInt + 1);
|
||||
theSurf->UIntervals(anInts, GeomAbs_C1);
|
||||
Standard_Integer i;
|
||||
Standard_Real aMinInt = Precision::Infinite();
|
||||
for (i = 1; i <= aNbInt; ++i)
|
||||
{
|
||||
aMinInt = Min(aMinInt, anInts(i + 1) - anInts(i));
|
||||
}
|
||||
|
||||
aMinInt /= theSurf->LastUParameter() - theSurf->FirstUParameter();
|
||||
if (aMinInt < 0.002)
|
||||
{
|
||||
aLocalStep = 0.0001;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (theSurf->VContinuity() == GeomAbs_C0)
|
||||
{
|
||||
Standard_Integer aNbInt = theSurf->NbVIntervals(GeomAbs_C1);
|
||||
if (aNbInt > 1)
|
||||
{
|
||||
TColStd_Array1OfReal anInts(1, aNbInt + 1);
|
||||
theSurf->VIntervals(anInts, GeomAbs_C1);
|
||||
Standard_Integer i;
|
||||
Standard_Real aMinInt = Precision::Infinite();
|
||||
for (i = 1; i <= aNbInt; ++i)
|
||||
{
|
||||
aMinInt = Min(aMinInt, anInts(i + 1) - anInts(i));
|
||||
}
|
||||
|
||||
aMinInt /= theSurf->LastVParameter() - theSurf->FirstVParameter();
|
||||
if (aMinInt < 0.002)
|
||||
{
|
||||
aLocalStep = 0.0001;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
aLocalStep = Min(theStep, aLocalStep);
|
||||
return aLocalStep;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
@@ -587,35 +657,39 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_Surface)& Surf
|
||||
}
|
||||
//
|
||||
Standard_Real aLocalPas = Pas;
|
||||
GeomAbs_SurfaceType aSType = reversed ? Surf1->GetType() : Surf2->GetType();
|
||||
//GeomAbs_SurfaceType aSType = reversed ? Surf1->GetType() : Surf2->GetType();
|
||||
if (reversed)
|
||||
aLocalPas = GetLocalStep(Surf1, Pas);
|
||||
else
|
||||
aLocalPas = GetLocalStep(Surf2, Pas);
|
||||
|
||||
if (aSType == GeomAbs_BezierSurface || aSType == GeomAbs_BSplineSurface)
|
||||
{
|
||||
Standard_Real aMinRes = Precision::Infinite();
|
||||
GeomAbs_Shape aCont = GeomAbs_C0;
|
||||
Standard_Integer aMaxDeg = 0;
|
||||
const Standard_Real aLimRes = 1.e-10;
|
||||
//if (aSType == GeomAbs_BezierSurface || aSType == GeomAbs_BSplineSurface)
|
||||
//{
|
||||
// Standard_Real aMinRes = Precision::Infinite();
|
||||
// GeomAbs_Shape aCont = GeomAbs_C0;
|
||||
// Standard_Integer aMaxDeg = 0;
|
||||
// const Standard_Real aLimRes = 1.e-10;
|
||||
|
||||
if (reversed)
|
||||
{
|
||||
aMinRes = Min(Surf1->UResolution(Precision::Confusion()),
|
||||
Surf1->VResolution(Precision::Confusion()));
|
||||
aCont = (GeomAbs_Shape)Min(Surf1->UContinuity(), Surf1->VContinuity());
|
||||
aMaxDeg = Max(Surf1->UDegree(), Surf1->VDegree());
|
||||
}
|
||||
else
|
||||
{
|
||||
aMinRes = Min(Surf2->UResolution(Precision::Confusion()),
|
||||
Surf2->VResolution(Precision::Confusion()));
|
||||
aCont = (GeomAbs_Shape)Min(Surf2->UContinuity(), Surf2->VContinuity());
|
||||
aMaxDeg = Max(Surf2->UDegree(), Surf2->VDegree());
|
||||
}
|
||||
// if (reversed)
|
||||
// {
|
||||
// aMinRes = Min(Surf1->UResolution(Precision::Confusion()),
|
||||
// Surf1->VResolution(Precision::Confusion()));
|
||||
// aCont = (GeomAbs_Shape)Min(Surf1->UContinuity(), Surf1->VContinuity());
|
||||
// aMaxDeg = Max(Surf1->UDegree(), Surf1->VDegree());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// aMinRes = Min(Surf2->UResolution(Precision::Confusion()),
|
||||
// Surf2->VResolution(Precision::Confusion()));
|
||||
// aCont = (GeomAbs_Shape)Min(Surf2->UContinuity(), Surf2->VContinuity());
|
||||
// aMaxDeg = Max(Surf2->UDegree(), Surf2->VDegree());
|
||||
// }
|
||||
|
||||
if (aMinRes < aLimRes && aCont > GeomAbs_C0 && aMaxDeg > 3)
|
||||
{
|
||||
aLocalPas = Min(Pas, 0.0001);
|
||||
}
|
||||
}
|
||||
// if (aMinRes < aLimRes && aCont > GeomAbs_C0 && aMaxDeg > 3)
|
||||
// {
|
||||
// aLocalPas = Min(Pas, 0.0001);
|
||||
// }
|
||||
//}
|
||||
|
||||
Func.SetImplicitSurface(Quad);
|
||||
Func.Set(IntSurf_QuadricTool::Tolerance(Quad));
|
||||
|
@@ -385,11 +385,34 @@ static Standard_Boolean IsInsideIn3d(const gp_Pnt& aBasePnt,
|
||||
static const Standard_Integer aMinNbBadDistr = 15;
|
||||
static const Standard_Integer aNbSingleBezier = 30;
|
||||
|
||||
//=========================================================================
|
||||
// function : IsSurfPlaneLike
|
||||
// purpose : Define is surface plane like or not.
|
||||
// Static subfunction in DeleteByTube.
|
||||
//=========================================================================
|
||||
static Standard_Boolean IsSurfPlaneLike(const Handle(Adaptor3d_Surface) &theS)
|
||||
{
|
||||
if (theS->GetType() == GeomAbs_Plane)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
if (theS->GetType() == GeomAbs_BSplineSurface)
|
||||
{
|
||||
if (theS->UDegree() == 1 && theS->VDegree() == 1)
|
||||
{
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
|
||||
return Standard_False;
|
||||
}
|
||||
//=========================================================================
|
||||
// function : DeleteByTube
|
||||
// purpose : Check and delete points using tube criteria.
|
||||
// Static subfunction in ComputePurgedWLine.
|
||||
//=========================================================================
|
||||
|
||||
static Handle(IntPatch_WLine)
|
||||
DeleteByTube(const Handle(IntPatch_WLine) &theWLine,
|
||||
const Handle(Adaptor3d_Surface) &theS1,
|
||||
@@ -419,6 +442,7 @@ static Handle(IntPatch_WLine)
|
||||
gp_Vec2d aBase2dVec2(UonS2[1] - UonS2[0], VonS2[1] - VonS2[0]);
|
||||
gp_Pnt aBase3dPnt = theWLine->Point(1).Value();
|
||||
gp_Vec aBase3dVec(theWLine->Point(1).Value(), theWLine->Point(2).Value());
|
||||
Standard_Real aPrevStep = aBase3dVec.SquareMagnitude();
|
||||
|
||||
// Choose base tolerance and scale it to pipe algorithm.
|
||||
const Standard_Real aBaseTolerance = Precision::Approximation();
|
||||
@@ -431,6 +455,8 @@ static Handle(IntPatch_WLine)
|
||||
Standard_Real aTol3d = aBaseTolerance * aBaseTolerance;
|
||||
|
||||
const Standard_Real aLimitCoeff = 0.99 * 0.99;
|
||||
const Standard_Real aMaxSqrRatio = 15. * 15.;
|
||||
Standard_Boolean isPlanePlane = IsSurfPlaneLike(theS1) && IsSurfPlaneLike(theS2);
|
||||
for(i = 3; i <= theWLine->NbPnts(); i++)
|
||||
{
|
||||
Standard_Boolean isDeleteState = Standard_False;
|
||||
@@ -466,14 +492,27 @@ static Handle(IntPatch_WLine)
|
||||
if (Min(aStepOnS1, aStepOnS2) >= aLimitCoeff * Max(aStepOnS1, aStepOnS2))
|
||||
{
|
||||
// Set hash flag to "Delete" state.
|
||||
isDeleteState = Standard_True;
|
||||
aNewPointsHash.SetValue(i - 1, 1);
|
||||
Standard_Real aCurrStep = aBase3dPnt.SquareDistance(aPnt3d);
|
||||
Standard_Real aSqrRatio = 0.;
|
||||
if (!isPlanePlane)
|
||||
{
|
||||
aSqrRatio = aPrevStep / aCurrStep;
|
||||
if (aSqrRatio < 1.)
|
||||
{
|
||||
aSqrRatio = 1. / aSqrRatio;
|
||||
}
|
||||
}
|
||||
if (aSqrRatio < aMaxSqrRatio)
|
||||
{
|
||||
isDeleteState = Standard_True;
|
||||
aNewPointsHash.SetValue(i - 1, 1);
|
||||
|
||||
// Change middle point.
|
||||
UonS1[1] = UonS1[2];
|
||||
UonS2[1] = UonS2[2];
|
||||
VonS1[1] = VonS1[2];
|
||||
VonS2[1] = VonS2[2];
|
||||
// Change middle point.
|
||||
UonS1[1] = UonS1[2];
|
||||
UonS2[1] = UonS2[2];
|
||||
VonS1[1] = VonS1[2];
|
||||
VonS2[1] = VonS2[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -497,6 +536,8 @@ static Handle(IntPatch_WLine)
|
||||
aBase3dPnt = theWLine->Point(i - 1).Value();
|
||||
aBase3dVec = gp_Vec(theWLine->Point(i - 1).Value(), theWLine->Point(i).Value());
|
||||
|
||||
aPrevStep = aBase3dVec.SquareMagnitude();
|
||||
|
||||
aNbPnt++;
|
||||
}
|
||||
}
|
||||
|
16
tests/bugs/modalg_7/bug32569
Normal file
16
tests/bugs/modalg_7/bug32569
Normal file
@@ -0,0 +1,16 @@
|
||||
puts "================================================="
|
||||
puts "0032569: Modeling Algorithm - Section not found"
|
||||
puts "================================================="
|
||||
puts ""
|
||||
|
||||
restore [locate_data_file bug32569.brep] s
|
||||
explode s
|
||||
|
||||
bop s_1 s_2
|
||||
bopsection result
|
||||
|
||||
checknbshapes result -vertex 2 -edge 1
|
||||
|
||||
checkmaxtol result -min_tol 4.5e-4
|
||||
|
||||
checkprops result -l 5.5227
|
@@ -37,8 +37,8 @@ while { $AllowRepeat != 0 } {
|
||||
puts "Error: Wrong curve's range!"
|
||||
}
|
||||
|
||||
xdistcs res_$ic s1 U1 U2 100 2.0e-6
|
||||
xdistcs res_$ic s2 U1 U2 100 2.0e-6
|
||||
xdistcs res_$ic s1 U1 U2 100 3.0e-6
|
||||
xdistcs res_$ic s2 U1 U2 100 3.0e-6
|
||||
|
||||
mkedge ee res_$ic
|
||||
baddobjects ee
|
||||
|
Reference in New Issue
Block a user