mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0026675: Eliminate normalization of coordinates in ApproxInt package
Normalization has been eliminated. Additionally, 1. Some methods of AppDef_Compute and ApproxInt_MultiLine classes have become inline (for speeding up performance). 2. Interfaces of AppDef_Compute::Parametrization(...) and BRepAlgo_BooleanOperations::SetApproxParameters() methods have been changed. 3. Overloaded methods for ApproxInt_Approx::SetParameters(...), TopOpeBRepTool_GeomTool::GetTolerances(...) and TopOpeBRepTool_GeomTool::SetTolerances(...) have been removed (because some fields of these classes are not used more). 4. Lost comments have been added in BRepApprox_TheMultiLineOfApprox.hxx and GeomInt_TheMultiLineOfWLApprox.hxx files. 5. Some fields have been deleted from ApproxInt_MultiLine class. Kept members have become constant. 6. Interface of ksection DRAW-command has been changed. 7. Some code fragments have been rewritten to make them easier. 8. Function CleanWline(...) has been added in IntPatch_Intersection.cxx file. See comments in code for detail description. Adjusting some test case according to their new behavior. Creation test case for this issue.
This commit is contained in:
@@ -83,47 +83,88 @@ public:
|
||||
Standard_EXPORT void Perform (const AppDef_MultiLine& Line);
|
||||
|
||||
//! changes the degrees of the approximation.
|
||||
Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
|
||||
Standard_EXPORT void SetDegrees ( const Standard_Integer degreemin,
|
||||
const Standard_Integer degreemax)
|
||||
{
|
||||
mydegremin = degreemin;
|
||||
mydegremax = degreemax;
|
||||
}
|
||||
|
||||
//! Changes the tolerances of the approximation.
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d,
|
||||
const Standard_Real Tolerance2d)
|
||||
{
|
||||
mytol3d = Tolerance3d;
|
||||
mytol2d = Tolerance2d;
|
||||
}
|
||||
|
||||
//! changes the first and the last constraint points.
|
||||
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC);
|
||||
Standard_EXPORT void SetConstraints ( const AppParCurves_Constraint FirstC,
|
||||
const AppParCurves_Constraint LastC)
|
||||
{
|
||||
myfirstC = FirstC;
|
||||
mylastC = LastC;
|
||||
}
|
||||
|
||||
//! returns False if at a moment of the approximation,
|
||||
//! the status NoApproximation has been sent by the user
|
||||
//! when more points were needed.
|
||||
Standard_EXPORT Standard_Boolean IsAllApproximated() const;
|
||||
Standard_EXPORT Standard_Boolean IsAllApproximated() const
|
||||
{
|
||||
return alldone;
|
||||
}
|
||||
|
||||
//! returns False if the status NoPointsAdded has been sent.
|
||||
Standard_EXPORT Standard_Boolean IsToleranceReached() const;
|
||||
Standard_EXPORT Standard_Boolean IsToleranceReached() const
|
||||
{
|
||||
return tolreached;
|
||||
}
|
||||
|
||||
//! returns the tolerances 2d and 3d of the <Index> MultiCurve.
|
||||
Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const;
|
||||
Standard_EXPORT void Error (const Standard_Integer Index,
|
||||
Standard_Real& tol3d,
|
||||
Standard_Real& tol2d) const
|
||||
{
|
||||
tol3d = Tolers3d.Value(Index);
|
||||
tol2d = Tolers2d.Value(Index);
|
||||
}
|
||||
|
||||
//! Returns the number of MultiCurve doing the approximation
|
||||
//! of the MultiLine.
|
||||
Standard_EXPORT Standard_Integer NbMultiCurves() const;
|
||||
Standard_EXPORT Standard_Integer NbMultiCurves() const
|
||||
{
|
||||
return myMultiCurves.Length();
|
||||
}
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT const AppParCurves_MultiCurve& Value (const Standard_Integer Index = 1) const;
|
||||
Standard_EXPORT const AppParCurves_MultiCurve&
|
||||
Value (const Standard_Integer Index = 1) const
|
||||
{
|
||||
return myMultiCurves.Value(Index);
|
||||
}
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1);
|
||||
Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1)
|
||||
{
|
||||
return myMultiCurves.ChangeValue(Index);
|
||||
}
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& SplineValue();
|
||||
|
||||
//! returns the type of parametrization
|
||||
Standard_EXPORT void Parametrization (Approx_ParametrizationType& partype) const;
|
||||
Standard_EXPORT Approx_ParametrizationType Parametrization () const
|
||||
{
|
||||
return Par;
|
||||
}
|
||||
|
||||
//! returns the new parameters of the approximation
|
||||
//! corresponding to the points of the multicurve <Index>.
|
||||
Standard_EXPORT const TColStd_Array1OfReal& Parameters (const Standard_Integer Index = 1) const;
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT const TColStd_Array1OfReal&
|
||||
Parameters (const Standard_Integer Index = 1) const
|
||||
{
|
||||
return (myPar.Value(Index))->Array1();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
|
@@ -783,32 +783,6 @@ void Approx_ComputeLine::Perform(const MultiLine& Line)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const TColStd_Array1OfReal& Approx_ComputeLine::Parameters(const Standard_Integer Index) const
|
||||
{
|
||||
return (myPar.Value(Index))->Array1();
|
||||
}
|
||||
|
||||
|
||||
Standard_Integer Approx_ComputeLine::NbMultiCurves()const
|
||||
{
|
||||
return myMultiCurves.Length();
|
||||
}
|
||||
|
||||
AppParCurves_MultiCurve& Approx_ComputeLine::ChangeValue(const Standard_Integer Index)
|
||||
{
|
||||
return myMultiCurves.ChangeValue(Index);
|
||||
}
|
||||
|
||||
|
||||
const AppParCurves_MultiCurve& Approx_ComputeLine::Value(const Standard_Integer Index)
|
||||
const
|
||||
{
|
||||
return myMultiCurves.Value(Index);
|
||||
}
|
||||
|
||||
|
||||
const AppParCurves_MultiBSpCurve& Approx_ComputeLine::SplineValue()
|
||||
{
|
||||
Approx_MCurvesToBSpCurve Trans;
|
||||
@@ -817,10 +791,6 @@ const AppParCurves_MultiBSpCurve& Approx_ComputeLine::SplineValue()
|
||||
return myspline;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Approx_ComputeLine::Parameters(const MultiLine& Line,
|
||||
const Standard_Integer firstP,
|
||||
const Standard_Integer lastP,
|
||||
@@ -880,7 +850,6 @@ void Approx_ComputeLine::Parameters(const MultiLine& Line,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Standard_Boolean Approx_ComputeLine::Compute(const MultiLine& Line,
|
||||
const Standard_Integer fpt,
|
||||
const Standard_Integer lpt,
|
||||
@@ -979,9 +948,6 @@ Standard_Boolean Approx_ComputeLine::Compute(const MultiLine& Line,
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Standard_Boolean Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
|
||||
const Standard_Integer firstpt,
|
||||
const Standard_Integer lastpt)
|
||||
@@ -1208,8 +1174,6 @@ Standard_Boolean Approx_ComputeLine::ComputeCurve(const MultiLine& Line,
|
||||
return mydone;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Approx_ComputeLine::Init(const Standard_Integer degreemin,
|
||||
const Standard_Integer degreemax,
|
||||
const Standard_Real Tolerance3d,
|
||||
@@ -1227,54 +1191,4 @@ void Approx_ComputeLine::Init(const Standard_Integer degreemin,
|
||||
mysquares = Squares;
|
||||
mycut = cutting;
|
||||
myitermax = NbIterations;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Approx_ComputeLine::SetDegrees(const Standard_Integer degreemin,
|
||||
const Standard_Integer degreemax)
|
||||
{
|
||||
mydegremin = degreemin;
|
||||
mydegremax = degreemax;
|
||||
}
|
||||
|
||||
|
||||
void Approx_ComputeLine::SetTolerances(const Standard_Real Tolerance3d,
|
||||
const Standard_Real Tolerance2d)
|
||||
{
|
||||
mytol3d = Tolerance3d;
|
||||
mytol2d = Tolerance2d;
|
||||
}
|
||||
|
||||
|
||||
void Approx_ComputeLine::SetConstraints(const AppParCurves_Constraint FirstC,
|
||||
const AppParCurves_Constraint LastC)
|
||||
{
|
||||
myfirstC = FirstC;
|
||||
mylastC = LastC;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Standard_Boolean Approx_ComputeLine::IsAllApproximated()
|
||||
const {
|
||||
return alldone;
|
||||
}
|
||||
|
||||
Standard_Boolean Approx_ComputeLine::IsToleranceReached()
|
||||
const {
|
||||
return tolreached;
|
||||
}
|
||||
|
||||
void Approx_ComputeLine::Error(const Standard_Integer Index,
|
||||
Standard_Real& tol3d,
|
||||
Standard_Real& tol2d) const
|
||||
{
|
||||
tol3d = Tolers3d.Value(Index);
|
||||
tol2d = Tolers2d.Value(Index);
|
||||
}
|
||||
|
||||
void Approx_ComputeLine::Parametrization(Approx_ParametrizationType& partype) const
|
||||
{
|
||||
partype = Par;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -14,351 +14,192 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#define DEBUG 0
|
||||
|
||||
|
||||
#include <TColStd_Array1OfReal.hxx>
|
||||
#include <IntSurf_LineOn2S.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
|
||||
ApproxInt_MultiLine::ApproxInt_MultiLine(const Handle_TheLine& line,
|
||||
const Standard_Address svsurf,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Real xo,
|
||||
const Standard_Real ax,
|
||||
const Standard_Real yo,
|
||||
const Standard_Real ay,
|
||||
const Standard_Real zo,
|
||||
const Standard_Real az,
|
||||
const Standard_Real u1o,
|
||||
const Standard_Real a1u,
|
||||
const Standard_Real v1o,
|
||||
const Standard_Real a1v,
|
||||
const Standard_Real u2o,
|
||||
const Standard_Real a2u,
|
||||
const Standard_Real v2o,
|
||||
const Standard_Real a2v,
|
||||
const Standard_Boolean P2DOnFirst,
|
||||
const Standard_Integer IndMin,
|
||||
const Standard_Integer IndMax):
|
||||
|
||||
PtrOnmySvSurfaces(svsurf),
|
||||
myLine(line),
|
||||
indicemin(IndMin),
|
||||
indicemax(IndMax),
|
||||
nbp3d(NbP3d),
|
||||
nbp2d(NbP2d),
|
||||
p2donfirst(P2DOnFirst),
|
||||
Xo(xo),Ax(ax),Yo(yo),Ay(ay),Zo(zo),Az(az),
|
||||
U1o(u1o),A1u(a1u),V1o(v1o),A1v(a1v),
|
||||
U2o(u2o),A2u(a2u),V2o(v2o),A2v(a2v)
|
||||
//=======================================================================
|
||||
//function : Constructor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
ApproxInt_MultiLine::
|
||||
ApproxInt_MultiLine(const Handle_TheLine& line,
|
||||
const Standard_Address svsurf,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Boolean P2DOnFirst,
|
||||
const Standard_Integer IndMin,
|
||||
const Standard_Integer IndMax):PtrOnmySvSurfaces(svsurf),
|
||||
myLine(line),
|
||||
indicemin(Min(IndMin, IndMax)),
|
||||
indicemax(Max(IndMin, IndMax)),
|
||||
nbp3d(NbP3d),
|
||||
nbp2d(NbP2d),
|
||||
p2donfirst(P2DOnFirst)
|
||||
{
|
||||
#if DEBUG
|
||||
if(indicemin>=indicemax) {
|
||||
cout<<"\n********************************************";
|
||||
cout<<"\n***** ApproxInt_MultiLine ********";
|
||||
cout<<"\n***** indicemin = indicemax = "<<indicemin;
|
||||
cout<<"\n********************************************"<<endl;
|
||||
|
||||
}
|
||||
#if OCCT_DEBUG
|
||||
//if(indicemin == indicemax)
|
||||
//{
|
||||
// cout<<"ApproxInt_MultiLine: indicemin = indicemax = " << indicemin << endl;
|
||||
//}
|
||||
#endif
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
ApproxInt_MultiLine::ApproxInt_MultiLine(const Handle_TheLine& line,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Real xo,
|
||||
const Standard_Real ax,
|
||||
const Standard_Real yo,
|
||||
const Standard_Real ay,
|
||||
const Standard_Real zo,
|
||||
const Standard_Real az,
|
||||
const Standard_Real u1o,
|
||||
const Standard_Real a1u,
|
||||
const Standard_Real v1o,
|
||||
const Standard_Real a1v,
|
||||
const Standard_Real u2o,
|
||||
const Standard_Real a2u,
|
||||
const Standard_Real v2o,
|
||||
const Standard_Real a2v,
|
||||
const Standard_Boolean P2DOnFirst,
|
||||
const Standard_Integer IndMin,
|
||||
const Standard_Integer IndMax):
|
||||
|
||||
PtrOnmySvSurfaces(0),
|
||||
myLine(line),
|
||||
indicemin(IndMin),
|
||||
indicemax(IndMax),
|
||||
nbp3d(NbP3d),
|
||||
nbp2d(NbP2d),
|
||||
p2donfirst(P2DOnFirst),
|
||||
Xo(xo),Ax(ax),Yo(yo),Ay(ay),Zo(zo),Az(az),
|
||||
U1o(u1o),A1u(a1u),V1o(v1o),A1v(a1v),
|
||||
U2o(u2o),A2u(a2u),V2o(v2o),A2v(a2v)
|
||||
//=======================================================================
|
||||
//function : Constructor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
ApproxInt_MultiLine::
|
||||
ApproxInt_MultiLine(const Handle_TheLine& line,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Boolean P2DOnFirst,
|
||||
const Standard_Integer IndMin,
|
||||
const Standard_Integer IndMax):PtrOnmySvSurfaces(0),
|
||||
myLine(line),
|
||||
indicemin(Min(IndMin, IndMax)),
|
||||
indicemax(Max(IndMin, IndMax)),
|
||||
nbp3d(NbP3d),
|
||||
nbp2d(NbP2d),
|
||||
p2donfirst(P2DOnFirst)
|
||||
{
|
||||
if(indicemin>=indicemax) {
|
||||
#if DEBUG
|
||||
cout<<"\n********************************************";
|
||||
cout<<"\n***** ApproxInt_MultiLine ********";
|
||||
cout<<"\n***** indicemin = indicemax = "<<indicemin;
|
||||
cout<<"\n********************************************"<<endl;
|
||||
#if OCCT_DEBUG
|
||||
//if(indicemin == indicemax)
|
||||
//{
|
||||
// cout<<"ApproxInt_MultiLine: indicemin = indicemax = " << indicemin << endl;
|
||||
//}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
Standard_Integer ApproxInt_MultiLine::FirstPoint() const {
|
||||
return(indicemin);
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
Standard_Integer ApproxInt_MultiLine::LastPoint() const {
|
||||
return(indicemax);
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
Approx_Status ApproxInt_MultiLine::WhatStatus() const {
|
||||
if(PtrOnmySvSurfaces)
|
||||
return(Approx_PointsAdded);
|
||||
else
|
||||
return(Approx_NoPointsAdded);
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
Standard_Integer ApproxInt_MultiLine::NbP3d() const {
|
||||
return(nbp3d);
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
Standard_Integer ApproxInt_MultiLine::NbP2d() const {
|
||||
return(nbp2d);
|
||||
}
|
||||
//================================================================================
|
||||
void ApproxInt_MultiLine::Value(const Standard_Integer Index,
|
||||
TColgp_Array1OfPnt& TabPnt) const
|
||||
{
|
||||
IntSurf_PntOn2S POn2S(myLine->Point(Index));
|
||||
Standard_Real X = POn2S.Value().X();
|
||||
Standard_Real Y = POn2S.Value().Y();
|
||||
Standard_Real Z = POn2S.Value().Z();
|
||||
TabPnt(1) = gp_Pnt(X*Ax + Xo, Y*Ay + Yo, Z*Az + Zo);
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
void ApproxInt_MultiLine::Value( const Standard_Integer Index
|
||||
,TColgp_Array1OfPnt2d& TabPnt2d) const
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void ApproxInt_MultiLine::Value(const Standard_Integer MPointIndex,
|
||||
TColgp_Array1OfPnt2d& TabPnt2d) const
|
||||
{
|
||||
IntSurf_PntOn2S POn2S(myLine->Point(Index));
|
||||
Standard_Real u1,u2,v1,v2;
|
||||
POn2S.Parameters(u1,v1,u2,v2);
|
||||
if(nbp2d==1) {
|
||||
if(p2donfirst) {
|
||||
TabPnt2d(1) = gp_Pnt2d(u1 * A1u + U1o , v1 * A1v + V1o);
|
||||
const IntSurf_PntOn2S& POn2S = myLine->Point(MPointIndex);
|
||||
Standard_Real u1 = 0.0, u2 = 0.0, v1 = 0.0, v2 = 0.0;
|
||||
POn2S.Parameters(u1, v1, u2, v2);
|
||||
if(nbp2d==1)
|
||||
{
|
||||
if(p2donfirst)
|
||||
{
|
||||
TabPnt2d(1) = gp_Pnt2d(u1, v1);
|
||||
}
|
||||
else {
|
||||
TabPnt2d(1) = gp_Pnt2d(u2 * A2u + U2o , v2 * A2v + V2o);
|
||||
else
|
||||
{
|
||||
TabPnt2d(1) = gp_Pnt2d(u2, v2);
|
||||
}
|
||||
}
|
||||
else {
|
||||
TabPnt2d(1) = gp_Pnt2d(u1 * A1u + U1o , v1 * A1v + V1o);
|
||||
if(TabPnt2d.Length()>=2) {
|
||||
TabPnt2d(2) = gp_Pnt2d(u2 * A2u + U2o , v2 * A2v + V2o);
|
||||
else
|
||||
{
|
||||
TabPnt2d(1) = gp_Pnt2d(u1, v1);
|
||||
if(TabPnt2d.Length() >= 2)
|
||||
{
|
||||
TabPnt2d(2) = gp_Pnt2d(u2, v2);
|
||||
}
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
void ApproxInt_MultiLine::Value( const Standard_Integer Index
|
||||
,TColgp_Array1OfPnt& TabPnt
|
||||
,TColgp_Array1OfPnt2d& TabPnt2d) const
|
||||
{
|
||||
IntSurf_PntOn2S POn2S(myLine->Point(Index));
|
||||
Standard_Real u1,u2,v1,v2;
|
||||
POn2S.Parameters(u1,v1,u2,v2);
|
||||
if(nbp2d==1) {
|
||||
if(p2donfirst) {
|
||||
TabPnt2d(1) = gp_Pnt2d(u1 * A1u + U1o , v1 * A1v + V1o);
|
||||
}
|
||||
else {
|
||||
TabPnt2d(1) = gp_Pnt2d(u2 * A2u + U2o , v2 * A2v + V2o);
|
||||
}
|
||||
}
|
||||
else {
|
||||
TabPnt2d(1) = gp_Pnt2d(u1 * A1u + U1o , v1 * A1v + V1o);
|
||||
if(TabPnt2d.Length()>=2) {
|
||||
TabPnt2d(2) = gp_Pnt2d(u2 * A2u + U2o , v2 * A2v + V2o);
|
||||
}
|
||||
}
|
||||
Standard_Real X = POn2S.Value().X();
|
||||
Standard_Real Y = POn2S.Value().Y();
|
||||
Standard_Real Z = POn2S.Value().Z();
|
||||
TabPnt(1) = gp_Pnt(X * Ax + Xo, Y * Ay + Yo, Z * Az + Zo);
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
//--------------------------------------------------------------------------------
|
||||
Standard_Boolean ApproxInt_MultiLine::Tangency( const Standard_Integer Index
|
||||
,TColgp_Array1OfVec& TabVec) const
|
||||
{
|
||||
|
||||
//=======================================================================
|
||||
//function : Tangency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean ApproxInt_MultiLine::Tangency( const Standard_Integer Index,
|
||||
TColgp_Array1OfVec& TabVec) const
|
||||
{
|
||||
if(PtrOnmySvSurfaces==NULL)
|
||||
return(Standard_False);
|
||||
return Standard_False;
|
||||
|
||||
IntSurf_PntOn2S POn2S(myLine->Point(Index));
|
||||
Standard_Real u1,u2,v1,v2;
|
||||
gp_Vec Tg;
|
||||
const IntSurf_PntOn2S& POn2S = myLine->Point(Index);
|
||||
Standard_Real u1 = 0.0, u2 = 0.0, v1 = 0.0, v2 = 0.0;
|
||||
POn2S.Parameters(u1,v1,u2,v2);
|
||||
Standard_Boolean ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->Tangency( u1,v1,u2,v2,Tg);
|
||||
if(ret) {
|
||||
Standard_Real X = Tg.X();
|
||||
Standard_Real Y = Tg.Y();
|
||||
Standard_Real Z = Tg.Z();
|
||||
TabVec(1) = gp_Vec(X * Ax, Y * Ay, Z * Az);
|
||||
|
||||
Standard_Boolean ret=
|
||||
((TheSvSurfaces *)PtrOnmySvSurfaces)->Tangency(u1, v1, u2, v2, TabVec(1));
|
||||
if(!ret)
|
||||
{
|
||||
TabVec(1) = gp_Vec(0.0, 0.0, 0.0);
|
||||
}
|
||||
else
|
||||
TabVec(1) = gp_Vec(0.0,0.0,0.0);
|
||||
return(ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
Standard_Boolean ApproxInt_MultiLine::Tangency( const Standard_Integer Index
|
||||
,TColgp_Array1OfVec2d& TabVec2d) const
|
||||
{
|
||||
|
||||
//=======================================================================
|
||||
//function : Tangency
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean ApproxInt_MultiLine::Tangency( const Standard_Integer Index,
|
||||
TColgp_Array1OfVec2d& TabVec2d) const
|
||||
{
|
||||
if(PtrOnmySvSurfaces==NULL)
|
||||
return(Standard_False);
|
||||
return Standard_False;
|
||||
|
||||
IntSurf_PntOn2S POn2S(myLine->Point(Index));
|
||||
Standard_Real u1,u2,v1,v2,U,V;
|
||||
gp_Vec2d Tg2d;
|
||||
Standard_Boolean ret;
|
||||
const IntSurf_PntOn2S& POn2S = myLine->Point(Index);
|
||||
Standard_Real u1 = 0.0, u2 = 0.0, v1 = 0.0, v2 = 0.0;
|
||||
POn2S.Parameters(u1,v1,u2,v2);
|
||||
if(nbp2d==1) {
|
||||
Standard_Real Au = A1u;
|
||||
Standard_Real Av = A1v;
|
||||
if(p2donfirst) {
|
||||
ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf1( u1,v1,u2,v2,Tg2d);
|
||||
|
||||
Standard_Boolean ret = Standard_False;
|
||||
if(nbp2d==1)
|
||||
{
|
||||
if(p2donfirst)
|
||||
{
|
||||
ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf1(u1, v1, u2, v2, TabVec2d(1));
|
||||
}
|
||||
else {
|
||||
ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf2( u1,v1,u2,v2,Tg2d);
|
||||
Au = A2u;
|
||||
Av = A2v;
|
||||
else
|
||||
{
|
||||
ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf2(u1, v1, u2, v2, TabVec2d(1));
|
||||
}
|
||||
if(ret) {
|
||||
U = Tg2d.X();
|
||||
V = Tg2d.Y();
|
||||
TabVec2d(1) = gp_Vec2d(U * Au, V * Av);
|
||||
}
|
||||
else {
|
||||
TabVec2d(1) = gp_Vec2d(0.0,0.0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf1( u1,v1,u2,v2,Tg2d);
|
||||
if(ret) {
|
||||
U = Tg2d.X();
|
||||
V = Tg2d.Y();
|
||||
TabVec2d(1) = gp_Vec2d(U * A1u, V * A1v);
|
||||
|
||||
if(TabVec2d.Length()>=2) {
|
||||
ret&=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf2( u1,v1,u2,v2,Tg2d);
|
||||
U = Tg2d.X();
|
||||
V = Tg2d.Y();
|
||||
TabVec2d(2) = gp_Vec2d(U * A2u, V * A2v);
|
||||
}
|
||||
else {
|
||||
TabVec2d(1) = gp_Vec2d(0.0,0.0);
|
||||
if(TabVec2d.Length()>=2) {
|
||||
TabVec2d(2) = gp_Vec2d(0.0,0.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf1(u1, v1, u2, v2, TabVec2d(1));
|
||||
if(ret)
|
||||
{
|
||||
if(TabVec2d.Length()>=2)
|
||||
{
|
||||
ret =
|
||||
(ret &&
|
||||
((TheSvSurfaces *)PtrOnmySvSurfaces)->
|
||||
TangencyOnSurf2(u1, v1, u2, v2, TabVec2d(2)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return(ret);
|
||||
|
||||
if(!ret)
|
||||
{
|
||||
TabVec2d(1) = gp_Vec2d(0.0, 0.0);
|
||||
if(TabVec2d.Length() >= 2)
|
||||
{
|
||||
TabVec2d(2) = gp_Vec2d(0.0,0.0);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
Standard_Boolean ApproxInt_MultiLine::Tangency( const Standard_Integer Index
|
||||
,TColgp_Array1OfVec& TabVec
|
||||
,TColgp_Array1OfVec2d& TabVec2d) const
|
||||
|
||||
//=======================================================================
|
||||
//function : MakeMLBetween
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
ApproxInt_MultiLine
|
||||
ApproxInt_MultiLine::MakeMLBetween( const Standard_Integer Low,
|
||||
const Standard_Integer High,
|
||||
const Standard_Integer aNbPntsToInsert) const
|
||||
{
|
||||
if(PtrOnmySvSurfaces==NULL)
|
||||
return(Standard_False);
|
||||
|
||||
IntSurf_PntOn2S POn2S(myLine->Point(Index));
|
||||
Standard_Real u1,u2,v1,v2,U,V;
|
||||
gp_Vec2d Tg2d;
|
||||
gp_Vec Tg;
|
||||
Standard_Boolean ret;
|
||||
POn2S.Parameters(u1,v1,u2,v2);
|
||||
if(nbp2d==1) {
|
||||
Standard_Real Au = A1u;
|
||||
Standard_Real Av = A1v;
|
||||
if(p2donfirst) {
|
||||
ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf1( u1,v1,u2,v2,Tg2d);
|
||||
}
|
||||
else {
|
||||
ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf2( u1,v1,u2,v2,Tg2d);
|
||||
Au = A2u;
|
||||
Av = A2v;
|
||||
}
|
||||
if(ret) {
|
||||
U = Tg2d.X();
|
||||
V = Tg2d.Y();
|
||||
TabVec2d(1) = gp_Vec2d(U * Au, V * Av);
|
||||
}
|
||||
else {
|
||||
TabVec2d(1) = gp_Vec2d(0.0,0.0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ret=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf1( u1,v1,u2,v2,Tg2d);
|
||||
if(ret) {
|
||||
U = Tg2d.X();
|
||||
V = Tg2d.Y();
|
||||
TabVec2d(1) = gp_Vec2d(U * A1u, V * A1v);
|
||||
if(TabVec2d.Length()>=2) {
|
||||
ret&=((TheSvSurfaces *)PtrOnmySvSurfaces)->TangencyOnSurf2( u1,v1,u2,v2,Tg2d);
|
||||
U = Tg2d.X();
|
||||
V = Tg2d.Y();
|
||||
TabVec2d(2) = gp_Vec2d(U * A2u, V * A2v);
|
||||
}
|
||||
}
|
||||
else {
|
||||
TabVec2d(1) = gp_Vec2d(0.0,0.0);
|
||||
if(TabVec2d.Length()>=2) {
|
||||
TabVec2d(2) = gp_Vec2d(0.0,0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ret) {
|
||||
ret&=((TheSvSurfaces *)PtrOnmySvSurfaces)->Tangency( u1,v1,u2,v2,Tg);
|
||||
Standard_Real X = Tg.X();
|
||||
Standard_Real Y = Tg.Y();
|
||||
Standard_Real Z = Tg.Z();
|
||||
TabVec(1) = gp_Vec(X * Ax, Y * Ay, Z * Az);
|
||||
}
|
||||
else {
|
||||
TabVec(1) = gp_Vec(0.0,0.0,0.0);
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
//================================================================================
|
||||
ApproxInt_MultiLine ApproxInt_MultiLine::MakeMLBetween(const Standard_Integer Low,
|
||||
const Standard_Integer High,
|
||||
const Standard_Integer aNbPntsToInsert)
|
||||
const {
|
||||
if(PtrOnmySvSurfaces==NULL) {
|
||||
//-- cout<<"\n Erreur dans : ApproxInt_MultiLine ApproxInt_MultiLine::MakeMLBetween "<<endl;
|
||||
if(PtrOnmySvSurfaces==NULL)
|
||||
{
|
||||
//-- cout<<"\n Erreur dans : ApproxInt_MultiLine "
|
||||
// "ApproxInt_MultiLine::MakeMLBetween "<<endl;
|
||||
Handle(IntSurf_LineOn2S) vide1 = new IntSurf_LineOn2S();
|
||||
Handle(TheLine) vide = new TheLine(vide1,Standard_False);
|
||||
return(ApproxInt_MultiLine(vide,
|
||||
NULL,
|
||||
nbp3d,
|
||||
nbp2d,
|
||||
Xo,Ax,Yo,Ay,Zo,Az,
|
||||
U1o,A1u,V1o,A1v,
|
||||
U2o,A2u,V2o,A2v,
|
||||
p2donfirst,
|
||||
1,1));
|
||||
return(ApproxInt_MultiLine(vide, NULL, nbp3d, nbp2d, p2donfirst, 1, 1));
|
||||
//-- return(*this);
|
||||
}
|
||||
|
||||
Standard_Integer NbPntsToInsert=aNbPntsToInsert;
|
||||
if(NbPntsToInsert<(High-Low)) NbPntsToInsert=(High-Low);
|
||||
Standard_Integer NbPnts = NbPntsToInsert + High - Low + 1;
|
||||
@@ -401,7 +242,6 @@ const {
|
||||
AC(Low) =0.0;
|
||||
|
||||
#if 0
|
||||
|
||||
for( i=Low+1; i<=High; i++) {
|
||||
myLine->Point(i).Parameters(u1,v1,u2,v2);
|
||||
U1(i) = u1;
|
||||
@@ -416,26 +256,24 @@ const {
|
||||
}
|
||||
#else
|
||||
//-- Essai du 19 juin 96 (parametrage selon abs curv en XYZ)
|
||||
for( i=Low+1; i<=High; i++) {
|
||||
for( i=Low+1; i<=High; i++)
|
||||
{
|
||||
myLine->Point(i).Parameters(u1,v1,u2,v2);
|
||||
U1(i) = u1;
|
||||
V1(i) = v1;
|
||||
U2(i) = u2;
|
||||
V2(i) = v2;
|
||||
AC(i) = AC(i-1)
|
||||
+ (myLine->Point(i-1).Value()).Distance(myLine->Point(i).Value());
|
||||
AC(i) = AC(i-1) + (myLine->Point(i-1).Value()).Distance(myLine->Point(i).Value());
|
||||
}
|
||||
|
||||
#endif
|
||||
//-------------------------------------------------------------
|
||||
//-- Creation des structures contenant les resultats
|
||||
|
||||
Handle(IntSurf_LineOn2S) ResultPntOn2SLine
|
||||
= new IntSurf_LineOn2S();
|
||||
Handle(IntSurf_LineOn2S) ResultPntOn2SLine = new IntSurf_LineOn2S();
|
||||
|
||||
IntSurf_PntOn2S StartPOn2S;
|
||||
TColStd_Array1OfReal StartParams(1,4);
|
||||
|
||||
TColStd_Array1OfReal StartParams(1,4);
|
||||
|
||||
ds = AC(High) / (NbPnts-1);
|
||||
Standard_Integer Indice = Low;
|
||||
@@ -443,15 +281,19 @@ const {
|
||||
Standard_Real dsmin = ds*0.3;
|
||||
Standard_Real smax = AC(High);
|
||||
|
||||
for(i=2,s=ds; (s < smax && Indice <= High-1); i++,s+=ds) {
|
||||
for(i=2,s=ds; (s < smax && Indice <= High-1); i++,s+=ds)
|
||||
{
|
||||
//----------------------------------------------------------
|
||||
//-- Recherche des indices des points --
|
||||
//-- Point : 2 i NbPnts-1 --
|
||||
//-- s s --
|
||||
//-- Current Indice tel que AC(Indice)<= s < AC(Indice+1) --
|
||||
//----------------------------------------------------------
|
||||
while(AC(Indice+1) <= s) {
|
||||
if(!HasBeenInserted) ResultPntOn2SLine->Add(myLine->Point(Indice));
|
||||
while(AC(Indice+1) <= s)
|
||||
{
|
||||
if(!HasBeenInserted)
|
||||
ResultPntOn2SLine->Add(myLine->Point(Indice));
|
||||
|
||||
HasBeenInserted = Standard_False;
|
||||
Indice++;
|
||||
if (Indice == High)
|
||||
@@ -461,10 +303,12 @@ const {
|
||||
if (Indice == High)
|
||||
break;
|
||||
|
||||
if(!HasBeenInserted && AC(Indice) <= s) {
|
||||
if(!HasBeenInserted && AC(Indice) <= s)
|
||||
{
|
||||
ResultPntOn2SLine->Add(myLine->Point(Indice));
|
||||
HasBeenInserted = Standard_True;
|
||||
}
|
||||
|
||||
Standard_Real a = s - AC(Indice);
|
||||
Standard_Real b = AC(Indice+1) - s;
|
||||
Standard_Real nab = 1.0/(a+b);
|
||||
@@ -474,48 +318,57 @@ const {
|
||||
//-- Si Dist au precedent point < dsmin --
|
||||
//-- --
|
||||
//----------------------------------------------------------
|
||||
if((a>dsmin) && (b>dsmin)) {
|
||||
|
||||
if((a>dsmin) && (b>dsmin))
|
||||
{
|
||||
u1 = (U1(Indice) * b + U1(Indice+1) * a) * nab;
|
||||
v1 = (V1(Indice) * b + V1(Indice+1) * a) * nab;
|
||||
u2 = (U2(Indice) * b + U2(Indice+1) * a) * nab;
|
||||
v2 = (V2(Indice) * b + V2(Indice+1) * a) * nab;
|
||||
|
||||
|
||||
if(((TheSvSurfaces *)PtrOnmySvSurfaces)->Compute(u1,v1,u2,v2,P,T,TS1,TS2)) {
|
||||
StartPOn2S.SetValue(P,u1,v1,u2,v2);
|
||||
//-- cout<<" Insertion du point calcule : "<<u1<<","<<v1<<","<<u2<<","<<v2<<",";
|
||||
//-- cout<<P.X()<<","<<P.Y()<<","<<P.Z()<<endl;
|
||||
ResultPntOn2SLine->Add(StartPOn2S);
|
||||
|
||||
if(((TheSvSurfaces *)PtrOnmySvSurfaces)->Compute(u1,v1,u2,v2,P,T,TS1,TS2))
|
||||
{
|
||||
StartPOn2S.SetValue(P,u1,v1,u2,v2);
|
||||
//-- cout<<" Insertion du point calcule : "<<u1<<","<<v1<<","<<u2<<","<<v2<<",";
|
||||
//-- cout<<P.X()<<","<<P.Y()<<","<<P.Z()<<endl;
|
||||
ResultPntOn2SLine->Add(StartPOn2S);
|
||||
}
|
||||
else {
|
||||
//-- cout<<" Probleme Non Traite ds ApproxInt_ApproxIntIntersection "<<endl;
|
||||
else
|
||||
{
|
||||
//-- cout<<" Probleme Non Traite ds ApproxInt_ApproxIntIntersection "<<endl;
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
//-- Point non situe a distance suffisante de 2 pts existants
|
||||
//-- avec le point p[indice] deja insere
|
||||
|
||||
if(b<0.0) {
|
||||
while(AC(Indice+1) <= s) {
|
||||
if(!HasBeenInserted) ResultPntOn2SLine->Add(myLine->Point(Indice));
|
||||
//-- cout<<" Insertion du point :"<<Indice<<endl;
|
||||
HasBeenInserted = Standard_False;
|
||||
Indice++;
|
||||
if(b<0.0)
|
||||
{
|
||||
while(AC(Indice+1) <= s)
|
||||
{
|
||||
if(!HasBeenInserted)
|
||||
ResultPntOn2SLine->Add(myLine->Point(Indice));
|
||||
|
||||
//-- cout<<" Insertion du point :"<<Indice<<endl;
|
||||
HasBeenInserted = Standard_False;
|
||||
Indice++;
|
||||
|
||||
if (Indice == High)
|
||||
break;
|
||||
}
|
||||
|
||||
if (Indice == High)
|
||||
}
|
||||
|
||||
if(Indice == High)
|
||||
break;
|
||||
|
||||
if(!HasBeenInserted && AC(Indice) <= s) {
|
||||
ResultPntOn2SLine->Add(myLine->Point(Indice));
|
||||
HasBeenInserted = Standard_True;
|
||||
}
|
||||
|
||||
if(!HasBeenInserted && AC(Indice) <= s)
|
||||
{
|
||||
ResultPntOn2SLine->Add(myLine->Point(Indice));
|
||||
HasBeenInserted = Standard_True;
|
||||
}
|
||||
}
|
||||
else {
|
||||
s+=dsmin - ds;
|
||||
else
|
||||
{
|
||||
s+= (dsmin - ds);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -538,7 +391,8 @@ const {
|
||||
|
||||
Standard_Integer CodeErreur=0;
|
||||
|
||||
for(i=3,NbPnts=temp->NbPnts();CodeErreur==0 && i<=NbPnts; i++) {
|
||||
for(i=3,NbPnts=temp->NbPnts();CodeErreur==0 && i<=NbPnts; i++)
|
||||
{
|
||||
Standard_Real d,du,dv,duv2;
|
||||
temp->Point(i).Parameters(u1,v1,u2,v2);
|
||||
//-- Virage P1A P1B P1C
|
||||
@@ -551,11 +405,13 @@ const {
|
||||
du = P1C.X() - u1;
|
||||
dv = P1C.Y() - v1;
|
||||
d = du*du+dv*dv;
|
||||
if(d>duv2) {
|
||||
if(d>duv2)
|
||||
{
|
||||
CodeErreur = 1;
|
||||
CodeErreur = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
//-- Virage P2A P2B P2C
|
||||
P2C.SetCoord(u2,v2);
|
||||
du = P2B.X()-P2A.X();
|
||||
@@ -566,53 +422,51 @@ const {
|
||||
du = P2C.X() - u2;
|
||||
dv = P2C.Y() - v2;
|
||||
d = du*du+dv*dv;
|
||||
if(d>duv2) {
|
||||
if(d>duv2)
|
||||
{
|
||||
CodeErreur = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
P1A=P1B;
|
||||
P2A=P2B;
|
||||
P1B=P1C;
|
||||
P2B=P2C;
|
||||
}
|
||||
#if DEBUG
|
||||
if (temp->NbPnts() < NbPntsToInsert + High - Low + 1) {
|
||||
cout<<" *** Pas assez de points entre :"<<Low<<" et "<<High<<" -> "<<temp->NbPnts()<<endl;
|
||||
}
|
||||
if(CodeErreur) {
|
||||
cout<<" *** CodeErreur : "<<CodeErreur<<endl;
|
||||
}
|
||||
|
||||
#if OCCT_DEBUG
|
||||
//if (temp->NbPnts() < NbPntsToInsert + High - Low + 1)
|
||||
//{
|
||||
// cout<<" *** Pas assez de points entre :"<<
|
||||
// Low<<" et "<<High<<" -> "<<temp->NbPnts()<<endl;
|
||||
//}
|
||||
|
||||
//if(CodeErreur)
|
||||
//{
|
||||
// cout<<" *** CodeErreur : "<<CodeErreur<<endl;
|
||||
//}
|
||||
#endif
|
||||
if((temp->NbPnts() >= NbPntsToInsert + High - Low + 1)
|
||||
&& (CodeErreur==0)) {
|
||||
return(ApproxInt_MultiLine(temp,
|
||||
(High-Low>10)? PtrOnmySvSurfaces : NULL,
|
||||
nbp3d,
|
||||
nbp2d,
|
||||
Xo,Ax,Yo,Ay,Zo,Az,
|
||||
U1o,A1u,V1o,A1v,
|
||||
U2o,A2u,V2o,A2v,
|
||||
p2donfirst,
|
||||
1,ResultPntOn2SLine->NbPoints()));
|
||||
|
||||
if((temp->NbPnts() >= NbPntsToInsert + High - Low + 1) && (CodeErreur==0))
|
||||
{
|
||||
return(ApproxInt_MultiLine( temp,
|
||||
(High-Low>10)? PtrOnmySvSurfaces : NULL,
|
||||
nbp3d, nbp2d, p2donfirst, 1, ResultPntOn2SLine->NbPoints()));
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
//-- cout<<" ApproxInt_MultiLine "<<endl;
|
||||
//-- cout<<" Pas de Rajout de points ds1min = "<<minds1<<" ds2min = "<<minds2<<endl;
|
||||
Handle(IntSurf_LineOn2S) vide1 = new IntSurf_LineOn2S();
|
||||
Handle(TheLine) vide = new TheLine(vide1,Standard_False);
|
||||
return(ApproxInt_MultiLine(vide,
|
||||
NULL,
|
||||
nbp3d,
|
||||
nbp2d,
|
||||
Xo,Ax,Yo,Ay,Zo,Az,
|
||||
U1o,A1u,V1o,A1v,
|
||||
U2o,A2u,V2o,A2v,
|
||||
p2donfirst,
|
||||
1,1));
|
||||
return(ApproxInt_MultiLine(vide, NULL, nbp3d, nbp2d, p2donfirst, 1, 1));
|
||||
}
|
||||
}
|
||||
//======================================================================
|
||||
|
||||
//=======================================================================
|
||||
//function : Dump
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void ApproxInt_MultiLine::Dump() const
|
||||
{
|
||||
TColgp_Array1OfPnt anArr1(1, 1);
|
||||
|
@@ -42,8 +42,7 @@
|
||||
BRepAlgo_BooleanOperations::BRepAlgo_BooleanOperations() :
|
||||
myApproxNbPntMax (30) ,
|
||||
myApproxTol3D (1.e-7) ,
|
||||
myApproxTol2D (1.e-7) ,
|
||||
myApproxRelativeTol (Standard_True)
|
||||
myApproxTol2D (1.e-7)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -109,13 +108,11 @@ myApproxRelativeTol (Standard_True)
|
||||
//=======================================================================
|
||||
void BRepAlgo_BooleanOperations::SetApproxParameters (const Standard_Integer NbPntMax,
|
||||
const Standard_Real Tol3D,
|
||||
const Standard_Real Tol2D,
|
||||
const Standard_Boolean RelativeTol)
|
||||
const Standard_Real Tol2D)
|
||||
{
|
||||
myApproxNbPntMax = NbPntMax ;
|
||||
myApproxTol3D = Tol3D ;
|
||||
myApproxTol2D = Tol2D ;
|
||||
myApproxRelativeTol = RelativeTol ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -140,7 +137,7 @@ myApproxRelativeTol (Standard_True)
|
||||
TopOpeBRepDS_BuildTool& BTofBuilder = myDSA.myHB->ChangeBuildTool();
|
||||
TopOpeBRepTool_GeomTool& GTofBTofBuilder = BTofBuilder.ChangeGeomTool();
|
||||
GTofBTofBuilder.SetNbPntMax(myApproxNbPntMax);
|
||||
GTofBTofBuilder.SetTolerances (myApproxTol3D, myApproxTol2D, myApproxRelativeTol) ;
|
||||
GTofBTofBuilder.SetTolerances (myApproxTol3D, myApproxTol2D) ;
|
||||
Handle(TopOpeBRepBuild_HBuilder)& HB = myDSA.myHB;
|
||||
Handle(TopOpeBRepDS_HDataStructure)& HDS = myDSA.ChangeDS();
|
||||
HB->Perform(HDS,myS1,myS2);
|
||||
|
@@ -58,7 +58,8 @@ public:
|
||||
//! the same time in one curve.
|
||||
//! Tol3D, Tol2D : Tolerances to be reached by the approximation.
|
||||
//! RelativeTol : The given tolerances are relative.
|
||||
Standard_EXPORT void SetApproxParameters (const Standard_Integer NbPntMax, const Standard_Real Tol3D, const Standard_Real Tol2D, const Standard_Boolean RelativeTol);
|
||||
Standard_EXPORT void SetApproxParameters (const Standard_Integer NbPntMax,
|
||||
const Standard_Real Tol3D, const Standard_Real Tol2D);
|
||||
|
||||
Standard_EXPORT void Define (const TopoDS_Shape& S1, const TopoDS_Shape& S2, Handle(TopOpeBRepDS_HDataStructure)& HDS);
|
||||
|
||||
@@ -129,9 +130,6 @@ private:
|
||||
Standard_Integer myApproxNbPntMax;
|
||||
Standard_Real myApproxTol3D;
|
||||
Standard_Real myApproxTol2D;
|
||||
Standard_Boolean myApproxRelativeTol;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@@ -59,13 +59,31 @@ public:
|
||||
|
||||
Standard_EXPORT BRepApprox_Approx();
|
||||
|
||||
Standard_EXPORT void Perform (const BRepAdaptor_Surface& Surf1, const BRepAdaptor_Surface& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
|
||||
Standard_EXPORT void Perform (const BRepAdaptor_Surface& Surf1,
|
||||
const BRepAdaptor_Surface& Surf2,
|
||||
const Handle(BRepApprox_ApproxLine)& aLine,
|
||||
const Standard_Boolean ApproxXYZ = Standard_True,
|
||||
const Standard_Boolean ApproxU1V1 = Standard_True,
|
||||
const Standard_Boolean ApproxU2V2 = Standard_True,
|
||||
const Standard_Integer indicemin = 0,
|
||||
const Standard_Integer indicemax = 0);
|
||||
|
||||
Standard_EXPORT void Perform (const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
|
||||
Standard_EXPORT void Perform (const Handle(BRepApprox_ApproxLine)& aLine,
|
||||
const Standard_Boolean ApproxXYZ = Standard_True,
|
||||
const Standard_Boolean ApproxU1V1 = Standard_True,
|
||||
const Standard_Boolean ApproxU2V2 = Standard_True,
|
||||
const Standard_Integer indicemin = 0,
|
||||
const Standard_Integer indicemax = 0);
|
||||
|
||||
Standard_EXPORT void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer DegMin, const Standard_Integer DegMax, const Standard_Integer NbIterMax, const Standard_Boolean ApproxWithTangency = Standard_True, const Approx_ParametrizationType Parametrization = Approx_ChordLength);
|
||||
|
||||
Standard_EXPORT void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Boolean RelativeTol, const Standard_Integer DegMin, const Standard_Integer DegMax, const Standard_Integer NbIterMax, const Standard_Integer NbPntMax, const Standard_Boolean ApproxWithTangency = Standard_True, const Approx_ParametrizationType Parametrization = Approx_ChordLength);
|
||||
Standard_EXPORT
|
||||
void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d,
|
||||
const Standard_Integer DegMin,
|
||||
const Standard_Integer DegMax,
|
||||
const Standard_Integer NbIterMax,
|
||||
const Standard_Integer NbPntMax = 30,
|
||||
const Standard_Boolean ApproxWithTangency = Standard_True,
|
||||
const Approx_ParametrizationType
|
||||
Parametrization = Approx_ChordLength);
|
||||
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
@@ -77,7 +95,8 @@ public:
|
||||
|
||||
Standard_EXPORT Standard_Integer NbMultiCurves() const;
|
||||
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& Value (const Standard_Integer Index) const;
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve&
|
||||
Value (const Standard_Integer Index) const;
|
||||
|
||||
|
||||
|
||||
@@ -90,11 +109,19 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
Standard_EXPORT Standard_Integer CorrectFinishIdx(const Standard_Integer theMinIdx,
|
||||
const Standard_Integer theMaxIdx,
|
||||
const Handle(BRepApprox_ApproxLine)& theline);
|
||||
Standard_EXPORT Standard_Integer
|
||||
CorrectFinishIdx( const Standard_Integer theMinIdx,
|
||||
const Standard_Integer theMaxIdx,
|
||||
const Handle(BRepApprox_ApproxLine)& theline);
|
||||
|
||||
Standard_EXPORT void Perform (const BRepAdaptor_Surface& Surf1, const IntSurf_Quadric& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax);
|
||||
Standard_EXPORT void Perform (const BRepAdaptor_Surface& Surf1,
|
||||
const IntSurf_Quadric& Surf2,
|
||||
const Handle(BRepApprox_ApproxLine)& aLine,
|
||||
const Standard_Boolean ApproxXYZ,
|
||||
const Standard_Boolean ApproxU1V1,
|
||||
const Standard_Boolean ApproxU2V2,
|
||||
const Standard_Integer indicemin,
|
||||
const Standard_Integer indicemax);
|
||||
|
||||
Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const BRepAdaptor_Surface& Surf2, const Handle(BRepApprox_ApproxLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax);
|
||||
|
||||
@@ -104,22 +131,16 @@ private:
|
||||
BRepApprox_TheComputeLineOfApprox myComputeLine;
|
||||
BRepApprox_TheComputeLineBezierOfApprox myComputeLineBezier;
|
||||
Approx_MCurvesToBSpCurve myBezToBSpl;
|
||||
Standard_Boolean myTolReached;
|
||||
Standard_Boolean myApproxBez;
|
||||
Standard_Boolean myWithTangency;
|
||||
Standard_Real myTol3d;
|
||||
Standard_Real myTol2d;
|
||||
Standard_Boolean myRelativeTol;
|
||||
Standard_Integer myDegMin;
|
||||
Standard_Integer myDegMax;
|
||||
Standard_Integer myNbPntMax;
|
||||
Standard_Integer myNbIterMax;
|
||||
Standard_Real myMinFactorXYZ;
|
||||
Standard_Real myMinFactorUV;
|
||||
Standard_Real myTolReached3d;
|
||||
Standard_Real myTolReached2d;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@@ -83,47 +83,88 @@ public:
|
||||
Standard_EXPORT void Perform (const BRepApprox_TheMultiLineOfApprox& Line);
|
||||
|
||||
//! changes the degrees of the approximation.
|
||||
Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
|
||||
Standard_EXPORT void SetDegrees ( const Standard_Integer degreemin,
|
||||
const Standard_Integer degreemax)
|
||||
{
|
||||
mydegremin = degreemin;
|
||||
mydegremax = degreemax;
|
||||
}
|
||||
|
||||
//! Changes the tolerances of the approximation.
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d,
|
||||
const Standard_Real Tolerance2d)
|
||||
{
|
||||
mytol3d = Tolerance3d;
|
||||
mytol2d = Tolerance2d;
|
||||
}
|
||||
|
||||
//! changes the first and the last constraint points.
|
||||
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC);
|
||||
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC,
|
||||
const AppParCurves_Constraint LastC)
|
||||
{
|
||||
myfirstC = FirstC;
|
||||
mylastC = LastC;
|
||||
}
|
||||
|
||||
//! returns False if at a moment of the approximation,
|
||||
//! the status NoApproximation has been sent by the user
|
||||
//! when more points were needed.
|
||||
Standard_EXPORT Standard_Boolean IsAllApproximated() const;
|
||||
Standard_EXPORT Standard_Boolean IsAllApproximated() const
|
||||
{
|
||||
return alldone;
|
||||
}
|
||||
|
||||
//! returns False if the status NoPointsAdded has been sent.
|
||||
Standard_EXPORT Standard_Boolean IsToleranceReached() const;
|
||||
Standard_EXPORT Standard_Boolean IsToleranceReached() const
|
||||
{
|
||||
return tolreached;
|
||||
}
|
||||
|
||||
//! returns the tolerances 2d and 3d of the <Index> MultiCurve.
|
||||
Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const;
|
||||
Standard_EXPORT void Error (const Standard_Integer Index,
|
||||
Standard_Real& tol3d,
|
||||
Standard_Real& tol2d) const
|
||||
{
|
||||
tol3d = Tolers3d.Value(Index);
|
||||
tol2d = Tolers2d.Value(Index);
|
||||
}
|
||||
|
||||
//! Returns the number of MultiCurve doing the approximation
|
||||
//! of the MultiLine.
|
||||
Standard_EXPORT Standard_Integer NbMultiCurves() const;
|
||||
Standard_EXPORT Standard_Integer NbMultiCurves() const
|
||||
{
|
||||
return myMultiCurves.Length();
|
||||
}
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT const AppParCurves_MultiCurve& Value (const Standard_Integer Index = 1) const;
|
||||
Standard_EXPORT const AppParCurves_MultiCurve&
|
||||
Value (const Standard_Integer Index = 1) const
|
||||
{
|
||||
return myMultiCurves.Value(Index);
|
||||
}
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1);
|
||||
Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1)
|
||||
{
|
||||
return myMultiCurves.ChangeValue(Index);
|
||||
}
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& SplineValue();
|
||||
|
||||
//! returns the type of parametrization
|
||||
Standard_EXPORT void Parametrization (Approx_ParametrizationType& partype) const;
|
||||
Standard_EXPORT Approx_ParametrizationType Parametrization () const
|
||||
{
|
||||
return Par;
|
||||
}
|
||||
|
||||
//! returns the new parameters of the approximation
|
||||
//! corresponding to the points of the multicurve <Index>.
|
||||
Standard_EXPORT const TColStd_Array1OfReal& Parameters (const Standard_Integer Index = 1) const;
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT const TColStd_Array1OfReal&
|
||||
Parameters (const Standard_Integer Index = 1) const
|
||||
{
|
||||
return (myPar.Value(Index))->Array1();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
|
@@ -30,7 +30,9 @@
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColgp_Array1OfVec.hxx>
|
||||
#include <TColgp_Array1OfVec2d.hxx>
|
||||
class BRepApprox_ApproxLine;
|
||||
#include <IntSurf_LineOn2S.hxx>
|
||||
#include <BRepApprox_ApproxLine.hxx>
|
||||
|
||||
class ApproxInt_SvSurfaces;
|
||||
|
||||
|
||||
@@ -40,105 +42,113 @@ class BRepApprox_TheMultiLineOfApprox
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! 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.
|
||||
//!
|
||||
//! SvSurfaces is a deferred class which allows
|
||||
//! several implementations of this algorithm with
|
||||
//! different surfaces (bi-parametric ones, or
|
||||
//! 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.
|
||||
//! SvSurfaces is a deferred class which allows several implementations of
|
||||
//! this algorithm with different surfaces (bi-parametric ones, or
|
||||
//! implicit and biparametric ones)
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line, const Standard_Address PtrSvSurfaces, const Standard_Integer NbP3d, const Standard_Integer NbP2d, const Standard_Real xo, const Standard_Real ax, const Standard_Real yo, const Standard_Real ay, const Standard_Real zo, const Standard_Real az, const Standard_Real u1o, const Standard_Real a1u, const Standard_Real v1o, const Standard_Real a1v, const Standard_Real u2o, const Standard_Real a2u, const Standard_Real v2o, const Standard_Real a2v, const Standard_Boolean P2DOnFirst, const Standard_Integer IndMin = 0, const Standard_Integer IndMax = 0);
|
||||
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line,
|
||||
const Standard_Address PtrSvSurfaces,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Boolean P2DOnFirst,
|
||||
const Standard_Integer IndMin = 0,
|
||||
const Standard_Integer IndMax = 0);
|
||||
|
||||
//! No Extra points will be added on the current line
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line, const Standard_Integer NbP3d, const Standard_Integer NbP2d, const Standard_Real xo, const Standard_Real ax, const Standard_Real yo, const Standard_Real ay, const Standard_Real zo, const Standard_Real az, const Standard_Real u1o, const Standard_Real a1u, const Standard_Real v1o, const Standard_Real a1v, const Standard_Real u2o, const Standard_Real a2u, const Standard_Real v2o, const Standard_Real a2v, const Standard_Boolean P2DOnFirst, const Standard_Integer IndMin = 0, const Standard_Integer IndMax = 0);
|
||||
|
||||
Standard_EXPORT Standard_Integer FirstPoint() const;
|
||||
|
||||
Standard_EXPORT Standard_Integer LastPoint() const;
|
||||
|
||||
//! Returns the number of 2d points of a TheLine.
|
||||
Standard_EXPORT Standard_Integer NbP2d() const;
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox(const Handle(BRepApprox_ApproxLine)& line,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Boolean P2DOnFirst,
|
||||
const Standard_Integer IndMin = 0,
|
||||
const Standard_Integer IndMax = 0);
|
||||
|
||||
Standard_EXPORT Standard_Integer FirstPoint() const
|
||||
{
|
||||
return indicemin;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Integer LastPoint() const
|
||||
{
|
||||
return indicemax;
|
||||
}
|
||||
|
||||
Standard_EXPORT Approx_Status WhatStatus() const
|
||||
{
|
||||
if(PtrOnmySvSurfaces)
|
||||
return(Approx_PointsAdded);
|
||||
else
|
||||
return(Approx_NoPointsAdded);
|
||||
}
|
||||
|
||||
//! Returns the number of 3d points of a TheLine.
|
||||
Standard_EXPORT Standard_Integer NbP3d() const;
|
||||
Standard_EXPORT Standard_Integer NbP3d() const
|
||||
{
|
||||
return nbp3d;
|
||||
}
|
||||
|
||||
//! Returns the number of 2d points of a TheLine.
|
||||
Standard_EXPORT Standard_Integer NbP2d() const
|
||||
{
|
||||
return nbp2d;
|
||||
}
|
||||
|
||||
Standard_EXPORT Approx_Status WhatStatus() const;
|
||||
//! Returns the 3d points of the multipoint <MPointIndex> when only 3d points exist.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex,
|
||||
TColgp_Array1OfPnt& tabPt) const
|
||||
{
|
||||
tabPt(1) = myLine->Point(MPointIndex).Value();
|
||||
}
|
||||
|
||||
//! returns the 3d points of the multipoint <MPointIndex>
|
||||
//! when only 3d points exist.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt) const;
|
||||
//! Returns the 3d and 2d points of the multipoint <MPointIndex>.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex,
|
||||
TColgp_Array1OfPnt& tabPt,
|
||||
TColgp_Array1OfPnt2d& tabPt2d) const
|
||||
{
|
||||
Value(MPointIndex, tabPt);
|
||||
Value(MPointIndex, tabPt2d);
|
||||
}
|
||||
|
||||
//! Returns the 2d points of the multipoint <MPointIndex> when only 2d points exist.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex,
|
||||
TColgp_Array1OfPnt2d& tabPt2d) const;
|
||||
|
||||
//! returns the 2d points of the multipoint <MPointIndex>
|
||||
//! when only 2d points exist.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d) const;
|
||||
//! Returns the 3d tangency points of the multipoint <MPointIndex> only
|
||||
//! when 3d points exist.
|
||||
Standard_EXPORT Standard_Boolean Tangency ( const Standard_Integer MPointIndex,
|
||||
TColgp_Array1OfVec& tabV) const;
|
||||
|
||||
//! returns the 3d and 2d points of the multipoint
|
||||
//! <MPointIndex>.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d) const;
|
||||
//! Returns the 2d tangency points of the multipoint <MPointIndex> only
|
||||
//! when 2d points exist.
|
||||
Standard_EXPORT Standard_Boolean Tangency ( const Standard_Integer MPointIndex,
|
||||
TColgp_Array1OfVec2d& tabV2d) const;
|
||||
|
||||
//! returns the 3d points of the multipoint <MPointIndex>
|
||||
//! when only 3d points exist.
|
||||
Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV) const;
|
||||
|
||||
//! returns the 2d tangency points of the multipoint
|
||||
//! <MPointIndex> only when 2d points exist.
|
||||
Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d) const;
|
||||
|
||||
//! 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;
|
||||
//! 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
|
||||
{
|
||||
return (Tangency(MPointIndex, tabV) && Tangency(MPointIndex, tabV2d));
|
||||
}
|
||||
|
||||
Standard_EXPORT BRepApprox_TheMultiLineOfApprox MakeMLBetween (const Standard_Integer Low, const Standard_Integer High, const Standard_Integer NbPointsToInsert) const;
|
||||
|
||||
//! Dump of the current multi-line.
|
||||
Standard_EXPORT void Dump() const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
BRepApprox_TheMultiLineOfApprox operator=(BRepApprox_TheMultiLineOfApprox&);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Address PtrOnmySvSurfaces;
|
||||
Handle(BRepApprox_ApproxLine) myLine;
|
||||
Standard_Integer indicemin;
|
||||
Standard_Integer indicemax;
|
||||
Standard_Integer nbp3d;
|
||||
Standard_Integer nbp2d;
|
||||
Standard_Boolean p2donfirst;
|
||||
Standard_Real Xo;
|
||||
Standard_Real Ax;
|
||||
Standard_Real Yo;
|
||||
Standard_Real Ay;
|
||||
Standard_Real Zo;
|
||||
Standard_Real Az;
|
||||
Standard_Real U1o;
|
||||
Standard_Real A1u;
|
||||
Standard_Real V1o;
|
||||
Standard_Real A1v;
|
||||
Standard_Real U2o;
|
||||
Standard_Real A2u;
|
||||
Standard_Real V2o;
|
||||
Standard_Real A2v;
|
||||
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _BRepApprox_TheMultiLineOfApprox_HeaderFile
|
||||
|
@@ -3039,8 +3039,6 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_HSurface)& S1,
|
||||
Standard_Real& tolreached,
|
||||
const Standard_Boolean wholeCurv)
|
||||
{
|
||||
Standard_Real Step = 0.1;
|
||||
|
||||
gp_Pnt pdeb1 = S1->Value(Pardeb(1),Pardeb(2));
|
||||
gp_Pnt pfin1 = S1->Value(Parfin(1),Parfin(2));
|
||||
gp_Pnt pdeb2 = S2->Value(Pardeb(3),Pardeb(4));
|
||||
@@ -3267,7 +3265,8 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_HSurface)& S1,
|
||||
else Ul = Uok;
|
||||
}
|
||||
else { // both projected, but where?
|
||||
if (Uf == Ul) continue;
|
||||
if (Abs(Uf - Ul) < Precision::PConfusion())
|
||||
continue;
|
||||
}
|
||||
ptestdeb = C3d->Value(Uf);
|
||||
ptestfin = C3d->Value(Ul);
|
||||
@@ -3323,7 +3322,8 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_HSurface)& S1,
|
||||
|
||||
// At this stage :
|
||||
// classic intersections have failed, the path is approached in vain.
|
||||
// Standard_Real Step = 0.1;
|
||||
|
||||
Standard_Real Step = 0.1;
|
||||
for(;;) {
|
||||
//Attention the parameters of arrow for the path and
|
||||
//the tolerance for the approximation can't be taken as those of the
|
||||
@@ -3451,8 +3451,12 @@ Standard_Boolean ChFi3d_ComputeCurves(const Handle(Adaptor3d_HSurface)& S1,
|
||||
//
|
||||
Handle(IntPatch_WLine) WL = new IntPatch_WLine(L2S,Standard_False);
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
//WL->Dump(0);
|
||||
#endif
|
||||
|
||||
GeomInt_WLApprox approx;
|
||||
approx.SetParameters(tolap,tol2d,4,8,0,1);
|
||||
approx.SetParameters(tolap, tol2d, 4, 8, 0, 30, Standard_True);
|
||||
// manage here the approximations that are not useful on planes!
|
||||
approx.Perform(S1,S2,WL,
|
||||
Standard_True,Standard_True,Standard_True,
|
||||
|
@@ -562,7 +562,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index,
|
||||
GeomInt_WLApprox theapp3d;
|
||||
Standard_Real tol2d = myTolApprox;
|
||||
//
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, Standard_True);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_True);
|
||||
|
||||
aNbParts=myLConstruct.NbParts();
|
||||
for (i=1; i<=aNbParts; i++) {
|
||||
@@ -658,12 +658,17 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index,
|
||||
}// case IntPatch_Analytic:
|
||||
break;
|
||||
|
||||
//########################################
|
||||
// Walking
|
||||
//########################################
|
||||
//########################################
|
||||
// Walking
|
||||
//########################################
|
||||
case IntPatch_Walking:{
|
||||
Handle(IntPatch_WLine) WL =
|
||||
Handle(IntPatch_WLine)::DownCast(L);
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
//WL->Dump(0);
|
||||
#endif
|
||||
|
||||
//
|
||||
Standard_Integer ifprm, ilprm;
|
||||
//
|
||||
@@ -701,10 +706,10 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index,
|
||||
tol2d = myTolApprox;
|
||||
aTolSS=2.e-7;
|
||||
if(myHS1 == myHS2) {
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, Standard_False);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_False);
|
||||
}
|
||||
else {
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, Standard_True);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_True);
|
||||
}
|
||||
//
|
||||
bIsDecomposited =
|
||||
@@ -749,7 +754,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index,
|
||||
if ((typs1==GeomAbs_BezierSurface || typs1==GeomAbs_BSplineSurface) &&
|
||||
(typs2==GeomAbs_BezierSurface || typs2==GeomAbs_BSplineSurface)) {
|
||||
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, Standard_True);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_True);
|
||||
//Standard_Boolean bUseSurfaces;
|
||||
//bUseSurfaces=NotUseSurfacesForApprox(myFace1, myFace2, WL, ifprm, ilprm);
|
||||
//if (bUseSurfaces) {
|
||||
@@ -2134,6 +2139,9 @@ void GeomInt_IntSS::TreatRLine(const Handle(IntPatch_RLine)& theRL,
|
||||
anAHC2d = theRL->ArcOnS1();
|
||||
theRL->ParamOnS1(tf, tl);
|
||||
theC2d1 = Geom2dAdaptor::MakeCurve(anAHC2d->Curve2d());
|
||||
tf = Max(tf, theC2d1->FirstParameter());
|
||||
tl = Min(tl, theC2d1->LastParameter());
|
||||
theC2d1 = new Geom2d_TrimmedCurve(theC2d1, tf, tl);
|
||||
}
|
||||
else if (theRL->IsArcOnS2())
|
||||
{
|
||||
@@ -2141,6 +2149,9 @@ void GeomInt_IntSS::TreatRLine(const Handle(IntPatch_RLine)& theRL,
|
||||
anAHC2d = theRL->ArcOnS2();
|
||||
theRL->ParamOnS2(tf, tl);
|
||||
theC2d2 = Geom2dAdaptor::MakeCurve(anAHC2d->Curve2d());
|
||||
tf = Max(tf, theC2d2->FirstParameter());
|
||||
tl = Min(tl, theC2d2->LastParameter());
|
||||
theC2d2 = new Geom2d_TrimmedCurve(theC2d2, tf, tl);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -83,54 +83,93 @@ public:
|
||||
Standard_EXPORT void Perform (const GeomInt_TheMultiLineOfWLApprox& Line);
|
||||
|
||||
//! changes the degrees of the approximation.
|
||||
Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
|
||||
Standard_EXPORT void SetDegrees ( const Standard_Integer degreemin,
|
||||
const Standard_Integer degreemax)
|
||||
{
|
||||
mydegremin = degreemin;
|
||||
mydegremax = degreemax;
|
||||
}
|
||||
|
||||
//! Changes the tolerances of the approximation.
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d,
|
||||
const Standard_Real Tolerance2d)
|
||||
{
|
||||
mytol3d = Tolerance3d;
|
||||
mytol2d = Tolerance2d;
|
||||
}
|
||||
|
||||
//! changes the first and the last constraint points.
|
||||
Standard_EXPORT void SetConstraints (const AppParCurves_Constraint firstC, const AppParCurves_Constraint lastC);
|
||||
Standard_EXPORT void SetConstraints ( const AppParCurves_Constraint FirstC,
|
||||
const AppParCurves_Constraint LastC)
|
||||
{
|
||||
myfirstC = FirstC;
|
||||
mylastC = LastC;
|
||||
}
|
||||
|
||||
//! returns False if at a moment of the approximation,
|
||||
//! the status NoApproximation has been sent by the user
|
||||
//! when more points were needed.
|
||||
Standard_EXPORT Standard_Boolean IsAllApproximated() const;
|
||||
Standard_EXPORT Standard_Boolean IsAllApproximated() const
|
||||
{
|
||||
return alldone;
|
||||
}
|
||||
|
||||
//! returns False if the status NoPointsAdded has been sent.
|
||||
Standard_EXPORT Standard_Boolean IsToleranceReached() const;
|
||||
Standard_EXPORT Standard_Boolean IsToleranceReached() const
|
||||
{
|
||||
return tolreached;
|
||||
}
|
||||
|
||||
//! returns the tolerances 2d and 3d of the <Index> MultiCurve.
|
||||
Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const;
|
||||
Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d,
|
||||
Standard_Real& tol2d) const
|
||||
{
|
||||
tol3d = Tolers3d.Value(Index);
|
||||
tol2d = Tolers2d.Value(Index);
|
||||
}
|
||||
|
||||
//! Returns the number of MultiCurve doing the approximation
|
||||
//! of the MultiLine.
|
||||
Standard_EXPORT Standard_Integer NbMultiCurves() const;
|
||||
Standard_EXPORT Standard_Integer NbMultiCurves() const
|
||||
{
|
||||
return myMultiCurves.Length();
|
||||
}
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT const AppParCurves_MultiCurve& Value (const Standard_Integer Index = 1) const;
|
||||
Standard_EXPORT const AppParCurves_MultiCurve&
|
||||
Value (const Standard_Integer Index = 1) const
|
||||
{
|
||||
return myMultiCurves.Value(Index);
|
||||
}
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1);
|
||||
Standard_EXPORT AppParCurves_MultiCurve& ChangeValue (const Standard_Integer Index = 1)
|
||||
{
|
||||
return myMultiCurves.ChangeValue(Index);
|
||||
}
|
||||
|
||||
//! returns the result of the approximation.
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& SplineValue();
|
||||
|
||||
//! returns the type of parametrization
|
||||
Standard_EXPORT void Parametrization (Approx_ParametrizationType& partype) const;
|
||||
|
||||
Standard_EXPORT Approx_ParametrizationType Parametrization () const
|
||||
{
|
||||
return Par;
|
||||
}
|
||||
|
||||
//! returns the new parameters of the approximation
|
||||
//! corresponding to the points of the multicurve <Index>.
|
||||
Standard_EXPORT const TColStd_Array1OfReal& Parameters (const Standard_Integer Index = 1) const;
|
||||
|
||||
|
||||
|
||||
Standard_EXPORT const TColStd_Array1OfReal&
|
||||
Parameters (const Standard_Integer Index = 1) const
|
||||
{
|
||||
return (myPar.Value(Index))->Array1();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
@@ -30,7 +30,9 @@
|
||||
#include <TColgp_Array1OfPnt2d.hxx>
|
||||
#include <TColgp_Array1OfVec.hxx>
|
||||
#include <TColgp_Array1OfVec2d.hxx>
|
||||
class IntPatch_WLine;
|
||||
#include <IntPatch_WLine.hxx>
|
||||
|
||||
|
||||
class ApproxInt_SvSurfaces;
|
||||
|
||||
|
||||
@@ -41,58 +43,99 @@ public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! 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.
|
||||
//!
|
||||
//! SvSurfaces is a deferred class which allows
|
||||
//! several implementations of this algorithm with
|
||||
//! different surfaces (bi-parametric ones, or
|
||||
//! 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.
|
||||
//! SvSurfaces is a deferred class which allows several implementations of
|
||||
//! this algorithm with different surfaces (bi-parametric ones, or
|
||||
//! implicit and biparametric ones)
|
||||
Standard_EXPORT GeomInt_TheMultiLineOfWLApprox(const Handle(IntPatch_WLine)& line, const Standard_Address PtrSvSurfaces, const Standard_Integer NbP3d, const Standard_Integer NbP2d, const Standard_Real xo, const Standard_Real ax, const Standard_Real yo, const Standard_Real ay, const Standard_Real zo, const Standard_Real az, const Standard_Real u1o, const Standard_Real a1u, const Standard_Real v1o, const Standard_Real a1v, const Standard_Real u2o, const Standard_Real a2u, const Standard_Real v2o, const Standard_Real a2v, const Standard_Boolean P2DOnFirst, const Standard_Integer IndMin = 0, const Standard_Integer IndMax = 0);
|
||||
Standard_EXPORT GeomInt_TheMultiLineOfWLApprox( const Handle(IntPatch_WLine)& line,
|
||||
const Standard_Address PtrSvSurfaces,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Boolean P2DOnFirst,
|
||||
const Standard_Integer IndMin = 0,
|
||||
const Standard_Integer IndMax = 0);
|
||||
|
||||
//! No Extra points will be added on the current line
|
||||
Standard_EXPORT GeomInt_TheMultiLineOfWLApprox(const Handle(IntPatch_WLine)& line, const Standard_Integer NbP3d, const Standard_Integer NbP2d, const Standard_Real xo, const Standard_Real ax, const Standard_Real yo, const Standard_Real ay, const Standard_Real zo, const Standard_Real az, const Standard_Real u1o, const Standard_Real a1u, const Standard_Real v1o, const Standard_Real a1v, const Standard_Real u2o, const Standard_Real a2u, const Standard_Real v2o, const Standard_Real a2v, const Standard_Boolean P2DOnFirst, const Standard_Integer IndMin = 0, const Standard_Integer IndMax = 0);
|
||||
Standard_EXPORT GeomInt_TheMultiLineOfWLApprox( const Handle(IntPatch_WLine)& line,
|
||||
const Standard_Integer NbP3d,
|
||||
const Standard_Integer NbP2d,
|
||||
const Standard_Boolean P2DOnFirst,
|
||||
const Standard_Integer IndMin = 0,
|
||||
const Standard_Integer IndMax = 0);
|
||||
|
||||
Standard_EXPORT Standard_Integer FirstPoint() const;
|
||||
Standard_EXPORT Standard_Integer FirstPoint() const
|
||||
{
|
||||
return indicemin;
|
||||
}
|
||||
|
||||
Standard_EXPORT Standard_Integer LastPoint() const;
|
||||
Standard_EXPORT Standard_Integer LastPoint() const
|
||||
{
|
||||
return indicemax;
|
||||
}
|
||||
|
||||
Standard_EXPORT Approx_Status WhatStatus() const
|
||||
{
|
||||
if(PtrOnmySvSurfaces)
|
||||
return(Approx_PointsAdded);
|
||||
else
|
||||
return(Approx_NoPointsAdded);
|
||||
}
|
||||
|
||||
//! Returns the number of 3d points of a TheLine.
|
||||
Standard_EXPORT Standard_Integer NbP3d() const
|
||||
{
|
||||
return nbp3d;
|
||||
}
|
||||
|
||||
//! Returns the number of 2d points of a TheLine.
|
||||
Standard_EXPORT Standard_Integer NbP2d() const;
|
||||
Standard_EXPORT Standard_Integer NbP2d() const
|
||||
{
|
||||
return nbp2d;
|
||||
}
|
||||
|
||||
//! Returns the number of 3d points of a TheLine.
|
||||
Standard_EXPORT Standard_Integer NbP3d() const;
|
||||
//! Returns the 3d points of the multipoint <MPointIndex> when only 3d points exist.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex,
|
||||
TColgp_Array1OfPnt& tabPt) const
|
||||
{
|
||||
tabPt(1) = myLine->Point(MPointIndex).Value();
|
||||
}
|
||||
|
||||
Standard_EXPORT Approx_Status WhatStatus() const;
|
||||
//! returns the 3d and 2d points of the multipoint <MPointIndex>.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex,
|
||||
TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d) const
|
||||
{
|
||||
Value(MPointIndex, tabPt);
|
||||
Value(MPointIndex, tabPt2d);
|
||||
}
|
||||
|
||||
//! returns the 3d points of the multipoint <MPointIndex>
|
||||
//! when only 3d points exist.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt) const;
|
||||
//! Returns the 2d points of the multipoint <MPointIndex> when only 2d points exist.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex,
|
||||
TColgp_Array1OfPnt2d& tabPt2d) const;
|
||||
|
||||
//! returns the 2d points of the multipoint <MPointIndex>
|
||||
//! when only 2d points exist.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt2d& tabPt2d) const;
|
||||
//! Returns the 3d tangency points of the multipoint <MPointIndex> only
|
||||
//! when 3d points exist.
|
||||
Standard_EXPORT Standard_Boolean Tangency ( const Standard_Integer MPointIndex,
|
||||
TColgp_Array1OfVec& tabV) const;
|
||||
|
||||
//! returns the 3d and 2d points of the multipoint
|
||||
//! <MPointIndex>.
|
||||
Standard_EXPORT void Value (const Standard_Integer MPointIndex, TColgp_Array1OfPnt& tabPt, TColgp_Array1OfPnt2d& tabPt2d) const;
|
||||
//! Returns the 2d tangency points of the multipoint <MPointIndex> only
|
||||
//! when 2d points exist.
|
||||
Standard_EXPORT Standard_Boolean Tangency ( const Standard_Integer MPointIndex,
|
||||
TColgp_Array1OfVec2d& tabV2d) const;
|
||||
|
||||
//! returns the 3d points of the multipoint <MPointIndex>
|
||||
//! when only 3d points exist.
|
||||
Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec& tabV) const;
|
||||
//! 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
|
||||
{
|
||||
return (Tangency(MPointIndex, tabV) && Tangency(MPointIndex, tabV2d));
|
||||
}
|
||||
|
||||
//! returns the 2d tangency points of the multipoint
|
||||
//! <MPointIndex> only when 2d points exist.
|
||||
Standard_EXPORT Standard_Boolean Tangency (const Standard_Integer MPointIndex, TColgp_Array1OfVec2d& tabV2d) const;
|
||||
|
||||
//! 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;
|
||||
|
||||
Standard_EXPORT GeomInt_TheMultiLineOfWLApprox MakeMLBetween (const Standard_Integer Low, const Standard_Integer High, const Standard_Integer NbPointsToInsert) const;
|
||||
Standard_EXPORT GeomInt_TheMultiLineOfWLApprox
|
||||
MakeMLBetween ( const Standard_Integer Low,
|
||||
const Standard_Integer High,
|
||||
const Standard_Integer NbPointsToInsert) const;
|
||||
|
||||
//! Dump of the current multi-line.
|
||||
Standard_EXPORT void Dump() const;
|
||||
@@ -101,44 +144,16 @@ public:
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
GeomInt_TheMultiLineOfWLApprox operator=(GeomInt_TheMultiLineOfWLApprox&);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Address PtrOnmySvSurfaces;
|
||||
Handle(IntPatch_WLine) myLine;
|
||||
Standard_Integer indicemin;
|
||||
Standard_Integer indicemax;
|
||||
Standard_Integer nbp3d;
|
||||
Standard_Integer nbp2d;
|
||||
Standard_Boolean p2donfirst;
|
||||
Standard_Real Xo;
|
||||
Standard_Real Ax;
|
||||
Standard_Real Yo;
|
||||
Standard_Real Ay;
|
||||
Standard_Real Zo;
|
||||
Standard_Real Az;
|
||||
Standard_Real U1o;
|
||||
Standard_Real A1u;
|
||||
Standard_Real V1o;
|
||||
Standard_Real A1v;
|
||||
Standard_Real U2o;
|
||||
Standard_Real A2u;
|
||||
Standard_Real V2o;
|
||||
Standard_Real A2v;
|
||||
|
||||
|
||||
const Standard_Address PtrOnmySvSurfaces;
|
||||
const Handle(IntPatch_WLine) myLine;
|
||||
const Standard_Integer indicemin;
|
||||
const Standard_Integer indicemax;
|
||||
const Standard_Integer nbp3d;
|
||||
const Standard_Integer nbp2d;
|
||||
const Standard_Boolean p2donfirst;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _GeomInt_TheMultiLineOfWLApprox_HeaderFile
|
||||
|
@@ -63,9 +63,15 @@ public:
|
||||
|
||||
Standard_EXPORT void Perform (const Handle(IntPatch_WLine)& aLine, const Standard_Boolean ApproxXYZ = Standard_True, const Standard_Boolean ApproxU1V1 = Standard_True, const Standard_Boolean ApproxU2V2 = Standard_True, const Standard_Integer indicemin = 0, const Standard_Integer indicemax = 0);
|
||||
|
||||
Standard_EXPORT void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer DegMin, const Standard_Integer DegMax, const Standard_Integer NbIterMax, const Standard_Boolean ApproxWithTangency = Standard_True, const Approx_ParametrizationType Parametrization = Approx_ChordLength);
|
||||
|
||||
Standard_EXPORT void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Boolean RelativeTol, const Standard_Integer DegMin, const Standard_Integer DegMax, const Standard_Integer NbIterMax, const Standard_Integer NbPntMax, const Standard_Boolean ApproxWithTangency = Standard_True, const Approx_ParametrizationType Parametrization = Approx_ChordLength);
|
||||
Standard_EXPORT
|
||||
void SetParameters (const Standard_Real Tol3d, const Standard_Real Tol2d,
|
||||
const Standard_Integer DegMin,
|
||||
const Standard_Integer DegMax,
|
||||
const Standard_Integer NbIterMax,
|
||||
const Standard_Integer NbPntMax = 30,
|
||||
const Standard_Boolean ApproxWithTangency = Standard_True,
|
||||
const Approx_ParametrizationType
|
||||
Parametrization = Approx_ChordLength);
|
||||
|
||||
Standard_EXPORT void Perform();
|
||||
|
||||
@@ -77,7 +83,8 @@ public:
|
||||
|
||||
Standard_EXPORT Standard_Integer NbMultiCurves() const;
|
||||
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve& Value (const Standard_Integer Index) const;
|
||||
Standard_EXPORT const AppParCurves_MultiBSpCurve&
|
||||
Value (const Standard_Integer Index) const;
|
||||
|
||||
|
||||
|
||||
@@ -90,11 +97,19 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
Standard_EXPORT Standard_Integer CorrectFinishIdx(const Standard_Integer theMinIdx,
|
||||
const Standard_Integer theMaxIdx,
|
||||
const Handle(IntPatch_WLine)& theline);
|
||||
Standard_EXPORT Standard_Integer
|
||||
CorrectFinishIdx( const Standard_Integer theMinIdx,
|
||||
const Standard_Integer theMaxIdx,
|
||||
const Handle(IntPatch_WLine)& theline);
|
||||
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Surf1, const IntSurf_Quadric& Surf2, const Handle(IntPatch_WLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax);
|
||||
Standard_EXPORT void Perform (const Handle(Adaptor3d_HSurface)& Surf1,
|
||||
const IntSurf_Quadric& Surf2,
|
||||
const Handle(IntPatch_WLine)& aLine,
|
||||
const Standard_Boolean ApproxXYZ,
|
||||
const Standard_Boolean ApproxU1V1,
|
||||
const Standard_Boolean ApproxU2V2,
|
||||
const Standard_Integer indicemin,
|
||||
const Standard_Integer indicemax);
|
||||
|
||||
Standard_EXPORT void Perform (const IntSurf_Quadric& Surf1, const Handle(Adaptor3d_HSurface)& Surf2, const Handle(IntPatch_WLine)& aLine, const Standard_Boolean ApproxXYZ, const Standard_Boolean ApproxU1V1, const Standard_Boolean ApproxU2V2, const Standard_Integer indicemin, const Standard_Integer indicemax);
|
||||
|
||||
@@ -104,22 +119,16 @@ private:
|
||||
GeomInt_TheComputeLineOfWLApprox myComputeLine;
|
||||
GeomInt_TheComputeLineBezierOfWLApprox myComputeLineBezier;
|
||||
Approx_MCurvesToBSpCurve myBezToBSpl;
|
||||
Standard_Boolean myTolReached;
|
||||
Standard_Boolean myApproxBez;
|
||||
Standard_Boolean myWithTangency;
|
||||
Standard_Real myTol3d;
|
||||
Standard_Real myTol2d;
|
||||
Standard_Boolean myRelativeTol;
|
||||
Standard_Integer myDegMin;
|
||||
Standard_Integer myDegMax;
|
||||
Standard_Integer myNbPntMax;
|
||||
Standard_Integer myNbIterMax;
|
||||
Standard_Real myMinFactorXYZ;
|
||||
Standard_Real myMinFactorUV;
|
||||
Standard_Real myTolReached3d;
|
||||
Standard_Real myTolReached2d;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@@ -280,16 +280,14 @@ static Standard_Integer extrema(Draw_Interpretor& di, Standard_Integer n, const
|
||||
//function : intersect
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
static Standard_Integer intersect(Draw_Interpretor& di, Standard_Integer n, const char** a)
|
||||
{
|
||||
if( n < 2)
|
||||
{
|
||||
#ifdef OCCT_DEBUG
|
||||
cout<< "2dintersect curve curve [Tol]"<<endl;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
Standard_Integer k = 1;
|
||||
Handle(Geom2d_Curve) C1 = DrawTrSurf::GetCurve2d(a[k++]);
|
||||
if ( C1.IsNull())
|
||||
@@ -331,6 +329,7 @@ static Standard_Integer intersect(Draw_Interpretor& di, Standard_Integer n, cons
|
||||
Handle(Geom2d_Curve) S1,S2;
|
||||
Handle(DrawTrSurf_Curve2d) CD;
|
||||
for ( i = 1; i <= Intersector.NbSegments(); i++) {
|
||||
di << "Segment #" << i << " found.\n";
|
||||
Intersector.Segment(i,S1,S2);
|
||||
CD = new DrawTrSurf_Curve2d(S1, Draw_bleu, 30);
|
||||
dout << CD;
|
||||
|
@@ -450,7 +450,7 @@ void HLRTopoBRep_DSFiller::InsertFace (const Standard_Integer /*FI*/,
|
||||
|
||||
//-- cout<<"\nHLRTopoBRep_DSFiller : nbp="<<nbp<<" Tol3d="<<TOL3d<<" Tol2d="<<TOL2d<<endl;
|
||||
|
||||
Approx.SetParameters(TOL3d,TOL2d,dmin,dmax,niter,tg);
|
||||
Approx.SetParameters(TOL3d, TOL2d, dmin, dmax, niter, 30, tg);
|
||||
Approx.Perform(AppLine,Standard_True,Standard_True,Standard_False,1,nbp);
|
||||
if (!Approx.IsDone()) {
|
||||
C = AppC;
|
||||
|
@@ -420,6 +420,136 @@ static void JoinWLines(IntPatch_SequenceOfLine& theSlin,
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : CleanWline
|
||||
//purpose : Iterates set of points in theWline and removes several of it
|
||||
// if they led to too non-uniform distribution.
|
||||
//ATTENTION!!!
|
||||
// 1. Removed point must not be vertex.
|
||||
// 2. In the future, this method should be improved to make it more universal.
|
||||
// Now, it is created only in order to avoid regressions.
|
||||
//=======================================================================
|
||||
static void CleanWline( const GeomAbs_SurfaceType theTypeS1,
|
||||
const GeomAbs_SurfaceType theTypeS2,
|
||||
const Handle(IntPatch_WLine)& theWline)
|
||||
{
|
||||
const Standard_Real aFactor = 100.0;
|
||||
const Standard_Integer aNbVertices = theWline->NbVertex();
|
||||
|
||||
Standard_Boolean isSurfS1WithSeam = (theTypeS1 == GeomAbs_Cylinder) ||
|
||||
(theTypeS1 == GeomAbs_Cone) ||
|
||||
(theTypeS1 == GeomAbs_Sphere) ||
|
||||
(theTypeS1 == GeomAbs_Torus) ||
|
||||
(theTypeS1 == GeomAbs_SurfaceOfRevolution),
|
||||
isSurfS2WithSeam = (theTypeS2 == GeomAbs_Cylinder) ||
|
||||
(theTypeS2 == GeomAbs_Cone) ||
|
||||
(theTypeS2 == GeomAbs_Sphere) ||
|
||||
(theTypeS2 == GeomAbs_Torus) ||
|
||||
(theTypeS2 == GeomAbs_SurfaceOfRevolution);
|
||||
|
||||
if(!isSurfS1WithSeam && !isSurfS2WithSeam)
|
||||
return;
|
||||
|
||||
//Sometimes WLine contains several vertices which have same ParameterOnLine
|
||||
//(i.e. one IntSurf_PntOn2S is marked by several vertices).
|
||||
//However, neighbour points should be deleted once. To provide it, we enter
|
||||
//following variable.
|
||||
Standard_Integer aVertIndPrev = -1;
|
||||
|
||||
for(Standard_Integer aVertID = 1; aVertID <= aNbVertices; aVertID++)
|
||||
{
|
||||
Standard_Integer aRemoveInd = -1;
|
||||
const IntPatch_Point& aVert = theWline->Vertex(aVertID);
|
||||
|
||||
{
|
||||
//Consider only vertices which in the seam. Another vertices are rejected.
|
||||
Standard_Real u1 = 0.0, v1 = 0.0, u2 = 0.0, v2 = 0.0;
|
||||
aVert.Parameters(u1, v1, u2, v2);
|
||||
if( (!isSurfS1WithSeam || (!IsEqual(u1, 0.0) && !IsEqual(u1, 2.0*M_PI))) &&
|
||||
(!isSurfS2WithSeam || (!IsEqual(u2, 0.0) && !IsEqual(u2, 2.0*M_PI))))
|
||||
continue;
|
||||
}
|
||||
|
||||
const Standard_Integer aVertInd = static_cast<Standard_Integer>(aVert.ParameterOnLine());
|
||||
|
||||
if(aVertInd == aVertIndPrev)
|
||||
{//Go to the next vertex, whose ParameterOnLine is different from aVertInd.
|
||||
continue;
|
||||
}
|
||||
|
||||
aVertIndPrev = aVertInd;
|
||||
|
||||
//This condition should be removed (it is added in order to make checking easier)
|
||||
if((aVertInd == 1) || (aVertInd == theWline->NbPnts()))
|
||||
continue;
|
||||
|
||||
const gp_Pnt &aPCurr = aVert.Value();
|
||||
const gp_Pnt &aPPrev = theWline->Curve()->Value(aVertInd-1).Value(),
|
||||
&aPNext = theWline->Curve()->Value(aVertInd+1).Value();
|
||||
|
||||
const Standard_Real aSqD1 = aPCurr.SquareDistance(aPPrev),
|
||||
aSqD2 = aPCurr.SquareDistance(aPNext);
|
||||
|
||||
if(aSqD1 > aFactor*aSqD2)
|
||||
{
|
||||
aRemoveInd = aVertInd+1;
|
||||
|
||||
//Check, if removed point is not the Vertex
|
||||
if(aVertID < aNbVertices)
|
||||
{
|
||||
Standard_Integer aNextVertParam = static_cast<Standard_Integer>(theWline->Vertex(aVertID+1).ParameterOnLine());
|
||||
if(aNextVertParam == aRemoveInd)
|
||||
{//The candidate is the Vertex. Removing is forbidden.
|
||||
aRemoveInd = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(aSqD2 > aFactor*aSqD1)
|
||||
{
|
||||
aRemoveInd = aVertInd-1;
|
||||
|
||||
//Check, if removed point is not the Vertex
|
||||
if(aVertID > 1)
|
||||
{
|
||||
Standard_Integer aNextVertParam = static_cast<Standard_Integer>(theWline->Vertex(aVertID-1).ParameterOnLine());
|
||||
if(aNextVertParam == aRemoveInd)
|
||||
{//The candidate is the Vertex. Removing is forbidden.
|
||||
aRemoveInd = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
aRemoveInd = -1;
|
||||
}
|
||||
|
||||
if(aRemoveInd < 1)
|
||||
continue;
|
||||
|
||||
//Removing
|
||||
theWline->Curve()->RemovePoint(aRemoveInd);
|
||||
|
||||
//After removing points, ParameterOnLine for some vertices should be shifted
|
||||
//(usualy it means the number of this vertex in
|
||||
//the sequence of Walking-line points).
|
||||
for(Standard_Integer aVID = 1; aVID <= aNbVertices; aVID++)
|
||||
{
|
||||
const Standard_Integer aVertParam =
|
||||
static_cast<Standard_Integer>(theWline->Vertex(aVID).ParameterOnLine());
|
||||
|
||||
if(aVertParam < aRemoveInd)
|
||||
continue;
|
||||
|
||||
IntPatch_Point aVertTemp(theWline->Vertex(aVID));
|
||||
aVertTemp.SetParameter(aVertParam-1);
|
||||
theWline->Replace(aVID, aVertTemp);
|
||||
|
||||
if(aVID == aVertID)
|
||||
aVertIndPrev--;
|
||||
}
|
||||
}//for(Standard_Integer aVertID = 1; aVertID <= aNbVertices; aVertID++)
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// function: SequenceOfLine
|
||||
//======================================================================
|
||||
@@ -1336,6 +1466,14 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
||||
ParamParamPerfom(theS1, theD1, theS2, theD2, TolArc,
|
||||
TolTang, ListOfPnts, RestrictLine, typs1, typs2);
|
||||
}
|
||||
|
||||
for(Standard_Integer i = slin.Lower(); i <= slin.Upper(); i++)
|
||||
{
|
||||
const Handle(IntPatch_WLine) WL = Handle(IntPatch_WLine)::DownCast(slin(i));
|
||||
|
||||
if(!WL.IsNull())
|
||||
CleanWline(typs1, typs2, WL);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -1555,6 +1693,14 @@ void IntPatch_Intersection::Perform(const Handle(Adaptor3d_HSurface)& theS1,
|
||||
TolArc, TolTang, ListOfPnts, RestrictLine, typs1, typs2);
|
||||
}
|
||||
}
|
||||
|
||||
for(Standard_Integer i = slin.Lower(); i <= slin.Upper(); i++)
|
||||
{
|
||||
const Handle(IntPatch_WLine) WL = Handle(IntPatch_WLine)::DownCast(slin(i));
|
||||
|
||||
if(!WL.IsNull())
|
||||
CleanWline(typs1, typs2, WL);
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -1394,7 +1394,7 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
||||
//
|
||||
Standard_Real tol2d = myTolApprox;
|
||||
//
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, Standard_True);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_True);
|
||||
|
||||
aNbParts=myLConstruct.NbParts();
|
||||
for (i=1; i<=aNbParts; i++) {
|
||||
@@ -1578,17 +1578,18 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
||||
}
|
||||
|
||||
if(myHS1 == myHS2) {
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, Standard_False, aParType);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_False, aParType);
|
||||
rejectSurface = Standard_True;
|
||||
}
|
||||
else {
|
||||
if(reApprox && !rejectSurface)
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, Standard_False, aParType);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30, Standard_False, aParType);
|
||||
else {
|
||||
Standard_Integer iDegMax, iDegMin, iNbIter;
|
||||
//
|
||||
ApproxParameters(myHS1, myHS2, iDegMin, iDegMax, iNbIter);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, iDegMin, iDegMax, iNbIter, Standard_True, aParType);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, iDegMin, iDegMax,
|
||||
iNbIter, 30, Standard_True, aParType);
|
||||
}
|
||||
}
|
||||
//
|
||||
@@ -1654,7 +1655,8 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
||||
if ((typs1==GeomAbs_BezierSurface || typs1==GeomAbs_BSplineSurface) &&
|
||||
(typs2==GeomAbs_BezierSurface || typs2==GeomAbs_BSplineSurface)) {
|
||||
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, Standard_True, aParType);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30,
|
||||
Standard_True, aParType);
|
||||
|
||||
Standard_Boolean bUseSurfaces;
|
||||
bUseSurfaces = IntTools_WLineTool::NotUseSurfacesForApprox(myFace1, myFace2, WL, ifprm, ilprm);
|
||||
@@ -1662,7 +1664,8 @@ void IntTools_FaceFace::MakeCurve(const Standard_Integer Index,
|
||||
// ######
|
||||
rejectSurface = Standard_True;
|
||||
// ######
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, Standard_False, aParType);
|
||||
theapp3d.SetParameters(myTolApprox, tol2d, 4, 8, 0, 30,
|
||||
Standard_False, aParType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@ QABugs_16.cxx
|
||||
QABugs_17.cxx
|
||||
QABugs_18.cxx
|
||||
QABugs_19.cxx
|
||||
QABugs_20.cxx
|
||||
QABugs_MyText.cxx
|
||||
QABugs_MyText.hxx
|
||||
QABugs_PresentableObject.cxx
|
||||
|
@@ -35,6 +35,7 @@ void QABugs::Commands(Draw_Interpretor& theCommands) {
|
||||
QABugs::Commands_17(theCommands);
|
||||
QABugs::Commands_18(theCommands);
|
||||
QABugs::Commands_19(theCommands);
|
||||
QABugs::Commands_20(theCommands);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@@ -73,6 +73,7 @@ public:
|
||||
|
||||
Standard_EXPORT static void Commands_19 (Draw_Interpretor& DI);
|
||||
|
||||
Standard_EXPORT static void Commands_20 (Draw_Interpretor& DI);
|
||||
|
||||
|
||||
|
||||
|
@@ -1695,14 +1695,9 @@ static Standard_Integer OCC708 (Draw_Interpretor& di, Standard_Integer argc, con
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
#include <TColStd_Array2OfInteger.hxx>
|
||||
static Standard_Integer OCC670 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
|
||||
static Standard_Integer OCC670 (Draw_Interpretor&, Standard_Integer, const char **)
|
||||
{
|
||||
if(argc != 1){
|
||||
di<<"Usage : " << argv[0] << "\n";
|
||||
return -1;
|
||||
}
|
||||
TColStd_Array2OfInteger Array2OfInteger(1,1,1,1);
|
||||
Array2OfInteger.SetValue(5,5,55);
|
||||
Standard_OutOfRange::Raise();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
1251
src/QABugs/QABugs_20.cxx
Normal file
1251
src/QABugs/QABugs_20.cxx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -286,17 +286,15 @@ static Standard_Integer BUC60652(Draw_Interpretor& di, Standard_Integer argc, co
|
||||
static Standard_Integer defNbPntMax = 30;
|
||||
static Standard_Real defTol3d = 1.e-7;
|
||||
static Standard_Real defTol2d = 1.e-7;
|
||||
static Standard_Boolean defRelativeTol=Standard_True;
|
||||
Standard_Integer NbPntMax = defNbPntMax;
|
||||
Standard_Real Toler3d =defTol3d;
|
||||
Standard_Real Toler2d = defTol2d;
|
||||
Standard_Boolean RelativeTol= defRelativeTol;
|
||||
// //== // ksection : operateur section appelant BRepAlgo_BooleanOperation
|
||||
//== // ksection : operateur section appelant BRepAlgo_BooleanOperations
|
||||
//=======================================================================
|
||||
Standard_Integer ksection(Draw_Interpretor& di, Standard_Integer n, const char ** a) {
|
||||
if (n < 8) {
|
||||
di << "Usage : " << a[0] << " resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol" << "\n";
|
||||
di << "Usage : " << a[0] << " resultat shell1 shell2 NbPntMax Toler3d Toler2d" << "\n";
|
||||
return -1;
|
||||
}
|
||||
// a[1]= resultat
|
||||
@@ -305,20 +303,18 @@ Standard_Integer ksection(Draw_Interpretor& di, Standard_Integer n, const char *
|
||||
// a[4]= NbPntMax
|
||||
// a[5]= Toler3d
|
||||
// a[6]= Toler2d
|
||||
// a[7]= RelativeTol
|
||||
TopoDS_Shape s1 = DBRep::Get(a[2],TopAbs_SHELL);
|
||||
TopoDS_Shape s2 = DBRep::Get(a[3],TopAbs_SHELL);
|
||||
if (s1.IsNull() || s2.IsNull()) return 1;
|
||||
NbPntMax=Draw::Atoi(a[4]);
|
||||
Toler3d=Draw::Atof(a[5]);
|
||||
Toler2d=Draw::Atof(a[6]);
|
||||
RelativeTol=Draw::Atoi(a[7]);
|
||||
|
||||
di << "BRepAlgo_BooleanOperations myalgo" << "\n";
|
||||
BRepAlgo_BooleanOperations myalgo;
|
||||
|
||||
myalgo.Shapes(s1, s2);
|
||||
myalgo.SetApproxParameters(NbPntMax,Toler3d,Toler2d,RelativeTol);
|
||||
myalgo.SetApproxParameters(NbPntMax,Toler3d,Toler2d);
|
||||
TopoDS_Shape res; res = myalgo.Section();
|
||||
DBRep::Set(a[1],res);
|
||||
return 0;
|
||||
@@ -1816,10 +1812,10 @@ void QABugs::Commands_3(Draw_Interpretor& theCommands) {
|
||||
theCommands.Add("BUC60609","BUC60609 shape name [U V]",__FILE__,BUC60609,group);
|
||||
theCommands.Add("BUC60632","BUC60632 mode length",__FILE__,BUC60632,group);
|
||||
theCommands.Add("BUC60652","BUC60652 face",__FILE__,BUC60652,group);
|
||||
theCommands.Add("ksection","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
|
||||
theCommands.Add("BUC60682","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
|
||||
theCommands.Add("BUC60669","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
|
||||
theCommands.Add("PRO19626","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d RelativeTol",__FILE__,ksection,group);
|
||||
theCommands.Add("ksection","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d",__FILE__,ksection,group);
|
||||
theCommands.Add("BUC60682","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d",__FILE__,ksection,group);
|
||||
theCommands.Add("BUC60669","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d",__FILE__,ksection,group);
|
||||
theCommands.Add("PRO19626","ksection resultat shell1 shell2 NbPntMax Toler3d Toler2d",__FILE__,ksection,group);
|
||||
theCommands.Add("BUC60574","BUC60574 ",__FILE__,BUC60574,group);
|
||||
|
||||
theCommands.Add("BUC60699","BUC60699 ",__FILE__,BUC60699,group);
|
||||
|
@@ -217,7 +217,7 @@ void ShapeAlgo_AlgoContainer::ApproxBSplineCurve (const Handle(Geom_BSplineCurve
|
||||
}
|
||||
GeomInt_WLApprox theapp3d;
|
||||
Standard_Real Tol = Precision::Approximation();
|
||||
theapp3d.SetParameters(Tol, Tol, 4, 8, 0, Standard_True);
|
||||
theapp3d.SetParameters(Tol, Tol, 4, 8, 0, 30, Standard_True);
|
||||
Handle(IntPatch_WLine) WL = new IntPatch_WLine(R, Standard_False);
|
||||
Standard_Integer indicemin = 1;
|
||||
Standard_Integer indicemax = jpole;
|
||||
@@ -349,7 +349,7 @@ void ShapeAlgo_AlgoContainer::ApproxBSplineCurve (const Handle(Geom2d_BSplineCur
|
||||
}
|
||||
GeomInt_WLApprox theapp3d;
|
||||
Standard_Real Tol = Precision::PApproximation();
|
||||
theapp3d.SetParameters(Tol, Tol, 4, 8, 0, Standard_True);
|
||||
theapp3d.SetParameters(Tol, Tol, 4, 8, 0, 30, Standard_True);
|
||||
Handle(IntPatch_WLine) WL = new IntPatch_WLine(R, Standard_False);
|
||||
Standard_Integer indicemin = 1;
|
||||
Standard_Integer indicemax = jpole;
|
||||
|
@@ -318,8 +318,7 @@ Standard_Boolean TopOpeBRepTool_CurveTool::MakeCurves
|
||||
Standard_Boolean CompPC1 = myGeomTool.CompPC1();
|
||||
Standard_Boolean CompPC2 = myGeomTool.CompPC2();
|
||||
Standard_Real tol3d,tol2d;
|
||||
Standard_Boolean RelativeTol;
|
||||
myGeomTool.GetTolerances(tol3d,tol2d,RelativeTol);
|
||||
myGeomTool.GetTolerances(tol3d,tol2d);
|
||||
Standard_Integer NbPntMax = myGeomTool.NbPntMax();
|
||||
|
||||
#ifdef OCCT_DEBUG
|
||||
@@ -599,7 +598,7 @@ Standard_Boolean TopOpeBRepTool_CurveTool::MakeCurves
|
||||
Handle(BRepApprox_ApproxLine) AL;
|
||||
AL = new BRepApprox_ApproxLine(HC3D,HPC1,HPC2);
|
||||
|
||||
Approx.SetParameters(tol3d,tol2d,RelativeTol,degmin,degmax,nitmax,NbPntMax,withtangency,
|
||||
Approx.SetParameters(tol3d,tol2d,degmin,degmax,nitmax,NbPntMax,withtangency,
|
||||
parametrization);
|
||||
|
||||
if (CompC3D && CompPC1 && BAS1.GetType() == GeomAbs_Plane) {
|
||||
|
@@ -33,7 +33,6 @@ TopOpeBRepTool_GeomTool::TopOpeBRepTool_GeomTool
|
||||
myCompPC2(CompPC2),
|
||||
myTol3d(Precision::Approximation()),
|
||||
myTol2d(Precision::PApproximation()),
|
||||
myRelativeTol(Standard_True),
|
||||
myNbPntMax(30)
|
||||
{
|
||||
}
|
||||
@@ -133,34 +132,6 @@ void TopOpeBRepTool_GeomTool::SetTolerances
|
||||
{
|
||||
myTol3d = tol3d;
|
||||
myTol2d = tol2d;
|
||||
myRelativeTol = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetTolerances
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopOpeBRepTool_GeomTool::GetTolerances
|
||||
(Standard_Real& tol3d, Standard_Real& tol2d, Standard_Boolean& relative) const
|
||||
{
|
||||
tol3d = myTol3d;
|
||||
tol2d = myTol2d;
|
||||
relative = myRelativeTol;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTolerances
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void TopOpeBRepTool_GeomTool::SetTolerances
|
||||
(const Standard_Real tol3d, const Standard_Real tol2d, const Standard_Boolean relative)
|
||||
{
|
||||
myTol3d = tol3d;
|
||||
myTol2d = tol2d;
|
||||
myRelativeTol = relative;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -63,10 +63,6 @@ public:
|
||||
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real tol3d, const Standard_Real tol2d);
|
||||
|
||||
Standard_EXPORT void GetTolerances (Standard_Real& tol3d, Standard_Real& tol2d, Standard_Boolean& relative) const;
|
||||
|
||||
Standard_EXPORT void SetTolerances (const Standard_Real tol3d, const Standard_Real tol2d, const Standard_Boolean relative);
|
||||
|
||||
Standard_EXPORT Standard_Integer NbPntMax() const;
|
||||
|
||||
Standard_EXPORT void SetNbPntMax (const Standard_Integer NbPntMax);
|
||||
@@ -98,7 +94,6 @@ private:
|
||||
|
||||
Standard_Real myTol3d;
|
||||
Standard_Real myTol2d;
|
||||
Standard_Boolean myRelativeTol;
|
||||
Standard_Integer myNbPntMax;
|
||||
|
||||
|
||||
|
@@ -11,4 +11,4 @@ mkevol result s
|
||||
updatevol s_7 0 10 1 20 2 10
|
||||
buildevol
|
||||
|
||||
set square 11500.5
|
||||
set square 12023.4
|
||||
|
@@ -4,6 +4,8 @@
|
||||
## Comment : From CV tests serie page 25/26
|
||||
## ===========================================
|
||||
|
||||
puts "TODO #OCC26740 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
|
||||
restore [locate_data_file CCV_1_h1_gsk.rle] s
|
||||
explode s E
|
||||
blend result s 30 s_14
|
||||
|
@@ -1,14 +1,10 @@
|
||||
puts "BUC60290 (the same problem with cut and common)"
|
||||
|
||||
puts "TODO OCC1111 ALL: Error : The area of the resulting shape is"
|
||||
|
||||
restore [locate_data_file buc60290a.rle] sol1
|
||||
restore [locate_data_file buc60290b.rle] sol2
|
||||
|
||||
bcommon result sol2 sol1
|
||||
|
||||
set square 667287
|
||||
if { [regexp {Windows} [dversion]] } {
|
||||
if { [regexp {64} [dversion]] } {
|
||||
#set square 804392
|
||||
puts "TODO OCC1111 Windows: Error : The area of the resulting shape is"
|
||||
}
|
||||
}
|
||||
set square 667287
|
@@ -1,3 +1,5 @@
|
||||
puts "TODO #OCC26777 ALL: Error : The length of the resulting shape is"
|
||||
|
||||
restore [locate_data_file GEN758_nofog.rle] a
|
||||
explode a
|
||||
bsection result a_1 a_2
|
||||
|
@@ -2,4 +2,4 @@ restore [locate_data_file GEN778_nofog.rle] a
|
||||
explode a
|
||||
bsection result a_1 a_2
|
||||
|
||||
set length 456.707
|
||||
set length 456.706
|
||||
|
@@ -1,3 +1,5 @@
|
||||
puts "TODO #OCC26814 ALL: Error : The length of the resulting shape is"
|
||||
|
||||
restore [locate_data_file lh3d_px1.brep] a
|
||||
plane p 0 0 0 1 0 0
|
||||
mkface f p
|
||||
|
@@ -1,8 +1,6 @@
|
||||
# test script on make volume operation
|
||||
# cone cylinder plane
|
||||
|
||||
puts "TODO OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
|
||||
# planar face
|
||||
plane pln_f1 2.3537565147188571e-015 -592.35294118000002 1.1044592656221142e-015 0.90529096719956037 4.7161388709779336e-017 0.42479202523927467
|
||||
erase pln_f1
|
||||
@@ -41,5 +39,5 @@ mkface f7 cyl_f7 0 6.2831853071795862 -1000000 1000000
|
||||
# make volume operation
|
||||
mkvolume result f1 f2 f3 f4 f5 f6 f7
|
||||
|
||||
set square 1.71122e+013
|
||||
set square 9.42987e+007
|
||||
|
||||
|
@@ -2,6 +2,8 @@
|
||||
# cone cylinder plane
|
||||
# Error status: 102
|
||||
|
||||
puts "TODO OCC26020 ALL: Error : is WRONG because number of "
|
||||
|
||||
# conical face
|
||||
cone con_f1 -59.814698440000001 384.36473473000001 127 0.41716766026590824 -0.90882954575006414 -5.4874902763032048e-016 89.995898744693349 0
|
||||
erase con_f1
|
||||
@@ -24,3 +26,6 @@ mkface f4 cyl_f4 0 6.2831853071795862 -1000000 1000000
|
||||
|
||||
# make volume operation
|
||||
mkvolume result f1 f2 f3 f4
|
||||
|
||||
checknbshapes result -vertex 6 -edge 11 -wire 11 -face 8 -shell 4 -solid 2 -compsolid 0 -compound 1 -shape 43
|
||||
|
||||
|
@@ -33,5 +33,5 @@ if { $MaxFaceTolerance > 1 || $MaxEdgeTolerance > 1 || $MaxVertexTolerance > 1 }
|
||||
puts "Tolerance of shape is less then 1.0"
|
||||
}
|
||||
|
||||
set square 4.21741e+007
|
||||
set square 3.92897e+007
|
||||
set 2dviewer 0
|
||||
|
@@ -50,5 +50,5 @@ if { $MaxFaceTolerance > 1 || $MaxEdgeTolerance > 1 || $MaxVertexTolerance > 1 }
|
||||
} else {
|
||||
puts "Tolerance of shape is less then 1.0"
|
||||
}
|
||||
set square 4.03996e+007
|
||||
set square 3.67079e+007
|
||||
set 2dviewer 0
|
||||
|
@@ -66,5 +66,5 @@ if { $MaxFaceTolerance > 2 || $MaxEdgeTolerance > 2 || $MaxVertexTolerance > 2 }
|
||||
} else {
|
||||
puts "Tolerance of shape is less then 2.0"
|
||||
}
|
||||
set square 1.74934e+007
|
||||
set square 1.24589e+07
|
||||
set 2dviewer 0
|
||||
|
@@ -1,4 +1,5 @@
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of "
|
||||
puts "TODO OCC11111 ALL: Error : The square of result shape is "
|
||||
|
||||
puts "============"
|
||||
puts "OCC10160"
|
||||
|
@@ -1,5 +1,4 @@
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of "
|
||||
puts "TODO OCC11111 ALL: Error : The square of result shape is"
|
||||
puts "============"
|
||||
puts "OCC10160"
|
||||
puts "============"
|
||||
|
@@ -2,7 +2,11 @@ puts "================"
|
||||
puts "OCC1255"
|
||||
puts "================"
|
||||
puts ""
|
||||
# Exception in command 'section'
|
||||
###############################################
|
||||
## Exception in command 'section'
|
||||
###############################################
|
||||
|
||||
puts "TODO #OCC26815 ALL: Error : The length of result shape is"
|
||||
|
||||
restore [locate_data_file OCC1255.brep] a
|
||||
checkshape a
|
||||
|
@@ -7,6 +7,8 @@ puts ""
|
||||
# (This script tests new topology)
|
||||
###############################################
|
||||
|
||||
puts "TODO #OCC26815 ALL: Error : The length of result shape is"
|
||||
|
||||
restore [locate_data_file OCC1255.brep] a
|
||||
checkshape a
|
||||
|
||||
|
@@ -1,6 +1,3 @@
|
||||
puts "TODO OCC21564 ALL: The square of result shape is"
|
||||
puts "TODO OCC21564 ALL: Error : is WRONG because number of "
|
||||
|
||||
puts "============"
|
||||
puts "OCC22557"
|
||||
puts "============"
|
||||
@@ -24,7 +21,7 @@ puts "Start boolean operation ..."
|
||||
bopcut result
|
||||
puts "Finish boolean operation ..."
|
||||
|
||||
set square 0.172993
|
||||
set square 0.172994
|
||||
|
||||
checknbshapes result -vertex 192 -edge 288 -wire 98 -face 98 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 679
|
||||
|
||||
|
@@ -30,7 +30,7 @@ set distance -0.1
|
||||
catch { OFFSETSHAPE $distance {s_3} $calcul $type }
|
||||
|
||||
|
||||
set square 1470.32
|
||||
set square 1485.39
|
||||
|
||||
checknbshapes result -vertex 4 -edge 6 -wire 6 -face 5 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 23
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
puts "TODO OCC12345 ALL: Error : The square of result shape is"
|
||||
puts "TODO OCC00000 ALL: Faulty OCC602: function BLEND works wrongly"
|
||||
puts "TODO OCC00000 ALL: Tcl Exception: result is not a topological shape!!!"
|
||||
puts "TODO OCC00000 ALL: TEST INCOMPLETE"
|
||||
|
||||
puts "========================"
|
||||
puts " OCC602 "
|
||||
|
@@ -5,6 +5,9 @@ puts ""
|
||||
###########################################################
|
||||
# Wrong pcurve of the section curve
|
||||
###########################################################
|
||||
|
||||
puts "TODO OCC26752 ALL: Error: Tolerance is too big!"
|
||||
|
||||
set MaxTol 1.05e-6
|
||||
set NbCurv_OK 1
|
||||
|
||||
|
@@ -1,10 +1,7 @@
|
||||
puts "TODO OCC25929 ALL: Error: Tolerance is too big!"
|
||||
|
||||
puts "TODO OCC21564 Linux: Error : T=0.464646\tD=0.000326627"
|
||||
puts "TODO OCC21564 Linux: Error : T=0.464646\tD=0.00032747"
|
||||
|
||||
puts "TODO OCC21564 Windows: Error : T=0.464646\tD=0.000326671"
|
||||
puts "TODO OCC21564 Windows: Error : T=0.464646\tD=0.000327516"
|
||||
puts "TODO OCC25929 ALL: Error : T=0.505051 D=0.000100165"
|
||||
puts "TODO OCC25929 ALL: Error : T=0.505051 D=0.000100918"
|
||||
|
||||
puts "========="
|
||||
puts "CR24915"
|
||||
|
@@ -6,6 +6,8 @@ puts ""
|
||||
# IntTools_FaceFace enters to infinite loop on the attached case
|
||||
###########################################################
|
||||
|
||||
puts "TODO OCC26431 ALL: Error : is WRONG because number of "
|
||||
|
||||
restore [locate_data_file bug24981_shapes.brep] a
|
||||
restore [locate_data_file bug24981_tools.brep] b
|
||||
|
||||
|
@@ -6,6 +6,8 @@ puts ""
|
||||
# The section curve between two cylindrical faces is incomplete
|
||||
#######################################################################
|
||||
|
||||
puts "TODO OCC26431 ALL: Faulty shapes in variables faulty_1 to faulty_2"
|
||||
|
||||
restore [locate_data_file bug25224_Input_5.brep] b1
|
||||
restore [locate_data_file bug25224_Input_21.brep] b2
|
||||
|
||||
|
@@ -1,5 +1,3 @@
|
||||
puts "TODO OCC26417 ALL: Faulty shapes in variables faulty_1"
|
||||
|
||||
puts "================"
|
||||
puts "OCC25319"
|
||||
puts "================"
|
||||
@@ -15,5 +13,5 @@ bcommon result b1 b2
|
||||
|
||||
set square 1690.81
|
||||
|
||||
checknbshapes result -vertex 19 -edge 30 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 78
|
||||
checknbshapes result -vertex 20 -edge 31 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 80
|
||||
set 2dviewer 1
|
||||
|
@@ -1,5 +1,3 @@
|
||||
puts "TODO OCC26417 ALL: Faulty shapes in variables faulty_1"
|
||||
|
||||
puts "================"
|
||||
puts "OCC25319"
|
||||
puts "================"
|
||||
@@ -18,5 +16,5 @@ bcommon result b1 b2
|
||||
|
||||
set square 1690.81
|
||||
|
||||
checknbshapes result -vertex 19 -edge 30 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 78
|
||||
checknbshapes result -vertex 20 -edge 31 -wire 13 -face 13 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 80
|
||||
set 2dviewer 1
|
||||
|
@@ -5,6 +5,8 @@ puts ""
|
||||
###############################################
|
||||
# Wrong result obtained by General Fuse operator.
|
||||
###############################################
|
||||
puts "TODO #OCC26816 ALL: Error : Result done by General Fuse operator is WRONG because number of"
|
||||
puts "TODO #OCC26816 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
|
||||
restore [locate_data_file bug25715_p02c3s1.brep] b1
|
||||
restore [locate_data_file bug25838_p02c3s2.brep] b2
|
||||
|
60
tests/bugs/modalg_6/bug26675
Normal file
60
tests/bugs/modalg_6/bug26675
Normal file
@@ -0,0 +1,60 @@
|
||||
puts "============"
|
||||
puts "OCC26675"
|
||||
puts "============"
|
||||
puts ""
|
||||
###############################
|
||||
## 0026675: Eliminate normalization of coordinates in ApproxInt package
|
||||
###############################
|
||||
|
||||
puts "TODO OCC25929 ALL: Error : T="
|
||||
|
||||
set GoodNbCurv 1
|
||||
|
||||
pload QAcommands
|
||||
OCC26675_1 ss
|
||||
|
||||
intersect res ss_1 ss_2
|
||||
|
||||
set che [whatis res]
|
||||
set ind [string first "3d curve" $che]
|
||||
if {${ind} >= 0} {
|
||||
#Only variable "res" exists
|
||||
renamevar res res_1
|
||||
}
|
||||
|
||||
|
||||
set ic 1
|
||||
set AllowRepeate 1
|
||||
while { $AllowRepeate != 0 } {
|
||||
set che [whatis res_$ic]
|
||||
set ind [string first "3d curve" $che]
|
||||
if {${ind} < 0} {
|
||||
set AllowRepeate 0
|
||||
} else {
|
||||
display res_$ic
|
||||
|
||||
bounds res_$ic U1 U2
|
||||
|
||||
dval U1
|
||||
dval U2
|
||||
|
||||
if {[dval U2-U1] < 1.0e-20} {
|
||||
puts "Error: Wrong curve's range!"
|
||||
}
|
||||
|
||||
xdistcs res_$ic ss_1 U1 U2 10 1e-7
|
||||
xdistcs res_$ic ss_2 U1 U2 10 1e-7
|
||||
|
||||
incr ic
|
||||
}
|
||||
}
|
||||
|
||||
if {[expr {$ic - 1}] == $GoodNbCurv} {
|
||||
puts "OK: Curve Number is good!"
|
||||
} else {
|
||||
puts "Error: Curve Number is bad!"
|
||||
}
|
||||
|
||||
smallview
|
||||
fit
|
||||
set only_screen_axo 1
|
@@ -1,7 +1,4 @@
|
||||
#E6----------------------------------------------
|
||||
#puts "TODO OCC22803 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
puts "TODO OCC26426 ALL: Error: The tolerance of the resulting shape is too big "
|
||||
|
||||
|
||||
ptorus pt 25 24 90
|
||||
profile pr o 20 18 5 p 0 -1 0 1 0 0 l 10 t 0 30 \
|
||||
|
@@ -1,3 +1,5 @@
|
||||
puts "TODO #OCC26431 ALL: Faulty shapes in variables faulty_1 to "
|
||||
|
||||
#A2----------------------------------------------
|
||||
plane p 0 0 0 1 0 0 0 -.5 1
|
||||
pcylinder p p 10 20
|
||||
|
Reference in New Issue
Block a user