mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0023178: Intersection of cylinders fails to produce results
1. Unification of trimmed and not-trimmed cylinders processing (IntPatch_Intersection::GeomGeomPerfomTrimSurf() method has been removed). 2. Interface of IntPatch_ImpImpIntersection::Perform(...) method has been changed. 3. Now, WLine purging is forbidden for Geom-Geom-Intersection. 4. Bnd_Range class has been created. See Bnd_Range.hxx for detail information. 5. Algorithm of AddBoundaryPoint function has been improved in order to obtain intersection points in both boundaries (VFirst and VLast of every surface). 6. Earlier, method Geom2dConvert::ConcatG1(...) increased resulted B-spline degree (in case of not succession of previous iteration). Now increased value has been limited by Geom2d_BSplineCurve::MaxDegree() value (max degree = 25). 7. Algorithm of B-spline closure definition has been changed in the methods Geom2dConvert::C0BSplineToC1BSplineCurve(...) and Geom2dConvert::C0BSplineToArrayOfC1BSplineCurve(...). Creation of test case for this issue. Adjusting test cases according to their new behavior. Small correction in the code according to KGV's remark.
This commit is contained in:
@@ -31,8 +31,6 @@
|
||||
|
||||
#include <math_Matrix.hxx>
|
||||
|
||||
static const Standard_Integer aGlobalMaxDegree = 25;
|
||||
|
||||
//=======================================================================
|
||||
//struct : BSplCLib_DataContainer
|
||||
//purpose: Auxiliary structure providing buffers for poles and knots used in
|
||||
@@ -44,8 +42,7 @@ struct BSplCLib_DataContainer
|
||||
BSplCLib_DataContainer(Standard_Integer Degree)
|
||||
{
|
||||
(void)Degree; // avoid compiler warning
|
||||
Standard_OutOfRange_Raise_if (Degree > BSplCLib::MaxDegree() ||
|
||||
BSplCLib::MaxDegree() > aGlobalMaxDegree,
|
||||
Standard_OutOfRange_Raise_if (Degree > BSplCLib::MaxDegree(),
|
||||
"BSplCLib: bspline degree is greater than maximum supported");
|
||||
}
|
||||
|
||||
@@ -326,7 +323,7 @@ BSplCLib::BuildBSpMatrix(const TColStd_Array1OfReal& Parameters,
|
||||
ReturnCode = 0,
|
||||
FirstNonZeroBsplineIndex,
|
||||
BandWidth,
|
||||
MaxOrder = aGlobalMaxDegree+1,
|
||||
MaxOrder = BSplCLib::MaxDegree() + 1,
|
||||
Order ;
|
||||
|
||||
math_Matrix BSplineBasis(1, MaxOrder,
|
||||
|
37
src/Bnd/Bnd_Range.cxx
Normal file
37
src/Bnd/Bnd_Range.cxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 2016-06-07
|
||||
// Created by: Nikolai BUKHALOV
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <Bnd_Range.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Common
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void Bnd_Range::Common(const Bnd_Range& theOther)
|
||||
{
|
||||
if(theOther.IsVoid())
|
||||
{
|
||||
SetVoid();
|
||||
}
|
||||
|
||||
if(IsVoid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
myFirst = Max(myFirst, theOther.myFirst);
|
||||
myLast = Min(myLast, theOther.myLast);
|
||||
}
|
124
src/Bnd/Bnd_Range.hxx
Normal file
124
src/Bnd/Bnd_Range.hxx
Normal file
@@ -0,0 +1,124 @@
|
||||
// Created on: 2016-06-07
|
||||
// Created by: Nikolai BUKHALOV
|
||||
// Copyright (c) 2016 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#ifndef _Bnd_Range_HeaderFile
|
||||
#define _Bnd_Range_HeaderFile
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_ConstructionError.hxx>
|
||||
|
||||
//! This class describes a range in 1D space restricted
|
||||
//! by two real values.
|
||||
//! A range can be void indicating there is no point included in the range.
|
||||
|
||||
class Bnd_Range
|
||||
{
|
||||
public:
|
||||
|
||||
//! Default constructor. Creates VOID range.
|
||||
Bnd_Range() : myFirst(0.0), myLast(-1.0)
|
||||
{
|
||||
};
|
||||
|
||||
//! Constructor. Never creates VOID range.
|
||||
Bnd_Range(const Standard_Real theMin, const Standard_Real theMax) :
|
||||
myFirst(theMin), myLast(theMax)
|
||||
{
|
||||
if(myLast < myFirst)
|
||||
Standard_ConstructionError::Raise("Last < First");
|
||||
};
|
||||
|
||||
//! Replaces <this> with common-part of <this> and theOther
|
||||
Standard_EXPORT void Common(const Bnd_Range& theOther);
|
||||
|
||||
//! Extends <this> to include theParameter
|
||||
void Add(const Standard_Real theParameter)
|
||||
{
|
||||
if(IsVoid())
|
||||
{
|
||||
myFirst = myLast = theParameter;
|
||||
return;
|
||||
}
|
||||
|
||||
myFirst = Min(myFirst, theParameter);
|
||||
myLast = Max(myLast, theParameter);
|
||||
}
|
||||
|
||||
//! Obtain MIN boundary of <this>.
|
||||
//! If <this> is VOID the method returns false.
|
||||
Standard_Boolean GetMin(Standard_Real& thePar) const
|
||||
{
|
||||
if(IsVoid())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
thePar = myFirst;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//! Obtain MAX boundary of <this>.
|
||||
//! If <this> is VOID the method returns false.
|
||||
Standard_Boolean GetMAX(Standard_Real& thePar) const
|
||||
{
|
||||
if(IsVoid())
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
thePar = myLast;
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//! Returns range value (MAX-MIN). Returns negative value for VOID range.
|
||||
Standard_Real Delta() const
|
||||
{
|
||||
return (myLast - myFirst);
|
||||
}
|
||||
|
||||
//! Is <this> initialized.
|
||||
Standard_Boolean IsVoid() const
|
||||
{
|
||||
return (myLast < myFirst);
|
||||
}
|
||||
|
||||
//! Initializes <this> by default parameters. Makes <this> VOID.
|
||||
void SetVoid()
|
||||
{
|
||||
myLast = -1.0;
|
||||
myFirst = 0.0;
|
||||
}
|
||||
|
||||
//! Extends this to the given value (in both side)
|
||||
void Enlarge(const Standard_Real theDelta)
|
||||
{
|
||||
if (IsVoid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
myFirst -= theDelta;
|
||||
myLast += theDelta;
|
||||
}
|
||||
|
||||
private:
|
||||
//! Start of range
|
||||
Standard_Real myFirst;
|
||||
|
||||
//! End of range
|
||||
Standard_Real myLast;
|
||||
};
|
||||
|
||||
#endif
|
@@ -24,6 +24,8 @@ Bnd_Box2d.hxx
|
||||
Bnd_HArray1OfBox.hxx
|
||||
Bnd_HArray1OfBox2d.hxx
|
||||
Bnd_HArray1OfSphere.hxx
|
||||
Bnd_Range.cxx
|
||||
Bnd_Range.hxx
|
||||
Bnd_SeqOfBox.hxx
|
||||
Bnd_Sphere.cxx
|
||||
Bnd_Sphere.hxx
|
||||
|
@@ -1025,6 +1025,7 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
|
||||
for (j=1;j<=nb_curve-1;j++){ //boucle secondaire a l'interieur de chaque groupe
|
||||
Curve1=ArrayOfCurves(j);
|
||||
if ( (j==(nb_curve-1)) &&(Need2DegRepara(ArrayOfCurves))){
|
||||
const Standard_Integer aNewCurveDegree = Min(2 * Curve1->Degree(), Geom2d_BSplineCurve::MaxDegree());
|
||||
Curve2->D1(Curve2->LastParameter(),Pint,Vec1);
|
||||
Curve1->D1(Curve1->FirstParameter(),Pint,Vec2);
|
||||
lambda=Vec2.Magnitude()/Vec1.Magnitude();
|
||||
@@ -1074,7 +1075,7 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
|
||||
Curve1FlatKnots,
|
||||
Curve1Poles,
|
||||
FlatKnots,
|
||||
2*Curve1->Degree(),
|
||||
aNewCurveDegree,
|
||||
NewPoles,
|
||||
Status
|
||||
);
|
||||
@@ -1084,7 +1085,7 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
|
||||
Curve1FlatKnots,
|
||||
Curve1Weights,
|
||||
FlatKnots,
|
||||
2*Curve1->Degree(),
|
||||
aNewCurveDegree,
|
||||
NewWeights,
|
||||
Status
|
||||
);
|
||||
@@ -1110,7 +1111,7 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
|
||||
for (ii=1;ii<=NewPoles.Length();ii++)
|
||||
for (jj=1;jj<=2;jj++)
|
||||
NewPoles(ii).SetCoord(jj,NewPoles(ii).Coord(jj)/NewWeights(ii));
|
||||
Curve1= new Geom2d_BSplineCurve(NewPoles,NewWeights,KnotC1,KnotC1Mults,2*Curve1->Degree());
|
||||
Curve1 = new Geom2d_BSplineCurve(NewPoles, NewWeights, KnotC1, KnotC1Mults, aNewCurveDegree);
|
||||
}
|
||||
Geom2dConvert_CompCurveToBSplineCurve C(Curve2);
|
||||
fusion=C.Add(Curve1,
|
||||
@@ -1276,6 +1277,8 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
|
||||
else
|
||||
Curve1=ArrayOfCurves(j);
|
||||
|
||||
const Standard_Integer aNewCurveDegree = Min(2 * Curve1->Degree(), Geom2d_BSplineCurve::MaxDegree());
|
||||
|
||||
if (j==0) //initialisation en debut de groupe
|
||||
Curve2=Curve1;
|
||||
else{
|
||||
@@ -1315,7 +1318,7 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
|
||||
TColStd_Array1OfReal FlatKnots(1,Curve1FlatKnots.Length()+(Curve1->Degree()*Curve1->NbKnots()));
|
||||
|
||||
BSplCLib::KnotSequence(KnotC1,KnotC1Mults,FlatKnots);
|
||||
TColgp_Array1OfPnt2d NewPoles(1,FlatKnots.Length()-(2*Curve1->Degree()+1));
|
||||
TColgp_Array1OfPnt2d NewPoles(1, FlatKnots.Length() - (aNewCurveDegree + 1));
|
||||
Standard_Integer Status;
|
||||
TColStd_Array1OfReal Curve1Weights(1,Curve1->NbPoles());
|
||||
Curve1->Weights(Curve1Weights);
|
||||
@@ -1330,18 +1333,18 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
|
||||
Curve1FlatKnots,
|
||||
Curve1Poles,
|
||||
FlatKnots,
|
||||
2*Curve1->Degree(),
|
||||
aNewCurveDegree,
|
||||
NewPoles,
|
||||
Status
|
||||
);
|
||||
TColStd_Array1OfReal NewWeights(1,FlatKnots.Length()-(2*Curve1->Degree()+1));
|
||||
TColStd_Array1OfReal NewWeights(1, FlatKnots.Length() - (aNewCurveDegree + 1));
|
||||
// BSplCLib::FunctionReparameterise(reparameterise_evaluator,
|
||||
BSplCLib::FunctionReparameterise(ev,
|
||||
Curve1->Degree(),
|
||||
Curve1FlatKnots,
|
||||
Curve1Weights,
|
||||
FlatKnots,
|
||||
2*Curve1->Degree(),
|
||||
aNewCurveDegree,
|
||||
NewWeights,
|
||||
Status
|
||||
);
|
||||
@@ -1349,7 +1352,7 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
|
||||
for (jj=1;jj<=2;jj++)
|
||||
NewPoles(ii).SetCoord(jj,NewPoles(ii).Coord(jj)/NewWeights(ii));
|
||||
}
|
||||
Curve1= new Geom2d_BSplineCurve(NewPoles,NewWeights,KnotC1,KnotC1Mults,2*Curve1->Degree());
|
||||
Curve1 = new Geom2d_BSplineCurve(NewPoles, NewWeights, KnotC1, KnotC1Mults, aNewCurveDegree);
|
||||
}
|
||||
Geom2dConvert_CompCurveToBSplineCurve C(Curve2);
|
||||
fusion=C.Add(Curve1,
|
||||
@@ -1420,7 +1423,7 @@ void Geom2dConvert::C0BSplineToC1BSplineCurve(Handle(Geom2d_BSplineCurve)& BS,
|
||||
Standard_Integer i,j,nbcurveC1=1;
|
||||
Standard_Real U1,U2;
|
||||
Standard_Boolean closed_flag = Standard_False ;
|
||||
gp_Pnt2d point;
|
||||
gp_Pnt2d point1, point2;
|
||||
gp_Vec2d V1,V2;
|
||||
Standard_Boolean fusion;
|
||||
|
||||
@@ -1453,15 +1456,20 @@ void Geom2dConvert::C0BSplineToC1BSplineCurve(Handle(Geom2d_BSplineCurve)& BS,
|
||||
BSbis->Segment(U1,U2);
|
||||
ArrayOfCurves(i)=BSbis;
|
||||
}
|
||||
|
||||
const Standard_Real anAngularToler = 1.0e-7;
|
||||
Handle(TColStd_HArray1OfInteger) ArrayOfIndices;
|
||||
Handle(TColGeom2d_HArray1OfBSplineCurve) ArrayOfConcatenated;
|
||||
|
||||
BS->D1(BS->FirstParameter(),point,V1); //a verifier
|
||||
BS->D1(BS->LastParameter(),point,V2);
|
||||
BS->D1(BS->FirstParameter(),point1,V1); //a verifier
|
||||
BS->D1(BS->LastParameter(),point2,V2);
|
||||
|
||||
if ((BS->IsClosed())&&(V1.IsParallel(V2,Precision::Confusion())))
|
||||
closed_flag = Standard_True ;
|
||||
|
||||
if ((point1.SquareDistance(point2) < gp::Resolution()) &&
|
||||
(V1.IsParallel(V2, anAngularToler)))
|
||||
{
|
||||
closed_flag = Standard_True;
|
||||
}
|
||||
|
||||
Geom2dConvert::ConcatC1(ArrayOfCurves,
|
||||
ArrayOfToler,
|
||||
ArrayOfIndices,
|
||||
@@ -1510,7 +1518,7 @@ void Geom2dConvert::C0BSplineToArrayOfC1BSplineCurve(const Handle(Geom2d_BSpline
|
||||
Standard_Integer i,j,nbcurveC1=1;
|
||||
Standard_Real U1,U2;
|
||||
Standard_Boolean closed_flag = Standard_False ;
|
||||
gp_Pnt2d point;
|
||||
gp_Pnt2d point1, point2;
|
||||
gp_Vec2d V1,V2;
|
||||
// Standard_Boolean fusion;
|
||||
|
||||
@@ -1544,11 +1552,14 @@ void Geom2dConvert::C0BSplineToArrayOfC1BSplineCurve(const Handle(Geom2d_BSpline
|
||||
|
||||
Handle(TColStd_HArray1OfInteger) ArrayOfIndices;
|
||||
|
||||
BS->D1(BS->FirstParameter(),point,V1);
|
||||
BS->D1(BS->LastParameter(),point,V2);
|
||||
BS->D1(BS->FirstParameter(),point1,V1);
|
||||
BS->D1(BS->LastParameter(),point2,V2);
|
||||
|
||||
if ((BS->IsClosed())&&(V1.IsParallel(V2,AngularTolerance)))
|
||||
closed_flag = Standard_True ;
|
||||
if (((point1.SquareDistance(point2) < gp::Resolution())) &&
|
||||
(V1.IsParallel(V2, AngularTolerance)))
|
||||
{
|
||||
closed_flag = Standard_True;
|
||||
}
|
||||
|
||||
Geom2dConvert::ConcatC1(ArrayOfCurves,
|
||||
ArrayOfToler,
|
||||
|
@@ -62,7 +62,14 @@ public:
|
||||
//! When intersection result returns IntPatch_RLine and another
|
||||
//! IntPatch_Line (not restriction) we (in case of theIsReqToKeepRLine==TRUE)
|
||||
//! will always keep both lines even if they are coincided.
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& D1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& D2, const Standard_Real TolArc, const Standard_Real TolTang, const Standard_Boolean isTheTrimmed = Standard_False, const Standard_Boolean theIsReqToKeepRLine = Standard_False);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& S1,
|
||||
const Handle(Adaptor3d_TopolTool)& D1,
|
||||
const Handle(Adaptor3d_HSurface)& S2,
|
||||
const Handle(Adaptor3d_TopolTool)& D2,
|
||||
const Standard_Real TolArc,
|
||||
const Standard_Real TolTang,
|
||||
const Standard_Boolean theIsReqToKeepRLine =
|
||||
Standard_False);
|
||||
|
||||
//! Returns True if the calculus was succesfull.
|
||||
Standard_Boolean IsDone() const;
|
||||
@@ -71,8 +78,8 @@ public:
|
||||
Standard_Boolean IsEmpty() const;
|
||||
|
||||
//! Returns True if the two patches are considered as
|
||||
//! entierly tangent, i-e every restriction arc of one
|
||||
//! patch is inside the geometric base of the otehr patch.
|
||||
//! entirely tangent, i.e every restriction arc of one
|
||||
//! patch is inside the geometric base of the other patch.
|
||||
Standard_Boolean TangentFaces() const;
|
||||
|
||||
//! Returns True when the TangentFaces returns True and the
|
||||
|
@@ -70,16 +70,7 @@ static void ProcessBounds(const Handle(IntPatch_ALine)&,
|
||||
const Standard_Real);
|
||||
|
||||
|
||||
static Standard_Boolean IntCyCy(const IntSurf_Quadric&,
|
||||
const IntSurf_Quadric&,
|
||||
const Standard_Real,
|
||||
Standard_Boolean&,
|
||||
Standard_Boolean&,
|
||||
Standard_Boolean&,
|
||||
IntPatch_SequenceOfLine&,
|
||||
IntPatch_SequenceOfPoint&);
|
||||
|
||||
static Standard_Boolean IntCyCyTrim(const IntSurf_Quadric& theQuad1,
|
||||
static Standard_Boolean IntCyCy(const IntSurf_Quadric& theQuad1,
|
||||
const IntSurf_Quadric& theQuad2,
|
||||
const Standard_Real theTol3D,
|
||||
const Standard_Real theTol2D,
|
||||
@@ -87,6 +78,8 @@ static Standard_Boolean IntCyCyTrim(const IntSurf_Quadric& theQuad1,
|
||||
const Bnd_Box2d& theUVSurf2,
|
||||
const Standard_Boolean isTheReverse,
|
||||
Standard_Boolean& isTheEmpty,
|
||||
Standard_Boolean& isTheSameSurface,
|
||||
Standard_Boolean& isTheMultiplePoint,
|
||||
IntPatch_SequenceOfLine& theSlin,
|
||||
IntPatch_SequenceOfPoint& theSPnt);
|
||||
|
||||
|
@@ -14,6 +14,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IntPatch_WLine.hxx>
|
||||
|
||||
static
|
||||
Standard_Integer SetQuad(const Handle(Adaptor3d_HSurface)& theS,
|
||||
GeomAbs_SurfaceType& theTS,
|
||||
@@ -40,7 +42,7 @@ IntPatch_ImpImpIntersection::IntPatch_ImpImpIntersection
|
||||
const Standard_Real TolTang,
|
||||
const Standard_Boolean theIsReqToKeepRLine)
|
||||
{
|
||||
Perform(S1,D1,S2,D2,TolArc,TolTang, Standard_False, theIsReqToKeepRLine);
|
||||
Perform(S1,D1,S2,D2,TolArc,TolTang, theIsReqToKeepRLine);
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
@@ -52,13 +54,14 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
||||
const Handle(Adaptor3d_TopolTool)& D2,
|
||||
const Standard_Real TolArc,
|
||||
const Standard_Real TolTang,
|
||||
const Standard_Boolean isTheTrimmed,
|
||||
const Standard_Boolean theIsReqToKeepRLine) {
|
||||
const Standard_Boolean theIsReqToKeepRLine)
|
||||
{
|
||||
done = Standard_False;
|
||||
Standard_Boolean isTrimmed = isTheTrimmed;
|
||||
spnt.Clear();
|
||||
slin.Clear();
|
||||
|
||||
Standard_Boolean isPostProcessingRequired = Standard_True;
|
||||
|
||||
empt = Standard_True;
|
||||
tgte = Standard_False;
|
||||
oppo = Standard_False;
|
||||
@@ -149,59 +152,53 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
||||
case 22:
|
||||
{ // Cylinder/Cylinder
|
||||
Standard_Boolean isDONE = Standard_False;
|
||||
|
||||
if(!isTrimmed)
|
||||
Bnd_Box2d aBox1, aBox2;
|
||||
|
||||
const Standard_Real aU1f = S1->FirstUParameter();
|
||||
Standard_Real aU1l = S1->LastUParameter();
|
||||
const Standard_Real aU2f = S2->FirstUParameter();
|
||||
Standard_Real aU2l = S2->LastUParameter();
|
||||
|
||||
const Standard_Real anUperiod = 2.0*M_PI;
|
||||
|
||||
if(aU1l - aU1f > anUperiod)
|
||||
aU1l = aU1f + anUperiod;
|
||||
|
||||
if(aU2l - aU2f > anUperiod)
|
||||
aU2l = aU2f + anUperiod;
|
||||
|
||||
aBox1.Add(gp_Pnt2d(aU1f, S1->FirstVParameter()));
|
||||
aBox1.Add(gp_Pnt2d(aU1l, S1->LastVParameter()));
|
||||
aBox2.Add(gp_Pnt2d(aU2f, S2->FirstVParameter()));
|
||||
aBox2.Add(gp_Pnt2d(aU2l, S2->LastVParameter()));
|
||||
|
||||
// Resolution is too big if the cylinder radius is
|
||||
// too small. Therefore, we shall bounde its value above.
|
||||
// Here, we use simple constant.
|
||||
const Standard_Real a2DTol = Min(1.0e-4, Min( S1->UResolution(TolTang),
|
||||
S2->UResolution(TolTang)));
|
||||
|
||||
//The bigger range the bigger nunber of points in Walking-line (WLine)
|
||||
//we will be able to add and, consequently, we will obtain more
|
||||
//precise intersection line.
|
||||
//Every point of WLine is determined as function from U1-parameter,
|
||||
//where U1 is U-parameter on 1st quadric.
|
||||
//Therefore, we should use quadric with bigger range as 1st parameter
|
||||
//in IntCyCy() function.
|
||||
//On the other hand, there is no point in reversing in case of
|
||||
//analytical intersection (when result is line, ellipse, point...).
|
||||
//This result is independent of the arguments order.
|
||||
Standard_Boolean isReversed = ((aU2l - aU2f) < (aU1l - aU1f));
|
||||
|
||||
if(isReversed)
|
||||
{
|
||||
isDONE = IntCyCy(quad1, quad2, TolTang, empt,
|
||||
SameSurf, multpoint, slin, spnt);
|
||||
isDONE = IntCyCy(quad2, quad1, TolTang, a2DTol, aBox2, aBox1,
|
||||
Standard_True, empt, SameSurf, multpoint, slin, spnt);
|
||||
}
|
||||
else
|
||||
{
|
||||
Bnd_Box2d aBox1, aBox2;
|
||||
|
||||
const Standard_Real aU1f = S1->FirstUParameter();
|
||||
Standard_Real aU1l = S1->LastUParameter();
|
||||
const Standard_Real aU2f = S2->FirstUParameter();
|
||||
Standard_Real aU2l = S2->LastUParameter();
|
||||
|
||||
const Standard_Real anUperiod = 2.0*M_PI;
|
||||
|
||||
if(aU1l - aU1f > anUperiod)
|
||||
aU1l = aU1f + anUperiod;
|
||||
|
||||
if(aU2l - aU2f > anUperiod)
|
||||
aU2l = aU2f + anUperiod;
|
||||
|
||||
aBox1.Add(gp_Pnt2d(aU1f, S1->FirstVParameter()));
|
||||
aBox1.Add(gp_Pnt2d(aU1l, S1->LastVParameter()));
|
||||
aBox2.Add(gp_Pnt2d(aU2f, S2->FirstVParameter()));
|
||||
aBox2.Add(gp_Pnt2d(aU2l, S2->LastVParameter()));
|
||||
|
||||
// Resolution is too big if the cylinder radius is
|
||||
// too small. Therefore, we shall bounde its value above.
|
||||
// Here, we use simple constant.
|
||||
const Standard_Real a2DTol = Min(1.0e-4, Min( S1->UResolution(TolTang),
|
||||
S2->UResolution(TolTang)));
|
||||
|
||||
Standard_Boolean isReversed = ((aU2l - aU2f) < (aU1l - aU1f));
|
||||
|
||||
if(isReversed)
|
||||
{
|
||||
isDONE = IntCyCyTrim(quad2, quad1, TolTang, a2DTol, aBox2, aBox1,
|
||||
isReversed, empt, slin, spnt);
|
||||
}
|
||||
else
|
||||
{
|
||||
isDONE = IntCyCyTrim(quad1, quad2, TolTang, a2DTol, aBox1, aBox2,
|
||||
isReversed, empt, slin, spnt);
|
||||
}
|
||||
|
||||
if(!isDONE)
|
||||
{
|
||||
isDONE = IntCyCy(quad1, quad2, TolTang, empt,
|
||||
SameSurf, multpoint, slin, spnt);
|
||||
isTrimmed = Standard_False;
|
||||
}
|
||||
isDONE = IntCyCy(quad1, quad2, TolTang, a2DTol, aBox1, aBox2,
|
||||
Standard_False, empt, SameSurf, multpoint, slin, spnt);
|
||||
}
|
||||
|
||||
if (!isDONE)
|
||||
@@ -210,6 +207,17 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
||||
}
|
||||
|
||||
bEmpty = empt;
|
||||
if(!slin.IsEmpty())
|
||||
{
|
||||
const Handle(IntPatch_WLine)& aWLine =
|
||||
Handle(IntPatch_WLine)::DownCast(slin.Value(1));
|
||||
|
||||
if(!aWLine.IsNull())
|
||||
{//No geometric solution
|
||||
isPostProcessingRequired = Standard_False;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
//
|
||||
@@ -302,7 +310,7 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
||||
}
|
||||
//
|
||||
|
||||
if(!isTrimmed)
|
||||
if(isPostProcessingRequired)
|
||||
{
|
||||
if (!SameSurf) {
|
||||
AFunc.SetQuadric(quad2);
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -917,18 +917,9 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
||||
ListOfPnts.Clear();
|
||||
if(isGeomInt)
|
||||
{
|
||||
if(theD1->DomainIsInfinite() || theD2->DomainIsInfinite())
|
||||
{
|
||||
GeomGeomPerfom( theS1, theD1, theS2, theD2, TolArc,
|
||||
TolTang, ListOfPnts, RestrictLine,
|
||||
typs1, typs2, theIsReqToKeepRLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
GeomGeomPerfomTrimSurf( theS1, theD1, theS2, theD2,
|
||||
TolArc, TolTang, ListOfPnts, RestrictLine,
|
||||
typs1, typs2, theIsReqToKeepRLine);
|
||||
}
|
||||
GeomGeomPerfom( theS1, theD1, theS2, theD2, TolArc,
|
||||
TolTang, ListOfPnts, RestrictLine,
|
||||
typs1, typs2, theIsReqToKeepRLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1182,16 +1173,8 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
||||
}
|
||||
else if(ts1 == 1)
|
||||
{
|
||||
if(theD1->DomainIsInfinite() || theD2->DomainIsInfinite())
|
||||
{
|
||||
GeomGeomPerfom(theS1, theD1, theS2, theD2, TolArc,
|
||||
TolTang, ListOfPnts, RestrictLine, typs1, typs2, theIsReqToKeepRLine);
|
||||
}
|
||||
else
|
||||
{
|
||||
GeomGeomPerfomTrimSurf(theS1, theD1, theS2, theD2,
|
||||
TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2, theIsReqToKeepRLine);
|
||||
}
|
||||
GeomGeomPerfom(theS1, theD1, theS2, theD2, TolArc,
|
||||
TolTang, ListOfPnts, RestrictLine, typs1, typs2, theIsReqToKeepRLine);
|
||||
}
|
||||
|
||||
if(!theIsReqToPostWLProc)
|
||||
@@ -1438,7 +1421,36 @@ void IntPatch_Intersection::GeomGeomPerfom(const Handle(Adaptor3d_HSurface)& the
|
||||
slin.Append(wlin);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(line->ArcType() == IntPatch_Walking)
|
||||
{
|
||||
Handle(IntPatch_WLine)::DownCast(line)->EnablePurging(Standard_False);
|
||||
}
|
||||
|
||||
slin.Append(line);
|
||||
}
|
||||
}
|
||||
|
||||
for (Standard_Integer i = 1; i <= interii.NbPnts(); i++)
|
||||
{
|
||||
spnt.Append(interii.Point(i));
|
||||
}
|
||||
|
||||
if((theTyps1 == GeomAbs_Cylinder) && (theTyps2 == GeomAbs_Cylinder))
|
||||
{
|
||||
IntPatch_WLineTool::JoinWLines( slin, spnt, TolTang,
|
||||
theS1->IsUPeriodic()? theS1->UPeriod() : 0.0,
|
||||
theS2->IsUPeriodic()? theS2->UPeriod() : 0.0,
|
||||
theS1->IsVPeriodic()? theS1->VPeriod() : 0.0,
|
||||
theS2->IsVPeriodic()? theS2->VPeriod() : 0.0,
|
||||
theS1->FirstUParameter(),
|
||||
theS1->LastUParameter(),
|
||||
theS1->FirstVParameter(),
|
||||
theS1->LastVParameter(),
|
||||
theS2->FirstUParameter(),
|
||||
theS2->LastUParameter(),
|
||||
theS2->FirstVParameter(),
|
||||
theS2->LastVParameter());
|
||||
}
|
||||
|
||||
if(isQuadSet)
|
||||
@@ -1472,11 +1484,6 @@ void IntPatch_Intersection::GeomGeomPerfom(const Handle(Adaptor3d_HSurface)& the
|
||||
theS2->IsVPeriodic()? theS2->VPeriod() : 0.0,
|
||||
aBx1, aBx2);
|
||||
}
|
||||
|
||||
for (Standard_Integer i = 1; i <= interii.NbPnts(); i++)
|
||||
{
|
||||
spnt.Append(interii.Point(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1568,84 +1575,6 @@ void IntPatch_Intersection::
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GeomGeomPerfomTrimSurf
|
||||
//purpose : This function returns ready walking-line (which is not need
|
||||
// in convertation) as an intersection line between two
|
||||
// trimmed surfaces.
|
||||
//=======================================================================
|
||||
void IntPatch_Intersection::
|
||||
GeomGeomPerfomTrimSurf( const Handle(Adaptor3d_HSurface)& theS1,
|
||||
const Handle(Adaptor3d_TopolTool)& theD1,
|
||||
const Handle(Adaptor3d_HSurface)& theS2,
|
||||
const Handle(Adaptor3d_TopolTool)& theD2,
|
||||
const Standard_Real theTolArc,
|
||||
const Standard_Real theTolTang,
|
||||
IntSurf_ListOfPntOn2S& theListOfPnts,
|
||||
const Standard_Boolean RestrictLine,
|
||||
const GeomAbs_SurfaceType theTyps1,
|
||||
const GeomAbs_SurfaceType theTyps2,
|
||||
const Standard_Boolean theIsReqToKeepRLine)
|
||||
{
|
||||
IntSurf_Quadric Quad1,Quad2;
|
||||
|
||||
if((theTyps1 == GeomAbs_Cylinder) && (theTyps2 == GeomAbs_Cylinder))
|
||||
{
|
||||
IntPatch_ImpImpIntersection anInt;
|
||||
anInt.Perform(theS1, theD1, theS2, theD2, myTolArc,
|
||||
myTolTang, Standard_True, theIsReqToKeepRLine);
|
||||
|
||||
done = anInt.IsDone();
|
||||
|
||||
if(done)
|
||||
{
|
||||
empt = anInt.IsEmpty();
|
||||
if (!empt)
|
||||
{
|
||||
tgte = anInt.TangentFaces();
|
||||
if (tgte)
|
||||
oppo = anInt.OppositeFaces();
|
||||
|
||||
const Standard_Integer aNbLin = anInt.NbLines();
|
||||
const Standard_Integer aNbPts = anInt.NbPnts();
|
||||
|
||||
for(Standard_Integer aLID = 1; aLID <= aNbLin; aLID++)
|
||||
{
|
||||
const Handle(IntPatch_Line)& aLine = anInt.Line(aLID);
|
||||
slin.Append(aLine);
|
||||
}
|
||||
|
||||
for(Standard_Integer aPID = 1; aPID <= aNbPts; aPID++)
|
||||
{
|
||||
const IntPatch_Point& aPoint = anInt.Point(aPID);
|
||||
spnt.Append(aPoint);
|
||||
}
|
||||
|
||||
IntPatch_WLineTool::JoinWLines( slin, spnt, theTolTang,
|
||||
theS1->IsUPeriodic()? theS1->UPeriod() : 0.0,
|
||||
theS2->IsUPeriodic()? theS2->UPeriod() : 0.0,
|
||||
theS1->IsVPeriodic()? theS1->VPeriod() : 0.0,
|
||||
theS2->IsVPeriodic()? theS2->VPeriod() : 0.0,
|
||||
theS1->FirstUParameter(),
|
||||
theS1->LastUParameter(),
|
||||
theS1->FirstVParameter(),
|
||||
theS1->LastVParameter(),
|
||||
theS2->FirstUParameter(),
|
||||
theS2->LastUParameter(),
|
||||
theS2->FirstVParameter(),
|
||||
theS2->LastVParameter());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GeomGeomPerfom(theS1, theD1, theS2, theD2,
|
||||
theTolArc, theTolTang, theListOfPnts,
|
||||
RestrictLine, theTyps1, theTyps2, theIsReqToKeepRLine);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& S1,
|
||||
const Handle(Adaptor3d_TopolTool)& D1,
|
||||
const Handle(Adaptor3d_HSurface)& S2,
|
||||
|
@@ -167,14 +167,6 @@ private:
|
||||
//! will always keep both lines even if they are coincided.
|
||||
Standard_EXPORT void GeomGeomPerfom (const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& D1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& D2, const Standard_Real TolArc, const Standard_Real TolTang, IntSurf_ListOfPntOn2S& LOfPnts, const Standard_Boolean RestrictLine, const GeomAbs_SurfaceType typs1, const GeomAbs_SurfaceType typs2, const Standard_Boolean theIsReqToKeepRLine = Standard_False);
|
||||
|
||||
//! Flag theIsReqToKeepRLine has been enterred only for
|
||||
//! compatibility with TopOpeBRep package. It shall be deleted
|
||||
//! after deleting TopOpeBRep.
|
||||
//! When intersection result returns IntPatch_RLine and another
|
||||
//! IntPatch_Line (not restriction) we (in case of theIsReqToKeepRLine==TRUE)
|
||||
//! will always keep both lines even if they are coincided.
|
||||
Standard_EXPORT void GeomGeomPerfomTrimSurf (const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& D1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& D2, const Standard_Real TolArc, const Standard_Real TolTang, IntSurf_ListOfPntOn2S& LOfPnts, const Standard_Boolean RestrictLine, const GeomAbs_SurfaceType typs1, const GeomAbs_SurfaceType typs2, const Standard_Boolean theIsReqToKeepRLine = Standard_False);
|
||||
|
||||
Standard_EXPORT void GeomParamPerfom (const Handle(Adaptor3d_HSurface)& S1, const Handle(Adaptor3d_TopolTool)& D1, const Handle(Adaptor3d_HSurface)& S2, const Handle(Adaptor3d_TopolTool)& D2, const Standard_Boolean isNotAnalitical, const GeomAbs_SurfaceType typs1, const GeomAbs_SurfaceType typs2);
|
||||
|
||||
|
||||
|
@@ -17,6 +17,9 @@
|
||||
#include <Adaptor3d_TopolTool.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
|
||||
// It is pure empirical value.
|
||||
const Standard_Real IntPatch_WLineTool::myMaxConcatAngle = M_PI/6;
|
||||
|
||||
//Bit-mask is used for information about
|
||||
//the operation made in
|
||||
//IntPatch_WLineTool::ExtendTwoWlinesToEachOther() method.
|
||||
@@ -830,27 +833,26 @@ static Standard_Boolean IsOutOfDomain(const Bnd_Box2d& theBoxS1,
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CheckArguments
|
||||
//function : CheckArgumentsToExtend
|
||||
//purpose : Check if extending is possible
|
||||
// (see IntPatch_WLineTool::ExtendTwoWlinesToEachOther)
|
||||
//=======================================================================
|
||||
static Standard_Boolean CheckArguments(const IntSurf_Quadric& theS1,
|
||||
const IntSurf_Quadric& theS2,
|
||||
const IntSurf_PntOn2S& thePtWL1,
|
||||
const IntSurf_PntOn2S& thePtWL2,
|
||||
IntSurf_PntOn2S& theNewPoint,
|
||||
const gp_Vec& theVec1,
|
||||
const gp_Vec& theVec2,
|
||||
const gp_Vec& theVec3,
|
||||
const Bnd_Box2d& theBoxS1,
|
||||
const Bnd_Box2d& theBoxS2,
|
||||
const Standard_Real theToler3D,
|
||||
const Standard_Real theU1Period,
|
||||
const Standard_Real theU2Period,
|
||||
const Standard_Real theV1Period,
|
||||
const Standard_Real theV2Period)
|
||||
Standard_Boolean CheckArgumentsToExtend(const IntSurf_Quadric& theS1,
|
||||
const IntSurf_Quadric& theS2,
|
||||
const IntSurf_PntOn2S& thePtWL1,
|
||||
const IntSurf_PntOn2S& thePtWL2,
|
||||
IntSurf_PntOn2S& theNewPoint,
|
||||
const gp_Vec& theVec1,
|
||||
const gp_Vec& theVec2,
|
||||
const gp_Vec& theVec3,
|
||||
const Bnd_Box2d& theBoxS1,
|
||||
const Bnd_Box2d& theBoxS2,
|
||||
const Standard_Real theToler3D,
|
||||
const Standard_Real theU1Period,
|
||||
const Standard_Real theU2Period,
|
||||
const Standard_Real theV1Period,
|
||||
const Standard_Real theV2Period)
|
||||
{
|
||||
const Standard_Real aMaxAngle = M_PI/6; //30 degree
|
||||
const Standard_Real aSqToler = theToler3D*theToler3D;
|
||||
|
||||
if(theVec3.SquareMagnitude() <= aSqToler)
|
||||
@@ -858,9 +860,9 @@ static Standard_Boolean CheckArguments(const IntSurf_Quadric& theS1,
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
if((theVec1.Angle(theVec2) > aMaxAngle) ||
|
||||
(theVec1.Angle(theVec3) > aMaxAngle) ||
|
||||
(theVec2.Angle(theVec3) > aMaxAngle))
|
||||
if((theVec1.Angle(theVec2) > IntPatch_WLineTool::myMaxConcatAngle) ||
|
||||
(theVec1.Angle(theVec3) > IntPatch_WLineTool::myMaxConcatAngle) ||
|
||||
(theVec2.Angle(theVec3) > IntPatch_WLineTool::myMaxConcatAngle))
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
@@ -907,6 +909,20 @@ static Standard_Boolean CheckArguments(const IntSurf_Quadric& theS1,
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CheckArgumentsToJoin
|
||||
//purpose : Check if joining is possible
|
||||
// (see IntPatch_WLineTool::JoinWLines)
|
||||
//=======================================================================
|
||||
Standard_Boolean CheckArgumentsToJoin(const gp_Vec& theVec1,
|
||||
const gp_Vec& theVec2)
|
||||
{
|
||||
// [0, PI] - range
|
||||
const Standard_Real anAngle = theVec1.Angle(theVec2);
|
||||
|
||||
return (anAngle < IntPatch_WLineTool::myMaxConcatAngle);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ExtendTwoWLFirstFirst
|
||||
//purpose : Performs extending theWLine1 and theWLine2 through their
|
||||
@@ -932,10 +948,10 @@ static void ExtendTwoWLFirstFirst(const IntSurf_Quadric& theS1,
|
||||
Standard_Boolean &theHasBeenJoined)
|
||||
{
|
||||
IntSurf_PntOn2S aPOn2S;
|
||||
if(!CheckArguments(theS1, theS2, thePtWL1, thePtWL2, aPOn2S,
|
||||
theVec1, theVec2, theVec3,
|
||||
theBoxS1, theBoxS2, theToler3D,
|
||||
theU1Period, theU2Period, theV1Period, theV2Period))
|
||||
if(!CheckArgumentsToExtend(theS1, theS2, thePtWL1, thePtWL2, aPOn2S,
|
||||
theVec1, theVec2, theVec3,
|
||||
theBoxS1, theBoxS2, theToler3D,
|
||||
theU1Period, theU2Period, theV1Period, theV2Period))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1006,10 +1022,10 @@ static void ExtendTwoWLFirstLast(const IntSurf_Quadric& theS1,
|
||||
Standard_Boolean &theHasBeenJoined)
|
||||
{
|
||||
IntSurf_PntOn2S aPOn2S;
|
||||
if(!CheckArguments(theS1, theS2, thePtWL1, thePtWL2, aPOn2S,
|
||||
theVec1, theVec2, theVec3,
|
||||
theBoxS1, theBoxS2, theToler3D,
|
||||
theU1Period, theU2Period, theV1Period, theV2Period))
|
||||
if(!CheckArgumentsToExtend(theS1, theS2, thePtWL1, thePtWL2, aPOn2S,
|
||||
theVec1, theVec2, theVec3,
|
||||
theBoxS1, theBoxS2, theToler3D,
|
||||
theU1Period, theU2Period, theV1Period, theV2Period))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1078,10 +1094,10 @@ static void ExtendTwoWLLastFirst(const IntSurf_Quadric& theS1,
|
||||
Standard_Boolean &theHasBeenJoined)
|
||||
{
|
||||
IntSurf_PntOn2S aPOn2S;
|
||||
if(!CheckArguments(theS1, theS2, thePtWL1, thePtWL2, aPOn2S,
|
||||
theVec1, theVec2, theVec3,
|
||||
theBoxS1, theBoxS2, theToler3D,
|
||||
theU1Period, theU2Period, theV1Period, theV2Period))
|
||||
if(!CheckArgumentsToExtend(theS1, theS2, thePtWL1, thePtWL2, aPOn2S,
|
||||
theVec1, theVec2, theVec3,
|
||||
theBoxS1, theBoxS2, theToler3D,
|
||||
theU1Period, theU2Period, theV1Period, theV2Period))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1146,10 +1162,10 @@ static void ExtendTwoWLLastLast(const IntSurf_Quadric& theS1,
|
||||
Standard_Boolean &theHasBeenJoined)
|
||||
{
|
||||
IntSurf_PntOn2S aPOn2S;
|
||||
if(!CheckArguments(theS1, theS2, thePtWL1, thePtWL2, aPOn2S,
|
||||
theVec1, theVec2, theVec3,
|
||||
theBoxS1, theBoxS2, theToler3D,
|
||||
theU1Period, theU2Period, theV1Period, theV2Period))
|
||||
if(!CheckArgumentsToExtend(theS1, theS2, thePtWL1, thePtWL2, aPOn2S,
|
||||
theVec1, theVec2, theVec3,
|
||||
theBoxS1, theBoxS2, theToler3D,
|
||||
theU1Period, theU2Period, theV1Period, theV2Period))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1387,10 +1403,19 @@ void IntPatch_WLineTool::JoinWLines(IntPatch_SequenceOfLine& theSlin,
|
||||
{
|
||||
const IntSurf_PntOn2S& aPt1 = aWLine1->Point(2);
|
||||
const IntSurf_PntOn2S& aPt2 = aWLine2->Point(2);
|
||||
if(!IsSeamOrBound(aPt1, aPt2, aPntFWL1, theU1Period, theU2Period,
|
||||
theV1Period, theV2Period, theUfSurf1, theUlSurf1,
|
||||
theVfSurf1, theVlSurf1, theUfSurf2, theUlSurf2,
|
||||
theVfSurf2, theVlSurf2))
|
||||
Standard_Boolean aCond =
|
||||
CheckArgumentsToJoin(gp_Vec(aPntFWL1.Value(), aPt1.Value()),
|
||||
gp_Vec(aPt2.Value(), aPntFWL2.Value()));
|
||||
|
||||
aCond = aCond && !IsSeamOrBound(aPt1, aPt2, aPntFWL1,
|
||||
theU1Period, theU2Period,
|
||||
theV1Period, theV2Period,
|
||||
theUfSurf1, theUlSurf1,
|
||||
theVfSurf1, theVlSurf1,
|
||||
theUfSurf2, theUlSurf2,
|
||||
theVfSurf2, theVlSurf2);
|
||||
|
||||
if(aCond)
|
||||
{
|
||||
aWLine1->ClearVertexes();
|
||||
for(Standard_Integer aNPt = 1; aNPt <= aNbPntsWL2; aNPt++)
|
||||
@@ -1413,10 +1438,20 @@ void IntPatch_WLineTool::JoinWLines(IntPatch_SequenceOfLine& theSlin,
|
||||
{
|
||||
const IntSurf_PntOn2S& aPt1 = aWLine1->Point(2);
|
||||
const IntSurf_PntOn2S& aPt2 = aWLine2->Point(aNbPntsWL2-1);
|
||||
if(!IsSeamOrBound(aPt1, aPt2, aPntFWL1, theU1Period, theU2Period,
|
||||
theV1Period, theV2Period, theUfSurf1, theUlSurf1,
|
||||
theVfSurf1, theVlSurf1, theUfSurf2, theUlSurf2,
|
||||
theVfSurf2, theVlSurf2))
|
||||
|
||||
Standard_Boolean aCond =
|
||||
CheckArgumentsToJoin(gp_Vec(aPntFWL1.Value(), aPt1.Value()),
|
||||
gp_Vec(aPt2.Value(), aPntLWL2.Value()));
|
||||
|
||||
aCond = aCond && !IsSeamOrBound(aPt1, aPt2, aPntFWL1,
|
||||
theU1Period, theU2Period,
|
||||
theV1Period, theV2Period,
|
||||
theUfSurf1, theUlSurf1,
|
||||
theVfSurf1, theVlSurf1,
|
||||
theUfSurf2, theUlSurf2,
|
||||
theVfSurf2, theVlSurf2);
|
||||
|
||||
if(aCond)
|
||||
{
|
||||
aWLine1->ClearVertexes();
|
||||
for(Standard_Integer aNPt = aNbPntsWL2; aNPt >= 1; aNPt--)
|
||||
@@ -1439,10 +1474,20 @@ void IntPatch_WLineTool::JoinWLines(IntPatch_SequenceOfLine& theSlin,
|
||||
{
|
||||
const IntSurf_PntOn2S& aPt1 = aWLine1->Point(aNbPntsWL1-1);
|
||||
const IntSurf_PntOn2S& aPt2 = aWLine2->Point(2);
|
||||
if(!IsSeamOrBound(aPt1, aPt2, aPntLWL1, theU1Period, theU2Period,
|
||||
theV1Period, theV2Period, theUfSurf1, theUlSurf1,
|
||||
theVfSurf1, theVlSurf1, theUfSurf2, theUlSurf2,
|
||||
theVfSurf2, theVlSurf2))
|
||||
|
||||
Standard_Boolean aCond =
|
||||
CheckArgumentsToJoin(gp_Vec(aPt1.Value(), aPntLWL1.Value()),
|
||||
gp_Vec(aPntFWL2.Value(), aPt2.Value()));
|
||||
|
||||
aCond = aCond && !IsSeamOrBound(aPt1, aPt2, aPntLWL1,
|
||||
theU1Period, theU2Period,
|
||||
theV1Period, theV2Period,
|
||||
theUfSurf1, theUlSurf1,
|
||||
theVfSurf1, theVlSurf1,
|
||||
theUfSurf2, theUlSurf2,
|
||||
theVfSurf2, theVlSurf2);
|
||||
|
||||
if(aCond)
|
||||
{
|
||||
aWLine1->ClearVertexes();
|
||||
for(Standard_Integer aNPt = 1; aNPt <= aNbPntsWL2; aNPt++)
|
||||
@@ -1465,10 +1510,20 @@ void IntPatch_WLineTool::JoinWLines(IntPatch_SequenceOfLine& theSlin,
|
||||
{
|
||||
const IntSurf_PntOn2S& aPt1 = aWLine1->Point(aNbPntsWL1-1);
|
||||
const IntSurf_PntOn2S& aPt2 = aWLine2->Point(aNbPntsWL2-1);
|
||||
if(!IsSeamOrBound(aPt1, aPt2, aPntLWL1, theU1Period, theU2Period,
|
||||
theV1Period, theV2Period, theUfSurf1, theUlSurf1,
|
||||
theVfSurf1, theVlSurf1, theUfSurf2, theUlSurf2,
|
||||
theVfSurf2, theVlSurf2))
|
||||
|
||||
Standard_Boolean aCond =
|
||||
CheckArgumentsToJoin(gp_Vec(aPt1.Value(), aPntLWL1.Value()),
|
||||
gp_Vec(aPntLWL2.Value(), aPt2.Value()));
|
||||
|
||||
aCond = aCond && !IsSeamOrBound(aPt1, aPt2, aPntLWL1,
|
||||
theU1Period, theU2Period,
|
||||
theV1Period, theV2Period,
|
||||
theUfSurf1, theUlSurf1,
|
||||
theVfSurf1, theVlSurf1,
|
||||
theUfSurf2, theUlSurf2,
|
||||
theVfSurf2, theVlSurf2);
|
||||
|
||||
if(aCond)
|
||||
{
|
||||
aWLine1->ClearVertexes();
|
||||
for(Standard_Integer aNPt = aNbPntsWL2; aNPt >= 1; aNPt--)
|
||||
|
@@ -96,6 +96,9 @@ public:
|
||||
const Standard_Real theV2Period,
|
||||
const Bnd_Box2d& theBoxS1,
|
||||
const Bnd_Box2d& theBoxS2);
|
||||
|
||||
//! Max angle to concatenate two WLines to avoid result with C0-continuity
|
||||
static const Standard_Real myMaxConcatAngle;
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user