内容へ移動
RhinoとGrasshopperとPythonScriptのWiki
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
トレース:
ブール演算
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
==== 基本コード ==== <code python> rs.BooleanDifference(input0, input1, delete_input=True) # 差 rs.BooleanIntersection(input0, input1, delete_input=True) # 交差 rs.BooleanUnion(input, delete_input=True) # 和 </code> *API [[https://developer.rhino3d.com/api/RhinoScriptSyntax/#surface-BooleanDifference|BooleanDifference]] *API [[https://developer.rhino3d.com/api/RhinoScriptSyntax/#surface-BooleanIntersection|BooleanIntersection]] *API [[https://developer.rhino3d.com/api/RhinoScriptSyntax/#surface-BooleanUnion|BooleanUnion]] ==== サンプルコード1 ==== 2つの球の差を求める <code python> import rhinoscriptsyntax as rs a = [] s0 = rs.AddSphere([0,0,0], 50) s1 = rs.AddSphere([40,0,0], 40) a.extend(rs.BooleanDifference(s0, s1)) </code> 実行結果 {{:diff.png?direct|}} {{:diff2.png?direct|}} ==== サンプルコード2 ==== 円柱の表面から複数の球を引き算する <code python> a = [] s0 = rs.AddCylinder([0,0,-50], [0,0,50], 100) DIV_NUM = 12 for i in range(DIV_NUM): angle = math.radians(i * 360 / DIV_NUM) s1 = rs.AddSphere([100*math.cos(angle),100*math.sin(angle),0], 20) s0 = rs.BooleanDifference(s0, s1) a.extend(s0) </code> 実行結果 {{:diff3.jpg?direct|}}
ブール演算.txt
· 最終更新: 2023/01/26 13:14 by
jmitani
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