こちらを挑むことにしてみました。
Dividing mesh into hexagonal sections - Autodesk Community
本音を書くと、メッシュを扱うのはFusion360ではない方が
良いような気もしてます・・・。
平面でしか分割できないから不可能だな と思っていたのですが、
三角形に分割し、6個の三角形をくっ付けて六角形を作る
なんて発想は思い付きませんでした。
複数の人間のアイデアってすごいですね。(二人だけだけど)
何となく処理を考えると、こちらのコマンドの処理が必要かな?
と感じてます。
何れもダイレクトモードで実行する必要があります。
平面切断はあちらの動画の様に経験が有るので何とかなると思ってます。
但し、ボディで分割してしまうと見失ってしまう可能性が高い為、
”面を分割” で処理させたいです。
分離は ”面を分割” にしてしまった為の後処理です。
”面を分割” だとメッシュボディを分割せずに面グループを作っています。
これを面グループ毎に分離させます。
こちらの処理はこんな感じでテストしたところ可能だと分かりました。
def execMeshExtract( target: adsk.fusion.MeshBody): app: adsk.core.Application = adsk.core.Application.get() ui :adsk.core.UserInterface = app.userInterface sels :adsk.core.Selections = ui.activeSelections sels.clear() sels.add(target) app.executeTextCommand(u'Commands.Start ParaMeshExtractCommand') app.executeTextCommand(u'Commands.SetString infoType infoTypeAllFaceGroups') app.executeTextCommand(u'Commands.SetBool infoPreserveSourceBody 0') app.executeTextCommand(u'NuCommands.CommitCmd')
三角形6個から六角形を作る為、結合も必要です。
こちらをテストしたところ上手く行きました。
def execMeshCombine( target: adsk.fusion.MeshBody, tools: list): app: adsk.core.Application = adsk.core.Application.get() ui :adsk.core.UserInterface = app.userInterface sels :adsk.core.Selections = ui.activeSelections sels.clear() app.executeTextCommand(u'Commands.Start ParaMeshCombineCommand') app.executeTextCommand(u'UI.EnableCommandInput infoTargetBody') sels.add(target) for tool in tools: app.executeTextCommand(u'UI.EnableCommandInput infoToolBody') sels.add(tool) app.executeTextCommand(u'NuCommands.CommitCmd')
処理的な部分は何とかクリア出来そうかな?と感じてます。
後はアルゴリズムチックな部分です。
・分割すべき平面をどうやって求めるか?
(質問者さん的には任意の方向で分割したいっぽい)
・三角形6個から六角形を作る際、組み合わせるべき三角形を
どうやって見つけ出すか?
・六角形に見える方向の平面と横方向のベクトルと六角形のサイズの
三個をユーザーに指定させるだけで十分かな?
ゴールに辿り着けるかな?