Frequently asked questions

How do I save & load multiple meshes/labels to my STL file?

It is not possible to save multiple meshes in a single STL file. Each mesh must be store in a separate file. The code below shows how to save all the meshes and use their labels (unique ID) as a base for their file names.


STL_path = "where_do_you_want_to_save_the_STL_files"

list_of_meshes = ["root"]

while len(list_of_meshes):
    label = list_of_meshes.pop(0)
    if gvxr.getNumberOfPrimitives(label):
        gvxr.saveSTLfile(label, os.path.join(STL_path, label + ."stl")

    for i in range(gvxr.getNumberOfChildren(label)):
        list_of_meshes.append(gvxr.getChildLabel(label, i))