ホーム / モデリング / CGaudiBody / 関数 / Cruising
Cruising関数
定義
Cruising (PFrom As CGaudiPoint,VecFrom As CGaudiVector,PTo As CGaudiPoint,VecTo As CGaudiVector,Angle As Double) As Boolean戻り値
| True | 成功 | |
| False | 失敗 |
引数
| PFrom | 移動元の基準点 | |
| VecFrom | 移動元の基準ベクトル | |
| PTo | 移動先の基準点 | |
| VecTo | 移動先の基準ベクトル | |
| Angle | 移動後の回転角度 |
解説
引数で指定された移動元基準点から移動先基準点まで移動させ、移動元基準ベクトルが移動先基準ベクトルに一致するように回転させます(クルージング)。
その後、移動先の基準ベクトルを回転軸として、移動後の回転角度分、回転させます。
実行例
Dim Femtet As New CFemtetDim Gaudi As CGaudi
Dim Body As CGaudiBody
Dim Point0 As New CGaudiPoint
Dim PointFrom As New CGaudiPoint
Dim VectorFrom As New CGaudiVector
Dim PointTo As New CGaudiPoint
Dim VectorTo As New CGaudiVector'新規プロジェクト作成
If Femtet.OpenNewProject() = False Then
Femtet.ShowLastError
End If
'Femtet.Gaudiを変数Gaudiに代入して使いやすくする
Set Gaudi = Femtet.Gaudi
Point0.X =0
Point0.Y =0
Point0.Z =0
Set Body = Gaudi.CreateCylinder(Point0,5,10)
PointFrom.SetCoord -3#, -5#, 0#
VectorFrom.SetCoord 0#, 0#, 1#
PointTo.SetCoord 3.75, 3.75, 2.1650635094611
VectorTo.SetCoord -0#, -0.5, 0.86602540378444Body.Cruising PointFrom, VectorFrom, PointTo, VectorTo, 30#


