Curve
Model ElementCurveは、3D空間でパラメトリック曲線を定義します。
クラス名
Curve
説明
パラメトリック曲線は、1つの自由パラメータuと3つの関連関数f(u)、g(u)、およびh(u)で構成されます。すべての値に対して、u=u*、f(u*)、g(u*)、およびh(u*)は空間内のポイントの座標を表します。uがその最小値から最大値まで移動すると、3D空間内の曲線が生成されます。Curveの定義に関する詳細については、Reference_ParamCurveの説明セクションとコメントセクションをご参照ください。
属性の概要
名前 | プロパティ | コマンドで変更可能か | 設計可能か |
---|---|---|---|
id | Int () | ||
label | Str () | ||
matrix | Reference ("Matrix") | ○ | FDのみ |
curve_points | Bool () | ○ | |
closed | Bool () | ○ | |
minpar | Double (-1.0) | ||
maxpar | Double (1.0) | ||
routine | Routine () | FDのみ | |
script | Script () | ||
function | Function ("CURSUB") | FDのみ |
使用法
曲線は、3つの異なる形式で使用できます。
#1: Curve data provided in a Matrix
Curve (matrix=objMatrix, type=string, curve_points=Boolean, optional_attributes)
#2. Curve specified in a compiled user-written subroutine
Curve (function=userString, routine=string, type=string, optional_attributes)
#3. Curve specified in a Python functionCurve (function=userString, routine=functionPointer, type=string, curve_points=boolean, optional_attributes)
属性
- matrix
- 既存のマトリクスオブジェクトへの参照。
- type
- 文字列
- curve_points
- ブール
- function
- 文字列
- routine
- 文字列
- type
- 文字列
- minpar
- 倍精度
- maxpar
- 倍精度
- function
- 文字列
- routine
- Python内の呼び出し可能な関数へのポインタ。
- type
- 文字列
- minpar
- 倍精度
- maxpar
- 倍精度
- id
- 整数
- label
- 文字列
例
x = a * (t - sin(t))
y = a * (1-cos(t))
図 1. パラメータで定義されたサイクロイド曲線
- マトリクスを使用してパラメトリック曲線を定義します。上記サイクロイドを定義するステートメントは次の曲線属性を持ちます:
- Curveは開いています。
- 独立パラメータtは0から始まります。
- 独立パラメータtは5で終わります。
- 曲線ポイントは、Matrixオブジェクトmat23で指定されます。
対応するMotionSolve Python指定は次のとおりです:# Note, since curve_points=True, MINPAR=-1 and MAXPAR=+1. # This range in u will accommodate all the data provided in the matrix. curve1 = Curve (type="OPEN", curve_points=True, matrix=mat23)
- python関数でパラメトリック曲線を定義します。この例では、Pythonで作成されたユーザー定義のサブルーチン内の実装と全く同じように指定する方法を示します。
# The cycloid function saved in file: cycloid.py from msolve import sin, cos def cycloid (id, par, npar, t, iord, iflag): a = par[0] if iord == 0: x = a * (t - sin(t)) y = a * (1 - cos(t)) z = 0.0 elif iord == 1: x = a * (1 - cos(t)) y = a * sin(t) z = 0.0 else: x = a * sin(t) y = a * cos(t) z = 0.0 return [x, y, z]
対応するMotionSolve Python指定は次のとおりです:curve2 = Curve (function="USER(1)", routine=cycloid, type="OPEN", minpar=0, maxpar=6)
コメント
- プロパティの概要、使用理由、および拡張方法については、プロパティをご参照ください。
- Curveの詳細については、Reference:ParamCurveをご参照ください。