Author Topic: A script for auto orienting stl files and minimize overhangs and supports  (Read 3136 times)

Munfred

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hello there,

I would like to know if it's possible to write a script for meshmixer to auto orient stl files so as to minimize overhangs and supports (what you obtain when clicking analysis > orientation > accept). I have a number of stl files of molecules I generated using an script with Chimera, and before slicing it's best to orient them with Meshixer. If there was a way to automate this process it would be great, as many files are pretty big (>100MB), and Meshmixer can take a while to process them, so leaving a script running over all of them as I did to generate them would be the best option.

Thanks

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
It should be possible...to run the orientation optimization you would just need:

mm.begin_tool(remote, "orientation")
mm.accept_tool(remote)

of course you would have to write the python code to iterate through the files and open each in sequence. For each file you would do something like:

new_objs = mm.append_objects_from_file(remote, part_filename);
(...optimize orientation...)
(...export...)
mm.delete_objects(remote, new_objs)
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting