如何使用meshmixer python API自动生成悬突?

lymgl2op  于 2022-12-28  发布在  Python
关注(0)|答案(1)|浏览(114)

我正在尝试使用给定的STL和meshmixer软件自动化3D打印的"突出部分生成",目前我能够成功地将"test.py"用于之前打开的meshmixer,它正确地切割了兔子模型,(来源:https://github.com/meshmixer/mm-api
但我挣扎与文件能够修改脚本和'自动生成突出':
正在尝试查找此文档的帮助:https://github.com/meshmixer/mm-api/blob/master/distrib/python/StoredCommands.h

#coding: utf-8
#for python 2.7 (32bits) and autodesk meshmixer 3.0 (3.5 seems to work not so bad)
# please note that you need to have meshmixer software launched, and import 'bunny' model first

import os, subprocess, shutil, time

import mmapi from mmRemote import *;

#initialize connection
remote = mmRemote(); remote.connect();
#construct commands to run
cmd = mmapi.StoredCommands()

cmd.AppendBeginToolCommand("overhangs")
remote.runCommand(cmd); # execute commands

cmd.AppendCompleteToolCommand("accept")
remote.runCommand(cmd); # execute commands

remote.shutdown();

print("done.")

如有任何帮助,先予感谢

zxlwwiss

zxlwwiss1#

编辑:
我刚刚得到的结果是:
为python2添加指向python包"mm"的路径

import sys
sys.path.append('D:/Tools/meshmixer_mmApi_python2')
import mm

感谢:https://drive.google.com/drive/folders/1dIJXIhTvk93as15j-DUMJtwE8P_eyGkM
那么

# initialize connection
remote = mmRemote();
remote.connect();
mm.begin_tool(remote, "overhangs")
mm.tool_utility_command(remote, "generateSupport")
mm.accept_tool(remote)

#done !
remote.shutdown();

(实际上它在"examples"文件夹中...)

相关问题