Hide menu
Loading...
Searching...
No Matches
manufacturingtoolkit.CadExMTK.Geom_Curve Class Reference

Curve Curve.hxx cadex/Geom/Curve.hxx. More...

Inheritance diagram for manufacturingtoolkit.CadExMTK.Geom_Curve:
manufacturingtoolkit.CadExMTK.Geom_Geometry manufacturingtoolkit.CadExMTK.BaseObject manufacturingtoolkit.CadExMTK.Geom_BSplineCurve manufacturingtoolkit.CadExMTK.Geom_BezierCurve manufacturingtoolkit.CadExMTK.Geom_Conic manufacturingtoolkit.CadExMTK.Geom_Line manufacturingtoolkit.CadExMTK.Geom_OffsetCurve manufacturingtoolkit.CadExMTK.Geom_Circle manufacturingtoolkit.CadExMTK.Geom_Ellipse manufacturingtoolkit.CadExMTK.Geom_Hyperbola manufacturingtoolkit.CadExMTK.Geom_Parabola

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 Type (self)
 Returns a curve type.
 
 Continuity (self)
 Returns a continuity type of the curve.
 
 Value (self, theParameter)
 Evaluates a point on the curve.
 
 Normal (self, theParameter)
 Returns the normal direction theNormal of parameter theParam.
 
 Curvature (self, theParameter)
 Returns the curvature value of parameter theParam.
 
 IsPeriodic (self)
 Returns true if the curve is periodic.
 
 UMin (self)
 Returns a minimum parameter of a definition domain.
 
 UMax (self)
 Returns a maximum parameter of a definition domain.
 
 Domain (self)
 Returns a definition domain.
 
 IsTrimmed (self)
 Returns whether curve is trimmed or not.
 
 SetTrim (self, theFirst, theLast)
 Trims curve with [theFirst, theLast] section.
 
 Transform (self, theTransformation)
 Applies transformation matrix to this object.
 
 Transformed (self, theTransformation)
 
 D0 (self, theParameter, theValue)
 Returns the point theValue of parameter theParam.
 
 D1 (self, theParameter, theValue, theD1)
 
 D2 (self, theParameter, theValue, theD1, theD2)
 Returns the point theValue of parameter theParam, the first theD1 and second theD2 derivatives.
 
 DN (self, theParameter, theDerivativeOrder, theValue, theD)
 Returns true if calculation completed successfully.
 
 Mirror (self, *args)
 
 Mirrored (self, *args)
 
 Rotate (self, theAxis, theAngle)
 
 Rotated (self, theAxis, theAngle)
 
 Translate (self, theVector)
 
 Translated (self, theVector)
 
 Scale (self, thePoint, theScale)
 
 Scaled (self, thePoint, theScale)
 
- Public Member Functions inherited from manufacturingtoolkit.CadExMTK.BaseObject
 Id (self)
 Return unique identifier of public object.
 
 IsNull (self)
 

Static Public Member Functions

 CompareType (theObject)
 
 Cast (theBase)
 

Detailed Description

Curve Curve.hxx cadex/Geom/Curve.hxx.

Base class for 3D curves.

3D curves are used to represent curves in 3D space. Each non-degenerated edge must refer to a 3D curve.

Types

Refer to Curve Types for the list of supported curve types. Type() returns a curve type as enumeration value which can be used to downcast to a respective subclass type, for instance:

Curve aCurve = ...;
if (aCurve.Type() == Geom::CurveType::Circle) {
const Circle& aCircle = static_cast<const Circle&> (aCurve);
double aRadius = aCircle.Radius();
...
}

Parametric Definition

Curve is defined using parametric definition as \(\mathbf{C}(t)\) where \(\mathbf{C}\) is a 3D radius-vector \((x,y,z)^\top\) and \(t\) is a parameter from a definition range \([a, b]\).

UMin() and UMax(), and Domain() return parametric definition range. Parametric range can be bounded (e.g. \([0, 2\pi]\) for a circle) or unbounded (e.g. \((-\infty, +\infty)\) for a line).

Evaluation

At any parameter \(t\) within a definition range, the curve can be evaluated as follows:

  • Value() and D0() return a 3D point;
  • D1(), D2() and DN() return a derivative of a respective order;
  • Curvature() returns a curvature;
  • Normal() returns a normal to the curve (i.e. perpendicular to its first derivative).

The following example demonstrates computation of a point on a line at parameter t=2:

Line aLine = ...;
Point aPoint = aLine.Value (2.);

If the curve is periodic (IsPeriodic() returns true) then the curve can be evaluated at any parameter t, otherwise behavior is undefined (e.g. an exception can be thrown or a weird value can be returned).

Continuity

Continuity() returns continuity ( \(C^0\), \(C^1\), \(C^2\), \(C^N\)) of the curve, where \(C^0\) that only the curve itself is continuous, \(C^1\) - that the curve is continuous together with its first derivative, and so on.

Transformation

The curve can be modified using the following operations:

  • translation (Translate() and Translated());
  • rotation (Rotate() and Rotated());
  • mirroring (Mirror() and Mirrored());
  • scaling (Scale() and Scaled());
  • arbitrary transformation using 3x4 matrix (Transform() and Transformed()).
  • Reversed() returns a curve with opposite orientation.
Warning
As the curve data is shared via internal pointer modification of the curve may affect other users of the curve (e.g. an edge referring to it). So you might want to use method returning a modified copy of the curve (such as Transformed()).
See also
Curves, Curve2d, ModelData.Edge, Surface.

Constructor & Destructor Documentation

◆ __init__()

Member Function Documentation

◆ Cast()

manufacturingtoolkit.CadExMTK.Geom_Curve.Cast ( theBase)
static

◆ CompareType()

manufacturingtoolkit.CadExMTK.Geom_Curve.CompareType ( theObject)
static

◆ DN()

manufacturingtoolkit.CadExMTK.Geom_Curve.DN ( self,
theParameter,
theDerivativeOrder,
theValue,
theD )

Returns true if calculation completed successfully.

In this case theD contains values of the derivatives from 0 up to theDerivativeOrder. Otherwise returns false. May throw exception if the continuity of the curve is less than theDerivativeOrder.

Parameters:

  • theDerivativeOrder must belong to range [0, 3].
  • theD should have size to store theDerivativeOrder derivatives (i.e. theDerivativeOrder or more).

The documentation for this class was generated from the following file:
  • CadExMTK.py