Author Topic: Is there any way to export Objects as STL files?  (Read 2003 times)

hottabich

  • Newbie
  • *
  • Posts: 0
    • View Profile
Is there any way to export Objects as STL files?
« on: March 06, 2016, 06:09:40 AM »
Is there any way to export Objects as STL files?
Problem description:
I need to import one model in MeshMixer. This model consist of 400 STL file objects. For each object I need to perform Remesh and then export it back. I have written python script that imports one by one all STL files using append_objects_from_file() and Remesh it using begin_tool(), set_toolparam() and accept_tool(). But I can't find scripting functions for exporting these STL files back. I’m using save_mix() to save whole assembly, but the need of export each object manually from .mex file to different .stl files saddens me. Is there any possibility to export STL object from Meshmixer using scripting api?

RMS

  • meshmixer founder
  • Administrator
  • Hero Member
  • *****
  • Posts: 1238
    • View Profile
    • gradientspace
Re: Is there any way to export Objects as STL files?
« Reply #1 on: March 11, 2016, 11:07:54 AM »
Yes, there is but I guess I haven't added it to the python mm package. You have to user the lower-level StoredCommands object/API. If you look in one of the mm functions, like mm.append_objects_from_file(), you will see how to do this.

The command you need to use is: AppendSceneCommand_ExportMeshFile_CurrentSelection( string )

There are **many** commands in the StoredCommands object that do not have a wrapper in the mm package yet. If you skim through StoredCommands.h you find see the full list.
created meshmixer - now starting gradientspace - meshmixer consulting available http://www.gradientspace.com/consulting

3DLirious

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Is there any way to export Objects as STL files?
« Reply #2 on: July 23, 2016, 09:05:41 PM »
I just submitted a pull request on github with an export_mesh function added to scene.py.