Hide menu
Loading...
Searching...
No Matches

Base class for 3D curves. More...

Inheritance diagram for cadex.Geom.Curve:
cadex.Geom.Geometry cadex.BaseObject cadex.Geom.BSplineCurve cadex.Geom.BezierCurve cadex.Geom.Conic cadex.Geom.Line cadex.Geom.OffsetCurve cadex.Geom.Circle cadex.Geom.Ellipse cadex.Geom.Hyperbola cadex.Geom.Parabola

Public Member Functions

 Curve (global::System.IntPtr cPtr, bool cMemoryOwn)
 
cadex.Geom.CurveType Type ()
 
cadex.Geom.Continuity Continuity ()
 Returns a continuity type of the curve.
 
cadex.Geom.Point Value (double theParameter)
 Evaluates a point on the curve.
 
cadex.Geom.Direction Normal (double theParameter)
 Returns the normal direction theNormal of parameter theParam.
 
double Curvature (double theParameter)
 Returns the curvature value of parameter theParam.
 
bool IsPeriodic ()
 Returns true if the curve is periodic.
 
double UMin ()
 Returns a minimum parameter of a definition domain.
 
double UMax ()
 Returns a maximum parameter of a definition domain.
 
void Domain (out double theUMin, out double theUMax)
 Returns a definition domain.
 
bool IsTrimmed ()
 Returns whether curve is trimmed or not.
 
void SetTrim (double theFirst, double theLast)
 Trims curve with [theFirst, theLast] section.
 
void Transform (cadex.Geom.Transformation theTransformation)
 Applies transformation matrix to this object.
 
cadex.Geom.Curve Transformed (cadex.Geom.Transformation theTransformation)
 Returns a copy this object after applying transformation.
 
void D0 (double theParameter, cadex.Geom.Point theValue)
 Returns the point theValue of parameter theParam.
 
void D1 (double theParameter, cadex.Geom.Point theValue, cadex.Geom.Vector theD1)
 
void D2 (double theParameter, cadex.Geom.Point theValue, cadex.Geom.Vector theD1, cadex.Geom.Vector theD2)
 Returns the point theValue of parameter theParam, the first theD1 and second theD2 derivatives.
 
bool DN (double theParameter, uint theDerivativeOrder, cadex.Geom.Point theValue, cadex.Collections.VectorList theD)
 
void Mirror (cadex.Geom.Point thePoint)
 
void Mirror (cadex.Geom.Axis1d theAxis)
 
void Mirror (cadex.Geom.Axis3d theAxis)
 
cadex.Geom.Curve Mirrored (cadex.Geom.Point theRef)
 
cadex.Geom.Curve Mirrored (cadex.Geom.Axis1d theAxis)
 
cadex.Geom.Curve Mirrored (cadex.Geom.Axis3d theAxis)
 
void Rotate (cadex.Geom.Axis1d theAxis, double theAngle)
 
cadex.Geom.Curve Rotated (cadex.Geom.Axis1d theAxis, double theAngle)
 
void Translate (cadex.Geom.Vector theVector)
 
cadex.Geom.Curve Translated (cadex.Geom.Vector theVector)
 
void Scale (cadex.Geom.Point thePoint, double theScale)
 
cadex.Geom.Curve Scaled (cadex.Geom.Point thePoint, double theScale)
 
- Public Member Functions inherited from cadex.Geom.Geometry
 Geometry (global::System.IntPtr cPtr, bool cMemoryOwn)
 
- Public Member Functions inherited from cadex.BaseObject
 BaseObject (global::System.IntPtr cPtr, bool cMemoryOwn)
 
void Dispose ()
 
bool IsNull ()
 
ulong Id ()
 Return unique identifier of public object.
 
bool IsEqual (cadex.BaseObject theObj)
 
override int GetHashCode ()
 
override bool Equals (System.Object o)
 

Static Public Member Functions

static new bool CompareType (cadex.BaseObject theObject)
 
static cadex.Geom.Curve Cast (cadex.Geom.Geometry theBase)
 
- Static Public Member Functions inherited from cadex.Geom.Geometry
static bool CompareType (cadex.BaseObject theObject)
 
static cadex.Geom.Geometry Cast (cadex.BaseObject theBase)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from cadex.Geom.Geometry
override void Dispose (bool disposing)
 

Detailed Description

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();
...
}
Defines 3D circle.
Definition Circle.cs:29
double Radius()
Returns radius.
Definition Circle.cs:74
Base class for 3D curves.
Definition Curve.cs:84
cadex.Geom.CurveType Type()
Definition Curve.cs:123

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.);
Defines 3D line.
Definition Line.cs:28
Defines a 3D point.
Definition Point.cs:17

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.
Examples
exploring/brep_geometry/Program.cs, exploring/brep_geometry/main.cxx, exploring/brep_topology/Program.cs, and exploring/brep_topology/main.cxx.

Member Function Documentation

◆ D0()

void cadex.Geom.Curve.D0 ( double theParameter,
cadex.Geom.Point theValue )
inline

Returns the point theValue of parameter theParam.

Throws exception only for the OffsetCurve if it is not possible to compute the current point. For example when the first derivative on the basis curve and the offset direction are parallel.

◆ D2()

void cadex.Geom.Curve.D2 ( double theParameter,
cadex.Geom.Point theValue,
cadex.Geom.Vector theD1,
cadex.Geom.Vector theD2 )
inline

Returns the point theValue of parameter theParam, the first theD1 and second theD2 derivatives.

Throws exception if the continuity of the curve is not \(C^2\).

◆ Dispose()

override void cadex.Geom.Curve.Dispose ( bool disposing)
inlineprotectedvirtual

Reimplemented from cadex.BaseObject.

◆ DN()

bool cadex.Geom.Curve.DN ( double theParameter,
uint theDerivativeOrder,
cadex.Geom.Point theValue,
cadex.Collections.VectorList theD )
inline

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).

◆ Domain()

void cadex.Geom.Curve.Domain ( out double theUMin,
out double theUMax )
inline

Returns a definition domain.

See also
UMin(), UMax().

◆ Transform()

void cadex.Geom.Curve.Transform ( cadex.Geom.Transformation theTransformation)
inline

Applies transformation matrix to this object.

Results depends on the actual curve type.

See also
Transformed().

◆ Transformed()

cadex.Geom.Curve cadex.Geom.Curve.Transformed ( cadex.Geom.Transformation theTransformation)
inline

Returns a copy this object after applying transformation.

The contents of this object is not modified.

See also
Transform().

◆ Type()

◆ UMax()

double cadex.Geom.Curve.UMax ( )
inline

Returns a maximum parameter of a definition domain.

See also
UMin(), Domain().
Examples
exploring/brep_geometry/Program.cs, and exploring/brep_geometry/main.cxx.

◆ UMin()

double cadex.Geom.Curve.UMin ( )
inline

Returns a minimum parameter of a definition domain.

See also
UMax(), Domain().
Examples
exploring/brep_geometry/Program.cs, and exploring/brep_geometry/main.cxx.

◆ Value()

cadex.Geom.Point cadex.Geom.Curve.Value ( double theParameter)
inline

Evaluates a point on the curve.

theParameter must be within Domain() if the curve is not periodic.