Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
FairCurve_MinimalVariation Class Reference

Computes a 2D curve using an algorithm which minimizes tension, sagging, and jerk energy. As in FairCurve_Batten, two reference points are used. Unlike that class, FairCurve_MinimalVariation requires curvature settings at the first and second reference points. These are defined by the rays of curvature desired at each point. More...

#include <FairCurve_MinimalVariation.hxx>

Inheritance diagram for FairCurve_MinimalVariation:
Inheritance graph
[legend]

Public Member Functions

 FairCurve_MinimalVariation (const gp_Pnt2d &P1, const gp_Pnt2d &P2, const double Heigth, const double Slope=0, const double PhysicalRatio=0)
 Constructs the two contact points P1 and P2 and the geometrical characteristics of the batten (elastic beam) These include the real number values for height of deformation Height, slope value Slope, and kind of energy PhysicalRatio. The kinds of energy include:
 
void SetCurvature1 (const double Curvature)
 Allows you to set a new constraint on curvature at the first point.
 
void SetCurvature2 (const double Curvature)
 Allows you to set a new constraint on curvature at the second point.
 
void SetPhysicalRatio (const double Ratio)
 Allows you to set the physical ratio Ratio. The kinds of energy which you can specify include: 0 is only "Jerk" Energy 1 is only "Sagging" Energy like batten Warning: if Ratio is 1 it is impossible to impose curvature constraints. Raises DomainError if Ratio < 0 or Ratio > 1.
 
bool Compute (FairCurve_AnalysisCode &ACode, const int NbIterations=50, const double Tolerance=1.0e-3) override
 Computes the curve with respect to the constraints, NbIterations and Tolerance. The tolerance setting allows you to control the precision of computation, and the maximum number of iterations allows you to set a limit on computation time.
 
double GetCurvature1 () const
 Returns the first established curvature.
 
double GetCurvature2 () const
 Returns the second established curvature.
 
double GetPhysicalRatio () const
 Returns the physical ratio, or kind of energy.
 
void Dump (Standard_OStream &o) const override
 Prints on the stream o information on the current state of the object. Is used to redefine the operator <<.
 
- Public Member Functions inherited from FairCurve_Batten
 FairCurve_Batten (const gp_Pnt2d &P1, const gp_Pnt2d &P2, const double Height, const double Slope=0)
 Constructor with the two points and the geometrical characteristics of the batten (elastic beam) Height is the height of the deformation, and Slope is the slope value, initialized at 0. The user can then supply the desired slope value by the method, SetSlope. Other parameters are initialized as follow :
 
virtual ~FairCurve_Batten ()
 
void SetFreeSliding (const bool FreeSliding)
 Freesliding is initialized with the default setting false. When Freesliding is set to true and, as a result, sliding is free, the sliding factor is automatically computed to satisfy the equilibrium of the batten.
 
void SetConstraintOrder1 (const int ConstraintOrder)
 Allows you to change the order of the constraint on the first point. ConstraintOrder has the default setting of 1. The following settings are available:
 
void SetConstraintOrder2 (const int ConstraintOrder)
 Allows you to change the order of the constraint on the second point. ConstraintOrder is initialized with the default setting of 1. The following settings are available:
 
void SetP1 (const gp_Pnt2d &P1)
 Allows you to change the location of the point, P1, and in doing so, modify the curve. Warning This method changes the angle as well as the point. Exceptions NullValue if the distance between P1 and P2 is less than or equal to the tolerance value for distance in Precision::Confusion: P1.IsEqual(P2, Precision::Confusion()). The function gp_Pnt2d::IsEqual tests to see if this is the case.
 
void SetP2 (const gp_Pnt2d &P2)
 Allows you to change the location of the point, P1, and in doing so, modify the curve. Warning This method changes the angle as well as the point. Exceptions NullValue if the distance between P1 and P2 is less than or equal to the tolerance value for distance in Precision::Confusion: P1.IsEqual(P2, Precision::Confusion()). The function gp_Pnt2d::IsEqual tests to see if this is the case.
 
void SetAngle1 (const double Angle1)
 Allows you to change the angle Angle1 at the first point, P1. The default setting is 0.
 
void SetAngle2 (const double Angle2)
 Allows you to change the angle Angle2 at the second point, P2. The default setting is 0.
 
void SetHeight (const double Height)
 Allows you to change the height of the deformation. Raises NegativeValue; – if Height <= 0 if Height <= 0.
 
void SetSlope (const double Slope)
 Allows you to set the slope value, Slope.
 
void SetSlidingFactor (const double SlidingFactor)
 Allows you to change the ratio SlidingFactor. This compares the length of the batten and the reference length, which is, in turn, a function of the constraints. This modification has one of the following two effects:
 
double SlidingOfReference () const
 Computes the real number value for length Sliding of Reference for new constraints. If you want to give a specific length to a batten curve, use the following syntax: b.SetSlidingFactor(L / b.SlidingOfReference()) where b is the name of the batten curve object.
 
bool GetFreeSliding () const
 Returns the initial free sliding value, false by default. Free sliding is generally more aesthetically pleasing than constrained sliding. However, the computation can fail with values such as angles greater than PI/2. This is because the resulting batten length is theoretically infinite.
 
int GetConstraintOrder1 () const
 Returns the established first constraint order.
 
int GetConstraintOrder2 () const
 Returns the established second constraint order.
 
const gp_Pnt2dGetP1 () const
 Returns the established location of the point P1.
 
