mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +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:
@@ -124,7 +124,6 @@ public:
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -135,7 +134,13 @@ private:
|
||||
|
||||
|
||||
//! is internally used in the algorithm.
|
||||
Standard_EXPORT Standard_Boolean Compute (const AppDef_MultiLine& Line, const Standard_Integer fpt, const Standard_Integer lpt, math_Vector& Para, Standard_Real& TheTol3d, Standard_Real& TheTol2d);
|
||||
Standard_EXPORT Standard_Boolean Compute (const AppDef_MultiLine& 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 AppDef_MultiLine& Line, const Standard_Integer firspt, const Standard_Integer lastpt);
|
||||
@@ -176,6 +181,7 @@ private:
|
||||
AppParCurves_Constraint myfirstC;
|
||||
AppParCurves_Constraint mylastC;
|
||||
Standard_Integer myMultiLineNb;
|
||||
Standard_Integer myNbPlusOnePoint;
|
||||
Standard_Boolean myIsClear;
|
||||
|
||||
|
||||
|
@@ -59,9 +59,11 @@ void AppDef_MyLineTool::Value(const AppDef_MultiLine& ML,
|
||||
TColgp_Array1OfPnt2d& tabPt2d)
|
||||
{
|
||||
AppDef_MultiPointConstraint MPC = ML.Value(MPointIndex);
|
||||
Standard_Integer nbp2d = MPC.NbPoints2d(), low = tabPt2d.Lower();
|
||||
Standard_Integer nbp3d = MPC.NbPoints();
|
||||
Standard_Integer nbp2d = MPC.NbPoints2d();
|
||||
Standard_Integer low = tabPt2d.Lower();
|
||||
for (Standard_Integer i = 1; i <= nbp2d; i++) {
|
||||
tabPt2d(i+low-1) = MPC.Point2d(i);
|
||||
tabPt2d(i+low-1) = MPC.Point2d(nbp3d+i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,10 +104,12 @@ Standard_Boolean AppDef_MyLineTool::Tangency(const AppDef_MultiLine& ML,
|
||||
TColgp_Array1OfVec2d& tabV2d)
|
||||
{
|
||||
AppDef_MultiPointConstraint MPC = ML.Value(MPointIndex);
|
||||
if (MPC.IsTangencyPoint()) {
|
||||
if (MPC.IsTangencyPoint())
|
||||
{
|
||||
Standard_Integer nbp3d = MPC.NbPoints();
|
||||
Standard_Integer nbp2d = MPC.NbPoints2d(), low = tabV2d.Lower();
|
||||
for (Standard_Integer i = 1; i <= nbp2d; i++) {
|
||||
tabV2d(i+low-1) = MPC.Tang2d(i);
|
||||
tabV2d(i+low-1) = MPC.Tang2d(nbp3d+i);
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
@@ -142,6 +146,15 @@ AppDef_MultiLine& AppDef_MyLineTool::MakeMLBetween(const AppDef_MultiLine&,
|
||||
return *((AppDef_MultiLine*) 0);
|
||||
}
|
||||
|
||||
Standard_Boolean AppDef_MyLineTool::MakeMLOneMorePoint(const AppDef_MultiLine& ,
|
||||
const Standard_Integer,
|
||||
const Standard_Integer,
|
||||
const Standard_Integer,
|
||||
AppDef_MultiLine&)
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
Approx_Status AppDef_MyLineTool::WhatStatus(const AppDef_MultiLine&,
|
||||
const Standard_Integer,
|
||||
const Standard_Integer)
|
||||
@@ -170,10 +183,12 @@ Standard_Boolean AppDef_MyLineTool::Curvature(const AppDef_MultiLine& ML,
|
||||
TColgp_Array1OfVec2d& tabV2d)
|
||||
{
|
||||
AppDef_MultiPointConstraint MPC = ML.Value(MPointIndex);
|
||||
if (MPC.IsCurvaturePoint()) {
|
||||
if (MPC.IsCurvaturePoint())
|
||||
{
|
||||
Standard_Integer nbp3d = MPC.NbPoints();
|
||||
Standard_Integer nbp2d = MPC.NbPoints2d(), low = tabV2d.Lower();
|
||||
for (Standard_Integer i = 1; i <= nbp2d; i++) {
|
||||
tabV2d(i+low-1) = MPC.Curv2d(i);
|
||||
tabV2d(i+low-1) = MPC.Curv2d(nbp3d+i);
|
||||
}
|
||||
return Standard_True;
|
||||
}
|
||||
|
@@ -94,8 +94,18 @@ public:
|
||||
|
||||
//! Is never called in the algorithms.
|
||||
//! Nothing is done.
|
||||
Standard_EXPORT static AppDef_MultiLine& MakeMLBetween (const AppDef_MultiLine& ML, const Standard_Integer I1, const Standard_Integer I2, const Standard_Integer NbPMin);
|
||||
Standard_EXPORT static AppDef_MultiLine& MakeMLBetween (const AppDef_MultiLine& ML,
|
||||
const Standard_Integer I1,
|
||||
const Standard_Integer I2,
|
||||
const Standard_Integer NbPMin);
|
||||
|
||||
//! Is never called in the algorithms.
|
||||
//! Nothing is done.
|
||||
Standard_EXPORT static Standard_Boolean MakeMLOneMorePoint (const AppDef_MultiLine& ML,
|
||||
const Standard_Integer I1,
|
||||
const Standard_Integer I2,
|
||||
const Standard_Integer indbad,
|
||||
AppDef_MultiLine& OtherLine);
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user