OCC.FairCurve module

class OCC.FairCurve.FairCurve_Batten(*args)

Bases: object

Compute()
  • Performs the algorithm, using the arguments Code, NbIterations and Tolerance and computes the curve with respect to the constraints. Code will have one of the following values: - OK - NotConverged - InfiniteSliding - NullHeight The parameters Tolerance and NbIterations control how precise the computation is, and how long it will take.
Parameters:
  • Code (FairCurve_AnalysisCode &) –
  • NbIterations (Standard_Integer) – default value is 50
  • Tolerance (float) – default value is 1.0e-3
Return type:

bool

  • Performs the algorithm, using the arguments Code, NbIterations and Tolerance and computes the curve with respect to the constraints. Code will have one of the following values: - OK - NotConverged - InfiniteSliding - NullHeight The parameters Tolerance and NbIterations control how precise the computation is, and how long it will take.
Parameters:
  • Code (FairCurve_AnalysisCode &) –
  • NbIterations (Standard_Integer) – default value is 50
  • Tolerance (float) – default value is 1.0e-3
Return type:

bool

  • Performs the algorithm, using the arguments Code, NbIterations and Tolerance and computes the curve with respect to the constraints. Code will have one of the following values: - OK - NotConverged - InfiniteSliding - NullHeight The parameters Tolerance and NbIterations control how precise the computation is, and how long it will take.
Parameters:
  • Code (FairCurve_AnalysisCode &) –
  • NbIterations (Standard_Integer) – default value is 50
  • Tolerance (float) – default value is 1.0e-3
Return type:

bool

Curve()
  • Returns the computed curve a 2d BSpline.
Return type:Handle_Geom2d_BSplineCurve
Delete()
Return type:void
DumpToString()

FairCurve_Batten_DumpToString(FairCurve_Batten self) -> std::string

GetAngle1()
  • Returns the established first angle.
Return type:float
GetAngle2()
  • Returns the established second angle.
Return type:float
GetConstraintOrder1()
  • Returns the established first constraint order.
Return type:int
GetConstraintOrder2()
  • Returns the established second constraint order.
Return type:int
GetFreeSliding()
  • 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.
Return type:bool
GetHeight()
  • Returns the thickness of the lathe.
Return type:float
GetP1()
  • Returns the established location of the point P1.
Return type:gp_Pnt2d
GetP2()
  • Returns the established location of the point P2.
Return type:gp_Pnt2d
GetSlidingFactor()
  • Returns the initial sliding factor.
Return type:float
GetSlope()
  • Returns the established slope value.
Return type:float
SetAngle1()
  • Allows you to change the angle Angle1 at the first point, P1. The default setting is 0.
Parameters:Angle1 (float) –
Return type:None
SetAngle2()
  • Allows you to change the angle Angle2 at the second point, P2. The default setting is 0.
Parameters:Angle2 (float) –
Return type:None
SetConstraintOrder1()
  • 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: - 0-the curve must pass through a point - 1-the curve must pass through a point and have a given tangent - 2-the curve must pass through a point, have a given tangent and a given curvature. The third setting is only valid for FairCurve_MinimalVariation curves. These constraints, though geometric, represent the mechanical constraints due, for example, to the resistance of the material the actual physical batten is made of.
Parameters:ConstraintOrder (Standard_Integer) –
Return type:None
SetConstraintOrder2()
  • 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: - 0-the curve must pass through a point - 1-the curve must pass through a point and have a given tangent - 2-the curve must pass through a point, have a given tangent and a given curvature. The third setting is only valid for FairCurve_MinimalVariation curves. These constraints, though geometric, represent the mechanical constraints due, for example, to the resistance of the material the actual physical batten is made of.
Parameters:ConstraintOrder (Standard_Integer) –
Return type:None
SetFreeSliding()
  • 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.
Parameters:FreeSliding (bool) –
Return type:None
SetHeight()
  • Allows you to change the height of the deformation. Raises NegativeValue; – if Height <= 0 if Height <= 0
Parameters:Height (float) –
Return type:None
SetP1()
  • 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.
Parameters:P1 (gp_Pnt2d) –
Return type:None
SetP2()
  • 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.
Parameters:P2 (gp_Pnt2d) –
Return type:None
SetSlidingFactor()
  • 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: - if you increase the value, it inflates the batten - if you decrease the value, it flattens the batten. When sliding is free, the sliding factor is automatically computed to satisfy the equilibrium of the batten. When sliding is imposed, a value is required for the sliding factor. SlidingFactor is initialized with the default setting of 1.
Parameters:SlidingFactor (float) –
Return type:None
SetSlope()
  • Allows you to set the slope value, Slope.
Parameters:Slope (float) –
Return type:None
SlidingOfReference()
  • 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.
Return type:float
thisown

The membership flag

class OCC.FairCurve.FairCurve_BattenLaw(*args)

Bases: object

SetHeigth()
  • Change the value of Heigth at the middle point.
Parameters:Heigth (float) –
Return type:None
SetSliding()
  • Change the value of sliding
Parameters:Sliding (float) –
Return type:None
SetSlope()
  • Change the value of the geometric slope.
Parameters:Slope (float) –
Return type:None
Value()
  • computes the value of the heigth for the parameter T on the neutral fibber
Parameters:
  • T (float) –
  • THeigth (float &) –
Return type:

bool

thisown

The membership flag

class OCC.FairCurve.FairCurve_DistributionOfEnergy(*args, **kwargs)

Bases: object

NbEquations()
  • returns the number of equations of the function.
Return type:int
NbVariables()
  • returns the number of variables of the function.
