Standard_Boolean Adaptor3d_CurveOnSurface::IsPeriodic() const
{
+ if (myType == GeomAbs_Circle ||
+ myType == GeomAbs_Ellipse)
+ return Standard_True;
+
return myCurve->IsPeriodic();
}
Standard_Real Adaptor3d_CurveOnSurface::Period() const
{
+ if (myType == GeomAbs_Circle ||
+ myType == GeomAbs_Ellipse)
+ return (2.*M_PI);
+
return myCurve->Period();
}
Standard_EXPORT void FillShrunkData (Handle(BOPDS_PaveBlock)& thePB);
- Standard_EXPORT void FillShrunkData (const TopAbs_ShapeEnum theType1, const TopAbs_ShapeEnum theType2);
+ Standard_EXPORT void FillShrunkData (const TopAbs_ShapeEnum theType1,
+ const TopAbs_ShapeEnum theType2);
//! Analyzes the results of computation of the valid range for the
//! pave block and in case of error adds the warning status, otherwise
const Handle(NCollection_BaseAllocator)& theAllocator,
const Standard_Boolean theIsEEIntersection = Standard_True);
- Standard_EXPORT Standard_Boolean CheckFacePaves (const TopoDS_Vertex& theVnew, const TColStd_MapOfInteger& theMIF);
+ Standard_EXPORT Standard_Boolean CheckFacePaves (const TopoDS_Vertex& theVnew,
+ const TColStd_MapOfInteger& theMIF);
- Standard_EXPORT static Standard_Boolean CheckFacePaves (const Standard_Integer theN, const TColStd_MapOfInteger& theMIFOn, const TColStd_MapOfInteger& theMIFIn);
+ Standard_EXPORT static Standard_Boolean CheckFacePaves (const Standard_Integer theN,
+ const TColStd_MapOfInteger& theMIFOn,
+ const TColStd_MapOfInteger& theMIFIn);
- Standard_EXPORT Standard_Boolean IsExistingVertex (const gp_Pnt& theP, const Standard_Real theTol, const TColStd_MapOfInteger& theMVOn) const;
+ Standard_EXPORT Standard_Boolean IsExistingVertex (const gp_Pnt& theP,
+ const Standard_Real theTol,
+ const TColStd_MapOfInteger& theMVOn) const;
//! Checks and puts paves from <theMVOnIn> on the curve <theNC>.
//! 1 - checks only EE;
//! 2 - checks only EF;
//! other - checks both types of intersections.
- Standard_EXPORT Standard_Boolean ExtendedTolerance (const Standard_Integer nV, const TColStd_MapOfInteger& aMI, Standard_Real& aTolVExt, const Standard_Integer aType = 0);
+ Standard_EXPORT Standard_Boolean ExtendedTolerance (const Standard_Integer nV,
+ const TColStd_MapOfInteger& aMI,
+ Standard_Real& aTolVExt,
+ const Standard_Integer aType = 0);
Standard_EXPORT void PutBoundPaveOnCurve(const TopoDS_Face& theF1,
const TopoDS_Face& theF2,
const TopTools_IndexedMapOfShape& theVertsOnRejectedPB,
const Handle(NCollection_BaseAllocator)& theAllocator);
- Standard_EXPORT void FindPaveBlocks (const Standard_Integer theV, const Standard_Integer theF, BOPDS_ListOfPaveBlock& theLPB);
+ Standard_EXPORT void FindPaveBlocks (const Standard_Integer theV,
+ const Standard_Integer theF,
+ BOPDS_ListOfPaveBlock& theLPB);
- Standard_EXPORT void FillPaves (const Standard_Integer theV, const Standard_Integer theE, const Standard_Integer theF, const BOPDS_ListOfPaveBlock& theLPB, const Handle(BOPDS_PaveBlock)& thePB);
+ Standard_EXPORT void FillPaves (const Standard_Integer theV,
+ const Standard_Integer theE,
+ const Standard_Integer theF,
+ const BOPDS_ListOfPaveBlock& theLPB,
+ const Handle(BOPDS_PaveBlock)& thePB);
Standard_EXPORT void MakeSplitEdge (const Standard_Integer theV, const Standard_Integer theF);
- Standard_EXPORT void GetEFPnts (const Standard_Integer nF1, const Standard_Integer nF2, IntSurf_ListOfPntOn2S& aListOfPnts);
+ Standard_EXPORT void GetEFPnts (const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ IntSurf_ListOfPntOn2S& aListOfPnts);
//! Checks and puts paves created in EF intersections on the curve <theNC>.
- Standard_EXPORT void PutEFPavesOnCurve (BOPDS_Curve& theNC,
- const TColStd_MapOfInteger& theMI,
- const TColStd_MapOfInteger& theMVEF,
- TColStd_DataMapOfIntegerReal& theMVTol,
- TColStd_DataMapOfIntegerListOfInteger& aDMVLV);
+ Standard_EXPORT void PutEFPavesOnCurve (const BOPDS_VectorOfCurve& theVC,
+ const Standard_Integer theIndex,
+ const TColStd_MapOfInteger& theMI,
+ const TColStd_MapOfInteger& theMVEF,
+ TColStd_DataMapOfIntegerReal& theMVTol,
+ TColStd_DataMapOfIntegerListOfInteger& aDMVLV);
//! Puts stick paves on the curve <theNC>
Standard_EXPORT void PutStickPavesOnCurve (const TopoDS_Face& aF1,
- const TopoDS_Face& aF2,
- const TColStd_MapOfInteger& theMI,
- BOPDS_Curve& theNC,
- const TColStd_MapOfInteger& theMVStick,
- TColStd_DataMapOfIntegerReal& theMVTol,
- TColStd_DataMapOfIntegerListOfInteger& aDMVLV);
+ const TopoDS_Face& aF2,
+ const TColStd_MapOfInteger& theMI,
+ const BOPDS_VectorOfCurve& theVC,
+ const Standard_Integer theIndex,
+ const TColStd_MapOfInteger& theMVStick,
+ TColStd_DataMapOfIntegerReal& theMVTol,
+ TColStd_DataMapOfIntegerListOfInteger& aDMVLV);
//! Collects indices of vertices created in all intersections between
//! two faces (<nF1> and <nF2>) to the map <theMVStick>.
//! Also, it collects indices of EF vertices to the <theMVEF> map
//! and indices of all subshapes of these two faces to the <theMI> map.
- Standard_EXPORT void GetStickVertices (const Standard_Integer nF1, const Standard_Integer nF2, TColStd_MapOfInteger& theMVStick, TColStd_MapOfInteger& theMVEF, TColStd_MapOfInteger& theMI);
+ Standard_EXPORT void GetStickVertices (const Standard_Integer nF1,
+ const Standard_Integer nF2,
+ TColStd_MapOfInteger& theMVStick,
+ TColStd_MapOfInteger& theMVEF,
+ TColStd_MapOfInteger& theMI);
//! Collects index nF and indices of all subshapes of the shape with index <nF>
//! Removes indices of vertices that are already on the
//! curve <theNC> from the map <theMV>.
//! It is used in PutEFPavesOnCurve and PutStickPavesOnCurve methods.
- Standard_EXPORT void RemoveUsedVertices (const BOPDS_Curve& theNC, TColStd_MapOfInteger& theMV);
+ Standard_EXPORT void RemoveUsedVertices (const BOPDS_VectorOfCurve& theVC, TColStd_MapOfInteger& theMV);
//! Puts the pave nV on the curve theNC.
const BOPAlgo_DataMapOfPaveBlockListOfInteger& thePBFacesMap);
//! Treatment of vertices that were created in EE intersections.
- Standard_EXPORT void TreatNewVertices(const BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB, TopTools_IndexedDataMapOfShapeListOfShape& theImages);
+ Standard_EXPORT void TreatNewVertices(const BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
+ TopTools_IndexedDataMapOfShapeListOfShape& theImages);
//! Put paves on the curve <aBC> in case when <aBC>
//! Keeps data for post treatment
- Standard_EXPORT void PreparePostTreatFF (const Standard_Integer aInt, const Standard_Integer aCur, const Handle(BOPDS_PaveBlock)& aPB, BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB, TopTools_DataMapOfShapeInteger& aMVI, BOPDS_ListOfPaveBlock& aLPB);
+ Standard_EXPORT void PreparePostTreatFF (const Standard_Integer aInt,
+ const Standard_Integer aCur,
+ const Handle(BOPDS_PaveBlock)& aPB,
+ BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& aMSCPB,
+ TopTools_DataMapOfShapeInteger& aMVI,
+ BOPDS_ListOfPaveBlock& aLPB);
//! Updates the information about faces
Standard_EXPORT void UpdateFaceInfo(BOPDS_DataMapOfPaveBlockListOfPaveBlock& theDME,
//! Creates new edge from the edge nE with vertices nV1 and nV2
//! and returns the index of that new edge in the DS.
- Standard_EXPORT Standard_Integer SplitEdge (const Standard_Integer nE, const Standard_Integer nV1, const Standard_Real aT1, const Standard_Integer nV2, const Standard_Real aT2);
+ Standard_EXPORT Standard_Integer SplitEdge (const Standard_Integer nE,
+ const Standard_Integer nV1,
+ const Standard_Real aT1,
+ const Standard_Integer nV2,
+ const Standard_Real aT2);
//! Updates pave blocks which have the paves with indices contained
Standard_EXPORT void CheckSelfInterference();
//! Adds the warning about failed intersection of pair of sub-shapes
- Standard_EXPORT void AddIntersectionFailedWarning(const TopoDS_Shape& theS1, const TopoDS_Shape& theS2);
+ Standard_EXPORT void AddIntersectionFailedWarning(const TopoDS_Shape& theS1,
+ const TopoDS_Shape& theS2);
//! Repeat intersection of sub-shapes with increased vertices.
Standard_EXPORT void RepeatIntersection();
BOPDS_Curve& aNC=aVC.ChangeValue(j);
const IntTools_Curve& aIC=aNC.Curve();
//
- PutStickPavesOnCurve(aF1, aF2, aMI, aNC, aMVStick, aMVTol, aDMVLV);
+ PutStickPavesOnCurve(aF1, aF2, aMI, aVC, j, aMVStick, aMVTol, aDMVLV);
//904/F7
if (aNbC == 1) {
- PutEFPavesOnCurve(aNC, aMI, aMVEF, aMVTol, aDMVLV);
+ PutEFPavesOnCurve(aVC, j, aMI, aMVEF, aMVTol, aDMVLV);
}
//
if (aIC.HasBounds()) {
TColStd_MapOfInteger aMV, aMVEF, aMI;
GetStickVertices(nF1, nF2, aMV, aMVEF, aMI);
BOPDS_VectorOfCurve& aVC = aFF.ChangeCurves();
- Standard_Integer aNbC = aVC.Length();
- for (j = 0; j < aNbC; j++)
- {
- BOPDS_Curve& aNC = aVC.ChangeValue(j);
- RemoveUsedVertices(aNC, aMV);
- }
+ RemoveUsedVertices (aVC, aMV);
TColStd_MapIteratorOfMapOfInteger itmap(aMV);
for(; itmap.More(); itmap.Next())
//purpose :
//=======================================================================
static void getBoundPaves(const BOPDS_DS* theDS,
- BOPDS_Curve& theNC,
+ const BOPDS_Curve& theNC,
Standard_Integer theNV[2])
{
theNV[0] = theNV[1] = -1;
// get extreme paves
- Handle(BOPDS_PaveBlock)& aPB = theNC.ChangePaveBlock1();
+ const Handle(BOPDS_PaveBlock)& aPB = theNC.PaveBlocks().First();
const BOPDS_ListOfPave& aLP = aPB->ExtPaves();
Standard_Integer aNbEP = aLP.Extent();
if (aNbEP == 0)
//purpose :
//=======================================================================
void BOPAlgo_PaveFiller::PutEFPavesOnCurve
- (BOPDS_Curve& aNC,
+ (const BOPDS_VectorOfCurve& theVC,
+ const Standard_Integer theIndex,
const TColStd_MapOfInteger& aMI,
const TColStd_MapOfInteger& aMVEF,
TColStd_DataMapOfIntegerReal& aMVTol,
return;
}
//
+ const BOPDS_Curve& aNC = theVC.Value(theIndex);
const IntTools_Curve& aIC=aNC.Curve();
GeomAbs_CurveType aTypeC;
aTypeC=aIC.Type();
TColStd_MapOfInteger aMV;
//
aMV.Assign(aMVEF);
- RemoveUsedVertices(aNC, aMV);
+ RemoveUsedVertices(theVC, aMV);
if (!aMV.Extent()) {
return;
}
(const TopoDS_Face& aF1,
const TopoDS_Face& aF2,
const TColStd_MapOfInteger& aMI,
- BOPDS_Curve& aNC,
+ const BOPDS_VectorOfCurve& theVC,
+ const Standard_Integer theIndex,
const TColStd_MapOfInteger& aMVStick,
TColStd_DataMapOfIntegerReal& aMVTol,
TColStd_DataMapOfIntegerListOfInteger& aDMVLV)
{
+ const BOPDS_Curve& aNC = theVC.Value(theIndex);
// Get numbers of vertices assigned to the ends of the curve
Standard_Integer aBndNV[2];
getBoundPaves(myDS, aNC, aBndNV);
}
TColStd_MapOfInteger aMV;
aMV.Assign(aMVStick);
- RemoveUsedVertices(aNC, aMV);
+ RemoveUsedVertices(theVC, aMV);
//
if (!aMV.Extent()) {
return;
Handle(Geom_Surface) aS2=BRep_Tool::Surface(aF2);
//
const IntTools_Curve& aIC=aNC.Curve();
- //if (aTypeC==GeomAbs_BezierCurve || aTypeC==GeomAbs_BSplineCurve) {
Handle(Geom2d_Curve) aC2D[2];
//
aC2D[0]=aIC.FirstCurve2d();
aInt->Indices(nS1, nS2);
if(aMI.Contains(nS1) && aMI.Contains(nS2)) {
nVNew = aInt->IndexNew();
+ myDS->HasShapeSD (nVNew, nVNew);
aMVStick.Add(nVNew);
}
}
aInt.Indices(nS1, nS2);
if(aMI.Contains(nS1) && aMI.Contains(nS2)) {
nVNew = aInt.IndexNew();
+ myDS->HasShapeSD (nVNew, nVNew);
aMVStick.Add(nVNew);
aMVEF.Add(nVNew);
}
// function: RemoveUsedVertices
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::RemoveUsedVertices(const BOPDS_Curve& aNC,
+void BOPAlgo_PaveFiller::RemoveUsedVertices(const BOPDS_VectorOfCurve& aVC,
TColStd_MapOfInteger& aMV)
{
if (aMV.IsEmpty())
return;
- const BOPDS_ListOfPaveBlock& aLPBC = aNC.PaveBlocks();
- BOPDS_ListIteratorOfListOfPaveBlock itPB(aLPBC);
- for (; itPB.More(); itPB.Next())
+ for (Standard_Integer i = 0; i < aVC.Length(); ++i)
{
- const Handle(BOPDS_PaveBlock)& aPB = itPB.Value();
- const BOPDS_ListOfPave& aLP = aPB->ExtPaves();
- BOPDS_ListIteratorOfListOfPave itLP(aLP);
- for (; itLP.More(); itLP.Next())
- aMV.Remove(itLP.Value().Index());
-
- aMV.Remove(aPB->Pave1().Index());
- aMV.Remove(aPB->Pave2().Index());
+ const BOPDS_Curve& aNC = aVC.Value(i);
+ const BOPDS_ListOfPaveBlock& aLPBC = aNC.PaveBlocks();
+ BOPDS_ListIteratorOfListOfPaveBlock itPB(aLPBC);
+ for (; itPB.More(); itPB.Next())
+ {
+ const Handle(BOPDS_PaveBlock)& aPB = itPB.Value();
+ const BOPDS_ListOfPave& aLP = aPB->ExtPaves();
+ BOPDS_ListIteratorOfListOfPave itLP(aLP);
+ for (; itLP.More(); itLP.Next())
+ aMV.Remove(itLP.Value().Index());
+
+ aMV.Remove(aPB->Pave1().Index());
+ aMV.Remove(aPB->Pave2().Index());
+ }
}
}
TColStd_ListOfReal& theParams) const
{
const Standard_Real aPIpPI = M_PI + M_PI,
- anEpsAng = 1.e-8,
- aSqTolPrecision=1.0e-8;
+ anEpsAng = 1.e-8,
+ InternalPrecision = 1.e-8, //precision of internal algorithm of values computation
+ aSqTolPrecision = Precision::SquareConfusion(); //for boundary points to check their coincidence with others
+
Standard_Real aTheta = 0.0;
//
switch (typequadric)
InternalUVValue(aParams[i], U, V, A, B, C,
cost, sint, SigneSqrtDis);
const gp_Pnt aP(InternalValue(U, V));
- if (aP.SquareDistance(theP) < aSqTolPrecision)
+
+ Standard_Real aSqTol;
+ if (aParams[i] == aTheta ||
+ (TwoCurves && aParams[i] == DomainSup + DomainSup - aTheta))
+ aSqTol = InternalPrecision;
+ else
+ aSqTol = aSqTolPrecision;
+
+ if (aP.SquareDistance(theP) < aSqTol)
{
theParams.Append(aParams[i]);
}
// commercial license or contractual agreement.
#include <algorithm>
+#include <memory>
#include <TopoDS_Edge.hxx>
#include <Geom_Curve.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <Adaptor3d_HSurface.hxx>
+#include <Adaptor3d_CurveOnSurface.hxx>
+#include <Adaptor3d_HCurveOnSurface.hxx>
#include <GeomAbs_SurfaceType.hxx>
#include <BRep_Tool.hxx>
#include <Geom_Line.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_CylindricalSurface.hxx>
+#include <Geom_ConicalSurface.hxx>
+#include <Geom_SphericalSurface.hxx>
+#include <Geom_ToroidalSurface.hxx>
#include <gp_Lin.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Lin.hxx>
#include <GeomAdaptor_Curve.hxx>
+#include <GeomAdaptor_HSurface.hxx>
#include <Precision.hxx>
#include <Extrema_ExtCC.hxx>
+//#include <Extrema_ExtCS.hxx>
#include <Extrema_POnCurv.hxx>
+#include <IntCurveSurface_HInter.hxx>
#include <math_FunctionSample.hxx>
#include <math_FunctionAllRoots.hxx>
#include <math_Vector.hxx>
#include <NCollection_Array1.hxx>
+#ifdef OCCT_DEBUG
+#include <Geom_Circle.hxx>
+#include <Geom_Ellipse.hxx>
+#include <Geom_Hyperbola.hxx>
+#include <Geom_Parabola.hxx>
+#include <Geom_BezierCurve.hxx>
+#include <Geom_BSplineCurve.hxx>
+#include <GeomLib.hxx>
+#endif
+
+
+static Standard_Boolean IsDegenerated(const Handle(Adaptor3d_HCurveOnSurface)& theCurve);
+static Standard_Boolean IsDegenerated(const IntSurf_Quadric& theQuadric);
+
static void FindVertex (const TheArc&,
const Handle(TheTopolTool)&,
TheFunction&,
}
}
+Standard_Boolean IsDegenerated(const Handle(Adaptor3d_HCurveOnSurface)& theCurve)
+{
+ if (theCurve->GetType() == GeomAbs_Circle)
+ {
+ gp_Circ aCirc = theCurve->Circle();
+ if (aCirc.Radius() <= Precision::Confusion())
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+Standard_Boolean IsDegenerated(const IntSurf_Quadric& theQuadric)
+{
+ GeomAbs_SurfaceType TypeQuad = theQuadric.TypeQuadric();
+ if (TypeQuad == GeomAbs_Cone)
+ {
+ gp_Cone aCone = theQuadric.Cone();
+ Standard_Real aSemiAngle = Abs(aCone.SemiAngle());
+ if (aSemiAngle < 0.02 || aSemiAngle > 1.55)
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
class SolInfo
{
public:
myValue = theSolution.GetPoint(theIndex);
}
+ void Init(const IntCurveSurface_HInter& theSolution, const Standard_Integer theIndex)
+ {
+ myMathIndex = theIndex;
+ myValue = theSolution.Point(theIndex).W();
+ }
+
Standard_Real Value() const
{
return myValue;
// des arcs ayant un point debut et un point de fin (intervalle ferme de
// parametrage).
- Standard_Integer i,Nbi,Nbp;
+ Standard_Integer i, Nbi = 0, Nbp = 0;
gp_Pnt ptdeb,ptfin;
Standard_Real pardeb = 0., parfin = 0.;
Standard_Integer ideb,ifin,range,ranged,rangef;
-
// Creer l echantillonage (math_FunctionSample ou classe heritant)
// Appel a math_FunctionAllRoots
// Standard_Integer NbEchant = TheSOBTool::NbSamplesOnArc(A);
Standard_Integer NbEchant = Func.NbSamples();
-
+ if(NbEchant<100) NbEchant = 100; //-- lbr le 22 Avril 96
+ //-- Toujours des pbs
+
//-- Modif 24 Aout 93 -----------------------------
Standard_Real nTolTangency = TolTangency;
if((Pfin - Pdeb) < (TolTangency*10.0)) {
if(EpsX>(nTolTangency+nTolTangency)) {
EpsX = nTolTangency * 0.1;
}
+
//--------------------------------------------------
//-- Plante avec un edge avec 2 Samples
//-- dont les extremites son solutions (f=0)
//-- if(NbEchant<3) NbEchant = 3; //-- lbr le 19 Avril 95
//--------------------------------------------------
Standard_Real para=0,dist,maxdist;
- /* if(NbEchant<20) NbEchant = 20; //-- lbr le 22 Avril 96
- //-- Toujours des pbs
- */
- if(NbEchant<100) NbEchant = 100; //-- lbr le 22 Avril 96
- //-- Toujours des pbs
//-------------------------------------------------------------- REJECTIONS le 15 oct 98
Standard_Boolean Rejection=Standard_True;
Arcsol=Standard_False;
- if(Rejection==Standard_False) {
+ if(Rejection==Standard_False)
+ {
+ const IntSurf_Quadric& aQuadric = Func.Quadric();
+ GeomAbs_SurfaceType TypeQuad = aQuadric.TypeQuadric();
+
+ IntCurveSurface_HInter IntCS;
+ Standard_Boolean IsIntCSdone = Standard_False;
+ TColStd_SequenceOfReal Params;
+
+#if (defined(_MSC_VER) && (_MSC_VER < 1600))
+ std::auto_ptr<math_FunctionAllRoots> pSol;
+#else
+ std::unique_ptr<math_FunctionAllRoots> pSol;
+#endif
+
math_FunctionSample Echant(Pdeb,Pfin,NbEchant);
Standard_Boolean aelargir=Standard_True;
maxdist = TolBoundary;
}
- math_FunctionAllRoots Sol(Func,Echant,EpsX,maxdist,maxdist); //-- TolBoundary,nTolTangency);
-
- if (!Sol.IsDone()) {throw Standard_Failure();}
+ if (TypeQuad != GeomAbs_OtherSurface) //intersection of boundary curve and quadric surface
+ {
+ //Exact solution
+ Handle(Adaptor3d_HSurface) aSurf = Func.Surface();
+ Adaptor3d_CurveOnSurface ConS(A, aSurf);
+ GeomAbs_CurveType TypeConS = ConS.GetType();
+#ifdef OCCT_DEBUG
+ Handle(Geom_Curve) CurveConS;
+ switch(TypeConS)
+ {
+ case GeomAbs_Line:
+ {
+ CurveConS = new Geom_Line(ConS.Line());
+ break;
+ }
+ case GeomAbs_Circle:
+ {
+ CurveConS = new Geom_Circle(ConS.Circle());
+ break;
+ }
+ case GeomAbs_Ellipse:
+ {
+ CurveConS = new Geom_Ellipse(ConS.Ellipse());
+ break;
+ }
+ case GeomAbs_Hyperbola:
+ {
+ CurveConS = new Geom_Hyperbola(ConS.Hyperbola());
+ break;
+ }
+ case GeomAbs_Parabola:
+ {
+ CurveConS = new Geom_Parabola(ConS.Parabola());
+ break;
+ }
+ case GeomAbs_BezierCurve:
+ {
+ CurveConS = ConS.Bezier();
+ break;
+ }
+ case GeomAbs_BSplineCurve:
+ {
+ CurveConS = ConS.BSpline();
+ break;
+ }
+ default:
+ {
+ Standard_Real MaxDeviation, AverageDeviation;
+ GeomLib::BuildCurve3d(1.e-5, ConS, ConS.FirstParameter(), ConS.LastParameter(),
+ CurveConS, MaxDeviation, AverageDeviation);
+ break;
+ }
+ }
+#endif
+ Handle(Adaptor3d_HCurveOnSurface) HConS = new Adaptor3d_HCurveOnSurface(ConS);
+ Handle(Geom_Surface) QuadSurf;
+ switch (TypeQuad)
+ {
+ case GeomAbs_Plane:
+ {
+ QuadSurf = new Geom_Plane(aQuadric.Plane());
+ break;
+ }
+ case GeomAbs_Cylinder:
+ {
+ QuadSurf = new Geom_CylindricalSurface(aQuadric.Cylinder());
+ break;
+ }
+ case GeomAbs_Cone:
+ {
+ QuadSurf = new Geom_ConicalSurface(aQuadric.Cone());
+ break;
+ }
+ case GeomAbs_Sphere:
+ {
+ QuadSurf = new Geom_SphericalSurface(aQuadric.Sphere());
+ break;
+ }
+ case GeomAbs_Torus:
+ {
+ QuadSurf = new Geom_ToroidalSurface(aQuadric.Torus());
+ break;
+ }
+ default:
+ break;
+ }
+ Handle(GeomAdaptor_HSurface) GAHsurf = new GeomAdaptor_HSurface(QuadSurf);
+
+ if ((TypeConS == GeomAbs_Line ||
+ TypeConS == GeomAbs_Circle ||
+ TypeConS == GeomAbs_Ellipse ||
+ TypeConS == GeomAbs_Parabola ||
+ TypeConS == GeomAbs_Hyperbola) &&
+ TypeQuad != GeomAbs_Torus &&
+ !IsDegenerated(HConS) &&
+ !IsDegenerated(aQuadric))
+ {
+ //exact intersection for only canonic curves and real quadric surfaces
+ IntCS.Perform(HConS, GAHsurf);
+ }
+
+ IsIntCSdone = IntCS.IsDone();
+ if (IsIntCSdone)
+ {
+ Nbp = IntCS.NbPoints();
+ Nbi = IntCS.NbSegments();
+ }
+ //If we have not got intersection, it may be touch with some tolerance,
+ //need to be checked
+ if (Nbp == 0 && Nbi == 0)
+ IsIntCSdone = Standard_False;
- Nbp=Sol.NbPoints();
+ } //if (TypeQuad != GeomAbs_OtherSurface) - intersection of boundary curve and quadric surface
+
+ if (!IsIntCSdone)
+ {
+ pSol.reset(new math_FunctionAllRoots(Func,Echant,EpsX,maxdist,maxdist)); //-- TolBoundary,nTolTangency);
+
+ if (!pSol->IsDone()) {throw Standard_Failure();}
+
+ Nbp=pSol->NbPoints();
+ }
//
//jgv: build solution on the whole boundary
if (RecheckOnRegularity && Nbp > 0 && IsRegularity(A, Domain))
return;
}
}
- }
+ } //if (RecheckOnRegularity && Nbp > 0 && IsRegularity(A, Domain))
////////////////////////////////////////////
//-- detection du cas ou la fonction est quasi tangente et que les
for(i=1;i<=Nbp;i++)
{
- aSI(i).Init(Sol, i);
+ if (IsIntCSdone)
+ aSI(i).Init(IntCS, i);
+ else
+ aSI(i).Init(*pSol, i);
}
std::sort(aSI.begin(), aSI.end());
// But we have 2,3,.. solutions. That is wrong ersult.
// The TreatLC(...) function is dedicated to solve the pb.
// PKV Fri Mar 23 12:17:29 2001
- Standard_Integer ip;
- const IntSurf_Quadric& aQuadric=Func.Quadric();
- ip=TreatLC (A, Domain, aQuadric, TolBoundary, pnt);
+ Standard_Integer ip = TreatLC (A, Domain, aQuadric, TolBoundary, pnt);
if (ip) {
//////////////////////////////////////////////////////////
//modified by NIZNHY-PKV Wed Mar 21 18:34:23 2001 t
dist = Abs(dist);
Standard_Integer anIndx = -1;
- const Standard_Real aParam = Sol.GetPoint(aSI(i).Index());
+ //const Standard_Real aParam = Sol->GetPoint(aSI(i).Index());
+ const Standard_Real aParam = aSI(i).Value();
if (dist < maxdist)
{
- if (Abs(aParam - Pdeb) <= Precision::PConfusion() || Abs(aParam - Pfin) <= Precision::PConfusion())
+ if (!IsIntCSdone &&
+ (Abs(aParam - Pdeb) <= Precision::PConfusion() || Abs(aParam - Pfin) <= Precision::PConfusion()))
{
- Standard_Real aDistTemp = RealLast();
- if (Func.Value(aParam, aDistTemp))
- {
- if (Abs(aDistTemp) < maxdist)
- {
- anIndx = Sol.GetPointState(aSI(i).Index());
- }
- }
+ anIndx = pSol->GetPointState(aSI(i).Index());
}
}
// Traiter les extremites comme des points
// Ajouter intervalle dans la liste des segments
- Nbi=Sol.NbIntervals();
-
+ if (!IsIntCSdone)
+ Nbi = pSol->NbIntervals();
if (!RecheckOnRegularity && Nbp) {
//--cout<<" Debug : IntStart_SearchOnBoundaries_1.gxx :Nbp>0 0 <- Nbi "<<Nbi<<endl;
IntStart_TheSegment newseg;
newseg.SetValue(A);
// Recuperer point debut et fin, et leur parametre.
- Sol.GetInterval(i,pardeb,parfin);
- Sol.GetIntervalState(i,ideb,ifin);
-
-
- //-- cout<<" Debug : IntStart_SearchOnBoundaries_1.gxx : i= "<<i<<" ParDeb:"<<pardeb<<" ParFin:"<<parfin<<endl;
+ if (IsIntCSdone)
+ {
+ IntCurveSurface_IntersectionSegment IntSeg = IntCS.Segment(i);
+ IntCurveSurface_IntersectionPoint End1 = IntSeg.FirstPoint();
+ IntCurveSurface_IntersectionPoint End2 = IntSeg.SecondPoint();
+ pardeb = End1.W();
+ parfin = End2.W();
+ ptdeb = End1.Pnt();
+ ptfin = End2.Pnt();
+ }
+ else
+ {
+ pSol->GetInterval(i,pardeb,parfin);
+ pSol->GetIntervalState(i,ideb,ifin);
- ptdeb=Func.Valpoint(ideb);
- ptfin=Func.Valpoint(ifin);
+ //-- cout<<" Debug : IntStart_SearchOnBoundaries_1.gxx : i= "<<i<<" ParDeb:"<<pardeb<<" ParFin:"<<parfin<<endl;
+
+ ptdeb=Func.Valpoint(ideb);
+ ptfin=Func.Valpoint(ifin);
+ }
PointProcess(ptdeb,pardeb,A,Domain,pnt,TolBoundary,ranged);
newseg.SetLimitPoint(pnt.Value(ranged),Standard_True);
set nbshapes_expected "
Number of shapes in result
- VERTEX : 6
- EDGE : 7
+ VERTEX : 7
+ EDGE : 8
WIRE : 2
FACE : 2
SHELL : 1
SOLID : 0
COMPSOLID : 0
COMPOUND : 0
- SHAPE : 18
+ SHAPE : 20
"
checknbshapes result -ref ${nbshapes_expected} -t -m "Result obtained by Boolean cut operation"
+set tolres [checkmaxtol result]
+
+if { ${tolres} > 5.e-7} {
+ puts "Error: bad tolerance of result"
+}
+
checkview -display result -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "==============================================="
+puts "OCC30590: Wrong result of Boolean Cut algorithm"
+puts "==============================================="
+puts ""
+
+binrestore [locate_data_file bug30590_cut_argument1.bin] a
+binrestore [locate_data_file bug30590_cut_tool1.bin] b
+
+bcut result a b
+
+checkshape result
+
+checknbshapes result -solid 1 -shell 1 -face 15 -wire 15 -edge 39 -vertex 26
+
+set tolres [checkmaxtol result]
+
+if { ${tolres} > 0.005} {
+ puts "Error: bad tolerance of result"
+}
+
+checkprops result -v 5639.93 -deps 1.e-7
--- /dev/null
+puts "==============================================="
+puts "OCC30590: Wrong result of Boolean Cut algorithm"
+puts "==============================================="
+puts ""
+
+binrestore [locate_data_file bug30590_cut_argument1.bin] a
+binrestore [locate_data_file bug30590_cut_tool2.bin] b
+
+bcut result a b
+
+checkshape result
+
+checknbshapes result -solid 1 -shell 1 -face 15 -wire 15 -edge 39 -vertex 26
+
+set tolres [checkmaxtol result]
+
+if { ${tolres} > 0.005} {
+ puts "Error: bad tolerance of result"
+}
+
+checkprops result -v 5639.78 -deps 1.e-7
--- /dev/null
+puts "==============================================="
+puts "OCC30590: Wrong result of Boolean Cut algorithm"
+puts "==============================================="
+puts ""
+
+binrestore [locate_data_file bug30590_cut_argument1.bin] a
+binrestore [locate_data_file bug30590_cut_tool3.bin] b
+
+bcut result a b
+
+checkshape result
+
+checknbshapes result -solid 1 -shell 1 -face 15 -wire 15 -edge 39 -vertex 26
+
+set tolres [checkmaxtol result]
+
+if { ${tolres} > 0.005} {
+ puts "Error: bad tolerance of result"
+}
+
+checkprops result -v 5638.15 -deps 1.e-7
puts "Error: bopargcheck has found some faulties in res2"
}
-checkmaxtol result -ref 0.00010921129251073595
+set tolres [checkmaxtol result]
+
+if { ${tolres} > 5.e-6} {
+ puts "Error: bad tolerance of result"
+}
smallview
don result sw tw
puts "========"
puts ""
-puts "TODO OCC29883 ALL: Error in res_2: T=0"
-puts "TODO OCC29883 ALL: Error: 0 vertices are expected but 2 are found"
-puts "TODO OCC29883 ALL: Error : is WRONG because number of VERTEX entities in shape \"result\" is 3"
-
foreach a [directory res*] {unset $a}
binrestore [locate_data_file bug29807_f1.bin] f1
puts "========"
puts ""
-puts "TODO OCC27243 ALL: Error: The curve res_1 possibly has a bend"
-
-set GoodNbCurves 2
+set GoodNbCurves 1
foreach a [directory res*] {unset $a}
puts "========"
puts ""
-puts "TODO OCC27243 ALL: Error: The curve res_1 possibly has a bend"
-
-set GoodNbCurves 2
+set GoodNbCurves 1
foreach a [directory res*] {unset $a}