mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026938: Boolean operations fail between two ellipsoids
Treatment for single singular point is added. Test cases are updated to the new behavior. New test cases are added, Message of "bad" state is corrected.
This commit is contained in:
@@ -1716,8 +1716,8 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
|
||||
if(PW.IsDone()) {
|
||||
if(PW.NbPoints()>2)
|
||||
{
|
||||
//Try to extend the intersection line to boundary, if it is possibly
|
||||
Standard_Boolean hasBeenAdded = PW.PutToBoundary(Surf1, Surf2);
|
||||
//Try to extend the intersection line to boundary, if it is possible.
|
||||
PW.PutToBoundary(Surf1, Surf2);
|
||||
|
||||
RejetLigne = Standard_False;
|
||||
Point3dDebut = PW.Value(1).Value();
|
||||
@@ -1773,8 +1773,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);
|
||||
if (RestrictLine){
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang,hasBeenAdded);
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang,hasBeenAdded);
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang);
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang);
|
||||
}
|
||||
|
||||
if(wline->NbVertex() == 0) {
|
||||
@@ -2345,13 +2345,12 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
|
||||
if( iPWNbPoints > 2 )
|
||||
{
|
||||
//Try to extend the intersection line to boundary, if it is possibly
|
||||
Standard_Boolean hasBeenAdded = PW.PutToBoundary(Surf1, Surf2);
|
||||
PW.PutToBoundary(Surf1, Surf2);
|
||||
|
||||
const Standard_Integer aMinNbPoints = 40;
|
||||
if(iPWNbPoints < aMinNbPoints)
|
||||
{
|
||||
hasBeenAdded =
|
||||
PW.SeekAdditionalPoints(Surf1, Surf2, aMinNbPoints) || hasBeenAdded;
|
||||
PW.SeekAdditionalPoints(Surf1, Surf2, aMinNbPoints);
|
||||
iPWNbPoints = PW.NbPoints();
|
||||
}
|
||||
|
||||
@@ -2453,9 +2452,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);
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf1,D1,Surf2,Standard_True,TolTang,hasBeenAdded);
|
||||
IntPatch_RstInt::PutVertexOnLine(wline,Surf2,D2,Surf1,Standard_False,TolTang,hasBeenAdded);
|
||||
|
||||
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;
|
||||
|
@@ -442,12 +442,11 @@ static Standard_Boolean IsSegment2dSmall(const IntPatch_Polygo& Pol,
|
||||
//=======================================================================
|
||||
|
||||
void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
const Handle(Adaptor3d_HSurface)& Surf,
|
||||
const Handle(Adaptor3d_TopolTool)& Domain,
|
||||
const Handle(Adaptor3d_HSurface)& OtherSurf,
|
||||
const Standard_Boolean OnFirst,
|
||||
const Standard_Real Tol,
|
||||
const Standard_Boolean hasBeenAdded)
|
||||
const Handle(Adaptor3d_HSurface)& Surf,
|
||||
const Handle(Adaptor3d_TopolTool)& Domain,
|
||||
const Handle(Adaptor3d_HSurface)& OtherSurf,
|
||||
const Standard_Boolean OnFirst,
|
||||
const Standard_Real Tol)
|
||||
{
|
||||
|
||||
// Domain est le domaine de restriction de la surface Surf.
|
||||
@@ -1243,7 +1242,7 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
*/
|
||||
|
||||
wlin->SetPeriod(pu1,pv1,pu2,pv2);
|
||||
wlin->ComputeVertexParameters(Tol, hasBeenAdded);
|
||||
wlin->ComputeVertexParameters(Tol);
|
||||
}
|
||||
else {
|
||||
rlin->ComputeVertexParameters(Tol);
|
||||
|
@@ -38,7 +38,12 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT static void PutVertexOnLine (const Handle(IntPatch_Line)& L, const Handle(Adaptor3d_HSurface)& Surf, const Handle(Adaptor3d_TopolTool)& Domain, const Handle(Adaptor3d_HSurface)& OtherSurf, const Standard_Boolean OnFirst, const Standard_Real Tol, const Standard_Boolean hasBeenAdded = Standard_False);
|
||||
Standard_EXPORT static void PutVertexOnLine (const Handle(IntPatch_Line)& L,
|
||||
const Handle(Adaptor3d_HSurface)& Surf,
|
||||
const Handle(Adaptor3d_TopolTool)& Domain,
|
||||
const Handle(Adaptor3d_HSurface)& OtherSurf,
|
||||
const Standard_Boolean OnFirst,
|
||||
const Standard_Real Tol);
|
||||
|
||||
};
|
||||
|
||||
|
@@ -255,8 +255,7 @@ inline Standard_Boolean CompareVerticesOnS2(const IntPatch_Point& vtx1, const In
|
||||
{return CompareVerticesOnSurf (vtx1, vtx2, Standard_False);}
|
||||
|
||||
|
||||
void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol,
|
||||
const Standard_Boolean hasBeenAdded)
|
||||
void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol)
|
||||
{
|
||||
// MSV Oct 15, 2001: use tolerance of vertex instead of RTol where
|
||||
// it is possible
|
||||
@@ -505,30 +504,8 @@ void IntPatch_WLine::ComputeVertexParameters( const Standard_Real RTol,
|
||||
for(i=1; i<=nbvtx; i++) {
|
||||
const gp_Pnt& P = svtx.Value(i).Value();
|
||||
Standard_Real vTol = svtx.Value(i).Tolerance();
|
||||
|
||||
if(hasBeenAdded)
|
||||
{
|
||||
if(nbvtx == 2)
|
||||
{
|
||||
if(i == nbvtx)
|
||||
{
|
||||
indicevertex = curv->NbPoints();
|
||||
}
|
||||
else
|
||||
{
|
||||
indicevertex = svtx.Value(i).ParameterOnLine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
indicevertex = svtx.Value(i).ParameterOnLine();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
indicevertex = svtx.Value(i).ParameterOnLine();
|
||||
}
|
||||
|
||||
|
||||
indicevertex = svtx.Value(i).ParameterOnLine();
|
||||
indicevertexonline = (Standard_Integer)indicevertex;
|
||||
//--------------------------------------------------
|
||||
//-- On Compare le vertex avec les points de la ligne
|
||||
|
@@ -124,7 +124,7 @@ public:
|
||||
//! if a vertex is already in the line,
|
||||
//! its parameter is modified
|
||||
//! else a new point in the line is inserted.
|
||||
Standard_EXPORT void ComputeVertexParameters (const Standard_Real Tol, const Standard_Boolean hasBeenAdded = Standard_False);
|
||||
Standard_EXPORT void ComputeVertexParameters (const Standard_Real Tol);
|
||||
|
||||
//! Returns set of intersection points
|
||||
Standard_EXPORT virtual Handle(IntSurf_LineOn2S) Curve() const Standard_OVERRIDE;
|
||||
|
Reference in New Issue
Block a user