Return type:int
SetDerivativeOrder()
Parameters:DerivativeOrder (Standard_Integer) –
Return type:None
thisown

The membership flag

class OCC.FairCurve.FairCurve_DistributionOfJerk(*args)

Bases: OCC.FairCurve.FairCurve_DistributionOfEnergy

Value()
  • computes the values <F> of the functions for the variable <X>. returns True if the computation was done successfully, False otherwise.
Parameters:
  • X (math_Vector &) –
  • F (math_Vector &) –
Return type:

bool

thisown

The membership flag

class OCC.FairCurve.FairCurve_DistributionOfSagging(*args)

Bases: OCC.FairCurve.FairCurve_DistributionOfEnergy

Value()
  • computes the values <F> of the functions for the variable <X>. returns True if the computation was done successfully, False otherwise.
Parameters:
  • X (math_Vector &) –
  • F (math_Vector &) –
Return type:

bool

thisown

The membership flag

class OCC.FairCurve.FairCurve_DistributionOfTension(*args)

Bases: OCC.FairCurve.FairCurve_DistributionOfEnergy

SetLengthSliding()
  • change the length sliding
Parameters:LengthSliding (float) –
Return type:None
Value()
  • computes the values <F> of the functions for the variable <X>. returns True if the computation was done successfully, False otherwise.
Parameters:
  • X (math_Vector &) –
  • F (math_Vector &) –
Return type:

bool

thisown

The membership flag

class OCC.FairCurve.FairCurve_Energy(*args, **kwargs)

Bases: object

Gradient()
  • //!computes the gradient <G> of the energys for the variable <X>. Returns True if the computation was done successfully, False otherwise.
Parameters:
  • X (math_Vector &) –
  • G (math_Vector &) –
Return type:

bool

NbVariables()
  • returns the number of variables of the energy.
Return type:int
Poles()
  • return the poles
Return type:Handle_TColgp_HArray1OfPnt2d
Value()
  • computes the values of the Energys E for the variable <X>. Returns True if the computation was done successfully, False otherwise.
Parameters:
  • X (math_Vector &) –
  • E (float &) –
Return type:

bool

Values()
  • computes the Energy <E> and the gradient <G> of the energy for the variable <X>. Returns True if the computation was done successfully, False otherwise.
Parameters:
  • X (math_Vector &) –
  • E (float &) –
  • G (math_Vector &) –
Return type:

bool

  • computes the Energy <E>, the gradient <G> and the Hessian <H> of the energy for the variable <X>. Returns True if the computation was done successfully, False otherwise.
Parameters:
  • X (math_Vector &) –
  • E (float &) –
  • G (math_Vector &) –
  • H (math_Matrix &) –
Return type:

bool

Variable()
  • compute the variables <X> wich correspond with the field <MyPoles>
Parameters:X (math_Vector &) –
Return type:bool
thisown

The membership flag

class OCC.FairCurve.FairCurve_EnergyOfBatten(*args)

Bases: OCC.FairCurve.FairCurve_Energy

LengthSliding()
  • return the lengthSliding = P1P2 + Sliding
Return type:float
Status()
  • return the status
Return type:FairCurve_AnalysisCode
thisown

The membership flag

class OCC.FairCurve.FairCurve_EnergyOfMVC(*args)

Bases: OCC.FairCurve.FairCurve_Energy

LengthSliding()
  • return the lengthSliding = P1P2 + Sliding
Return type:float
Status()
  • return the status
Return type:FairCurve_AnalysisCode
thisown

The membership flag

class OCC.FairCurve.FairCurve_MinimalVariation(*args)

Bases: OCC.FairCurve.FairCurve_Batten

Compute()
  • 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.
Parameters:
  • ACode (FairCurve_AnalysisCode &) –
  • NbIterations (Standard_Integer) – default value is 50
  • Tolerance (float) – default value is 1.0e-3
Return type:

bool

  • 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.
Parameters:
  • ACode (FairCurve_AnalysisCode &) –
  • NbIterations (Standard_Integer) – default value is 50
  • Tolerance (float) – default value is 1.0e-3
Return type:

bool

  • 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.
Parameters:
  • ACode (FairCurve_AnalysisCode &) –
  • NbIterations (Standard_Integer) – default value is 50
  • Tolerance (float) – default value is 1.0e-3
Return type:

bool

DumpToString()

FairCurve_MinimalVariation_DumpToString(FairCurve_MinimalVariation self) -> std::string

GetCurvature1()
  • Returns the first established curvature.
Return type:float
GetCurvature2()
  • Returns the second established curvature.
Return type:float
GetPhysicalRatio()
  • Returns the physical ratio, or kind of energy.
Return type:float
SetCurvature1()
  • Allows you to set a new constraint on curvature at the first point.
Parameters:Curvature (float) –
Return type:None
SetCurvature2()
  • Allows you to set a new constraint on curvature at the second point.
Parameters:Curvature (float) –
Return type:None
SetPhysicalRatio()
  • 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
Parameters:Ratio (float) –
Return type:None
thisown

The membership flag

class OCC.FairCurve.FairCurve_Newton(*args)

Bases: object

IsConverged()
  • This method is called at the end of each iteration to check the convergence : || Xi+1 - Xi || < SpatialTolerance/100 Or || Xi+1 - Xi || < SpatialTolerance and |F(Xi+1) - F(Xi)| < CriteriumTolerance * |F(xi)| It can be redefined in a sub-class to implement a specific test.
Return type:bool
thisown

The membership flag

class OCC.FairCurve.SwigPyIterator(*args, **kwargs)

Bases: object

advance()
copy()
decr()
distance()
equal()
incr()
next()
previous()
thisown

The membership flag

value()