ホーム / モデリング / CGaudiBody / 関数 / Intersect2
Intersect2関数
定義
Intersect2 (Tool( ) As CGaudiBody,newBody( ) As CGaudiBody,RemainOrg As Long) As Boolean
[Python]
Intersect2_py(CGaudiBody[] Tool, int RemainOrg)
戻り値
| True | 成功 | |
| False | 失敗 |
[Python]
| [0] | True:成功、False:失敗 | |
| [1][0~共通部分のボディ数-1] | 共通部分のCGaudiBody(配列) |
引数
| Tool | 共通部分を作成するためのCGaudiBody(配列) | |
| newBody | 共通部分のCGaudiBody(配列) | |
| RemainOrg | 元形状を残すかどうか [0:全部残す、1:全部削除、2:Targetのみ残す、3:Toolのみ残す] |
[Python]
| Tool | 共通部分を作成するためのCGaudiBody(配列) | |
| RemainOrg | 元形状を残すかどうか [0:全部残す、1:全部削除、2:Targetのみ残す、3:Toolのみ残す] |
解説
引数で指定されたCGaudiBodyとの共通点(積)を作成(積ブーリアン)します。RemainOrgは元形状を残すかどうかを設定します。
共通部分のCGaudiBodyはnewBody( )に設定されます。
FaceとSolid以外は戻り値がFalseを返します。
実行例
Dim Femtet As New CFemtetDim Gaudi As CGaudi
Dim Body(1)As CGaudiBody
Dim Box(0)As CGaudiBody
Dim Point(1)As New CGaudiPoint
Dim newBody()As CGaudiBody
'新規プロジェクト作成
If Femtet.OpenNewProject() = False Then
Femtet.ShowLastError
End If
'Femtet.Gaudiを変数Gaudiに代入して使いやすくする
Set Gaudi = Femtet.Gaudi
Point(0).X =0
Point(0).Y =0
Point(0).Z =0
Set Box(0)=Gaudi.CreatePolygonCylinder(Point(0),8,10,6)
Set Body(1)=Gaudi.CreatePolygonCylinder(Point(0),6,15,6)
Set Body(0)=Gaudi.CreateSphere(Point(0),10)
If Box(0).Intersect2(Body,newBody,1)=False Then
Femtet.ShowLastError
End If



