mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027079: Bad approximation of intersection curves with variable curvature
1. Method Approx_ComputeLine::Perform is modified: now it contains also recursive calls after new line computation made by new method ApproxInt_MultiLine::MakeMLOneMorePoint. 2. New method MakeMLOneMorePoint is added to ApproxInt_MultiLine: it builds new sub-line as a part of main line with new point added into the middle of the longest interval between existing points. 3. Method ShapeConstruct_ProjectCurveOnSurface::ApproxPCurve is modified to avoid regressions: now it takes care of the set of initial points to be enough close to each other so that an interval between two adjacent points is less than half-period of the surface. 4. Modification in ShapeConstruct_ProjectCurveOnSurface: correction of pcurves of edges which extremities are in the singularities of surface.
This commit is contained in:
@@ -132,7 +132,13 @@ private:
|
||||
|
||||
|
||||
//! is internally used in the algorithm.
|
||||
Standard_EXPORT Standard_Boolean Compute (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer fpt, const Standard_Integer lpt, math_Vector& Para, Standard_Real& TheTol3d, Standard_Real& TheTol2d);
|
||||
Standard_EXPORT Standard_Boolean Compute (const BRepApprox_TheMultiLineOfApprox& Line,
|
||||
const Standard_Integer fpt,
|
||||
const Standard_Integer lpt,
|
||||
math_Vector& Para,
|
||||
Standard_Real& TheTol3d,
|
||||
Standard_Real& TheTol2d,
|
||||
Standard_Integer& indbad);
|
||||
|
||||
//! is internally used in the algorithm.
|
||||
Standard_EXPORT Standard_Boolean ComputeCurve (const BRepApprox_TheMultiLineOfApprox& Line, const Standard_Integer firspt, const Standard_Integer lastpt);
|
||||
@@ -173,6 +179,7 @@ private:
|
||||
AppParCurves_Constraint myfirstC;
|
||||
AppParCurves_Constraint mylastC;
|
||||
Standard_Integer myMultiLineNb;
|
||||
Standard_Integer myNbPlusOnePoint;
|
||||
Standard_Boolean myIsClear;
|
||||
|
||||
|
||||
|
@@ -53,16 +53,34 @@ public:
|
||||
Standard_EXPORT BRepApprox_TheImpPrmSvSurfacesOfApprox(const IntSurf_Quadric& Surf1, const BRepAdaptor_Surface& Surf2);
|
||||
|
||||
//! returns True if Tg,Tguv1 Tguv2 can be computed.
|
||||
Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2, gp_Pnt& Pt, gp_Vec& Tg, gp_Vec2d& Tguv1, gp_Vec2d& Tguv2);
|
||||
Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2,
|
||||
gp_Pnt& Pt, gp_Vec& Tg, gp_Vec2d& Tguv1, gp_Vec2d& Tguv2);
|
||||
|
||||
Standard_EXPORT void Pnt (const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT Standard_Boolean SeekPoint(const Standard_Real u1,
|
||||
const Standard_Real v1,
|
||||
const Standard_Real u2,
|
||||
const Standard_Real v2,
|
||||
IntSurf_PntOn2S& Point);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Tangency (const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Vec& Tg);
|
||||
|
||||
Standard_EXPORT Standard_Boolean TangencyOnSurf1 (const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Vec2d& Tg);
|
||||
|
||||
Standard_EXPORT Standard_Boolean TangencyOnSurf2 (const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Vec2d& Tg);
|
||||
|
||||
Standard_Boolean FillInitialVectorOfSolution(const Standard_Real u1,
|
||||
const Standard_Real v1,
|
||||
const Standard_Real u2,
|
||||
const Standard_Real v2,
|
||||
const Standard_Real binfu,
|
||||
const Standard_Real bsupu,
|
||||
const Standard_Real binfv,
|
||||
const Standard_Real bsupv,
|
||||
math_Vector& X,
|
||||
Standard_Real& TranslationU,
|
||||
Standard_Real& TranslationV);
|
||||
|
||||
|
||||
|
||||
|
@@ -41,6 +41,8 @@ public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox();
|
||||
|
||||
//! The class SvSurfaces is used when the approximation algorithm
|
||||
//! needs some extra points on the line <line>.
|
||||
//! A New line is then created which shares the same surfaces and functions.
|
||||
@@ -51,6 +53,8 @@ public:
|
||||
const Standard_Address PtrSvSurfaces,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Boolean ApproxU1V1,
|
||||
const Standard_Boolean ApproxU2V2,
|
||||
const Standard_Real xo,
|
||||
const Standard_Real yo,
|
||||
const Standard_Real zo,
|
||||
@@ -66,6 +70,8 @@ public:
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Boolean ApproxU1V1,
|
||||
const Standard_Boolean ApproxU2V2,
|
||||
const Standard_Real xo,
|
||||
const Standard_Real yo,
|
||||
const Standard_Real zo,
|
||||
@@ -106,30 +112,42 @@ public:
|
||||
|
||||
//! Returns the 3d and 2d points of the multipoint <MPointIndex>.
|
||||
Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV, TColgp_Array1OfVec2d& tabV2d) const;
|
||||
|
||||
//! Tries to make a sub-line between <Low> and <High> points of this line
|
||||
//! by adding <NbPointsToInsert> new points
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox MakeMLBetween (const Standard_Integer Low,
|
||||
const Standard_Integer High,
|
||||
const Standard_Integer NbPointsToInsert) const;
|
||||
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox MakeMLBetween (const Standard_Integer Low, const Standard_Integer High, const Standard_Integer NbPointsToInsert) const;
|
||||
|
||||
//! Tries to make a sub-line between <Low> and <High> points of this line
|
||||
//! by adding one more point between (indbad-1)-th and indbad-th points
|
||||
Standard_EXPORT Standard_Boolean MakeMLOneMorePoint (const Standard_Integer Low,
|
||||
const Standard_Integer High,
|
||||
const Standard_Integer indbad,
|
||||
BRepApprox_TheMultiLineOfApprox& OtherLine) const;
|
||||
|
||||
//! Dump of the current multi-line.
|
||||
Standard_EXPORT void Dump() const;
|
||||
|
||||
protected:
|
||||
BRepApprox_TheMultiLineOfApprox operator=(BRepApprox_TheMultiLineOfApprox&);
|
||||
|
||||
private:
|
||||
const Standard_Address PtrOnmySvSurfaces;
|
||||
const Handle(BRepApprox_ApproxLine) myLine;
|
||||
const Standard_Integer indicemin;
|
||||
const Standard_Integer indicemax;
|
||||
const Standard_Integer nbp3d;
|
||||
const Standard_Integer nbp2d;
|
||||
const Standard_Boolean p2donfirst;
|
||||
const Standard_Real Xo;
|
||||
const Standard_Real Yo;
|
||||
const Standard_Real Zo;
|
||||
const Standard_Real U1o;
|
||||
const Standard_Real V1o;
|
||||
const Standard_Real U2o;
|
||||
const Standard_Real V2o;
|
||||
Standard_Address PtrOnmySvSurfaces;
|
||||
Handle(BRepApprox_ApproxLine) myLine;
|
||||
Standard_Integer indicemin;
|
||||
Standard_Integer indicemax;
|
||||
Standard_Integer nbp3d;
|
||||
Standard_Integer nbp2d;
|
||||
Standard_Boolean myApproxU1V1;
|
||||
Standard_Boolean myApproxU2V2;
|
||||
Standard_Boolean p2donfirst;
|
||||
Standard_Real Xo;
|
||||
Standard_Real Yo;
|
||||
Standard_Real Zo;
|
||||
Standard_Real U1o;
|
||||
Standard_Real V1o;
|
||||
Standard_Real U2o;
|
||||
Standard_Real V2o;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -92,6 +92,13 @@ public:
|
||||
//! Is called if WhatStatus returned "PointsAdded".
|
||||
static BRepApprox_TheMultiLineOfApprox MakeMLBetween (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer I1, const Standard_Integer I2, const Standard_Integer NbPMin);
|
||||
|
||||
//! Is called when the Bezier curve contains a loop
|
||||
static Standard_Boolean MakeMLOneMorePoint (const BRepApprox_TheMultiLineOfApprox& ML,
|
||||
const Standard_Integer I1,
|
||||
const Standard_Integer I2,
|
||||
const Standard_Integer indbad,
|
||||
BRepApprox_TheMultiLineOfApprox& OtherLine);
|
||||
|
||||
static Approx_Status WhatStatus (const BRepApprox_TheMultiLineOfApprox& ML, const Standard_Integer I1, const Standard_Integer I2);
|
||||
|
||||
//! Dump of the current multi-line.
|
||||
|
@@ -50,10 +50,17 @@ public:
|
||||
Standard_EXPORT BRepApprox_ThePrmPrmSvSurfacesOfApprox(const BRepAdaptor_Surface& Surf1, const BRepAdaptor_Surface& Surf2);
|
||||
|
||||
//! returns True if Tg,Tguv1 Tguv2 can be computed.
|
||||
Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2, gp_Pnt& Pt, gp_Vec& Tg, gp_Vec2d& Tguv1, gp_Vec2d& Tguv2);
|
||||
Standard_EXPORT Standard_Boolean Compute (Standard_Real& u1, Standard_Real& v1, Standard_Real& u2, Standard_Real& v2,
|
||||
gp_Pnt& Pt, gp_Vec& Tg, gp_Vec2d& Tguv1, gp_Vec2d& Tguv2);
|
||||
|
||||
Standard_EXPORT void Pnt (const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Pnt& P);
|
||||
|
||||
Standard_EXPORT Standard_Boolean SeekPoint(const Standard_Real u1,
|
||||
const Standard_Real v1,
|
||||
const Standard_Real u2,
|
||||
const Standard_Real v2,
|
||||
IntSurf_PntOn2S& Point);
|
||||
|
||||
Standard_EXPORT Standard_Boolean Tangency (const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Vec& Tg);
|
||||
|
||||
Standard_EXPORT Standard_Boolean TangencyOnSurf1 (const Standard_Real u1, const Standard_Real v1, const Standard_Real u2, const Standard_Real v2, gp_Vec2d& Tg);
|
||||
|
Reference in New Issue
Block a user