mpacts.io. savefiles

In order to be able to use this module import it like this:

import mpacts.io.savefiles
#or assign it to a shorter name
import mpacts.io.savefiles as sav
mpacts.io.savefiles.obj_to_stl(fname, fname_out=None, binary=False)
mpacts.io.savefiles.save_obj(vertices, triangles, filename='model.obj', scale=1.0, rotate_90=False)

Saves vertices and triangles into the .obj format that is readable by blender

mpacts.io.savefiles.save_off(vertices, triangles, filename='model.off', scale=1.0)

Saves vertices and triangles into the .off format that is also written by CGAL

mpacts.io.savefiles.save_oldDEMeter(var, varname, fname=None, fmt=None, write_size=False)

Writes numpy arrays in a format which can be directly included into a DEMeter.i file.

mpacts.io.savefiles.save_stl(vertices, triangles, fname, binary=False)

Saves vertices and triangles as a stereo lithography (stl) file using vtk. You have the choice of (non-portable?) binary and ascii files.

mpacts.io.savefiles.save_tri_vtp(vertices, triangles, fname, **kwargs)

Saves vertices and triangles with associated point_data and cell_data as .vtp file. The data should be given as kwargs, with the keyword beginning with ‘point’ or ‘cell’, as appropriate, and they must obviously have the correct length.

mpacts.io.savefiles.split_stl_solids(fname, prefix='', postfix='_solid_')

Takes a single .stl file and saves it into seperate stl files for each defined ‘solid’ object. Returns a sorted list of all writen ‘.stl’ files

mpacts.io.savefiles.test()
mpacts.io.savefiles.write_pos_freefem(fname, outname='test', scale=1.0)
mpacts.io.savefiles.write_sol(fname, array)

Saves an array of SCALAR variables for the nodes of a 3D FEM mesh so that it is compatible with FreeFEM