const gp_Pnt2dGetP2 () const
 Returns the established location of the point P2.
 
double GetAngle1 () const
 Returns the established first angle.
 
double GetAngle2 () const
 Returns the established second angle.
 
double GetHeight () const
 Returns the thickness of the lathe.
 
double GetSlope () const
 Returns the established slope value.
 
double GetSlidingFactor () const
 Returns the initial sliding factor.
 
occ::handle< Geom2d_BSplineCurveCurve () const
 Returns the computed curve a 2d BSpline.
 

Additional Inherited Members

- Protected Member Functions inherited from FairCurve_Batten
double SlidingOfReference (const double D, const double A1, const double A2) const
 
double Compute (const double D, const double A1, const double A2) const
 
double Compute (const double D, const double A) const
 Returns the effective geometrical constraints at the last batten computation. This effectives values may be not equal with the wanted values if.
 
- Protected Attributes inherited from FairCurve_Batten
FairCurve_AnalysisCode myCode
 
gp_Pnt2d OldP1
 
gp_Pnt2d OldP2
 
double OldAngle1
 
double OldAngle2
 
double OldHeight
 
double OldSlope
 
double OldSlidingFactor
 
bool OldFreeSliding
 
int OldConstraintOrder1
 
int OldConstraintOrder2
 
gp_Pnt2d NewP1
 
gp_Pnt2d NewP2
 
double NewAngle1
 
double NewAngle2
 
double NewHeight
 
double NewSlope
 
double NewSlidingFactor
 
bool NewFreeSliding
 
int NewConstraintOrder1
 
int NewConstraintOrder2
 
int Degree
 
occ::handle< NCollection_HArray1< gp_Pnt2d > > Poles
 
occ::handle< NCollection_HArray1< double > > Flatknots
 
occ::handle< NCollection_HArray1< double > > Knots
 
occ::handle< NCollection_HArray1< int > > Mults
 

Detailed Description

Computes a 2D curve using an algorithm which minimizes tension, sagging, and jerk energy. As in FairCurve_Batten, two reference points are used. Unlike that class, FairCurve_MinimalVariation requires curvature settings at the first and second reference points. These are defined by the rays of curvature desired at each point.

Constructor & Destructor Documentation

◆ FairCurve_MinimalVariation()

FairCurve_MinimalVariation::FairCurve_MinimalVariation ( const gp_Pnt2d & P1,
const gp_Pnt2d & P2,
const double Heigth,
const double Slope = 0,
const double PhysicalRatio = 0 )

Constructs the two contact points P1 and P2 and the geometrical characteristics of the batten (elastic beam) These include the real number values for height of deformation Height, slope value Slope, and kind of energy PhysicalRatio. The kinds of energy include:

  • Jerk (0)
  • Sagging (1). Note that the default setting for Physical Ration is in FairCurve_Batten Other parameters are initialized as follow :
  • FreeSliding = False
  • ConstraintOrder1 = 1
  • ConstraintOrder2 = 1
  • Angle1 = 0
  • Angle2 = 0
  • Curvature1 = 0
  • Curvature2 = 0
  • SlidingFactor = 1 Warning If PhysicalRatio equals 1, you cannot impose constraints on curvature. Exceptions NegativeValue if Height is less than or equal to 0. NullValue if the distance between P1 and P2 is less than or equal to the tolerance value for distance in Precision::Confusion: P1.IsEqual(P2, Precision::Confusion()). The function gp_Pnt2d::IsEqual tests to see if this is the case. Definition of the geometricals constraints

Member Function Documentation

◆ Compute()

bool FairCurve_MinimalVariation::Compute ( FairCurve_AnalysisCode & ACode,
const int NbIterations = 50,
const double Tolerance = 1.0e-3 )
overridevirtual

Computes the curve with respect to the constraints, NbIterations and Tolerance. The tolerance setting allows you to control the precision of computation, and the maximum number of iterations allows you to set a limit on computation time.

Reimplemented from FairCurve_Batten.

◆ Dump()

void FairCurve_MinimalVariation::Dump ( Standard_OStream & o) const
overridevirtual

Prints on the stream o information on the current state of the object. Is used to redefine the operator <<.

Reimplemented from FairCurve_Batten.

◆ GetCurvature1()

double FairCurve_MinimalVariation::GetCurvature1 ( ) const

Returns the first established curvature.

◆ GetCurvature2()

double FairCurve_MinimalVariation::GetCurvature2 ( ) const

Returns the second established curvature.

◆ GetPhysicalRatio()

double FairCurve_MinimalVariation::GetPhysicalRatio ( ) const

Returns the physical ratio, or kind of energy.

◆ SetCurvature1()

void FairCurve_MinimalVariation::SetCurvature1 ( const double Curvature)

Allows you to set a new constraint on curvature at the first point.

◆ SetCurvature2()

void FairCurve_MinimalVariation::SetCurvature2 ( const double Curvature)

Allows you to set a new constraint on curvature at the second point.

◆ SetPhysicalRatio()

void FairCurve_MinimalVariation::SetPhysicalRatio ( const double Ratio)

Allows you to set the physical ratio Ratio. The kinds of energy which you can specify include: 0 is only "Jerk" Energy 1 is only "Sagging" Energy like batten Warning: if Ratio is 1 it is impossible to impose curvature constraints. Raises DomainError if Ratio < 0 or Ratio > 1.


The documentation for this class was generated from the following file: