1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0028828: Modeling Algorithms - New functionalities of BRepFilletAPI_MakeChamfer algorithm

Two new functionalities have been added in BRepFilletAPI_MakeChamfer:
- constant throat (the section of chamfer is isosceles triangle, its height is constant in all sections - this is the "throat" of the weld);
- constant throat with penetration(the section of chamfer is right-angled triangle, the first of two surfaces (where is the top of the chamfer) is virtually moved inside the solid by offset operation, the apex of the section is on the intersection curve between moved surface and second surface, right angle is at the top of the chamfer, the length of the leg from apex to top is constant - this is the "throat" of the weld).

- New abstract classes BlendFunc_GenChamfer and BlendFunc_GenChamfInv have been added;
- Class BlendFunc_Chamfer is now descended from BlendFunc_GenChamfer, class BlendFunc_ChamfInv is now descended from BlendFunc_GenChamfInv.
- New class BlendFunc_ConstThroat is descended from BlendFunc_GenChamfer, new class BlendFund_ConstThroatInv is descended from BlendFunc_GenChamfInv.
- New class BlendFunc_ConstThroatWithPenetration is descended from BlendFunc_GenChamfer, new class BlendFund_ConstThroatWithPenetrationInv is descended from BlendFunc_GenChamfInv.
- Class ChFi3d_ChBuilder has now mode of chamfer that can be ClassicChamfer, ConstThroatChamfer and ConstThroatWithPenetrationChamfer.
- Two new DRAW Test Harness commands "chamf_throat" ant "chamf_throat_with_penetration" have been added for the second mode of ChBuilder.
- The interface of DRAW Test Harness command "chamf" changed for symmetric case.
This commit is contained in:
jgv
2017-06-14 16:28:15 +03:00
committed by apn
parent 364c88864b
commit 1d54b80764
83 changed files with 5471 additions and 1510 deletions

View File

@@ -74,7 +74,9 @@ public:
//! <D> for the variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT virtual Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) = 0;
Standard_EXPORT virtual Standard_Boolean Values (const math_Vector& X,
math_Vector& F,
math_Matrix& D) = 0;
//! Sets the value of the parameter along the guide line.
//! This determines the plane in which the solution has
@@ -90,7 +92,8 @@ public:
//! Returns in the vector Tolerance the parametric tolerance
//! for each of the 4 variables;
//! Tol is the tolerance used in 3d space.
Standard_EXPORT virtual void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const = 0;
Standard_EXPORT virtual void GetTolerance (math_Vector& Tolerance,
const Standard_Real Tol) const = 0;
//! Returns in the vector InfBound the lowest values allowed
//! for each of the 4 variables.
@@ -102,7 +105,8 @@ public:
//! Tol is the tolerance used in 3d space.
//! The computation is made at the current value of
//! the parameter on the guide line.
Standard_EXPORT virtual Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) = 0;
Standard_EXPORT virtual Standard_Boolean IsSolution (const math_Vector& Sol,
const Standard_Real Tol) = 0;
//! Returns the minimal Distance beetween two
//! extremitys of calculed sections.
@@ -135,16 +139,24 @@ public:
//! for the parameters. i.e. T.Length() > NbIntervals()
//! raises
//! OutOfRange from Standard
Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const = 0;
Standard_EXPORT virtual void Intervals (TColStd_Array1OfReal& T,
const GeomAbs_Shape S) const = 0;
Standard_EXPORT virtual void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) = 0;
Standard_EXPORT virtual void GetShape (Standard_Integer& NbPoles,
Standard_Integer& NbKnots,
Standard_Integer& Degree,
Standard_Integer& NbPoles2d) = 0;
//! Returns the tolerance to reach in approximation
//! to respecte
//! BoundTol error at the Boundary
//! AngleTol tangent error at the Boundary
//! SurfTol error inside the surface.
Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, math_Vector& Tol3d, math_Vector& Tol1D) const = 0;
Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol,
const Standard_Real SurfTol,
const Standard_Real AngleTol,
math_Vector& Tol3d,
math_Vector& Tol1D) const = 0;
Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) = 0;
@@ -153,16 +165,37 @@ public:
//! Used for the first and last section
//! The method returns Standard_True if the derivatives
//! are computed, otherwise it returns Standard_False.
Standard_EXPORT virtual Standard_Boolean Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths) = 0;
Standard_EXPORT virtual Standard_Boolean Section (const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths) = 0;
Standard_EXPORT virtual void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) = 0;
Standard_EXPORT virtual void Section (const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColStd_Array1OfReal& Weigths) = 0;
//! Used for the first and last section
//! The method returns Standard_True if the derivatives
//! are computed, otherwise it returns Standard_False.
Standard_EXPORT virtual Standard_Boolean Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfVec& D2Poles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColgp_Array1OfVec2d& D2Poles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths, TColStd_Array1OfReal& D2Weigths) = 0;
Standard_EXPORT virtual Standard_Boolean Section (const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfVec& D2Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColgp_Array1OfVec2d& D2Poles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths,
TColStd_Array1OfReal& D2Weigths) = 0;
Standard_EXPORT virtual void Resolution (const Standard_Integer IC2d, const Standard_Real Tol, Standard_Real& TolU, Standard_Real& TolV) const = 0;
Standard_EXPORT virtual void Resolution (const Standard_Integer IC2d,
const Standard_Real Tol,
Standard_Real& TolU,
Standard_Real& TolV) const = 0;
//! Returns the parameter of the point P. Used to
//! impose the parameters in the approximation.

