ホーム / モデリング / CGaudi / 関数 / MultiCruising
MultiCruising関数
定義
MultiCruising (BodyList() As CGaudiBody,PFrom As CGaudiPoint,VecFrom As CGaudiVector,PTo As CGaudiPoint,VecTo As CGaudiVector,Angle As Double) As Boolean
[Python]
MultiCruising_py(CGaudiBody[] BodyList, CGaudiPoint PFrom, CGaudiVector VecFrom, CGaudiPoint PTo, CGaudiVector VecTo, double Angle)
戻り値
| True | 成功 | |
| False | 失敗 |
[Python]
| True | 成功 | |
| False | 失敗 |
引数
| BodyList | 移動させたいBody配列 | |
| PFrom | 移動元の基準点 | |
| VecFrom | 移動元の基準ベクトル | |
| PTo | 移動先の基準点 | |
| VecTo | 移動先の基準ベクトル | |
| Angle | 移動後の回転角度 |
[Python]
| BodyList | 移動させたいBody(CGaudiBody)配列 | |
| PFrom | 移動元の基準点(CGaudiPoint) | |
| VecFrom | 移動元の基準ベクトル(CGaudiVector) | |
| PTo | 移動先の基準点(CGaudiPoint) | |
| VecTo | 移動先の基準ベクトル(CGaudiVector) | |
| Angle | 移動後の回転角度 |
解説
引数で指定された移動元基準点から移動先基準点まで移動させ、移動元基準ベクトルが移動先基準ベクトルに一致するように回転させます(クルージング)。
その後、移動先の基準ベクトルを回転軸として、移動後の回転角度分、回転させます。
実行例
Dim Femtet As New CFemtetDim Gaudi As CGaudi
Dim Body0 As CGaudiBody
Dim Body1 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 Body0 = Gaudi.CreateCylinder(Point0,5,10)
Set Body1 = Gaudi.CreateBox(Point0,5,5,5)
Dim BodyArray(1) As CGaudiBody
Set BodyArray(0) = Body0
Set BodyArray(1) = Body1
PointFrom.SetCoord -3#, -5#, 0#
VectorFrom.SetCoord 0#, 0#, 1#
PointTo.SetCoord 3.75, 3.75, 2.1650635094611
VectorTo.SetCoord -0#, -0.5, 0.86602540378444Gaudi.MultiCruising BodyArray, PointFrom, VectorFrom, PointTo, VectorTo, 30#