View File

@@ -56,55 +56,6 @@ public:
//! Returns 4.
Standard_EXPORT Standard_Integer NbVariables() const Standard_OVERRIDE;
//! returns the number of equations of the function.
Standard_EXPORT virtual Standard_Integer NbEquations() const Standard_OVERRIDE = 0;
//! computes the values <F> of the Functions for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& X, math_Vector& F) Standard_OVERRIDE = 0;
//! returns the values <D> of the derivatives for the
//! variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT virtual Standard_Boolean Derivatives (const math_Vector& X, math_Matrix& D) Standard_OVERRIDE = 0;
//! returns the values <F> of the functions and the derivatives
//! <D> for the variable <X>.
//! Returns True if the computation was done successfully,
//! False otherwise.
Standard_EXPORT virtual Standard_Boolean Values (const math_Vector& X, math_Vector& F, math_Matrix& D) Standard_OVERRIDE = 0;
//! Sets the value of the parameter along the guide line.
//! This determines the plane in which the solution has
//! to be found.
Standard_EXPORT virtual void Set (const Standard_Real Param) Standard_OVERRIDE = 0;
//! Sets the bounds of the parametric interval on
//! the guide line.
//! This determines the derivatives in these values if the
//! function is not Cn.
Standard_EXPORT virtual void Set (const Standard_Real First, const Standard_Real Last) Standard_OVERRIDE = 0;
//! Returns in the vector Tolerance the parametric tolerance
//! for each of the 4 variables;
//! Tol is the tolerance used in 3d space.
Standard_EXPORT virtual void GetTolerance (math_Vector& Tolerance, const Standard_Real Tol) const Standard_OVERRIDE = 0;
//! Returns in the vector InfBound the lowest values allowed
//! for each of the 4 variables.
//! Returns in the vector SupBound the greatest values allowed
//! for each of the 4 variables.
Standard_EXPORT virtual void GetBounds (math_Vector& InfBound, math_Vector& SupBound) const Standard_OVERRIDE = 0;
//! Returns Standard_True if Sol is a zero of the function.
//! Tol is the tolerance used in 3d space.
//! The computation is made at the current value of
//! the parameter on the guide line.
Standard_EXPORT virtual Standard_Boolean IsSolution (const math_Vector& Sol, const Standard_Real Tol) Standard_OVERRIDE = 0;
//! Returns the point on the first support.
Standard_EXPORT const gp_Pnt& Pnt1() const Standard_OVERRIDE;
@@ -143,36 +94,37 @@ public:
//! at the beginning and the end of the section, and
//! returns the normal (of the surfaces) at
//! these points.
Standard_EXPORT virtual void Tangent (const Standard_Real U1, const Standard_Real V1, const Standard_Real U2, const Standard_Real V2, gp_Vec& TgFirst, gp_Vec& TgLast, gp_Vec& NormFirst, gp_Vec& NormLast) const = 0;
Standard_EXPORT virtual void Tangent (const Standard_Real U1,
const Standard_Real V1,
const Standard_Real U2,
const Standard_Real V2,
gp_Vec& TgFirst,
gp_Vec& TgLast,
gp_Vec& NormFirst,
gp_Vec& NormLast) const = 0;
Standard_EXPORT virtual Standard_Boolean TwistOnS1() const;
Standard_EXPORT virtual Standard_Boolean TwistOnS2() const;
Standard_EXPORT virtual void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) Standard_OVERRIDE = 0;
//! Returns the tolerance to reach in approximation
//! to respecte
//! BoundTol error at the Boundary
//! AngleTol tangent error at the Boundary
//! SurfTol error inside the surface.
Standard_EXPORT virtual void GetTolerance (const Standard_Real BoundTol, const Standard_Real SurfTol, const Standard_Real AngleTol, math_Vector& Tol3d, math_Vector& Tol1D) const Standard_OVERRIDE = 0;
Standard_EXPORT virtual void Knots (TColStd_Array1OfReal& TKnots) Standard_OVERRIDE = 0;
Standard_EXPORT virtual void Mults (TColStd_Array1OfInteger& TMults) Standard_OVERRIDE = 0;
//! Used for the first and last section
//! The method returns Standard_True if the derivatives
//! are computed, otherwise it returns Standard_False.
Standard_EXPORT virtual Standard_Boolean Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths) Standard_OVERRIDE = 0;
Standard_EXPORT virtual void Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) Standard_OVERRIDE = 0;
Standard_EXPORT virtual void Section (const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColStd_Array1OfReal& Weigths) Standard_OVERRIDE = 0;
//! Used for the first and last section
//! The method returns Standard_True if the derivatives
//! are computed, otherwise it returns Standard_False
Standard_EXPORT virtual Standard_Boolean Section (const Blend_Point& P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfVec& D2Poles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColgp_Array1OfVec2d& D2Poles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths, TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean Section (const Blend_Point& P,
TColgp_Array1OfPnt& Poles,
TColgp_Array1OfVec& DPoles,
TColgp_Array1OfVec& D2Poles,
TColgp_Array1OfPnt2d& Poles2d,
TColgp_Array1OfVec2d& DPoles2d,
TColgp_Array1OfVec2d& D2Poles2d,
TColStd_Array1OfReal& Weigths,
TColStd_Array1OfReal& DWeigths,
TColStd_Array1OfReal& D2Weigths) Standard_OVERRIDE;

View File

@@ -16,6 +16,11 @@
#include <Extrema_ExtPS.hxx>
#include <Extrema_ExtPC.hxx>
#ifdef DRAW
#include <DrawTrSurf.hxx>
#endif
static const Standard_Real CosRef3D = 0.88;
static void RecadreIfPeriodic(Standard_Real& NewU,
@@ -483,6 +488,16 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
else {
line->Prepend(previousP);
}
#ifdef DRAW
Standard_Integer nbpts = line->NbPoints();
char name [100];
sprintf(name, "pg%d", nbpts);
DrawTrSurf::Set(name, PtOnGuide);
sprintf(name, "p1_%d", nbpts);
DrawTrSurf::Set(name, previousP.PointOnS1());
sprintf(name, "p2_%d", nbpts);
DrawTrSurf::Set(name, previousP.PointOnS2());
#endif
parprec = param;
@@ -551,6 +566,16 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
else {
line->Prepend(previousP);
}
#ifdef DRAW
Standard_Integer nbpts = line->NbPoints();
char name [100];
sprintf(name, "pg%d", nbpts);
DrawTrSurf::Set(name, PtOnGuide);
sprintf(name, "p1_%d", nbpts);
DrawTrSurf::Set(name, previousP.PointOnS1());
sprintf(name, "p2_%d", nbpts);
DrawTrSurf::Set(name, previousP.PointOnS2());
#endif
parprec = param;
@@ -588,6 +613,17 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
else {
line->Prepend(previousP);
}
#ifdef DRAW
Standard_Integer nbpts = line->NbPoints();
char name [100];
sprintf(name, "pg%d", nbpts);
DrawTrSurf::Set(name, PtOnGuide);
sprintf(name, "p1_%d", nbpts);
DrawTrSurf::Set(name, previousP.PointOnS1());
sprintf(name, "p2_%d", nbpts);
DrawTrSurf::Set(name, previousP.PointOnS2());
#endif
MakeExtremity(Ext1,Standard_True,Index1,
solrst1(1),Isvtx1,Vtx1);
// On blinde le cas singulier ou un des recadrage a planter
@@ -613,6 +649,17 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
else {
line->Prepend(previousP);
}
#ifdef DRAW
Standard_Integer nbpts = line->NbPoints();
char name [100];
sprintf(name, "pg%d", nbpts);
DrawTrSurf::Set(name, PtOnGuide);
sprintf(name, "p1_%d", nbpts);
DrawTrSurf::Set(name, previousP.PointOnS1());
sprintf(name, "p2_%d", nbpts);
DrawTrSurf::Set(name, previousP.PointOnS2());
#endif
// On blinde le cas singulier ou un des recadrage a plante
if (previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2*tolesp)) {
Ext1.SetValue(previousP.PointOnS2(),
@@ -639,6 +686,16 @@ void Blend_Walking::InternalPerform(Blend_Function& Func,
else {
line->Prepend(previousP);
}
#ifdef DRAW
Standard_Integer nbpts = line->NbPoints();
char name [100];
sprintf(name, "pg%d", nbpts);
DrawTrSurf::Set(name, PtOnGuide);
sprintf(name, "p1_%d", nbpts);
DrawTrSurf::Set(name, previousP.PointOnS1());
sprintf(name, "p2_%d", nbpts);
DrawTrSurf::Set(name, previousP.PointOnS2());
#endif
if ( (Isvtx1 != Isvtx2) &&
(previousP.PointOnS1().IsEqual(previousP.PointOnS2(), 2*tolesp)) ) {